Description of symbols is avalable here:
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 26 Feb 2016 14:36:36 +0000 (14:36 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 26 Feb 2016 14:36:36 +0000 (14:36 +0000)
commit9e8593949d6d2df38f9d354e99c683fb4f014710
treec519f6ec2edc939cc8b90f7f151bb822fe788a93
parenta350e266aa70925727cf543cc161a285bf860122
Description of symbols is avalable here:
https://docs.oracle.com/cd/E53394_01/html/E54766/u-etext-3c.html

It is said that:
_etext - The address of _etext is the first
location after the last read-only loadable segment.

_edata - The address of _edata is the first
location after the last read-write loadable segment.

_end - If the address of _edata is greater than the address
of _etext, the address of _end is same as the address of _edata.

In real life _end and _edata has different values for that case.
Both gold/bfd set _edata to the end of the last non SHT_NOBITS section.
This patch do the same for consistency.

It should fix the https://llvm.org/bugs/show_bug.cgi?id=26729.

Differential revision: http://reviews.llvm.org/D17601

llvm-svn: 262019
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/ELF/Writer.cpp
lld/test/ELF/edata-etext.s [new file with mode: 0644]