public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* load of in-place relocation addend in AArch64
@ 2023-12-06  8:08 Frédéric Rivière
  2023-12-06 11:14 ` Nick Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Frédéric Rivière @ 2023-12-06  8:08 UTC (permalink / raw)
  To: binutils

Dear binutils group,

I'm actually working on an in-house compiler that generates AArch64 ELF 
object files.

I'm actually fighting with the following issue:

My compiler generates REL relocations with an in-place addend but the 
addend is not taken into account for computing the final relocated 
symbol address (S+A).

The addend is initialized to 0 
(https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-aarch64.c;h=4faf642b422ffdff5c7879bff6bd08991b38eab8;hb=HEAD#l6931)

Then in elf32_arm_final_link_relocate, the addend is added from the 
relocation field "r_addend" (always 0 in case of REL)

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-aarch64.c;h=4faf642b422ffdff5c7879bff6bd08991b38eab8;hb=HEAD#l5674

So it seems the that I'm the first one that generates REL relocations 
for AArch64 target.

However, I don't see any limitation on using REL relocations in the 
AARCH64 ABI.

https://github.com/ARM-software/abi-aa/blob/2982a9f3b512a5bfdc9e3fea5d3b298f9165c36b/aaelf64/aaelf64.rst#572addends-and-pc-bias

I would appreciate any comment/feedback that would help me understanding 
the reasons behind that.

Thanks for your help.

Best Regards,

--Frédéric RIVIERE


	





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-28  7:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06  8:08 load of in-place relocation addend in AArch64 Frédéric Rivière
2023-12-06 11:14 ` Nick Clifton
2023-12-06 15:02   ` Frédéric Rivière
2023-12-06 15:31     ` Nick Clifton
2023-12-06 16:56       ` Frédéric Rivière
2023-12-07 17:16         ` Nick Clifton
2023-12-11  7:51           ` Frédéric Rivière
2024-03-28  7:10             ` Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).