diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2017-01-23 11:18:33 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2017-01-23 11:31:11 +0000 |
commit | 7d9468120fceed20240511404e6d9498e68f3dc6 (patch) | |
tree | 427498d0c8d6d11f5602998155193eec671afb2c | |
parent | be86488c130bea251aae3ae13a897687e6d1c36a (diff) | |
download | gdb-7d9468120fceed20240511404e6d9498e68f3dc6.zip gdb-7d9468120fceed20240511404e6d9498e68f3dc6.tar.gz gdb-7d9468120fceed20240511404e6d9498e68f3dc6.tar.bz2 |
PR ld/20828: Relax symbol ordering in tests
Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and make tests check for the
presence of global `_fdata' and `_edata' symbols separately, removing
any dependency on symbol table ordering for tests to succeed and
removing:
FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
failures with the `x86_64-solaris2' target, which has additional
intervening entries:
Symbol table '.dynsym' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _fdata
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT 1 _DYNAMIC
3: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS _PROCEDURE_LINKAGE_TABLE_
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _edata
5: 00000000000001b8 0 OBJECT GLOBAL DEFAULT 4 _GLOBAL_OFFSET_TABLE_
Rename dump pattern files accordingly for consistency.
ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: Remove test.
* testsuite/ld-elf/pr20828-a.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: Rename test to...
* testsuite/ld-elf/pr20828-b.sd: ... this.
* testsuite/ld-elf/pr20828-2b.sd: Rename test to...
* testsuite/ld-elf/pr20828-c.sd: ... this.
* testsuite/ld-elf/shared.exp: Adjust accordingly.
(cherry picked from commit adcbdc63e5ccf663dacc8493cec63a95b653285e)
-rw-r--r-- | ld/ChangeLog | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-a.sd (renamed from ld/testsuite/ld-elf/pr20828-1.sd) | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-b.sd (renamed from ld/testsuite/ld-elf/pr20828-2a.sd) | 0 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-c.sd (renamed from ld/testsuite/ld-elf/pr20828-2b.sd) | 0 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 10 |
5 files changed, 18 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 0059bfa..78059e5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +2017-01-23 Maciej W. Rozycki <macro@imgtec.com> + + PR ld/20828 + * testsuite/ld-elf/pr20828-1.sd: Remove test. + * testsuite/ld-elf/pr20828-a.sd: New test. + * testsuite/ld-elf/pr20828-2a.sd: Rename test to... + * testsuite/ld-elf/pr20828-b.sd: ... this. + * testsuite/ld-elf/pr20828-2b.sd: Rename test to... + * testsuite/ld-elf/pr20828-c.sd: ... this. + * testsuite/ld-elf/shared.exp: Adjust accordingly. + 2017-01-18 Maciej W. Rozycki <macro@imgtec.com> PR ld/20995 diff --git a/ld/testsuite/ld-elf/pr20828-1.sd b/ld/testsuite/ld-elf/pr20828-a.sd index c47eb1d..c24e5ad 100644 --- a/ld/testsuite/ld-elf/pr20828-1.sd +++ b/ld/testsuite/ld-elf/pr20828-a.sd @@ -1,12 +1,9 @@ -# Make sure symbols are global rather than local in the dynamic symbol table, +# Make sure `_fdata' is global rather than local in the dynamic symbol table, # e.g.: # Num: Value Size Type Bind Vis Ndx Name # 1: 00000000 0 NOTYPE GLOBAL DEFAULT 1 _fdata -# 2: 00000000 0 NOTYPE GLOBAL DEFAULT 1 _edata # vs: # 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 _fdata -# 2: 00000000 0 NOTYPE LOCAL DEFAULT 1 _edata #... *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_fdata - *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_edata #pass diff --git a/ld/testsuite/ld-elf/pr20828-2a.sd b/ld/testsuite/ld-elf/pr20828-b.sd index c4b239b..c4b239b 100644 --- a/ld/testsuite/ld-elf/pr20828-2a.sd +++ b/ld/testsuite/ld-elf/pr20828-b.sd diff --git a/ld/testsuite/ld-elf/pr20828-2b.sd b/ld/testsuite/ld-elf/pr20828-c.sd index 8089c48..8089c48 100644 --- a/ld/testsuite/ld-elf/pr20828-2b.sd +++ b/ld/testsuite/ld-elf/pr20828-c.sd diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index dfbf438..c940177 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -58,14 +58,16 @@ if { [check_gc_sections_available] } { (auxiliary shared library)" \ "$LFLAGS -shared --gc-sections -T pr20828.ld" "" "$AFLAGS_PIC" \ {pr20828.s} \ - {{readelf --dyn-syms pr20828-1.sd}} \ + {{readelf --dyn-syms pr20828-a.sd} \ + {readelf --dyn-syms pr20828-b.sd}} \ "libpr20828.so"] \ [list \ "PR ld/20828 dynamic symbols with section GC (plain)" \ "$LFLAGS -shared --gc-sections -T pr20828.ld" \ "tmpdir/libpr20828.so" "$AFLAGS_PIC" \ {pr20828.s} \ - {{readelf --dyn-syms pr20828-1.sd}} \ + {{readelf --dyn-syms pr20828-a.sd} \ + {readelf --dyn-syms pr20828-b.sd}} \ "pr20828-1.so"] \ [list \ "PR ld/20828 dynamic symbols with section GC (version script)" \ @@ -74,8 +76,8 @@ if { [check_gc_sections_available] } { "tmpdir/libpr20828.so" \ "$AFLAGS_PIC" \ {pr20828.s} \ - {{readelf --dyn-syms pr20828-2a.sd} \ - {readelf --dyn-syms pr20828-2b.sd}} \ + {{readelf --dyn-syms pr20828-b.sd} \ + {readelf --dyn-syms pr20828-c.sd}} \ "pr20828-2.so"]] } |