[binutils-gdb] Re: readelf: Add --got-contents option

Alan Modra amodra@sourceware.org
Mon Sep 1 07:44:33 GMT 2025


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

commit 7bdcd19cc6d8137ecdca83571946d6ffb7b4be26
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Sep 1 11:00:17 2025 +0930

    Re: readelf: Add --got-contents option
    
    The cris ld testsuite uses readelf -a.  The extra output now means
    that a number of tests fail.  Fix that by not using -a, but rather
    the options corresponding to output checked in the dump files.
    
            * testsuite/ld-cris/tls-local-63.d: Replace -a option with -r -s.
            Remove now unnecessary #... and superfluous unwind message.
            * testsuite/ld-cris/tls-local-64.d: Likewise.
            * testsuite/ld-cris/tls-und-38.d: Likewise.
            * testsuite/ld-cris/tls-und-42.d: Likewise.
            * testsuite/ld-cris/tls-und-46.d: Likewise.
            * testsuite/ld-cris/tls-und-50.d: Likewise.
            * testsuite/ld-cris/weakref3.d: Replace -a with -S -r -s, and
            remove unwind message.
            * testsuite/ld-cris/weakref4.d: Likewise.

Diff:
---
 ld/testsuite/ld-cris/tls-local-63.d | 9 +++------
 ld/testsuite/ld-cris/tls-local-64.d | 9 +++------
 ld/testsuite/ld-cris/tls-und-38.d   | 5 +----
 ld/testsuite/ld-cris/tls-und-42.d   | 5 +----
 ld/testsuite/ld-cris/tls-und-46.d   | 5 +----
 ld/testsuite/ld-cris/tls-und-50.d   | 5 +----
 ld/testsuite/ld-cris/weakref3.d     | 4 +---
 ld/testsuite/ld-cris/weakref4.d     | 4 +---
 8 files changed, 12 insertions(+), 34 deletions(-)

diff --git a/ld/testsuite/ld-cris/tls-local-63.d b/ld/testsuite/ld-cris/tls-local-63.d
index 4dcdb2ea558..d0841fb0adc 100644
--- a/ld/testsuite/ld-cris/tls-local-63.d
+++ b/ld/testsuite/ld-cris/tls-local-63.d
@@ -2,18 +2,15 @@
 #source: tls-hx.s
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 6 -x 8 -x 5
+#readelf: -r -s -x 6 -x 8 -x 5
 
 # A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol.  Make sure
 # the relocation, GOT, .text and .tdata have the right contents.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset     Info    Type            Sym.Value  Sym. Name \+ Addend
 000021a0  0000001c R_CRIS_32_TPREL[ ]+0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains 3 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
 #...
@@ -23,9 +20,9 @@ Symbol table '.symtab' contains 13 entries:
 #...
 Hex dump of section '.text':
   0x00000114 5fae0c00                            .*
-#...
+
 Hex dump of section '.tdata':
   0x00002118 280+                            .*
-#...
+
 Hex dump of section '.got':
   0x0+2194 1c210000 0+ 0+ 0+ .*
diff --git a/ld/testsuite/ld-cris/tls-local-64.d b/ld/testsuite/ld-cris/tls-local-64.d
index 38f90c86107..68989d32aa7 100644
--- a/ld/testsuite/ld-cris/tls-local-64.d
+++ b/ld/testsuite/ld-cris/tls-local-64.d
@@ -3,19 +3,16 @@
 #source: tls-hx.s
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 6 -x 8 -x 5
+#readelf: -r -s -x 6 -x 8 -x 5
 
 # A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol, at an offset
 # into .data.  Make sure the relocation, GOT, .text and .tdata have
 # the right contents.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset     Info    Type            Sym.Value  Sym. Name \+ Addend
 00002220  0000001c R_CRIS_32_TPREL[ ]+80
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains 3 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
 #...
@@ -25,13 +22,13 @@ Symbol table '.symtab' contains [0-9]+ entries:
 #...
 Hex dump of section '.text':
   0x00000114 5fae0c00                            .*
-#...
+
 Hex dump of section '.tdata':
   0x00002118 2f0+ 0+ 0+ 0+ .*
   0x00002128 0+ 0+ 0+ 0+ .*
 #...
   0x00002188 0+ 0+ 0+ 0+ .*
   0x00002198 280+                            .*
-#...
+
 Hex dump of section '.got':
   0x0+2214 9c210000 0+ 0+ 80+ .*
diff --git a/ld/testsuite/ld-cris/tls-und-38.d b/ld/testsuite/ld-cris/tls-und-38.d
index 07c066259c7..1174658de16 100644
--- a/ld/testsuite/ld-cris/tls-und-38.d
+++ b/ld/testsuite/ld-cris/tls-und-38.d
@@ -1,20 +1,17 @@
 #source: tls-gd-2.s --pic
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 7
+#readelf: -r -s -x 7
 
 # Undefined reference for a R_CRIS_32_GOT_GD in a DSO.  Not an error;
 # it's ok for a DSO to have undefined references upon creation for
 # global symbols that can be overridden.  Just make sure GOT, dynsyms
 # and dynrelocs look right.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
 00002190 +00000217 R_CRIS_DTP +00000000 +x \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
