Change the readelf and objdump programs so that they will automatically follow links...
authorNick Clifton <nickc@redhat.com>
Fri, 12 Feb 2021 14:52:22 +0000 (14:52 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 12 Feb 2021 14:52:22 +0000 (14:52 +0000)
* configure.ac (follow-debug-links): Add option to enable or
disable the following of debug links by default.  Set the
default for the option to be 'follow'.
* dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS.
(dwarf_select_sections_by_names): Add no-follow-links option.
(dwarf_select_sections_by_letter): Add 'N' option.
* objdump.c (usage): Add conditional text describing the
follow links option.
(slurp_symtab): Ensure that there is a NULL entry at the end
of the symbol table.
(slurp_dynamic_symtab): Likewise.
(dump_bfd): When extending the symbol table, ensure that there
is still a NULL entry at the end.
* readelf.c (usage): Add conditional text describing the
follow links option.
* doc/binutils.texi: Update documentation for objcopy and
readelf.
* doc/debug.options.texi: Update documentation of the
follow-links option.
* config.in: Regenerate.
* configure: Regenerate.
* testsuite/binutils-all/compress.exp: Add the -WN option to
objdump command lines that are not expecting to follow links.
* testsuite/binutils-all/readelf.exp: Add the
--debug-dump=no-follow-links option to tests that are not
expecting to follow debug links.

gas * testsuite/gas/mach-o/sections-1.d: Stop automatic debug link
        following.
* testsuite/gas/xgate/insns-dwarf2.d: Likewise.

ld * testsuite/ld-elf/sec64k.exp: Stop readelf from automatically
following debug links.

18 files changed:
binutils/ChangeLog
binutils/NEWS
binutils/config.in
binutils/configure
binutils/configure.ac
binutils/doc/binutils.texi
binutils/doc/debug.options.texi
binutils/dwarf.c
binutils/objdump.c
binutils/readelf.c
binutils/testsuite/binutils-all/compress.exp
binutils/testsuite/binutils-all/objdump.exp
binutils/testsuite/binutils-all/readelf.exp
gas/ChangeLog
gas/testsuite/gas/mach-o/sections-1.d
gas/testsuite/gas/xgate/insns-dwarf2.d
ld/ChangeLog
ld/testsuite/ld-elf/sec64k.exp

index 73b25e862103b9c8c7e62262b05a85057ff275c3..a717099426534ebb887bae0cefa58b449570ebbb 100644 (file)
@@ -1,3 +1,33 @@
+2021-02-12  Nick Clifton  <nickc@redhat.com>
+
+       * configure.ac (follow-debug-links): Add option to enable or
+       disable the following of debug links by default.  Set the
+       default for the option to be 'follow'.
+       * dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS.
+       (dwarf_select_sections_by_names): Add no-follow-links option.
+       (dwarf_select_sections_by_letter): Add 'N' option.
+       * objdump.c (usage): Add conditional text describing the
+       follow links option.
+       (slurp_symtab): Ensure that there is a NULL entry at the end
+       of the symbol table.
+       (slurp_dynamic_symtab): Likewise.
+       (dump_bfd): When extending the symbol table, ensure that there
+       is still a NULL entry at the end.
+       * readelf.c (usage): Add conditional text describing the
+       follow links option.
+       * doc/binutils.texi: Update documentation for objcopy and
+       readelf.
+       * doc/debug.options.texi: Update documentation of the
+       follow-links option.
+       * config.in: Regenerate.
+       * configure: Regenerate.
+       * testsuite/binutils-all/compress.exp: Add the -WN option to
+       objdump command lines that are not expecting to follow links.
+       * testsuite/binutils-all/readelf.exp: Add the
+       --debug-dump=no-follow-links option to tests that are not
+       expecting to follow debug links.
+       * NEWS: Mention the new behaviour.
+
 2021-02-12  Alan Modra  <amodra@gmail.com>
 
        * testsuite/binutils-all/objcopy.exp: Report "unsupported" when
index 1bd5ef37c4492aa0ec6116fdf91416da026eb920..b0d55623738eb2c7cbf1c6fded0db2dd7742a127 100644 (file)
@@ -1,5 +1,12 @@
 -*- text -*-
 
+* Readelf and objdump will now follow links to separate debug info files by
+  default.  This behaviour can be stopped via the use of the new -wN or
+  --debug-dump=no-follow-links options for readelf and the -WN or
+  --dwarf=no-follow-links options for objdump.  Also the old behaviour can be
+  restored by the use of the --enable-follow-debug-links=no configure time
+  option.
+
 Changes in 2.36:
 
 * Update elfedit and readelf with LAM_U48 and LAM_U57 support.
index 4d6744737192c8ab6b8bf743495bd20898ebc8ca..59076a607300918ec2fa453424f76e13c86e5b7a 100644 (file)
@@ -18,6 +18,9 @@
 /* Should ar and ranlib use -D behavior by default? */
 #undef DEFAULT_AR_DETERMINISTIC
 
+/* Have readelf and objdump follow debug links by default */
+#undef DEFAULT_FOR_FOLLOW_LINKS
+
 /* Have nm use F and f for global and local ifunc symbols */
 #undef DEFAULT_F_FOR_IFUNC_SYMBOLS
 
index 1918e94a155e7bd68626a874d0a12ad536297282..f328d31175db333cbcf394db05803d2646d51e33 100755 (executable)
@@ -822,6 +822,7 @@ enable_targets
 enable_deterministic_archives
 enable_default_strings_all
 enable_f_for_ifunc_symbols
+enable_follow_debug_links
 with_debuginfod
 enable_libctf
 enable_werror
@@ -1489,6 +1490,9 @@ Optional Features:
   --enable-f-for-ifunc-symbols
                           Have nm use F and f for global and local ifunc
                           symbols
+  --enable-follow-debug-links
+                          Have readelf and objdump follow debug links by
+                          default
   --enable-libctf         Handle .ctf type-info sections [default=yes]
   --enable-werror         treat compile warnings as errors
   --enable-build-warnings enable build-time compiler warnings
@@ -11577,7 +11581,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11580 "configure"
+#line 11584 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11683,7 +11687,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11686 "configure"
+#line 11690 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12359,6 +12363,27 @@ _ACEOF
 
 
 
+# Check whether --enable-follow-debug-links was given.
+if test "${enable_follow_debug_links+set}" = set; then :
+  enableval=$enable_follow_debug_links;
+if test "${enableval}" = no; then
+  default_for_follow_links=0
+else
+  default_for_follow_links=1
+fi
+else
+  default_for_follow_links=1
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_FOR_FOLLOW_LINKS $default_for_follow_links
+_ACEOF
+
+
+
+
 
 
 
index 6ab854663706b0ce44c180a27282adfa63f63a6d..af24c0c9a8a65901f2553eb401ce026f290bdb9a 100644 (file)
@@ -82,6 +82,20 @@ fi], [default_f_for_ifunc=0])
 AC_DEFINE_UNQUOTED(DEFAULT_F_FOR_IFUNC_SYMBOLS, $default_f_for_ifunc,
                   [Have nm use F and f for global and local ifunc symbols])
 
