[binutils-gdb] Revert "is_target_special_symbol fixes for commit 68bbe1183379"

Alan Modra amodra@sourceware.org
Tue Oct 8 05:27:15 GMT 2024


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

commit e022977bc563be7819bf1cd4b6c5f6c5eb878997
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Oct 8 09:49:14 2024 +1030

    Revert "is_target_special_symbol fixes for commit 68bbe1183379"
    
    This reverts commit 6e40f9bb31be2f3656df97a1fcba4d6a30081e24.

Diff:
---
 bfd/elf.c         | 3 ---
 bfd/elf32-v850.c  | 9 ++-------
 bfd/elfnn-riscv.c | 4 +---
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/bfd/elf.c b/bfd/elf.c
index 4012d994272..39ee641097b 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9725,9 +9725,6 @@ bool
 _bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
 			      const char *name)
 {
-  if (!name)
-    return false;
-
   /* Normal local symbols start with ``.L''.  */
   if (name[0] == '.' && name[1] == 'L')
     return true;
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 8d61ebb6754..85cbcbc3505 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1933,13 +1933,8 @@ v850_elf_info_to_howto_rela (bfd *abfd,
 static bool
 v850_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
 {
-  if (!name)
-    return false;
-  if (name[0] == '.' && (name[1] == 'L' || name[1] == '.'))
-    return true;
-  if (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')
-    return true;
-  return false;
+  return (   (name[0] == '.' && (name[1] == 'L' || name[1] == '.'))
+	  || (name[0] == '_' &&  name[1] == '.' && name[2] == 'L' && name[3] == '_'));
 }
 
 static bool
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 4844412a4d4..90ecc276f31 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -5610,11 +5610,9 @@ riscv_maybe_function_sym (const asymbol *sym,
 static bool
 riscv_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
 {
-  if (!sym->name)
-    return false;
   /* PR27584, local and empty symbols.  Since they are usually
      generated for pcrel relocations.  */
-  return (!sym->name[0]
+  return (!strcmp (sym->name, "")
 	  || _bfd_elf_is_local_label_name (abfd, sym->name)
 	  /* PR27916, mapping symbols.  */
 	  || riscv_elf_is_mapping_symbols (sym->name));


More information about the Binutils-cvs mailing list