[binutils-gdb] hppa64: Fallback to .text if .dynamic isn't found

John David Anglin danglin@sourceware.org
Wed Jan 21 18:49:27 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ec74e6871f4934fbdf661fde3be72fbf29db6c29

commit ec74e6871f4934fbdf661fde3be72fbf29db6c29
Author: John David Anglin <danglin@gcc.gnu.org>
Date:   Wed Jan 21 13:48:40 2026 -0500

    hppa64: Fallback to .text if .dynamic isn't found
    
    Commit a1c2fa92ac93bf50227941bd82094e6997c5fd56 broke the ld
    testcase for .note.GNU-stack wanting to be SHT_NOTE.  Fix this
    by falling back to .text if .dynamic isn't available to define
    the text segment base.
    
    2026-01-21  John David Anglin  <danglin@gcc.gnu.org>
    
    bfd/ChangeLog:
    
            * elf64-hppa.c (elf64_hppa_late_size_sections): Fallback
            to .text if .dynamic section isn't found.

Diff:
---
 bfd/elf64-hppa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index c35dcf02976..2828b15add9 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -1818,6 +1818,8 @@ elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
       asection *s;
 
       s = bfd_get_section_by_name (info->output_bfd, ".dynamic");
+      if (s == NULL)
+	s = bfd_get_section_by_name (info->output_bfd, ".text");
       if (s != NULL)
 	{
 	  struct elf_link_hash_entry *nh;


More information about the Binutils-cvs mailing list