[1/2] xtensa: reserve relocation number for R_XTENSA_32_ABS

Message ID 20260923170020.757213-2-alexey.lapshin@espressif.com
State New
Headers
Series xtensa: add R_XTENSA_32_ABS |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Alexey Lapshin Sept. 23, 2026, 4:59 p.m. UTC
  R_XTENSA_32 uses a partial_inplace howto, so BFD stores its addend in
the relocated word rather than in r_addend, which deviates from the
generic ABI for an SHT_RELA target.  R_XTENSA_32_ABS is the same 32-bit
absolute address computed as S + A, with the addend taken only from
r_addend.

Reserve its number ahead of the implementation so that other toolchains
can rely on it while the rest of the change is under review.

include/
	* elf/xtensa.h (R_XTENSA_32_ABS): New relocation, number 64.
---
 include/elf/xtensa.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/include/elf/xtensa.h b/include/elf/xtensa.h
index 032b94ef94b..328d64428bc 100644
--- a/include/elf/xtensa.h
+++ b/include/elf/xtensa.h
@@ -96,6 +96,11 @@  START_RELOC_NUMBERS (elf_xtensa_reloc_type)
      /* Positive same-section difference encoded as uleb128; rewritten
 	in place after relaxation without changing the section size.  */
      RELOC_NUMBER (R_XTENSA_PDIFF_ULEB128, 63)
+     /* 32-bit absolute address computed as S + A, with the addend taken
+	only from r_addend as the generic ABI requires.  Unlike R_XTENSA_32,
+	which is partial_inplace, the contents of the relocated word do not
+	contribute to the result.  */
+     RELOC_NUMBER (R_XTENSA_32_ABS, 64)
 END_RELOC_NUMBERS (R_XTENSA_max)
 
 /* Processor-specific flags for the ELF header e_flags field.  */