From: "Maciej W. Rozycki" <macro@imgtec.com>
To: Nick Clifton <nickc@redhat.com>, Alan Modra <amodra@gmail.com>,
James Cowgill <James.Cowgill@imgtec.com>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>, <binutils@sourceware.org>
Subject: [committed 2/5] PR ld/20828: Remove leading `_' from symbols used in tests
Date: Mon, 23 Jan 2017 11:35:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.00.1701212025140.13564@tp.orcam.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.00.1701202112480.6936@tp.orcam.me.uk>
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.
---
NB this change makes `edata' appear before `fdata' in symbol tables,
which is unlike `_fdata' vs `_edata', however 1/5 has already made tests
not depend on entry ordering. No regressions with other targets.
Committed as obvious, and backported to 2.28.
As a side note, perhaps we might want to support a `raw' or suchlike
version script entry encoding one day so that we can handle prefixed and
unprefixed symbols separately, e.g. if say `_edata' and `edata' were
present both at a time and required to have a different scope or version
tag each.
Maciej
binutils-bfd-elf-link-assignment-forced-local-test-symbol-leading-char.diff
Index: binutils/ld/testsuite/ld-elf/pr20828-a.sd
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr20828-a.sd 2017-01-20 20:43:42.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr20828-a.sd 2017-01-20 20:39:54.878920000 +0000
@@ -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
Index: binutils/ld/testsuite/ld-elf/pr20828-b.sd
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr20828-b.sd 2017-01-20 20:43:42.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr20828-b.sd 2017-01-20 20:39:54.896117000 +0000
@@ -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
Index: binutils/ld/testsuite/ld-elf/pr20828-c.sd
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr20828-c.sd 2017-01-20 20:43:42.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr20828-c.sd 2017-01-20 20:39:54.908304000 +0000
@@ -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
Index: binutils/ld/testsuite/ld-elf/pr20828.ld
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr20828.ld 2017-01-20 20:43:42.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr20828.ld 2017-01-20 20:45:37.648329567 +0000
@@ -2,9 +2,9 @@ SECTIONS
{
.data :
{
- _fdata = .;
+ fdata = .;
*(.data)
- _edata = .;
+ edata = .;
}
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
Index: binutils/ld/testsuite/ld-elf/pr20828.ver
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/pr20828.ver 2017-01-20 20:43:42.000000000 +0000
+++ binutils/ld/testsuite/ld-elf/pr20828.ver 2017-01-20 20:45:37.659399218 +0000
@@ -1 +1 @@
-{ global: _edata; local: *; };
+{ global: edata; local: *; };
next prev parent reply other threads:[~2017-01-23 11:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-20828-70@http.sourceware.org/bugzilla/>
[not found] ` <bug-20828-70-QMcZ2LkAaY@http.sourceware.org/bugzilla/>
[not found] ` <e6ca2026-eead-8e4a-b99b-dba27c41ac0d@redhat.com>
2017-01-20 12:57 ` [Bug ld/20828] GC-ed DSO symbols make corresponding symbols defined by a linker script local Maciej W. Rozycki
2017-01-23 11:34 ` [PATCH 0/5][Bug " Maciej W. Rozycki
2017-01-23 11:35 ` [committed 1/5] PR ld/20828: Relax symbol ordering in tests Maciej W. Rozycki
2017-01-23 11:35 ` Maciej W. Rozycki [this message]
2017-01-23 11:36 ` [committed 3/5] PR ld/20828: Work around RISC-V failures Maciej W. Rozycki
2017-01-23 20:44 ` Andrew Waterman
2017-01-23 11:37 ` [PATCH 4/5] Solaris2/LD: Fix anonymous version script acceptance bug Maciej W. Rozycki
2017-01-24 0:56 ` Alan Modra
2017-01-24 14:09 ` Maciej W. Rozycki
2017-01-23 11:38 ` [PATCH 5/5] PR ld/20828: Reorder the symbol sweep stage of section GC Maciej W. Rozycki
2017-01-24 1:18 ` Alan Modra
2017-01-24 14:16 ` Maciej W. Rozycki
2017-01-25 0:34 ` Alan Modra
2017-01-25 23:52 ` Maciej W. Rozycki
2017-01-27 14:23 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1701212025140.13564@tp.orcam.me.uk \
--to=macro@imgtec.com \
--cc=James.Cowgill@imgtec.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=macro@linux-mips.org \
--cc=nickc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).