]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
hppa64: Use address of __text_seg symbol insted of hppa_info->text_segment_base
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 30 Oct 2025 20:29:55 +0000 (16:29 -0400)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 30 Oct 2025 20:29:55 +0000 (16:29 -0400)
2025-10-30  John David Anglin  <danglin@gcc.gnu.org>

bfd/ChangeLog:

* elf64-hppa.c (elf_hppa_final_link_relocate): Use address of
__text_seg symbol insted of hppa_info->text_segment_base.

bfd/elf64-hppa.c

index cc4c64fda534023128119be679f911408b5237ba..73320ae6de4f00e9571c707de336e1e9ac3cd399 100644 (file)
@@ -3745,6 +3745,7 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel,
            Elf_Internal_Rela rela;
            bfd_byte *loc, *locend;
            int dynindx;
+           asection *sec;
 
            /* The offset of this relocation is the absolute address
               of the .opd entry for this symbol.  */
@@ -3753,7 +3754,8 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel,
 
            /* Compute the difference between the symbol address
               and the test segment base address.  */
-           value = relocation + addend - hppa_info->text_segment_base;
+           sec = hppa_info->text_segment->root.u.def.section;
+           value = (relocation + addend - sec->output_section->vma);
 
            /* The result becomes the addend of the relocation.  */
            rela.r_addend = value;