[binutils-gdb] Remove an accidental change to elfcode.h included as part of commit 6e0dfbf420.

Nick Clifton nickc@sourceware.org
Wed Jul 7 15:52:10 GMT 2021


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

commit ca52626babd59d58f3962dcaab94cf840e6aff82
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Jul 7 16:50:33 2021 +0100

    Remove an accidental change to elfcode.h included as part of commit 6e0dfbf420.
    
            PR 27659
            * elfcode.h (elf_swap_symbol_out): Revert accidental change that
            removed an abort if the shndx pointer is NULL.

Diff:
---
 bfd/ChangeLog | 5 +++++
 bfd/elfcode.h | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e0cb2bfd291..25bb16315a9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2021-07-07  Nick Clifton  <nickc@redhat.com>
+
+	* elfcode.h (elf_swap_symbol_out): Revert accidental change that
+	removed an abort if the shndx pointer is NULL.
+
 2021-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* sysdep.h [!ENABLE_NLS]: Prevent inclusion of <libintl.h> on
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 0f5156fbe1b..7eb27c2e16d 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -221,9 +221,8 @@ elf_swap_symbol_out (bfd *abfd,
   if (tmp >= (SHN_LORESERVE & 0xffff) && tmp < SHN_LORESERVE)
     {
       if (shndx == NULL)
-	H_PUT_32 (abfd, tmp, 0);
-      else
-	H_PUT_32 (abfd, tmp, shndx);
+	abort ();
+      H_PUT_32 (abfd, tmp, shndx);
       tmp = SHN_XINDEX & 0xffff;
     }
   H_PUT_16 (abfd, tmp, dst->st_shndx);


More information about the Binutils-cvs mailing list