From: John David Anglin Date: Thu, 30 Oct 2025 20:29:55 +0000 (-0400) Subject: hppa64: Use address of __text_seg symbol insted of hppa_info->text_segment_base X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b0ac024582f6f8cc3bfc5da7ad33d2d2b982258;p=thirdparty%2Fbinutils-gdb.git hppa64: Use address of __text_seg symbol insted of hppa_info->text_segment_base 2025-10-30 John David Anglin bfd/ChangeLog: * elf64-hppa.c (elf_hppa_final_link_relocate): Use address of __text_seg symbol insted of hppa_info->text_segment_base. --- diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index cc4c64fda53..73320ae6de4 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -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;