From 0b0ac024582f6f8cc3bfc5da7ad33d2d2b982258 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Thu, 30 Oct 2025 16:29:55 -0400 Subject: [PATCH] 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. --- bfd/elf64-hppa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.3