]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
hppa64: Fallback to .text if .dynamic isn't found
authorJohn David Anglin <danglin@gcc.gnu.org>
Wed, 21 Jan 2026 18:48:40 +0000 (13:48 -0500)
committerJohn David Anglin <danglin@gcc.gnu.org>
Wed, 21 Jan 2026 18:48:40 +0000 (13:48 -0500)
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.

bfd/elf64-hppa.c

index c35dcf0297620d945fcc9af5caf95fff43cfaa25..2828b15add96408373bb361a94f4dae6fcf39e01 100644 (file)
@@ -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;