Skip to content

Commit

Permalink
[sysvabi64] No BTI landing pads for absolute symbols.
Browse files Browse the repository at this point in the history
It is possible to provide a static linker with branch targets
using absolute symbols. For example using --defsym. The static
cannot disassemble the location of these symbols so it isn't
possible to check whether A BTI landing pad is necessary, nor
is it always possible to place a BTI landing pad within range
of the absolute symbol address.

A user providing the static linker with function addresses
using absolute symbols is responsible for putting BTI
compatible landing pads at the start of these addresses.
  • Loading branch information
smithp35 committed Nov 14, 2024
1 parent 6ede00d commit 96aa942
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sysvabi64/sysvabi64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,8 @@ A static linker is required to generate `Custom PLTs`_ with BTI
instructions.

A static linker that uses indirect branches in veneers is required to
generate a BTI compatible landing pad if the target does not have a
generate a BTI compatible landing pad if the target of the indirect
branch is defined within the same link unit and does not have a
compatible BTI instruction at the destination of the veneer. A BTI
compatible landing pad consists of a BTI instruction followed by a
direct branch. For example:
Expand All @@ -1726,6 +1727,9 @@ direct branch. For example:
fn:
// a non BTI instruction.
A static linker is not required to insert BTI compatible landing pads
for symbols with section index ``SHN_ABS``.

Program Loading
---------------

Expand Down

0 comments on commit 96aa942

Please sign in to comment.