llvm-project/lld/test/ELF/Inputs
Fangrui Song 96e6ed645d [ELF] Don't copy STT_TLS in copy relocation
During copy relocation of a variable defined in a DSO, if a TLS variable in that DSO happens to have the same st_value, it would also be copied. This was unnecessary because the addresses of TLS variables are relative to TLS segment. They don't interfere with non-TLS variables.

This copying behavior can be harmful in the following scenario:

For function-scope thread-local variables with non-trivial constructors,
they have guard variables. In the case of x86_64 general-dynamic model:

template <int N>
void foo() {
  thread_local std::string a;
}

GOT[n]   R_X86_64_DTPMOD64 guard variable for a
GOT[n+1] R_X86_64_DTPOFF64 guard variable for a
GOT[n+2] R_X86_64_DTPMOD64 a
GOT[n+3] R_X86_64_DTPOFF64 a

a and its guard variable are both represented as TLS variables, which
should be within the same module. If one is copy relocated to the main
module while the other is not, their module ID will mismatch and can
cause access without prior construction.

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 339042
2018-08-06 19:09:40 +00:00
..
aarch64-condb-reloc.s
aarch64-copy2.s
aarch64-tls-gdie.s
aarch64-tls-ie.s
aarch64-tstbr14-reloc.s
abs-hidden.s
abs.s
abs255.s
abs256.s
abs257.s
allow-multiple-definition.s
allow-shlib-undefined.s
amdgpu-kernel-0.s LLD/ELF/AMDGPU: Process AMDGPU-specific e_flags 2017-10-24 19:05:32 +00:00
amdgpu-kernel-1.s LLD/ELF/AMDGPU: Process AMDGPU-specific e_flags 2017-10-24 19:05:32 +00:00
archive.s
archive2.s
archive3.s
archive4.s
arm-attributes1.s
arm-exidx-cantunwind.s
arm-long-thunk-converge.lds ELF: Add support for short thunks on ARM. 2018-03-29 22:43:52 +00:00
arm-plt-reloc.s
arm-shared.s
arm-thumb-blx-targets.s
arm-thumb-narrow-branch.o
arm-thumb-narrow-branch.s
arm-tls-get-addr.s
arm-vfp-arg-base.s [ELF][ARM] Implement support for Tag_ABI_VFP_args 2018-07-31 13:41:59 +00:00
arm-vfp-arg-compat.s [ELF][ARM] Implement support for Tag_ABI_VFP_args 2018-07-31 13:41:59 +00:00
arm-vfp-arg-toolchain.s [ELF][ARM] Implement support for Tag_ABI_VFP_args 2018-07-31 13:41:59 +00:00
arm-vfp-arg-vfp.s [ELF][ARM] Implement support for Tag_ABI_VFP_args 2018-07-31 13:41:59 +00:00
as-needed-lazy.s Don't mark a shared library as needed because of a lazy symbol. 2018-01-23 16:59:20 +00:00
bad-archive.a
comdat-discarded-reloc.s [ELF] - Add a test case for relocation pointing to deduplicated COMDAT. 2018-07-04 10:38:12 +00:00
comdat.s
comment-gc.s
common.s
compress-debug.s [ELF] Compress debug sections after assignAddresses and support custom layout 2018-01-08 10:17:03 +00:00
conflict-debug.s Make the debug info in some tests more realistic. 2018-03-22 17:14:41 +00:00
conflict.s
copy-in-shared.s
copy-rel-abs.s Skip abs symbols when handling copy reloc aliases. 2017-10-30 17:26:12 +00:00
copy-rel-corrupted.s
copy-rel-large.s Use 64 bits for the shared symbol size again. 2017-10-30 17:43:16 +00:00
copy-rel-pie.s Make this test a bit less confusing. 2017-12-06 03:35:40 +00:00
copy-rel-tls.s [ELF] Don't copy STT_TLS in copy relocation 2018-08-06 19:09:40 +00:00
copy-rel-version.s [ELF] Fix copy relocation when two symbols share the same Symbol instance. 2018-06-11 19:42:57 +00:00
copy-relocation-zero-abs-addr.s Correct aligment computation for shared object symbols. 2018-06-06 21:43:34 +00:00
copy-relocation-zero-nonabs-addr.s Correct aligment computation for shared object symbols. 2018-06-06 21:43:34 +00:00
copy-relocation-zero-nonabs-addr.script Correct aligment computation for shared object symbols. 2018-06-06 21:43:34 +00:00
corrupt-version-reference.so [ELF] Don't crash when parsing a file with external version definition references 2017-10-05 23:28:29 +00:00
ctors_dtors_priority1.s Fix tests for .ctors/.dtors. 2017-07-17 20:42:52 +00:00
ctors_dtors_priority2.s Fix tests for .ctors/.dtors. 2017-07-17 20:42:52 +00:00
ctors_dtors_priority3.s Fix tests for .ctors/.dtors. 2017-07-17 20:42:52 +00:00
discard-merge-unnamed.o
dso-undef-size.s
dtrace-r.o
duplicated-plt-entry.s
dynamic-list-weak-archive.s Handle lazy symbols is computeIsPreemptible. 2017-09-08 18:41:49 +00:00
dynamic-reloc-weak.s
dynamic-reloc.s
eh-frame-end.s
eh-frame-pcrel-overflow.s [ELF] Check eh_frame_hdr overflow with PC offsets instead of PC absolute addresses 2018-07-20 20:27:42 +00:00
eh-frame.s Add a test. 2017-09-28 17:15:02 +00:00
ehframe-relocation.s
empty-ver.ver
exclude-libs.ll Also search BitcodeFiles for exclude-lib symbols 2018-07-11 17:45:28 +00:00
exclude-libs.s ELF: Stop collecting a list of symbols in ArchiveFile. 2018-02-16 20:23:54 +00:00
far-arm-abs.s
far-arm-thumb-abs.s
far-long-arm-abs.s ELF: Add support for short thunks on ARM. 2018-03-29 22:43:52 +00:00
gc-sections-shared.s Make a test stricter. 2017-11-23 23:40:33 +00:00
gc-sections-shared2.s Bring back r319008. 2017-11-28 20:17:58 +00:00
gc-sections-weak.s
gdb-index.s Remove 'z' in .zdebug when decompressing a section. 2018-02-12 22:25:45 +00:00
gnu-ifunc-dso.s
gnu-ifunc-gotpcrel.s
gotpc-relax-und-dso.s
hexagon.s Add Hexagon Support 2018-06-13 18:45:25 +00:00
hidden-shared-err.s Add an extra test. NFC. 2018-01-16 18:53:09 +00:00
hidden-shared-err2.s Fix another case we used the wrong visibility. 2018-01-16 19:02:46 +00:00
i386-got32x-baseless.elf
i386-pic-plt.s Error instead of producing broken binary. 2018-03-14 18:08:33 +00:00
i386-reloc-8-error.s
i386-reloc-8.s
i386-reloc-16-error.s
i386-reloc-16.s
i386-tls-got.s
icf-absolute.s
icf-absolute2.s [LLD][ELF] - ICF: Check we do not fold sections which relocations reffering to absolute symbols with a different values. 2018-07-31 13:55:25 +00:00
icf-merge-sec.s
icf-merge.s
icf-merge2.s
icf-merge3.s
icf-non-mergeable.s
icf-safe.s ELF: Implement --icf=safe using address-significance tables. 2018-07-18 22:49:31 +00:00
icf2.s
libsearch-dyn.s
libsearch-st.s
llvm33-rela-outside-group.o
local-symbol-in-dso.so Fix crash on invalid. 2017-12-14 05:01:49 +00:00
map-file2.s [ELF] Add .eh_frame pieces to map file 2018-03-14 21:18:18 +00:00
map-file3.s
map-file4.s
map-file5.s [ELF] - Show .plt symbols in -Map output. 2017-12-06 08:36:21 +00:00
merge.s
mips-64-got-load.s [ELF][MIPS] Fix primary GOT sometimes overflowing by one or two words 2018-07-24 05:40:37 +00:00
mips-align-err.s
mips-concatenated-abiflags.o
mips-dynamic.s
mips-fnpic.s
mips-fpic.s
mips-gp-dips-corrupt-ver.s [ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol 2018-02-07 10:02:49 +00:00
mips-gp-dips-corrupt-ver.so [ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol 2018-02-07 10:02:49 +00:00
mips-gp-disp.so
mips-gp0-non-zero.o
mips-mgot-1.s [ELF][MIPS] Multi-GOT implementation 2018-06-11 07:24:31 +00:00
mips-mgot-2.s [ELF][MIPS] Multi-GOT implementation 2018-06-11 07:24:31 +00:00
mips-micro-gp0-non-zero.o [ELF][MIPS] Fix calculation of GP relative relocations in case of relocatable output 2018-05-08 15:34:06 +00:00
mips-micro.s [MIPS] Initial support of microMIPS code linking 2017-09-12 13:08:24 +00:00
mips-n64-gp0-non-zero.o [ELF][MIPS] Fix calculation of GP relative relocations in case of relocatable output 2018-05-08 15:34:06 +00:00
mips-nonalloc.s
mips-options.o
mips-pic.s
mips-tls.s
multiple-cu.s Fix PR36793. 2018-03-23 00:35:27 +00:00
no-symtab.o
plt-aarch64.s
ppc64-addr16-error.s
ppc64-func-global-entry.s [PPC64] Add offset to local entry point when calling functions without plt 2018-04-27 15:41:19 +00:00
ppc64-func-local-entry.s [PPC64] Add offset to local entry point when calling functions without plt 2018-04-27 15:41:19 +00:00
ppc64-func.s [PPC64] Fix toc restore nops offset for V2 ABI 2018-04-23 15:01:24 +00:00
ppc64-tls.s [PPC64] Add support for initial-exec TLS model 2018-06-01 15:20:56 +00:00
print-icf.s [ELF] Add --print-icf-sections flag 2018-02-01 16:00:46 +00:00
progname-ver.s
protected-data-access.s Rename --icf-data and add a corresponding flag for functions. 2018-01-10 01:37:36 +00:00
protected-function-access.s Rename --icf-data and add a corresponding flag for functions. 2018-01-10 01:37:36 +00:00
protected-shared.s
relocatable-comdat-multiple.s
relocatable-ehframe.s
relocatable-non-alloc.s
relocatable-tls.s
relocatable.s
relocatable2.s
relocation-copy-alias.s
relocation-copy-align-common.s
relocation-copy-align.s
relocation-copy-arm.s
relocation-copy-relro.s
relocation-copy.s
relocation-relative-absolute.s
relocation-size-shared.s
resolution-end.s
resolution-shared.s
resolution.s
rodynamic.s
shared-ppc64.s [PPC64] Remove support for ELF V1 ABI in LLD 2018-05-04 15:09:49 +00:00
shared.s
shared2-x86-64.s
shared2.s
shared3.s [ELF] Make tests with undefined symbols more explicit. 2017-11-24 06:42:32 +00:00
shf-info-link.test
shlib-undefined-ref.s [ELF] Only scan executables for shlib undefined symbols 2017-12-30 08:00:44 +00:00
sht-group-gold-r.elf
sht-group-gold-r.s
start-lib-comdat.s
start-lib1.s
start-lib2.s
startstop-shared2.s
symbol-ordering-file-warnings1.s [ELF] Add warnings for various symbols that cannot be ordered 2018-02-14 13:36:22 +00:00
symbol-ordering-file-warnings2.s [ELF] Add warnings for various symbols that cannot be ordered 2018-02-14 13:36:22 +00:00
symbol-override.s
symver-archive1.s Bring back r307364. 2017-07-19 16:45:05 +00:00
symver-archive2.s Bring back r307364. 2017-07-19 16:45:05 +00:00
tls-got-entry.s
tls-got.s
tls-in-archive.s
tls-mismatch.s
tls-opt-gdie.s
tls-opt-gdiele-i686.s
tls-opt-iele-i686-nopic.s
trace-ar1.s
trace-ar2.s
trace-symbols-foo-strong.s
trace-symbols-foo-weak.s
uabs_label.s
undef-bad-debug.s [ELF] Rework debug line parsing to use llvm::Error and callbacks (LLD-side) 2018-05-10 10:52:21 +00:00
undef-debug.s Make the debug info in some tests more realistic. 2018-03-22 17:14:41 +00:00
undef-shared2.s Fix another case we were using the wrong visibility. 2018-01-16 18:21:23 +00:00
undef-with-plt-addr.s
undef.s
undefined-error.s [ELF] Try to not emit weird diagnostics on undefined symbols. 2017-10-11 18:37:24 +00:00
unknown-reloc.s
unresolved-symbols.s
use-bar.s
verdef-defaultver.s Don't depend on these symbols being implicitly global. 2017-07-19 18:24:38 +00:00
verdef.s
verneed1.s [ELF] - Get rid of precompiled input objects from testcases. 2017-10-04 09:46:53 +00:00
verneed2.s [ELF] - Get rid of precompiled input objects from testcases. 2017-10-04 09:46:53 +00:00
version-script-err.script
version-script-no-warn2.s Bring back InVersionScript. 2017-07-12 17:49:17 +00:00
version-script-weak.s
version-undef-sym.so
version-use.script
version-use.so
versiondef.s [ELF] Do not error for missing version when symbol has local version. 2018-05-14 10:13:56 +00:00
visibility.s
warn-common.s
warn-common2.s
weak-undef-lazy.s Handle lazy symbols is Symbol::includeInDynsym. 2017-09-13 00:47:06 +00:00
whole-archive.s
wrap-dynamic-undef.s
wrap-no-real.s Refine our --wrap implementation. 2017-10-06 20:09:34 +00:00
wrap-no-real2.s Correctly handle shared and lazy symbols. 2017-10-13 00:06:38 +00:00
wrap.s Copy the visibility in copyFrom. 2017-11-28 23:06:09 +00:00
writable-sec-plt-reloc.s Allow relocations in rw sections to create plt entries. 2017-12-24 19:02:10 +00:00
x86-64-relax-offset.s
x86-64-reloc-8-error.s
x86-64-reloc-8.s
x86-64-reloc-16-error.s
x86-64-reloc-16.s
x86-64-reloc-error.s
x86-64-split-stack-extra.s [LLD] Update split stack support to handle more generic prologues. Improve error handling. Add test file for better code-coverage. Update tests to be more complete. 2018-08-02 18:13:40 +00:00
x86-64-split-stack-main.s Implement framework for linking split-stack object files, and x86_64 support. 2018-07-17 23:16:02 +00:00
x86-64-tls-gd-got.s
znotext-copy-relocations.s Allow copy relocation with -z notext. 2017-12-28 00:23:49 +00:00
znotext-plt-relocations-protected.s Don't try to preempt protected symbols with -z notext. 2017-12-27 20:53:13 +00:00
znotext-plt-relocations.s [ELF] - Allow using PLT relocations when "-z notext" is given. 2017-12-23 09:00:37 +00:00
ztext.s Rename a test file and fix indentation. 2018-03-01 23:01:41 +00:00