llvm-project/lld/test/ELF/Inputs
Peter Collingbourne 24a01c341e ELF: Override DSO definitions when creating __start_* and __stop_* symbols.
Previously we would fail to synthesise a __start_ or __stop_ symbol if
there existed a definition in a DSO. Instead, we would try to link against
the DSO definition. This became possible after D23552 when linking against
lld-produced DSOs but could in principle also occur when linking against
DSOs produced by other linkers.

Not only does it seem more likely that a user would expect the resolved
definition to be local to the executable, but if a __start_ or __stop_
symbol was synthesised by the linker, it is effectively impossible to link
against correctly from a non-PIC executable in a read-only section. Neither
a PLT nor a copy relocation would give us the right semantics here. The only
way the link could succeed is if the executable provided its own synthetic
definition of the symbol.

The fix is to also synthesise the definition if the only definition comes
from a DSO. Since this is what the addOptionalSynthetic function does,
switch to using that function.

Fixes PR30680.

Differential Revision: https://reviews.llvm.org/D25544

llvm-svn: 284168
2016-10-13 22:20:18 +00:00
..
aarch64-condb-reloc.s [ELF/AARCH64] - Implemented R_AARCH64_CONDBR19 relocation. 2016-01-11 14:22:00 +00:00
aarch64-copy2.s Fix implicit plt creation on aarch64. 2016-06-04 19:11:14 +00:00
aarch64-tls-gdie.s Implement gd to ie relaxation for aarch64. 2016-06-04 23:33:31 +00:00
aarch64-tls-ie.s Reapply r257588 2016-01-13 13:04:46 +00:00
aarch64-tstbr14-reloc.s [ELF/AARCH64] - Implemented R_AARCH64_TSTBR14 relocation. 2016-01-11 14:27:05 +00:00
abs-hidden.s Don't create relocations for non preemptable absolute symbols. 2016-04-15 12:22:22 +00:00
abs.s
abs255.s
abs256.s
abs257.s
allow-multiple-definition.s
allow-shlib-undefined.s [ELF] - Error out when R_X86_64_PC32/R_X86_64_32 are used against preemptible symbol when linking shared object. 2016-03-29 08:35:42 +00:00
archive.s Remove unnecessary trailing semicolons. 2016-04-27 02:58:27 +00:00
archive2.s
archive3.s
archive4.s
arm-exidx-cantunwind.s [ELF][ARM] Initial implentation of ARM exceptions support 2016-10-10 09:39:26 +00:00
arm-plt-reloc.s Initial support for ARM in lld. 2016-06-07 09:31:52 +00:00
arm-thumb-blx-targets.s Add initial support for Thumb for ARMv7a 2016-06-16 09:53:46 +00:00
arm-thumb-narrow-branch.o Add initial support for Thumb for ARMv7a 2016-06-16 09:53:46 +00:00
arm-thumb-narrow-branch.s Add initial support for Thumb for ARMv7a 2016-06-16 09:53:46 +00:00
arm-tls-get-addr.s [ARM] ARM TLS shouldn't use relaxations 2016-09-23 13:54:48 +00:00
comdat.s
comment-gc.s Don't GC non-alloc mergeable section pieces 2016-09-29 10:27:10 +00:00
common.s
conflict.s ELF: Include archive names in error messages. 2016-02-02 08:22:41 +00:00
copy-in-shared.s Reject zero-sized symbols when creating copy relocations. 2016-05-24 02:37:40 +00:00
copy-rel-corrupted.s Reject zero-sized symbols when creating copy relocations. 2016-05-24 02:37:40 +00:00
copy-rel-pie.s Fix copy relocations in pie. 2016-05-05 19:41:49 +00:00
ctors_dtors_priority1.s ELF: Implement the correct semantics of .[cd]tors. 2016-02-11 23:41:38 +00:00
ctors_dtors_priority2.s ELF: Implement the correct semantics of .[cd]tors. 2016-02-11 23:41:38 +00:00
ctors_dtors_priority3.s ELF: Implement the correct semantics of .[cd]tors. 2016-02-11 23:41:38 +00:00
discard-merge-unnamed.o Treat unnamed symbols as locals. 2015-12-11 19:09:21 +00:00
duplicated-plt-entry.s Don't create multiple .got.plt entries for the same symbol. 2016-02-16 16:46:31 +00:00
dynamic-reloc-weak.s Fix some confusion about what can be preempted. 2016-02-26 14:27:47 +00:00
dynamic-reloc.s
ehframe-relocation.s Make this test a bit stronger. 2016-04-06 19:38:26 +00:00
empty-ver.ver Handle empty versions. 2016-06-28 21:48:33 +00:00
far-arm-abs.s Initial support for ARM in lld. 2016-06-07 09:31:52 +00:00
far-arm-thumb-abs.s Add initial support for Thumb for ARMv7a 2016-06-16 09:53:46 +00:00
gc-sections-weak.s Add an interesting GC testcase. 2016-04-15 15:26:52 +00:00
gnu-ifunc-gotpcrel.s ELF: Treat IFunc definitions in DSOs as functions. 2016-04-26 16:22:51 +00:00
gotpc-relax-und-dso.s [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation. 2016-05-25 14:31:37 +00:00
icf2.s ELF: Implement ICF. 2016-02-25 18:43:51 +00:00
libsearch-dyn.s Remove unnecessary trailing semicolons. 2016-04-27 02:58:27 +00:00
libsearch-st.s Remove unnecessary trailing semicolons. 2016-04-27 02:58:27 +00:00
llvm33-rela-outside-group.o [ELF] - Error out when R_X86_64_PC32/R_X86_64_32 are used against preemptible symbol when linking shared object. 2016-03-29 08:35:42 +00:00
merge.s
mips-align-err.s Fix the alignment check. 2016-03-31 12:09:36 +00:00
mips-dynamic.s Reject zero-sized symbols when creating copy relocations. 2016-05-24 02:37:40 +00:00
mips-fnpic.s [ELF][MIPS] Do not use a binary input file in the test case. NFC 2016-09-29 12:58:42 +00:00
mips-fpic.s [ELF][MIPS] Do not use a binary input file in the test case. NFC 2016-09-29 12:58:42 +00:00
mips-gp-disp.so Regenerate test file. 2016-04-04 16:02:39 +00:00
mips-gp0-non-zero.o [ELF][MIPS] Set GP0 value to zero in case of relocatable object generation 2016-09-29 12:58:48 +00:00
mips-nonalloc.s [ELF] Take into account offset in the output section when read addends for a non-alloc input section 2016-05-21 19:48:54 +00:00
mips-options.o [ELF][MIPS] Handle section symbol points to the .MIPS.options / .reginfo section 2016-05-26 20:46:01 +00:00
mips-pic.s [ELF] Implement infrastructure for thunk code creation 2016-03-31 21:26:23 +00:00
mips-tls.s [ELF][MIPS] Support MIPS TLS relocations 2016-06-23 15:26:31 +00:00
no-symtab.o
plt-aarch64.s Fix some confusion about what can be preempted. 2016-02-26 14:27:47 +00:00
ppc64-addr16-error.s Use defined hidden symbols for out of range tests. 2016-03-08 19:51:58 +00:00
progname-ver.so Fix producing undefined reference to __progname. 2016-04-29 16:23:31 +00:00
protected-shared.s Don't create dynamic relocations to ro segments. 2016-04-30 01:15:17 +00:00
relocatable-ehframe.s Run dos2unix. NFC. 2016-03-11 14:34:44 +00:00
relocatable.s [ELF2] - Basic implementation of -r/--relocatable 2016-02-25 08:23:37 +00:00
relocatable2.s [ELF2] - Basic implementation of -r/--relocatable 2016-02-25 08:23:37 +00:00
relocation-copy-alias.s ELF: Create dynamic symbols for symbol aliases of copy relocations. 2016-04-04 22:29:24 +00:00
relocation-copy-align.s Fix alignment computation for copy relocs. 2015-12-10 22:53:24 +00:00
relocation-copy-arm.s Initial support for ARM in lld. 2016-06-07 09:31:52 +00:00
relocation-copy.s [ELF/AArch64] Support R_AARCH64_COPY relocation. 2015-12-03 08:05:35 +00:00
relocation-size-shared.s [ELF] - R_X86_64_SIZE64/R_X86_64_SIZE32 relocations implemented. 2015-12-11 08:59:37 +00:00
resolution-shared.s Prefer symbols from .o over .so. 2016-01-18 23:54:05 +00:00
resolution.s
shared-ppc64.s
shared.s Create implicit plt entries for R_X86_64_32S. 2016-02-24 16:37:47 +00:00
shared2.s
shared3.s
start-lib-comdat.s Don't include --start-lib/--end-lib files twice. 2016-06-14 21:56:36 +00:00
start-lib1.s Fix a crash bug in --start-lib. 2016-04-08 20:49:31 +00:00
start-lib2.s Fix a crash bug in --start-lib. 2016-04-08 20:49:31 +00:00
startstop-shared2.s ELF: Override DSO definitions when creating __start_* and __stop_* symbols. 2016-10-13 22:20:18 +00:00
symbol-override.s Remove trailing whitespaces. 2016-07-25 16:51:52 +00:00
tls-got-entry.s Avoid creating duplicated relocations. 2016-04-01 12:54:27 +00:00
tls-got.s
tls-in-archive.s Handle a weak undefined tls to archive member. 2016-02-22 23:19:29 +00:00
tls-mismatch.s
tls-opt-gdie.s [ELF] - Implemented @tlsgd optimization (GD->IE case, x64). 2015-12-04 11:20:13 +00:00
tls-opt-gdiele-i686.s [ELF] - Implement the TLS relocation optimization for 32-bit x86. 2015-12-09 09:55:54 +00:00
tls-opt-iele-i686-nopic.s [ELF] - implemented @indntpoff (x86) relocation and its optimization. 2015-12-17 09:32:21 +00:00
trace-ar1.s [ELF] - Change -t implementation to print which archive members are used. 2016-04-13 18:07:57 +00:00
trace-ar2.s [ELF] - Change -t implementation to print which archive members are used. 2016-04-13 18:07:57 +00:00
trace-symbols-foo-strong.s Implement --trace-symbol=symbol option. 2016-06-23 07:00:17 +00:00
trace-symbols-foo-weak.s Implement --trace-symbol=symbol option. 2016-06-23 07:00:17 +00:00
uabs_label.s [ELF/AArch64] Implement some UABS relocs 2016-09-12 10:02:41 +00:00
undef-with-plt-addr.s Don't create dynamic relocations to ro segments. 2016-04-30 01:15:17 +00:00
undef.s Print member name in undefined symbol error. 2016-05-09 21:40:06 +00:00
unresolved-symbols.s [ELF] - Added support for --unresolved-symbols option. 2016-06-29 12:35:04 +00:00
use-bar.s [ELF] Don't fail if undefined symbol is not used 2016-10-06 09:45:04 +00:00
verdef-defaultver.s [ELF] - Implemented support of default/non-default symbols versions 2016-06-28 08:21:10 +00:00
verdef.s [ELF] - Recommit r273143("[ELF] - Basic versioned symbols support implemented.") 2016-06-20 11:55:12 +00:00
verneed.so.sh ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs. 2016-04-27 20:22:31 +00:00
verneed1.so ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs. 2016-04-27 20:22:31 +00:00
verneed2.so ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs. 2016-04-27 20:22:31 +00:00
version-script-err.script Don't go on an infinite loop on a missing ";". 2016-06-20 14:02:22 +00:00
version-undef-sym.so Be sure to always increment the Versym pointer. 2016-04-29 17:46:07 +00:00
version-use.script Ignore the "globally available" version. 2016-06-06 22:42:57 +00:00
version-use.so Ignore the "globally available" version. 2016-06-06 22:42:57 +00:00
visibility.s Don't depend on lld creating relocations in ro segments. 2016-04-30 00:49:10 +00:00
warn-common.s [ELF] implement --warn-common/--no-warn-common 2016-03-14 09:19:30 +00:00
warn-common2.s [ELF] implement --warn-common/--no-warn-common 2016-03-14 09:19:30 +00:00
whole-archive.s Remove unnecessary trailing semicolons. 2016-04-27 02:58:27 +00:00
wrap.s ELF: Implement --wrap. 2016-01-07 17:20:07 +00:00
x86-64-relax-offset.s Don't confuse input and output section offsets. 2016-06-17 15:42:36 +00:00
x86-64-reloc-error.s Use defined hidden symbols for out of range tests. 2016-03-08 19:51:58 +00:00
x86-64-tls-gd-got.s Add a test for accessing __tls_get_addr with a GOT. 2016-07-04 17:34:53 +00:00