[PATCH] D41438: [ELF] - Do not handle --defsym as regular linkerscript assignment.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 06:01:43 PST 2017


grimar created this revision.
grimar added reviewers: ruiu, rafael.
Herald added a subscriber: emaste.

With following code and script:

  .global foo
  foo:
  
  VER1 { global: foo ; local: * ; } ;

ld.bfd does not allow to redefine symbol:

  ++ ld.bfd --defsym=foo=2 --version-script version.txt -shared test.o -o test.so
  test.o: In function `foo':
  (.text+0x0): multiple definition of `foo'

So semantic of --defsym is like a symbol declaration. 
LLD allowed that, patch fixes it.


https://reviews.llvm.org/D41438

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/ScriptParser.cpp
  test/ELF/linkerscript/symbol-multiple-defs.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41438.127694.patch
Type: text/x-patch
Size: 3736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171220/e046381a/attachment.bin>


More information about the llvm-commits mailing list