llvm-project/lld/test/elf/Inputs
Rafael Auler 6fd0afa195 [ELF] Fix bug in ELFFile::createAtoms() that caused lld to mislink musl
When creating the graph edges of the atoms of an ELF file, special care must be
taken with atoms that represent weak symbols. They cannot be the target of any
Reference::kindLayoutAfter edge because they can be merged and point to other
code, screwing up the final layout of the atoms. ELFFile::createAtoms()
correctly handles this corner case. The problem is that createAtoms() assumed
that there can be no zero-sized weak symbols, which is not true. Consider:

my_weak_func1:
my_weak_func2:
my_weak_func3:
code

In this case, we have two zero-sized weak symbols, my_weak_func1 and
my_weak_func2, and one non-zero weak symbol my_weak_func3. createAtoms() would
correctly handle my_weak_func3, but not the first two symbols. This problem
happens in the musl C library when a zero-sized weak symbol is merged and
screws up the file layout. Since this musl code lives at the finalization hooks,
any C program linked with LLD and musl was correctly executing, but segfaulting
at the end.

Reviewers: shankarke

http://reviews.llvm.org/D5606

llvm-svn: 219034
2014-10-03 22:50:50 +00:00
..
abs-test.i386 This update does the following: 2012-10-18 17:16:19 +00:00
bar.o.x86-64 add support for merging common strings 2013-02-12 18:46:53 +00:00
branch-test.hexagon * Add relocation reference support for Hexagon and PowerPC. 2012-10-09 02:20:47 +00:00
branch-test.ppc * Add relocation reference support for Hexagon and PowerPC. 2012-10-09 02:20:47 +00:00
consecutive-weak-defs.o.yaml [ELF] Fix bug in ELFFile::createAtoms() that caused lld to mislink musl 2014-10-03 22:50:50 +00:00
constants-merge.x86-64 add support for merging common strings 2013-02-12 18:46:53 +00:00
constdata.x86-64 [ELF] Properly handle constant data. 2013-01-07 08:00:42 +00:00
foo.o.x86-64 add support for merging common strings 2013-02-12 18:46:53 +00:00
globalconst.c functionality to handle global atoms in Merge sections 2013-02-20 17:38:37 +00:00
globalconst.o.x86-64 functionality to handle global atoms in Merge sections 2013-02-20 17:38:37 +00:00
gotpcrel.S [ELF] Implement GOTPCREL for defined atoms. 2013-02-05 19:14:28 +00:00
gotpcrel.x86-64 [ELF] Implement GOTPCREL for defined atoms. 2013-02-05 19:14:28 +00:00
group-cmd-search-1.ls [ELF] Fix the file look up algorithm used in the linker script GROUP command. 2014-05-01 16:22:08 +00:00
group-cmd-search-2.ls [ELF] Fix the file look up algorithm used in the linker script GROUP command. 2014-05-01 16:22:08 +00:00
group-cmd-search-3.ls [ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command. 2014-07-15 17:17:30 +00:00
ifunc.S [ELF][x86-64] Handle PLT32 relocations to IFUNC. 2013-02-05 19:15:03 +00:00
ifunc.cpp [ELF] Add support for IFUNC. 2013-01-29 16:38:03 +00:00
ifunc.cpp.x86-64 [ELF] Add support for IFUNC. 2013-01-29 16:38:03 +00:00
ifunc.x86-64 [ELF][x86-64] Handle PLT32 relocations to IFUNC. 2013-02-05 19:15:03 +00:00
init_array.x86-64 [ELF] Add support for __init_array_{start,end}. 2013-01-10 22:41:42 +00:00
libfnarchive.a [Driver] Add -L and -l support. 2013-02-07 06:47:17 +00:00
libifunc.x86-64.so [ELF] Mark STT_GNU_IFUNC symbols as code. 2013-09-27 21:30:04 +00:00
libundef.so [ELF] Add COPY relocations. 2013-09-26 22:09:16 +00:00
libweaksym.so A weak reference to a symbol that is only weakly referenced in 2013-09-03 12:06:33 +00:00
main-with-global-def.o.yaml [ELF] Fix bug in ELFFile::createAtoms() that caused lld to mislink musl 2014-10-03 22:50:50 +00:00
mainobj.x86_64 Adding support to resolve symbols with archive libraries in lld 2012-11-13 18:39:10 +00:00
object-test.elf-hexagon
object-test.elf-i386
phdr.i386 Populate entry point into ELF executable. 2012-11-21 21:07:36 +00:00
quickdata-sort-test.o.elf-hexagon sort quickdata for the hexagon target 2013-02-22 18:01:08 +00:00
quickdata-sortcommon-test.o.elf-hexagon [ELF][Hexagon]add typeZeroFillFast 2013-02-24 03:09:10 +00:00
quickdata-test.elf-hexagon add changes for typeDataFast 2013-02-22 17:18:53 +00:00
reloc-test.elf-i386 Add ELFReference class - parse relocations needed by that class and update DefinedAtom to use the class. Tweak coding style. Add testcase to check relocations. Change was signed-off-by: Michael Spencer 2012-09-17 12:49:38 +00:00
reloc-xb.x86 This patch changes the following: 2012-10-25 17:53:04 +00:00
reloc-xt.x86 This patch changes the following: 2012-10-25 17:53:04 +00:00
relocs-dynamic.x86-64 [ELF][x86-64] Only emit a PLT entry for a PLT relocation if the target atom is a SharedLibraryAtom. 2013-03-01 00:03:56 +00:00
relocs.x86-64 [ELF] Add common x86_64 relocation types. 2013-01-07 06:58:53 +00:00
responsefile [ELF] Support response file. 2014-03-28 19:34:34 +00:00
rodata-test.hexagon This change: 2012-10-01 23:23:05 +00:00
rodata-test.i386 This change: 2012-10-01 23:23:05 +00:00
rodata.c [ELF] Implement --rosegment 2014-09-08 04:05:52 +00:00
rodata.o [ELF] Implement --rosegment 2014-09-08 04:05:52 +00:00
section-test.i386
shared.c Fix a variety of typos in function names and comments 2013-12-01 23:51:36 +00:00
shared.so-x86-64 [lld] Update a test file for r180209. 2013-05-21 20:05:55 +00:00
stripped-empty.x86_64 Fix handling of files without a symbol table. 2013-06-07 21:08:19 +00:00
target-test.hexagon * Add relocation reference support for Hexagon and PowerPC. 2012-10-09 02:20:47 +00:00
target-test.ppc * Add relocation reference support for Hexagon and PowerPC. 2012-10-09 02:20:47 +00:00
tls.S [ELF] Replace local dynamic tls access with direct access. 2013-02-05 19:14:07 +00:00
tls.c [ELF][x86-84] Add static TLS support. 2013-02-01 07:13:49 +00:00
tls.x86-64 [ELF] Replace local dynamic tls access with direct access. 2013-02-05 19:14:07 +00:00
tlsAddr.x86-64 [ELF] TBSS section has to be special cased so that it doesnot occupy memory space 2013-06-12 00:32:32 +00:00
tlsaddr.c [ELF] TBSS section has to be special cased so that it doesnot occupy memory space 2013-06-12 00:32:32 +00:00
undef-from-main-so.c [ELF] Add COPY relocations. 2013-09-26 22:09:16 +00:00
undef-from-main.c [ELF] Add COPY relocations. 2013-09-26 22:09:16 +00:00
undef-pc32.o [ELF] Handle copy relocations for PC32. 2013-09-27 21:30:27 +00:00
undef.o [ELF] Add COPY relocations. 2013-09-26 22:09:16 +00:00
undef2-so.o.yaml Re-commit r218259. 2014-09-22 20:48:04 +00:00
use-shared-32s.c [ELF][x86-64] Generate PLT for R_*_32S relocs. 2013-10-24 21:00:25 +00:00
use-shared-32s.x86-64 [ELF][x86-64] Generate PLT for R_*_32S relocs. 2013-10-24 21:00:25 +00:00
use-shared.c Revert "[ELF] Order DT_NEEDED entries by command line order." 2014-03-20 06:57:28 +00:00
use-shared.x86-64 [Writer][ELF][x86-64] Handle GOTPCREL relocations to SharedLibraryAtoms. 2013-03-01 01:09:46 +00:00
weaksym.o A weak reference to a symbol that is only weakly referenced in 2013-09-03 12:06:33 +00:00
writersyms.o support for adding linker defined symbols 2013-01-10 03:16:27 +00:00
x86-64-relocs.S [ELF][x86-64] Only emit a PLT entry for a PLT relocation if the target atom is a SharedLibraryAtom. 2013-03-01 00:03:56 +00:00