+
+AC_ARG_ENABLE(follow-debug-links,
+[AS_HELP_STRING([--enable-follow-debug-links],
+       [Have readelf and objdump follow debug links by default])], [
+if test "${enableval}" = no; then
+  default_for_follow_links=0
+else
+  default_for_follow_links=1
+fi], [default_for_follow_links=1])
+
+AC_DEFINE_UNQUOTED(DEFAULT_FOR_FOLLOW_LINKS, $default_for_follow_links,
+                  [Have readelf and objdump follow debug links by default])
+
+
 AC_DEBUGINFOD
 
 GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections])
index 526efe4940de1473a0d5057e57441efd5b243949..94ea5720be8d7a7e6f8dfd86e56a1ccbaffe5bce 100644 (file)
@@ -2187,8 +2187,10 @@ objdump [@option{-a}|@option{--archive-headers}]
         [@option{-r}|@option{--reloc}]
         [@option{-R}|@option{--dynamic-reloc}]
         [@option{-s}|@option{--full-contents}]
-        [@option{-W[lLiaprmfFsoORtUuTgAckK]}|
-         @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]]
+        [@option{-W[lLiaprmfFsoORtUuTgAck]}|
+         @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]]
+        [@option{-WK}|@option{--dwarf=follow-links}]
+        [@option{-WN}|@option{--dwarf=no-follow-links}]
         [@option{--ctf=}@var{section}]
         [@option{-G}|@option{--stabs}]
         [@option{-t}|@option{--syms}]
