hanchenye-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
bar.o.x86-64
branch-test.hexagon
branch-test.ppc
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
constdata.x86-64
foo.o.x86-64
globalconst.c
globalconst.o.x86-64
gotpcrel.S
gotpcrel.x86-64
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
ifunc.cpp
ifunc.cpp.x86-64
ifunc.x86-64
init_array.x86-64
libfnarchive.a
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
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
object-test.elf-hexagon
object-test.elf-i386
phdr.i386
quickdata-sort-test.o.elf-hexagon
quickdata-sortcommon-test.o.elf-hexagon
quickdata-test.elf-hexagon
reloc-test.elf-i386
reloc-xb.x86
reloc-xt.x86
relocs-dynamic.x86-64
relocs.x86-64
responsefile [ELF] Support response file. 2014-03-28 19:34:34 +00:00
rodata-test.hexagon
rodata-test.i386
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
stripped-empty.x86_64
target-test.hexagon
target-test.ppc
tls.S
tls.c
tls.x86-64
tlsAddr.x86-64
tlsaddr.c
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
weaksym.o
writersyms.o
x86-64-relocs.S