[ELF] Make -init/-fini options compatible with the gnu linker
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 10 Dec 2014 05:38:46 +0000 (05:38 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 10 Dec 2014 05:38:46 +0000 (05:38 +0000)
commit04da06ccee2b15b131efd26d69401112d21e5d48
tree367a87ea5e9026c55684b44e2012ac746fbc3a42
parentf3079d276268af8319e2a43b2d59af3763058584
[ELF] Make -init/-fini options compatible with the gnu linker

The LLD linker searches initializer and finalizer function names
and emits DT_INIT/DT_FINI dynamic table tags to point to these symbols.
The -init/-fini command line options override initializer ("_init") and
finalizer ("_fini") function names used by default.

Now the -init/-fini options do not affect .init_array/.fini_array
sections. The corresponding code has been removed.

Differential Revision: http://reviews.llvm.org/D6578

llvm-svn: 223917
21 files changed:
lld/include/lld/ReaderWriter/ELFLinkingContext.h
lld/lib/Driver/GnuLdDriver.cpp
lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h
lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
lld/lib/ReaderWriter/ELF/SectionChunks.h
lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h
lld/test/elf/AArch64/initfini-alignment.test [deleted file]
lld/test/elf/AArch64/initfini-option.test [deleted file]
lld/test/elf/Hexagon/Inputs/initfini-option.c [deleted file]
lld/test/elf/Hexagon/Inputs/initfini-option.o [deleted file]
lld/test/elf/Hexagon/initfini-option.test [deleted file]
lld/test/elf/X86_64/initfini-alignment.test [deleted file]
lld/test/elf/X86_64/initfini-option.test [deleted file]
lld/test/elf/initfini-options.test-1.test [new file with mode: 0644]
lld/test/elf/initfini-options.test-2.test [new file with mode: 0644]
lld/test/elf/initfini-options.test-3.test [new file with mode: 0644]
lld/unittests/DriverTests/GnuLdDriverTest.cpp