aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJens Remus <jremus@linux.ibm.com>2024-07-12 16:53:47 +0200
committerJens Remus <jremus@linux.ibm.com>2024-07-12 16:53:47 +0200
commit83511d2679bbcc4b8d6ac42fb71cfbc35e77107e (patch)
tree0a02921cf0d56dc7c59826c496cea01337c57b14 /ld
parent7bdb051fd62ca70aa2cf549441b7728d20a3a631 (diff)
downloadgdb-83511d2679bbcc4b8d6ac42fb71cfbc35e77107e.zip
gdb-83511d2679bbcc4b8d6ac42fb71cfbc35e77107e.tar.gz
gdb-83511d2679bbcc4b8d6ac42fb71cfbc35e77107e.tar.bz2
s390: Do not replace brcth referencing undefined weak symbol
Branch Relative on Count High (brcth) is a conditional branch relative instruction. It is not guaranteed that it only appears within loops that sooner or later will take the branch. It may very well be used to check a condition that will prevent the branch from ever being taken. bfd/ * elf64-s390.c (elf_s390_relocate_section): Do not replace brcth referencing undefined weak symbol with a trap. ld/ * testsuite/ld-s390/weakundef-1.s: Update test case accordingly. * testsuite/ld-s390/weakundef-1.dd: Likewise. Fixes: 896a639babe2 ("s390: Avoid reloc overflows on undefined weak symbols") Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-s390/weakundef-1.dd6
-rw-r--r--ld/testsuite/ld-s390/weakundef-1.s1
2 files changed, 3 insertions, 4 deletions
diff --git a/ld/testsuite/ld-s390/weakundef-1.dd b/ld/testsuite/ld-s390/weakundef-1.dd
index e514524..04d53c9 100644
--- a/ld/testsuite/ld-s390/weakundef-1.dd
+++ b/ld/testsuite/ld-s390/weakundef-1.dd
@@ -3,13 +3,13 @@ tmpdir/weakundef-1: file format elf64-s390
Disassembly of section .text:
.* <foo>:
-.*: c0 10 00 00 00 1e [ ]*larl %r1,20000003c <d>
-.*: c0 10 00 00 00 1f [ ]*larl %r1,200000044 <wd>
+.*: c0 10 00 00 00 1c [ ]*larl %r1,200000038 <d>
+.*: c0 10 00 00 00 1d [ ]*larl %r1,200000040 <wd>
.*: e3 10 00 00 00 71 [ ]*lay %r1,0
.*: c0 f4 00 00 00 01 [ ]*jg .*
.*: c0 f4 00 00 00 01 [ ]*jg .*
.*: c0 f4 00 00 00 01 [ ]*jg .*
.*: c0 f4 00 00 00 01 [ ]*jg .*
.*: c0 f4 00 00 00 01 [ ]*jg .*
-.*: c0 f4 00 00 00 01 [ ]*jg .*
.*: c0 04 00 00 00 00 [ ]*jgnop .*
+.*: 07 07 [ ]*nopr %r7
diff --git a/ld/testsuite/ld-s390/weakundef-1.s b/ld/testsuite/ld-s390/weakundef-1.s
index aeaef8d..db90932 100644
--- a/ld/testsuite/ld-s390/weakundef-1.s
+++ b/ld/testsuite/ld-s390/weakundef-1.s
@@ -9,7 +9,6 @@ foo:
lrl %r1,wu
strl %r1,wu
exrl %r1,wu
- brcth %r1,wu
pfdrl %r1,wu
.weak wd
.weak wu