llvm-project/lld/test/ELF/Inputs
Fangrui Song 19d53d45f2 [ELF][AArch64] Refine and fix the condition when BTI/PAC PLT needs bti c
(As I mentioned in https://reviews.llvm.org/D62609#1534158 ,
the condition for using bti c for executable can be loosened.)

In two cases the address of a PLT may escape:

* canonical PLT entry for a STT_FUNC
* non-preemptible STT_GNU_IFUNC which is converted to STT_FUNC

The first case can be detected with `needsPltAddr`.

The second case is not straightforward to detect because for the Relocations.cpp
created `directSym`, it's difficult to know whether the associated `sym` has
exercised the `!needsPlt(expr)` code path. Just use the conservative `isInIplt`
condition. A non-preemptible ifunc not referenced by non-GOT-generating
non-PLT-generating relocations will have an unneeded `bti c`, but the cost is acceptable.

The second case fixes a bug as well: a -shared link may have non-preemptible ifunc.
Before the patch we did not emit `bti c` and could be wrong if the PLT address escaped.
GNU ld doesn't handle the case: `relocation R_AARCH64_ADR_PREL_PG_HI21 against STT_GNU_IFUNC symbol 'ifunc2' isn't handled by elf64_aarch64_final_link_relocate` (https://sourceware.org/bugzilla/show_bug.cgi?id=28370)

For -shared, if BTI is enabled but PAC is disabled, the PLT entry size increases
from 16 to 24 because we have to select the PLT scheme early, but the cost is
acceptable.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D110217
2021-09-22 11:51:09 -07:00
..
aarch64-addrifunc.s [ELF][AArch64] Refine and fix the condition when BTI/PAC PLT needs bti c 2021-09-22 11:51:09 -07:00
aarch64-bti1.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-btipac1.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-condb-reloc.s
aarch64-copy2.s
aarch64-func2.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-func3-bti.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-func3-btipac.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-func3-pac.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-func3.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-nobti.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-nopac.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-pac1.s [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
aarch64-tls-gdie.s
aarch64-tls-ie.s
aarch64-tstbr14-reloc.s
abs.s
abs255.s
abs256.s
abs257.s
allow-multiple-definition.s
allow-shlib-undefined.s
amdgpu-kernel-0.s
amdgpu-kernel-1.s
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
canonical-plt-pcrel.s [ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order 2020-02-28 22:23:14 -08:00
comdat-discarded-reloc.s [ELF][test] Avoid local signature symbols for section groups to match reality 2021-05-22 17:48:45 -07:00
comdat.s [ELF][test] Avoid local signature symbols for section groups to match reality 2021-05-22 17:48:45 -07:00
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 [ELF][test] Make tests more tolerant to exact symbol addresses 2019-09-10 12:28:07 +00:00
copy-rel-abs.s [ELF][X86] Allow PT_LOAD to have overlapping p_offset ranges on EM_X86_64 2019-09-16 07:05:34 +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-tls.s [ELF][X86] Allow PT_LOAD to have overlapping p_offset ranges on EM_X86_64 2019-09-16 07:05:34 +00:00
copy-rel-version.s [ELF] Support copy relocation on non-default version symbols 2021-08-05 10:32:14 -07:00
copy-rel.s [ELF][test] Delete unneeded binding directive (.weak or .globl) 2020-03-25 23:34:46 -07:00
corrupt-version-reference.so
ctors_dtors_priority1.s
ctors_dtors_priority2.s
ctors_dtors_priority3.s
discard-merge-unnamed.o
dso-undef-size.s
dummy-shared.s [ELF] Emit weak-undef symbols in .dynsym of a PIE binary only if linked against shared libs. 2019-03-18 15:32:57 +00:00
duplicated-plt-entry.s
dynamic-list-weak-archive.s
dynamic-reloc-weak.s
dynamic-reloc.s
eh-frame-pcrel-overflow.s [ELF][test] Fix section sh_type and sh_flags 2020-02-19 22:01:42 -08:00
eh-frame.s
empty-ver.ver
exclude-libs.ll Fix lld testcases I missed in D78413 (9b9454a) 2020-04-20 12:48:57 -07: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 [ELF] Restore arm-branch.s test 2021-06-17 17:08:13 +07:00
far-arm-thumb-abs.s
far-long-arm-abs.s [ELF] Restore arm-branch.s test 2021-06-17 17:08:13 +07: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-invalid-ranges.obj.s gdb-index: Handle errors when parsing ranges 2018-12-22 00:31:05 +00:00
gdb-index-multiple-cu-2.s [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
gdb-index.s [DebugInfo] Add more checks to parsing .debug_pub* sections. 2020-07-09 19:15:31 +07:00
gnu-ifunc-canon-ro-abs.s ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an IRELATIVE where possible. 2019-02-13 21:49:55 +00:00
gnu-ifunc-canon-ro-pcrel.s ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an IRELATIVE where possible. 2019-02-13 21:49:55 +00:00
gnu-ifunc-canon-rw-addend.s ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an IRELATIVE where possible. 2019-02-13 21:49:55 +00:00
gnu-ifunc-dso.s [ELF][test] Improve and reorganize another set of tests 2019-09-09 03:35:14 +00:00
gotpc-relax-und-dso.s
hexagon-shared.s [ELF][HEXAGON] Add support for dynamic libraries 2018-09-28 14:09:16 +00:00
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-cet1.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
i386-cet2.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
i386-cet3.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
i386-cet4.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
i386-got32x-baseless.elf
i386-linkonce.s [ELF] Revert "Also demote lazy symbols." 2018-09-11 23:00:36 +00:00
i386-pic-plt.s Error instead of producing broken binary. 2018-03-14 18:08:33 +00:00
i386-static-tls-model1.s Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target." 2019-02-06 14:43:30 +00:00
i386-static-tls-model2.s Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target." 2019-02-06 14:43:30 +00:00
i386-static-tls-model3.s Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target." 2019-02-06 14:43:30 +00:00
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-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-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-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-bsymbolic-local-def.s [PPC64] Add test documenting toc-restore when linking with -Bsymbolic. [NFC] 2018-10-03 21:58:42 +00:00
ppc64-callee-global-hidden.s [PowerPC] Implement R_PPC64_REL24_NOTOC calls, callee also has no TOC 2020-07-10 07:23:32 -05:00
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-got-to-pcrel-relaxation-def.s [LLD][PowerPC] Implement GOT to PC-Rel relaxation 2020-08-17 09:36:09 -05:00
ppc64-no-split-stack.s Reland "[PPC64] Add split - stack support." 2018-10-16 17:13:01 +00:00
ppc64-sort-small-cm-relocs-input2.s [PPC64] Reland r351978 'Sort .toc sections accessed with small code model ...' 2019-01-24 18:17:40 +00:00
ppc64-sort-small-cm-relocs-input3.s [PPC64] Reland r351978 'Sort .toc sections accessed with small code model ...' 2019-01-24 18:17:40 +00:00
ppc64-sort-small-cm-relocs-input4.s [ELF][test] Fix section sh_type and sh_flags 2020-02-19 22:01:42 -08:00
ppc64-tls-ie-le.s [PPC64] Add TLS initial exec to local exec relaxation 2018-08-21 15:13:53 +00:00
ppc64-tls.s [PPC64] Add support for initial-exec TLS model 2018-06-01 15:20:56 +00:00
ppc64-toc-relax-shared.s [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
ppc64-toc-relax.s [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
ppc64le-quadword-ldst.o [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
print-icf.s Convert CRLF. NFC. 2019-02-11 21:38:20 +00:00
protected-data-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 [ELF][test] Make tests more tolerant to exact symbol addresses 2019-09-10 12:28:07 +00:00
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 ELF: Add .interp synthetic sections first in createSyntheticSections(). 2019-10-01 16:10:13 +00:00
shared2-x86-64.s [LLD][ELF] - Update and fix gnu-ifunc* tests. 2020-08-11 15:14:33 +03:00
shared2.s
shared3.s [ELF] Make tests with undefined symbols more explicit. 2017-11-24 06:42:32 +00:00
shf-info-link.test [lib/ObjectYAML] - Make `ELFYAML::Relocation::Offset` optional. 2020-03-06 13:59:58 +03:00
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
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
symver-archive2.s
tls-got-entry.s
tls-got.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
undef-bad-debug.s [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09: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
unknown-reloc.s
unresolved-symbols.s
use-bar.s
verdef-defaultver.s
verdef.s
verneed1.s
verneed2.s
version-script-err.script
version-script-no-warn2.s
version-script-weak.s
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
vs-diagnostics-duplicate2.s [lld] Add Visual Studio compatible diagnostics 2019-07-17 14:54:02 +00:00
vs-diagnostics-duplicate3.s [ELF] For VS-style diagnostics, prefer printing full paths in the header. 2019-08-09 08:29:03 +00:00
warn-common.s
warn-common2.s
weak-undef-lazy.s
whole-archive.s
wrap-no-real.s
wrap-no-real2.s
wrap-with-archive.s Fix linker-defined symbols possibly not being defined when -wrap is used 2019-01-02 19:28:00 +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-cet1.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
x86-64-cet2.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
x86-64-cet3.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
x86-64-cet4.s Read .note.gnu.property sections and emit a merged .note.gnu.property section. 2019-06-05 03:04:46 +00:00
x86-64-pcrel.s Fix a bug in R_X86_64_PC{8,16} relocation handling. 2019-02-07 18:12:57 +00:00
x86-64-relax-offset.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