Change the implementation of --dynamic-list to use linker script parsing.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 8 Dec 2016 17:54:26 +0000 (17:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 8 Dec 2016 17:54:26 +0000 (17:54 +0000)
commitd0ebd84c422e393e376cf23749d4ff6bb922d0bf
tree8cc67112f88d3b4551e7faa8e9201fc653cc0eb7
parent6f6d46d497bb5a23396079ae89b4b9c465275fb9
Change the implementation of --dynamic-list to use linker script parsing.

The feature is documented as
-----------------------------
The format of the dynamic list is the same as the version node
without scope and node name.  See *note VERSION:: for more
information.
--------------------------------

And indeed qt uses a dynamic list with an 'extern "C++"' in it. With
this patch we support that

The change to gc-sections-shared makes us match bfd. Just because we
kept bar doesn't mean it has to be in the dynamic symbol table.

The changes to invalid-dynamic-list.test and reproduce.s are because
of the new parser.

The changes to version-script.s are the only case where we change
behavior with regards to bfd, but I would like to see a mix of
--version-script and --dynamic-list used in the wild before
complicating the code.

llvm-svn: 289082
12 files changed:
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/Driver.h
lld/ELF/DriverUtils.cpp
lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/SymbolTable.cpp
lld/ELF/SymbolTable.h
lld/test/ELF/gc-sections-shared.s
lld/test/ELF/invalid-dynamic-list.test
lld/test/ELF/reproduce.s
lld/test/ELF/version-script.s