abi-aa icon indicating copy to clipboard operation
abi-aa copied to clipboard

New dynamic relocation type: R_AARCH64_FUNCINIT64

Open pcc opened this issue 7 months ago • 1 comments

R_AARCH64_FUNCINIT64 is a dynamic relocation type for relocating word-sized data in the output file using the return value of a function. An R_AARCH64_FUNCINIT64 shall be relocated as an R_AARCH64_IRELATIVE with the target symbol address if the target symbol is non-preemptible, and it shall be a usage error to relocate an R_AARCH64_FUNCINIT64 with a preemptible or STT_GNU_IFUNC target symbol.

The initial use case for this relocation type shall be for emitting global variable field initializers for structure protection. With structure protection, the relocation value computation is tied to the compiler implementation in such a way that it would not be reasonable to define a relocation type for it (for example, it may involve computing a hash using a compiler-determined algorithm), hence the need for the computation to be implemented as code in the binary.

pcc avatar May 13 '25 03:05 pcc

Thanks for raising. I'll take a look in context of the llvm patch. May be a bit later in the week before I can get to it.

smithp35 avatar May 13 '25 17:05 smithp35

Added in #340.

pcc avatar Aug 11 '25 17:08 pcc