@@ -2325,7 +2327,7 @@ will stop at the end of the function, otherwise it will stop when the
 next symbol is encountered.  If there are no matches for @var{symbol}
 then nothing will be displayed.
 
-Note if the @option{--dwarf=follow-links} option has also been enabled
+Note if the @option{--dwarf=follow-links} option is enabled
 then any symbol tables in linked debug info files will be read in and
 used when disassembling.
 
@@ -2347,7 +2349,7 @@ If the target is an ARM architecture this switch also has the effect
 of forcing the disassembler to decode pieces of data found in code
 sections as if they were instructions.
 
-Note if the @option{--dwarf=follow-links} option has also been enabled
+Note if the @option{--dwarf=follow-links} option is enabled
 then any symbol tables in linked debug info files will be read in and
 used when disassembling.
 
@@ -4753,8 +4755,10 @@ readelf [@option{-a}|@option{--all}]
         [@option{-R} <number or name>|@option{--relocated-dump=}<number or name>]
         [@option{-z}|@option{--decompress}]
         [@option{-c}|@option{--archive-index}]
-        [@option{-w[lLiaprmfFsoORtUuTgAckK]}|
-         @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]]
+        [@option{-w[lLiaprmfFsoORtUuTgAck]}|
+         @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]]
+        [@option{-wK}|@option{--debug-dump=follow-links}]
+        [@option{-wN}|@option{--debug-dump=no-follow-links}]
         [@option{--dwarf-depth=@var{n}}]
         [@option{--dwarf-start=@var{n}}]
         [@option{--ctf=}@var{section}]
index 31260c1d19ec8377a6baa2defbb951cd51b9e6b3..2ad8f03626d259bed8608e569a6934467cb1dbdc 100644 (file)
@@ -61,6 +61,17 @@ In addition, when displaying DWARF attributes, if a form is found that
 references the separate debug info file, then the referenced contents
 will also be displayed.
 
+Note - in some distributions this option is enabled by default.  It
+can be disabled via the @option{N} debug option.  The default can be
+chosen when configuring the binutils via the
+@option{--enable-follow-debug-links=yes} or
+@option{--enable-follow-debug-links=no} options.  If these are not
+used then the default is to enable the following of debug links.
+
+@item N
+@itemx =no-follow-links
+Disables the following of links to separate debug info files.
+
 @item l
 @itemx =rawline
 Displays the contents of the @samp{.debug_line} section in a raw
index e55a7daa8febdd6a56e99d61e538792919b7f1aa..ce1aeff7ee4829b44dfaf6809ba14f45d5b176d1 100644 (file)
@@ -99,7 +99,7 @@ int do_debug_addr;
 int do_debug_cu_index;
 int do_wide;
 int do_debug_links;
-int do_follow_links;
+int do_follow_links = DEFAULT_FOR_FOLLOW_LINKS;
 bfd_boolean do_checks;
 
 int dwarf_cutoff_level = -1;
@@ -11373,6 +11373,7 @@ dwarf_select_sections_by_names (const char *names)
       { "links", & do_debug_links, 1 },
       { "loc",  & do_debug_loc, 1 },
       { "macro", & do_debug_macinfo, 1 },
+      { "no-follow-links", & do_follow_links, 0 },
       { "pubnames", & do_debug_pubnames, 1 },
       { "pubtypes", & do_debug_pubtypes, 1 },
       /* This entry is for compatibility
@@ -11402,7 +11403,7 @@ dwarf_select_sections_by_names (const char *names)
          if (strncmp (p, entry->option, len) == 0
              && (p[len] == ',' || p[len] == '\0'))
            {
-             * entry->variable |= entry->val;
+             * entry->variable = entry->val;
 
              /* The --debug-dump=frames-interp option also
                 enables the --debug-dump=frames option.  */
@@ -11443,6 +11444,7 @@ dwarf_select_sections_by_letters (const char *letters)
       case 'g':        do_gdb_index = 1; break;
       case 'i':        do_debug_info = 1; break;
       case 'K': do_follow_links = 1; break;
