This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix objdump's display of indirect strings in object files, which was broken by the link following co


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

commit 2e8136f9453e21414cc328d025bec33218176b66
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Jul 23 17:54:32 2019 +0100

    Fix objdump's display of indirect strings in object files, which was broken by the link following code.
    
    	PR 24818
    	* objdump.c (is_relocateable): Delete.
    	(load_specific_debug_section): Test the abfd for relocations
    	directly, rather than relying upon is_relocateable.
    	(dump_dwarf): Delete initlialization of is_relocateable.

Diff:
---
 binutils/ChangeLog | 8 ++++++++
 binutils/dwarf.c   | 1 -
 binutils/objdump.c | 7 ++-----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e329c40..cc8bb80 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,11 @@
+2019-07-23  Nick Clifton  <nickc@redhat.com>
+
+	PR 24818
+	* objdump.c (is_relocateable): Delete.
+	(load_specific_debug_section): Test the abfd for relocations
+	directly, rather than relying upon is_relocateable.
+	(dump_dwarf): Delete initlialization of is_relocateable.
+
 2019-07-23  Alan Modra  <amodra@gmail.com>
 
 	* readelf.c (get_parisc_segment_type): Split off hpux entries..
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index f86e20d..519f9cc 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3296,7 +3296,6 @@ process_debug_info (struct dwarf_section *           section,
 	      if (! do_loc && do_printing)
 		/* Show the offset from where the tag was extracted.  */
 		printf ("    <%lx>", (unsigned long)(tags - section_begin));
-
 	      tags = read_and_display_attr (attr->attribute,
 					    attr->form,
 					    attr->implicit_const,
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 6812ba7..fffbcf8 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -192,8 +192,6 @@ static bfd_size_type stab_size;
 static bfd_byte *strtab;
 static bfd_size_type stabstr_size;
 
-static bfd_boolean is_relocatable = FALSE;
-
 /* Handlers for -P/--private.  */
 static const struct objdump_private_desc * const objdump_private_vectors[] =
   {
@@ -2749,7 +2747,8 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
   /* Ensure any string section has a terminating NUL.  */
   section->start[section->size] = 0;
 
-  if (is_relocatable && debug_displays [debug].relocate)
+  if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
+      && debug_displays [debug].relocate)
     {
       long         reloc_size;
       bfd_boolean  ret;
@@ -2943,8 +2942,6 @@ dump_dwarf (bfd *abfd)
       return;
     }
 
-  is_relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0;
-
   eh_addr_size = bfd_arch_bits_per_address (abfd) / 8;
 
   switch (bfd_get_arch (abfd))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]