summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-03-10 08:12:37 +0100
committerJan Beulich <jbeulich@suse.com>2021-03-10 08:12:37 +0100
commit67b0f684803f5bec9b801c43fe1559bc88c15bb6 (patch)
tree6430680e12759db6270ac8b4ffde38bab1756605 /ld
parent3044062c34f2372f4ecf81b69d9e63685cd5e995 (diff)
bfd: strip symbols not representable in COFF/PE symbol table
The offset-within-section field in the symbol table entry is only 32 bits wide, so rather than emitting bogus entries omit them, and issue a diagnostic identifying the issue. This requires adjusting the PR/22267 test to no longer produce symbols with out of range values on 64-bit BFD. This also depends on adjustments to testsuite/ld-scripts/map-address.* made by an earlier patch. The purpose of the test can very well be achieved nevertheless.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/scripttempl/mcorepe.sc2
-rw-r--r--ld/testsuite/ld-scripts/pr22267.d3
-rw-r--r--ld/testsuite/ld-scripts/pr22267.t2
4 files changed, 11 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c51332ad5c..ec7854163f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2021-03-10 Jan Beulich <jbeulich@suse.com>
+
+ * testsuite/ld-scripts/pr22267.t: Avoid symbol value with more
+ than 32 set bits.
+ * testsuite/ld-scripts/pr22267.d: Adjust expectation and drop
+ comment.
+ * scripttempl/mcorepe.sc: Use PROVIDE() for _stack.
+
2021-03-09 Jan Beulich <jbeulich@suse.com>
* testsuite/ld-pe/reloc.s: Add entry point symbols. Increase
diff --git a/ld/scripttempl/mcorepe.sc b/ld/scripttempl/mcorepe.sc
index 1cdbac282c..20fa6f9546 100644
--- a/ld/scripttempl/mcorepe.sc
+++ b/ld/scripttempl/mcorepe.sc
@@ -168,7 +168,7 @@ SECTIONS
.stack 0x80000 :
{
- _stack = .;
+ PROVIDE(_stack = .);
*(.stack)
}
}
diff --git a/ld/testsuite/ld-scripts/pr22267.d b/ld/testsuite/ld-scripts/pr22267.d
index b0bd18ed56..b46fec3ee7 100644
--- a/ld/testsuite/ld-scripts/pr22267.d
+++ b/ld/testsuite/ld-scripts/pr22267.d
@@ -2,7 +2,6 @@
#nm: -n
#xfail: bfin-*-linux* frv-*-linux*
-# Some targets may zero-extend 32-bit address to 64 bits.
#...
-0*f+00 A foo
+0*ff A foo
#pass
diff --git a/ld/testsuite/ld-scripts/pr22267.t b/ld/testsuite/ld-scripts/pr22267.t
index a0754058e5..004934594d 100644
--- a/ld/testsuite/ld-scripts/pr22267.t
+++ b/ld/testsuite/ld-scripts/pr22267.t
@@ -1,4 +1,4 @@
SECTIONS
{
- foo = ~0xFF;
+ foo = ~~0xFF;
}