+      case 'N': do_follow_links = 0; break;
       case 'k':        do_debug_links = 1; break;
       case 'l':        do_debug_lines |= FLAG_DEBUG_LINES_RAW; break;
       case 'L':        do_debug_lines |= FLAG_DEBUG_LINES_DECODED; break;
index 2cd0d84cefdcd8d9c4ac4d91dcfe3411fea943bb..fde5f59c9acee40bcc9c310ff9636cf476f31664 100644 (file)
@@ -229,13 +229,24 @@ usage (FILE *stream, int status)
   -g, --debugging          Display debug information in object file\n\
   -e, --debugging-tags     Display debug information using ctags style\n\
   -G, --stabs              Display (in raw form) any STABS info in the file\n\
-  -W[lLiaprmfFsoORtUuTgAckK] or\n\
+  -W[lLiaprmfFsoORtUuTgAck] or\n\
   --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\
           =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\
           =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\
-          =addr,=cu_index,=links,=follow-links]\n\
+          =addr,=cu_index,=links]\n\
                            Display DWARF info in the file\n\
 "));
+#if DEFAULT_FOR_FOLLOW_LINKS
+  fprintf (stream, _("\
+  -WK,--dwarf=follow-links     Follow links to separate debug info files (default)\n\
+  -WN,--dwarf=no-follow-links  Do not follow links to separate debug info files\n\
+"));
+#else
+  fprintf (stream, _("\
+  -WK,--dwarf=follow-links     Follow links to separate debug info files\n\
+  -WN,--dwarf=no-follow-links  Do not follow links to separate debug info files (default)\n\
+"));
+#endif
 #ifdef ENABLE_LIBCTF
   fprintf (stream, _("\
   --ctf=SECTION            Display CTF info from SECTION\n\
@@ -737,31 +748,32 @@ slurp_symtab (bfd *abfd)
       non_fatal (_("failed to read symbol table from: %s"), bfd_get_filename (abfd));
       bfd_fatal (_("error message was"));
     }
-  if (storage)
-    {
-      off_t filesize = bfd_get_file_size (abfd);
-
-      /* qv PR 24707.  */
-      if (filesize > 0
-         && filesize < storage
-         /* The MMO file format supports its own special compression
-            technique, so its sections can be larger than the file size.  */
-         && bfd_get_flavour (abfd) != bfd_target_mmo_flavour)    
-       {
-         bfd_nonfatal_message (bfd_get_filename (abfd), abfd, NULL,
-                               _("error: symbol table size (%#lx) is larger than filesize (%#lx)"),
-                       storage, (long) filesize);
-         exit_status = 1;
-         symcount = 0;
-         return NULL;
-       }
+  /* Add an extra entry (at the end) with a NULL pointer.  */
+  storage += sizeof (asymbol *);
 
-      sy = (asymbol **) xmalloc (storage);
+  off_t filesize = bfd_get_file_size (abfd);
+
+  /* qv PR 24707.  */
+  if (filesize > 0
+      && filesize < storage
+      /* The MMO file format supports its own special compression
+        technique, so its sections can be larger than the file size.  */
+      && bfd_get_flavour (abfd) != bfd_target_mmo_flavour)       
+    {
+      bfd_nonfatal_message (bfd_get_filename (abfd), abfd, NULL,
+                           _("error: symbol table size (%#lx) is larger than filesize (%#lx)"),
+                           storage, (long) filesize);
+      exit_status = 1;
+      symcount = 0;
+      return NULL;
     }
 
+  sy = (asymbol **) xmalloc (storage);
   symcount = bfd_canonicalize_symtab (abfd, sy);
   if (symcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
+  /* assert (symcount < (storage / sizeof (asymbol *))) */
+  sy[symcount] = NULL;
   return sy;
 }
 
@@ -774,6 +786,7 @@ slurp_dynamic_symtab (bfd *abfd)
   long storage;
 
   storage = bfd_get_dynamic_symtab_upper_bound (abfd);
+  /* Add an extra entry (at the end) with a NULL pointer.  */
   if (storage < 0)
     {
       if (!(bfd_get_file_flags (abfd) & DYNAMIC))
@@ -786,12 +799,15 @@ slurp_dynamic_symtab (bfd *abfd)
 
       bfd_fatal (bfd_get_filename (abfd));
     }
-  if (storage)
-    sy = (asymbol **) xmalloc (storage);
+
+  storage += sizeof (asymbol *);
+  sy = (asymbol **) xmalloc (storage);
 
   dynsymcount = bfd_canonicalize_dynamic_symtab (abfd, sy);
   if (dynsymcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
+  /* assert (symcount < (storage / sizeof (asymbol *))) */
+  sy[dynsymcount] = NULL;
   return sy;
 }
 
@@ -4899,10 +4915,12 @@ dump_bfd (bfd *abfd, bfd_boolean is_mainfile)
                    }
                  else
                    {
-                     syms = xrealloc (syms, (symcount + old_symcount) * sizeof (asymbol *));
+                     syms = xrealloc (syms, (symcount + old_symcount + 1) * sizeof (asymbol *));
                      memcpy (syms + old_symcount,
                              extra_syms,
                              symcount * sizeof (asymbol *));
+                     /* Preserve the NULL entry at the end of the symbol table.  */
+                     syms[symcount + old_symcount] = NULL;
                    }
                }
 
