aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2020-04-01 10:40:07 +0100
committerTamar Christina <tamar.christina@arm.com>2020-04-01 10:52:32 +0100
commit15ccbdd717530f81f545a716f0df1de62aee1157 (patch)
treeb54513be2b1a192572032eb32a8c3a52aecaef51 /bfd
parent40bd13ced9c03c74af9d55a98d6e06ddcf11429c (diff)
downloadgdb-15ccbdd717530f81f545a716f0df1de62aee1157.zip
gdb-15ccbdd717530f81f545a716f0df1de62aee1157.tar.gz
gdb-15ccbdd717530f81f545a716f0df1de62aee1157.tar.bz2
Arm: Fix thumb2 PLT branch offsets.
When I previously changed these offsets I had incorrectly used an offset of -2 for this Thumb2 PLT. Unfortunately because we had no tests for this PLT I had missed that the result was incorrect. This patch fixes the offset to PC .-4 so that it correctly addresses the previous instruction and adds a test for this PLT stub. bfd/ChangeLog: * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset. ld/ChangeLog: * testsuite/ld-arm/arm-elf.exp (thumb-plt): New. * testsuite/ld-arm/thumb-plt.d: New test. * testsuite/ld-arm/thumb-plt.s: New test.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf32-arm.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d11421f..1998e22 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-01 Tamar Christina <tamar.christina@arm.com>
+
+ * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
+
2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
* mmo.c (mmo_scan): Create .text section only when needed, not
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1ccbf14..0036ff9 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2453,8 +2453,8 @@ static const bfd_vma elf32_thumb2_plt_entry [] =
0x0c00f240, /* movw ip, #0xNNNN */
0x0c00f2c0, /* movt ip, #0xNNNN */
0xf8dc44fc, /* add ip, pc */
- 0xe7fdf000 /* ldr.w pc, [ip] */
- /* b .-2 */
+ 0xe7fcf000 /* ldr.w pc, [ip] */
+ /* b .-4 */
};
/* The format of the first entry in the procedure linkage table