[committed] MIPS/LD/testsuite: Adjust match patterns for special section indexes

Message ID alpine.DEB.2.00.1801292350440.4074@tp.orcam.me.uk
State New
Headers show
Series
  • [committed] MIPS/LD/testsuite: Adjust match patterns for special section indexes
Related show

Commit Message

Maciej W. Rozycki Jan. 30, 2018, 12:40 a.m.
Update `readelf' symbol table dump match patterns to handle SHN_MIPS_DATA 
and SHN_MIPS_TEXT special section indexes produced by the IRIX ELF format 
variation used with a number of MIPS targets and printed by `readelf' as 
PRC[0xff02] and PRC[0xff01] respectively, correcting LD test suite 
failures:

extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$"
EOF from dump.out
FAIL: Common symbol override test (auxiliary shared object build)

extra regexps in .../ld/testsuite/ld-elf/pr21703-shared.sd starting with "^ +[0-9]+: +[0-9a-f]+ +4 +FUNC +GLOBAL +DEFAULT +[0-9] +foo@FOO$"
EOF from dump.out
FAIL: PR ld/21703 shared

extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$"
EOF from dump.out
FAIL: MIPS o32/copyreloc common symbol override test (auxiliary shared object build)

extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$"
EOF from dump.out
FAIL: MIPS o32/nocopyreloc common symbol override test (auxiliary shared object build)

observed due to file contents like:

     7: 5ffe02e8     0 OBJECT  GLOBAL DEFAULT PRC[0xff02] foo

shown by `readelf -s' vs:

 +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo

pattern expected, triggered by widening testing to these targets by commit 
05a5feafdd38 ("Rewrite check_shared_lib_support").

	ld/
	* testsuite/ld-elf/comm-data1.sd: Alternatively accept 
	`PRC[0xff02]' in place of a regular section index.
	* testsuite/ld-elf/pr21703-shared.sd: Likewise `PRC[0xff01]'.
---
 ld/testsuite/ld-elf/comm-data1.sd     |    4 ++--
 ld/testsuite/ld-elf/pr21703-shared.sd |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

binutils-mips-ld-test-sym-prc.diff

Patch

Index: binutils/ld/testsuite/ld-elf/comm-data1.sd
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/comm-data1.sd	2017-12-12 00:50:12.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/comm-data1.sd	2018-01-19 09:22:16.397699598 +0000
@@ -1,10 +1,10 @@ 
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
- +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +(?:[0-9]+|PRC\[0xff02\]) +foo
 #...
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 #...
- +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +(?:[0-9]+|PRC\[0xff02\]) +foo
 #pass
Index: binutils/ld/testsuite/ld-elf/pr21703-shared.sd
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr21703-shared.sd	2017-12-13 11:20:18.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr21703-shared.sd	2018-01-19 16:54:24.230531065 +0000
@@ -1,11 +1,11 @@ 
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
 #...
- +[0-9]+: +[0-9a-f]+ +4 +FUNC +GLOBAL +DEFAULT +[0-9] +foo@FOO
+ +[0-9]+: +[0-9a-f]+ +4 +FUNC +GLOBAL +DEFAULT +(?:[0-9]+|PRC\[0xff01\]) +foo@FOO
 #...
  +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +ABS +FOO1
 #...
- +[0-9]+: +[0-9a-f]+ +32 +FUNC +GLOBAL +DEFAULT +[0-9] +foo@@FOO1
+ +[0-9]+: +[0-9a-f]+ +32 +FUNC +GLOBAL +DEFAULT +(?:[0-9]+|PRC\[0xff01\]) +foo@@FOO1
 #...
  +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +ABS +FOO
 #...