binutils Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
bfd

aarch64: Fix GOT entry confusion for DT_RELR.

Corrects handling of GOT entries for DT_RELR relocations on AArch64.

This commit fixes an issue in bfd/elfnn-aarch64.c where the record_relr_dyn_got_relocs function experienced a “union phase confusion” regarding GOT entries for DT_RELR relocations. The change modifies the condition for detecting unallocated GOT entries to match the updated offset semantics after allocate_dynrelocs.

In Details

Corrects a data interpretation error in bfd/elfnn-aarch64.c related to the h->got union within record_relr_dyn_got_relocs. The fix alters the check for an unallocated GOT entry from h->got.refcount <= 0 to h->got.offset == (bfd_vma) -1, aligning the logic with the post-allocate_dynrelocs repurposing of h->got to use offset semantics.

For Context
aarch64
The 64-bit implementation of the ARM architecture, commonly used in mobile devices and servers.
GOT
Global Offset Table. A table used in position-independent executable code to store addresses of global variables and functions, allowing them to be resolved at runtime.
DT_RELR
A dynamic tag in an ELF file that indicates a table of relocation entries. RELR implies a compact relocation format.
relocation
The process of updating symbolic addresses in relocatable object files to absolute addresses in an executable or shared library. This is typically done by the linker or dynamic loader.
union phase confusion
An issue where a data structure (a union) is used to store different types of information at different times, and the code incorrectly assumes one type is present when another is actually stored, leading to misinterpretation of the data.
Filed Under: aarch64linkerelfrelocation