mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
15b4f66b0a
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.
30 lines
323 B
ArmAsm
30 lines
323 B
ArmAsm
.text
|
|
.global _start
|
|
.type _start, %function
|
|
_start:
|
|
bl foo
|
|
bl bar
|
|
bl baz
|
|
baz:
|
|
ret
|
|
|
|
.section .far,"ax",@progbits
|
|
.global foo
|
|
.type foo, %function
|
|
foo:
|
|
bl baz
|
|
bar:
|
|
bl baz
|
|
bl foo
|
|
|
|
.section .note.gnu.property,"a"
|
|
.align 3
|
|
.word 4
|
|
.word 16
|
|
.word 5
|
|
.string "GNU"
|
|
.word 0xc0000000
|
|
.word 4
|
|
.word 1
|
|
.align 3
|