[PATCH] D23206: [ELF] - Linkerscript: do not define _edata, _end, _etext if SECTIONS is used.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 07:42:08 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, davide, emaste, evgeny777.

I faced that when tried to link FreeBSD kernel. It was "duplicate symbol: _edata in (internal) and (internal)" error.
_data was a shared symbol that came from hack.so. At first it was replaced with DefinedRegular by the code
disabled in this patch and later when script tried to define the same symbol - the error was shown.

I think when SECTIONS command is used we should not define these symbols automatically.
In the same situation (as given in testcase) ld defines them as UND. gold defines as ABS with zero value. 
I suggest just do not do anything in this case and let script handle everything.



https://reviews.llvm.org/D23206

Files:
  ELF/Writer.cpp
  test/ELF/end.s
  test/ELF/linkerscript/linkerscript-edata-etext.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23206.66947.patch
Type: text/x-patch
Size: 4668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160805/088cf40b/attachment.bin>


More information about the llvm-commits mailing list