index c61219a4652b8cf8f668adf47b51ee558e8911fa..77e450a619519d6a64ba158ff5abaa04289b6ca4 100644 (file)
@@ -4624,12 +4624,23 @@ usage (FILE * stream)
   -R --relocated-dump=<number|name>\n\
                          Dump the contents of section <number|name> as relocated bytes\n\
   -z --decompress        Decompress section before dumping it\n\
-  -w[lLiaprmfFsoORtUuTgAckK] or\n\
+  -w[lLiaprmfFsoORtUuTgAck] or\n\
   --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\
                =frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\
                =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\
-               =addr,=cu_index,=links,=follow-links]\n\
+               =addr,=cu_index,=links]\n\
                          Display the contents of DWARF debug sections\n"));
+#if DEFAULT_FOR_FOLLOW_LINKS
+  fprintf (stream, _("\
+  -wK,--debug-dump=follow-links     Follow links to separate debug info files (default)\n\
+  -wN,--debug-dump=no-follow-links  Do not follow links to separate debug info files\n\
+"));
+#else
+  fprintf (stream, _("\
+  -wK,--debug-dump=follow-links     Follow links to separate debug info files\n\
+  -wN,--debug-dump=no-follow-links  Do not follow links to separate debug info files (default)\n\
+"));
+#endif
   fprintf (stream, _("\
   --dwarf-depth=N        Do not display DIEs at depth N or greater\n\
   --dwarf-start=N        Display DIEs starting with N, at the same depth\n\
index e0e04f072e57c8537f222b09619b826b507e852d..5801f6b7c64a1fb7c8ffd196c808b6d9d9ab328d 100644 (file)
@@ -717,7 +717,7 @@ proc test_gnu_debuglink {} {
        fail "$test (objcopy link decompress)"
        return
     }
-    set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.decompress.dump"]
+    set got [remote_exec host "$OBJDUMP -S -WN tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.decompress.dump"]
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "$test (objcopy dump decompress)"
        return
@@ -726,7 +726,7 @@ proc test_gnu_debuglink {} {
        fail "$test (objcopy link compress)"
        return
     }
-    set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.compress.dump"]
+    set got [remote_exec host "$OBJDUMP -S -WN tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.compress.dump"]
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "$test (objcopy dump compress)"
        return
index aa8c207d4d1cea8b673574068ed4c73df4c116d7..6f95d4039f55a6d3e6c8a31c16831ce0ba41df92 100644 (file)
@@ -606,7 +606,7 @@ if { [is_elf_format] } then {
        set testfile tmpdir/debuglink.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk $testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk -WN $testfile" "" "/dev/null" "objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -Wk (reason: unexpected output)"
@@ -615,7 +615,7 @@ if { [is_elf_format] } then {
     }
 
     if { [regexp_diff objdump.out $srcdir/$subdir/objdump.Wk] } then {
-       fail "objdump -Wk"
+       fail "objdump -Wk (reason: output does not match expectations)"
     } else {
        pass "objdump -Wk"
     }
index 948323c06bb5565bab44e3739081d4f99e62f6cf..71164085706089faaea040e1aab3fc3abfb0a848 100644 (file)
@@ -507,7 +507,7 @@ if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
        set tempfile [remote_download host tmpdir/debuglink.o]
     }
 
-    readelf_test {--debug-dump=links} $tempfile readelf.k  {}
+    readelf_test {--debug-dump=links -wN} $tempfile readelf.k  {}
 
     # Check that debug link sections can be followed.
     if {![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug]} then {
@@ -530,7 +530,7 @@ if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then {
        set tempfile [remote_download host tmpdir/dwo.o]
     }
 
-    readelf_test {--debug-dump=links} $tempfile readelf.k2  {}
+    readelf_test {--debug-dump=links --debug-dump=no-follow-links} $tempfile readelf.k2  {}
 }
 
 if {![binutils_assemble $srcdir/$subdir/zero-sec.s tmpdir/zero-sec.o]} then {
@@ -555,6 +555,6 @@ if ![is_remote host] {
     if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} {
        untested "bzip2 -dc ($testname)"
     } else {
-       readelf_test {--debug-dump=macro} $tempfile pr26112.r {}
+       readelf_test {--debug-dump=macro -wN} $tempfile pr26112.r {}
     }
 }
index 6e701292fa97acc2973da3db979a75e5e3c23fcd..d21ff558f1bfc1a58f0b422a3fd1ea750667ee7a 100644 (file)
@@ -1,3 +1,9 @@
+2021-02-12  Nick Clifton  <nickc@redhat.com>
+
+       * testsuite/gas/mach-o/sections-1.d: Stop automatic debug link
+        following.
+       * testsuite/gas/xgate/insns-dwarf2.d: Likewise.
+
 2021-02-12  Alan Modra  <amodra@gmail.com>
 
        * testsuite/gas/all/pr27381.err: Don't match source file name.
index 5b8a8fa8c3aa752eea3f474248259ccfeed21cb0..cf7676925049bf93152f94d69ba90a5c1d3115d8 100644 (file)
@@ -1,4 +1,4 @@
-#objdump: -P section
+#objdump: -P section -WN
 .*: +file format mach-o.*
 #...
  Section: __text           __TEXT           \(bfdname: .text\)
index 3a8e6992aac4bca92a8a9c0f6223370f2d6b574b..fd658a6912e430cbf836a8cbbde6b4a587957049 100644 (file)
@@ -1,4 +1,4 @@
-#objdump: -S
+#objdump: -S -WN
 #as: -gdwarf2
 #name: Dwarf2 test on insns.s
 #source: insns.s
index 263f233e3cb79651d98c20a9df31ae74e7d72b4e..16c6f2f427abcbfda0fc359521b86d8b737214f8 100644 (file)
@@ -1,3 +1,8 @@
+2021-02-12  Nick Clifton  <nickc@redhat.com>
+
+       * testsuite/ld-elf/sec64k.exp: Stop readelf from automatically
+       following debug links.
+
 2021-02-11  Alan Modra  <amodra@gmail.com>
 
        * NEWS: Mention arm-symbianelf removal.
index d148c26d8fead8bab23f13b8289770152a5271e8..a8ce93358198ae95f7ccb8b7c5f7bc9f88e54cf4 100644 (file)
@@ -135,7 +135,7 @@ if { ![istarget "m32r-*-*"] } then {
        puts $ofd "#as: -ez80-adl"
     }
     puts $ofd "#ld: -r"
-    puts $ofd "#readelf: -W -Ss"
+    puts $ofd "#readelf: -W -wN -Ss"
     puts $ofd "There are 680.. section headers.*:"
     puts $ofd "#..."
     puts $ofd "  \\\[ 0\\\] .* 680\[0-9\]\[0-9\]\[ \]+0\[ \]+0"
@@ -190,7 +190,7 @@ if { ![istarget "d10v-*-*"]
     if { [istarget "z80-*-*"] } then {
        puts $ofd "#as: -ez80-adl"
     }
-    puts $ofd "#readelf: -W -Ss"
+    puts $ofd "#readelf: -W -wN -Ss"
     puts $ofd "There are 660.. section headers.*:"
     puts $ofd "#..."
     puts $ofd "  \\\[ 0\\\] .* 660..\[ \]+0\[ \]+0"
This page took 0.044507 seconds and 4 git commands to generate.