binutils-gdb/ld/testsuite/ld-aarch64/bti-far.ld
Szabolcs Nagy 15b4f66b0a bfd: aarch64: Fix stubs that may break BTI PR30076
Insert two stubs in a BTI enabled binary when fixing long calls: The
first is near the call site and uses an indirect jump like before,
but it targets the second stub that is near the call target site and
uses a direct jump.

This is needed when a single stub breaks BTI compatibility.

The stub layout is kept fixed between sizing and building the stubs,
so the location of the second stub is known at build time, this may
introduce padding between stubs when those are relaxed.  Stub layout
with BTI disabled is unchanged.
2023-03-23 12:49:32 +00:00

16 lines
327 B
Plaintext

OUTPUT_ARCH(aarch64)
ENTRY(_start)
SECTIONS
{
. = 0x10000;
.rela.plt : { *(.rela.plt) *(.rela.iplt) }
. = 0x18000;
.plt : { *(.plt) *(.iplt) }
. = 0x20000;
.text : { *(.text) }
. = 0x30000;
.got : { *(.got) *(.got.plt) }
. = 0x12340000;
.far : { *(.far) }
}