hppa64: Set has_local_dynsyms when adding __text_seg/__data_seg

Message ID CAMe9rOrTm2jbRg1Eb0XSzBQKwHBBJRzX7vGwi6x45DPEscg1+A@mail.gmail.com
State New
Headers
Series hppa64: Set has_local_dynsyms when adding __text_seg/__data_seg |

Commit Message

H.J. Lu Dec. 1, 2025, 3:10 a.m. UTC
  commit 54fbc12d6404b645363f901110a21f4410067df5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Nov 28 16:07:57 2025 +0800

    elf: Renumber local dynamic symbols only if needed

caused regressions for hppa64-linux which adds local dynamic symbols,
__text_seg and __data_seg in elf64_hppa_late_size_sections.  Set
has_local_dynsyms to true when adding __text_seg and __data_seg.

* elf64-hppa.c (elf64_hppa_late_size_sections): Set
has_local_dynsyms to true when adding __text_seg and __data_seg.
  

Comments

John David Anglin Dec. 4, 2025, 9:22 p.m. UTC | #1
On 2025-11-30 10:10 p.m., H.J. Lu wrote:
> commit 54fbc12d6404b645363f901110a21f4410067df5
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Fri Nov 28 16:07:57 2025 +0800
> 
>     elf: Renumber local dynamic symbols only if needed
> 
> caused regressions for hppa64-linux which adds local dynamic symbols,
> __text_seg and __data_seg in elf64_hppa_late_size_sections.  Set
> has_local_dynsyms to true when adding __text_seg and __data_seg.
> 
> * elf64-hppa.c (elf64_hppa_late_size_sections): Set
> has_local_dynsyms to true when adding __text_seg and __data_seg.

Okay.  I was wondering how to fix this.  Yesterday, I was thinking that
the renumber routines should ignore local dynamic symbols that were marked
to prevent garbage collection.

Thanks,
Dave
  
Alan Modra Dec. 4, 2025, 9:26 p.m. UTC | #2
On Mon, Dec 01, 2025 at 11:10:34AM +0800, H.J. Lu wrote:
> * elf64-hppa.c (elf64_hppa_late_size_sections): Set
> has_local_dynsyms to true when adding __text_seg and __data_seg.

Please apply.
  

Patch

From c406f7ec80bf66dbbd57a881f436d19fb841557c Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 1 Dec 2025 11:06:23 +0800
Subject: [PATCH] hppa64: Set has_local_dynsyms when adding
 __text_seg/__data_seg

commit 54fbc12d6404b645363f901110a21f4410067df5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Nov 28 16:07:57 2025 +0800

    elf: Renumber local dynamic symbols only if needed

caused regressions for hppa64-linux which adds local dynamic symbols,
__text_seg and __data_seg in elf64_hppa_late_size_sections.  Set
has_local_dynsyms to true when adding __text_seg and __data_seg.

	* elf64-hppa.c (elf64_hppa_late_size_sections): Set
	has_local_dynsyms to true when adding __text_seg and __data_seg.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 bfd/elf64-hppa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 026c8a60956..d1c0212c6eb 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -1698,6 +1698,7 @@  elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
 	      nh->other = STV_DEFAULT;
 	      bfd_elf_link_record_dynamic_symbol (info, nh);
 	      hppa_info->text_hash_entry = nh;
+	      hppa_info->root.has_local_dynsyms = true;
 	    }
 	}
     }
@@ -1728,6 +1729,7 @@  elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
 	      nh->other = STV_DEFAULT;
 	      bfd_elf_link_record_dynamic_symbol (info, nh);
 	      hppa_info->data_hash_entry = nh;
+	      hppa_info->root.has_local_dynsyms = true;
 	    }
 	}
     }
-- 
2.52.0