diff --git a/ld/testsuite/ld-cris/tls-und-42.d b/ld/testsuite/ld-cris/tls-und-42.d
index b7309a72332..0fe1dfa2124 100644
--- a/ld/testsuite/ld-cris/tls-und-42.d
+++ b/ld/testsuite/ld-cris/tls-und-42.d
@@ -1,20 +1,17 @@
 #source: tls-ie-10.s --pic
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 7
+#readelf: -r -s -x 7
 
 # Undefined reference for a R_CRIS_32_GOT_TPREL in a DSO.  Not an
 # error; it's ok for a DSO to have undefined references upon creation
 # for global symbols that can be overridden.  Just make sure GOT,
 # dynsyms and dynrelocs look right.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
 00002198 +0000021c R_CRIS_32_TPREL +0+ +x \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
diff --git a/ld/testsuite/ld-cris/tls-und-46.d b/ld/testsuite/ld-cris/tls-und-46.d
index 1088e420449..d536844e76b 100644
--- a/ld/testsuite/ld-cris/tls-und-46.d
+++ b/ld/testsuite/ld-cris/tls-und-46.d
@@ -1,20 +1,17 @@
 #source: tls-gd-1.s --pic
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 7
+#readelf: -r -s -x 7
 
 # Undefined reference for a R_CRIS_16_GOT_GD in a DSO.  Not an error;
 # it's ok for a DSO to have undefined references upon creation for
 # global symbols that can be overridden.  Just make sure GOT, dynsyms
 # and dynrelocs look right.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
 0000218c +00000217 R_CRIS_DTP +00000000 +x \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
diff --git a/ld/testsuite/ld-cris/tls-und-50.d b/ld/testsuite/ld-cris/tls-und-50.d
index 2b22a21d4d6..fd6ff4c367f 100644
--- a/ld/testsuite/ld-cris/tls-und-50.d
+++ b/ld/testsuite/ld-cris/tls-und-50.d
@@ -1,20 +1,17 @@
 #source: tls-ie-8.s --pic
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --shared --hash-style=sysv
-#readelf: -a -x 7
+#readelf: -r -s -x 7
 
 # Undefined reference for a R_CRIS_16_GOT_TPREL in a DSO.  Not an
 # error; it's ok for a DSO to have undefined references upon creation
 # for global symbols that can be overridden.  Just make sure GOT,
 # dynsyms and dynrelocs look right.
 
-#...
 Relocation section '.rela.dyn' at offset 0x.* contains 1 entry:
  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
 00002190 +0000021c R_CRIS_32_TPREL +0+ +x \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
diff --git a/ld/testsuite/ld-cris/weakref3.d b/ld/testsuite/ld-cris/weakref3.d
index a4a55b4e614..ffb9955dafb 100644
--- a/ld/testsuite/ld-cris/weakref3.d
+++ b/ld/testsuite/ld-cris/weakref3.d
@@ -3,7 +3,7 @@
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --hash-style=sysv
 #ld_after_inputfiles: tmpdir/libdso-15.so
-#readelf: -a -x 10
+#readelf: -S -r -s -x 10
 
 # Like libdso-15b.d, but referencing the weak symbol and function from
 # a program.  At some time we broke emitting a copy reloc for the
@@ -22,8 +22,6 @@ Relocation section '.rela.plt' at offset 0x... contains 1 entry:
  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
 .* R_CRIS_JUMP_SLOT .* expfn2@TST3 \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
 #...
  +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +13 __expobj2@TST3 \(2\)
diff --git a/ld/testsuite/ld-cris/weakref4.d b/ld/testsuite/ld-cris/weakref4.d
index 9012bdc007e..a52f86a8045 100644
--- a/ld/testsuite/ld-cris/weakref4.d
+++ b/ld/testsuite/ld-cris/weakref4.d
@@ -3,7 +3,7 @@
 #as: --no-underscore --emulation=criself
 #ld: -m crislinux --hash-style=sysv
 #ld_after_inputfiles: tmpdir/libdso-15.so
-#readelf: -a -x 11
+#readelf: -S -r -s -x 11
 
 # Like weakref3.d, but just the expobj2 referenced from .data.  We
 # should avoid a copy reloc (instead emitting a R_CRIS_GLOB_DAT or
@@ -19,8 +19,6 @@ Relocation section '.rela.dyn' at offset 0x... contains 1 entry:
 #...
 .* R_CRIS_COPY .* __expobj2@TST3 \+ 0
 
-The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported.
-
 Symbol table '.dynsym' contains . entries:
 #...
  +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +12 __expobj2@TST3 \(2\)


More information about the Binutils-cvs mailing list