diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2017-01-23 11:19:46 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2017-01-23 11:32:14 +0000 |
commit | b70d100fc1c5a130c3fe9387be83b7927e2025fb (patch) | |
tree | 1c562b14b984d1c398b9b84c762cc9cee57d8bf2 | |
parent | 7d9468120fceed20240511404e6d9498e68f3dc6 (diff) | |
download | gdb-b70d100fc1c5a130c3fe9387be83b7927e2025fb.zip gdb-b70d100fc1c5a130c3fe9387be83b7927e2025fb.tar.gz gdb-b70d100fc1c5a130c3fe9387be83b7927e2025fb.tar.bz2 |
PR ld/20828: Remove leading `_' from symbols used in tests
Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and remove the leading underscore
from `_fdata' and `_edata' symbols used in tests, fixing a:
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
failure with targets such as: `bfin-elf', `bfin-uclinux', `metag-elf',
`metag-linux' `mn10300-elf', `sh-elf', `sh64-elf', and possibly other
ones, that have `_' set (with `elf_symbol_leading_char') as the leading
character for symbols. As from commit 93252b1cf41a ("bfd/ld: handle ABI
prefixes in version scripts") these targets strip the leading underscore
before applying version script rules, because the (default) syntax for
symbol names is that of the C language rather than their low-level
symbol table encoding.
ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Rename `_fdata' and `_edata' to
`fdata' and `edata' respectively.
* testsuite/ld-elf/pr20828.ver: Adjust accordingly.
* testsuite/ld-elf/pr20828-a.sd: Likewise.
* testsuite/ld-elf/pr20828-b.sd: Likewise.
* testsuite/ld-elf/pr20828-c.sd: Likewise.
(cherry picked from commit fda46c417ff8324960ca305141df5fc6c2f580af)
-rw-r--r-- | ld/ChangeLog | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-a.sd | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-b.sd | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828-c.sd | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828.ld | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr20828.ver | 2 |
6 files changed, 24 insertions, 14 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 78059e5..6daab1b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,6 +1,16 @@ 2017-01-23 Maciej W. Rozycki <macro@imgtec.com> PR ld/20828 + * testsuite/ld-elf/pr20828.ld: Rename `_fdata' and `_edata' to + `fdata' and `edata' respectively. + * testsuite/ld-elf/pr20828.ver: Adjust accordingly. + * testsuite/ld-elf/pr20828-a.sd: Likewise. + * testsuite/ld-elf/pr20828-b.sd: Likewise. + * testsuite/ld-elf/pr20828-c.sd: Likewise. + +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... diff --git a/ld/testsuite/ld-elf/pr20828-a.sd b/ld/testsuite/ld-elf/pr20828-a.sd index c24e5ad..a24eedb 100644 --- a/ld/testsuite/ld-elf/pr20828-a.sd +++ b/ld/testsuite/ld-elf/pr20828-a.sd @@ -1,9 +1,9 @@ -# Make sure `_fdata' is 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 +# 1: 00000000 0 NOTYPE GLOBAL DEFAULT 1 fdata # vs: -# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 _fdata +# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 fdata #... - *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_fdata + *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +fdata #pass diff --git a/ld/testsuite/ld-elf/pr20828-b.sd b/ld/testsuite/ld-elf/pr20828-b.sd index c4b239b..95551bb 100644 --- a/ld/testsuite/ld-elf/pr20828-b.sd +++ b/ld/testsuite/ld-elf/pr20828-b.sd @@ -1,9 +1,9 @@ -# Make sure `_edata' is global rather than local in the dynamic symbol table, +# Make sure `edata' 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 _edata +# 1: 00000000 0 NOTYPE GLOBAL DEFAULT 1 edata # vs: -# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 _edata +# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 edata #... - *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_edata + *[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +edata #pass diff --git a/ld/testsuite/ld-elf/pr20828-c.sd b/ld/testsuite/ld-elf/pr20828-c.sd index 8089c48..5501e19 100644 --- a/ld/testsuite/ld-elf/pr20828-c.sd +++ b/ld/testsuite/ld-elf/pr20828-c.sd @@ -1,7 +1,7 @@ -# Make sure no `_fdata' is present in the dynamic symbol table, e.g.: +# Make sure no `fdata' is present in the dynamic symbol table, e.g.: # Num: Value Size Type Bind Vis Ndx Name -# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 _fdata +# 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 fdata #failif #... -.+ +_fdata +.+ +fdata #pass diff --git a/ld/testsuite/ld-elf/pr20828.ld b/ld/testsuite/ld-elf/pr20828.ld index 9ca1943..11aea82 100644 --- a/ld/testsuite/ld-elf/pr20828.ld +++ b/ld/testsuite/ld-elf/pr20828.ld @@ -2,9 +2,9 @@ SECTIONS { .data : { - _fdata = .; + fdata = .; *(.data) - _edata = .; + edata = .; } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/ld/testsuite/ld-elf/pr20828.ver b/ld/testsuite/ld-elf/pr20828.ver index 7d0fa22..bbc0ebd 100644 --- a/ld/testsuite/ld-elf/pr20828.ver +++ b/ld/testsuite/ld-elf/pr20828.ver @@ -1 +1 @@ -{ global: _edata; local: *; }; +{ global: edata; local: *; }; |