aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-05-11 11:26:26 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-05-11 11:28:16 -0700
commitf2c29a169242d0c564afb46ecaf160422b28bfbb (patch)
tree47f5430d0a762aeee6350933c33943da3de96ba3 /ld
parentdc2be3d2f6de530aac40983e79e29e050f40e759 (diff)
downloadgdb-f2c29a169242d0c564afb46ecaf160422b28bfbb.zip
gdb-f2c29a169242d0c564afb46ecaf160422b28bfbb.tar.gz
gdb-f2c29a169242d0c564afb46ecaf160422b28bfbb.tar.bz2
x86-64: Rename .plt.bnd to .plt.sec
Rename .plt.bnd to .plt.sec to indicate that this is used as the second PLT section. There is no change in run-time behavior. We also scan the .plt.sec section to synthesize PLT symbols. bfd/ * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd to plt_second. (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame to plt_second/plt_second_eh_frame. (elf_x86_64_link_hash_newfunc): Updated. (elf_x86_64_allocate_dynrelocs): Likewise. (elf_x86_64_size_dynamic_sections): Likewise. (elf_x86_64_relocate_section): Likewise. (elf_x86_64_finish_dynamic_symbol): Likewise. (elf_x86_64_finish_dynamic_sections): Likewise. (elf_x86_64_plt_type): Rename plt_bnd to plt_second. (elf_x86_64_get_synthetic_symtab): Updated. Also scan the .plt.sec section. (elf_backend_setup_gnu_properties): Updated. Create the .plt.sec section instead of the .plt.sec section. ld/ * emulparams/elf_x86_64.sh (TINY_READONLY_SECTION): Replace .plt.bnd with .plt.sec. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1.d: Likewise. * testsuite/ld-x86-64/mpx3.dd: Likewise. * testsuite/ld-x86-64/mpx3n.dd: Likewise. * testsuite/ld-x86-64/mpx4.dd: Likewise. * testsuite/ld-x86-64/mpx4n.dd: Likewise. * testsuite/ld-x86-64/plt-main-bnd-now.rd: Likewise. * testsuite/ld-x86-64/pr21038b-now.d: Likewise. * testsuite/ld-x86-64/pr21038b.d: Likewise. * testsuite/ld-x86-64/pr21038c-now.d: Likewise. * testsuite/ld-x86-64/pr21038c.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog19
-rw-r--r--ld/emulparams/elf_x86_64.sh2
-rw-r--r--ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d2
-rw-r--r--ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d2
-rw-r--r--ld/testsuite/ld-x86-64/bnd-ifunc-2.d2
-rw-r--r--ld/testsuite/ld-x86-64/bnd-plt-1-now.d2
-rw-r--r--ld/testsuite/ld-x86-64/bnd-plt-1.d2
-rw-r--r--ld/testsuite/ld-x86-64/mpx3.dd2
-rw-r--r--ld/testsuite/ld-x86-64/mpx3n.dd2
-rw-r--r--ld/testsuite/ld-x86-64/mpx4.dd2
-rw-r--r--ld/testsuite/ld-x86-64/mpx4n.dd2
-rw-r--r--ld/testsuite/ld-x86-64/plt-main-bnd-now.rd2
-rw-r--r--ld/testsuite/ld-x86-64/pr21038b-now.d4
-rw-r--r--ld/testsuite/ld-x86-64/pr21038b.d4
-rw-r--r--ld/testsuite/ld-x86-64/pr21038c-now.d4
-rw-r--r--ld/testsuite/ld-x86-64/pr21038c.d4
16 files changed, 38 insertions, 19 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index aac1840..92ebbf7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,24 @@
2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
+ * emulparams/elf_x86_64.sh (TINY_READONLY_SECTION): Replace
+ .plt.bnd with .plt.sec.
+ * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
+ * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
+ * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
+ * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
+ * testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
+ * testsuite/ld-x86-64/mpx3.dd: Likewise.
+ * testsuite/ld-x86-64/mpx3n.dd: Likewise.
+ * testsuite/ld-x86-64/mpx4.dd: Likewise.
+ * testsuite/ld-x86-64/mpx4n.dd: Likewise.
+ * testsuite/ld-x86-64/plt-main-bnd-now.rd: Likewise.
+ * testsuite/ld-x86-64/pr21038b-now.d: Likewise.
+ * testsuite/ld-x86-64/pr21038b.d: Likewise.
+ * testsuite/ld-x86-64/pr21038c-now.d: Likewise.
+ * testsuite/ld-x86-64/pr21038c.d: Likewise.
+
+2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
+
* testsuite/ld-i386/plt-pic2.dd: Updated.
* testsuite/ld-i386/plt2.dd: Likewise.
* testsuite/ld-i386/plt2.rd: Likewise.
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index 6055204..ca6d06c 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -24,7 +24,7 @@ IREL_IN_PLT=
# Reuse TINY_READONLY_SECTION which is placed right after .plt section.
TINY_READONLY_SECTION="
.plt.got ${RELOCATING-0} : { *(.plt.got) }
-.plt.bnd ${RELOCATING-0} : { *(.plt.bnd) }
+.plt.sec ${RELOCATING-0} : { *(.plt.sec) }
"
if [ "x${host}" = "x${target}" ]; then
diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d b/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d
index 723f960..73ddc31 100644
--- a/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d
+++ b/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d
@@ -16,7 +16,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 1f0 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+210 <\*ABS\*\+0x218@plt>:
+[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200350 <_GLOBAL_OFFSET_TABLE_\+0x18>
diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d b/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d
index e36a928..1fbcd17 100644
--- a/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d
+++ b/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d
@@ -25,7 +25,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+300 <\*ABS\*\+0x32c@plt>:
+[a-f0-9]+: f2 ff 25 59 01 20 00 bnd jmpq \*0x200159\(%rip\) # 200460 <_GLOBAL_OFFSET_TABLE_\+0x18>
diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-2.d b/ld/testsuite/ld-x86-64/bnd-ifunc-2.d
index 306a17d..fc03c17 100644
--- a/ld/testsuite/ld-x86-64/bnd-ifunc-2.d
+++ b/ld/testsuite/ld-x86-64/bnd-ifunc-2.d
@@ -20,7 +20,7 @@
[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.*>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+300 <\*ABS\*\+0x32c@plt>:
[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200440 <_GLOBAL_OFFSET_TABLE_\+0x18>
diff --git a/ld/testsuite/ld-x86-64/bnd-plt-1-now.d b/ld/testsuite/ld-x86-64/bnd-plt-1-now.d
index 65462cd..2989f82 100644
--- a/ld/testsuite/ld-x86-64/bnd-plt-1-now.d
+++ b/ld/testsuite/ld-x86-64/bnd-plt-1-now.d
@@ -25,7 +25,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+2e0 <foo2@plt>:
+[a-f0-9]+: f2 ff 25 61 01 20 00 bnd jmpq \*0x200161\(%rip\) # 200448 <foo2>
diff --git a/ld/testsuite/ld-x86-64/bnd-plt-1.d b/ld/testsuite/ld-x86-64/bnd-plt-1.d
index 6bd50b2..66efb1a 100644
--- a/ld/testsuite/ld-x86-64/bnd-plt-1.d
+++ b/ld/testsuite/ld-x86-64/bnd-plt-1.d
@@ -25,7 +25,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.*>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+2e0 <foo2@plt>:
[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200428 <foo2>
diff --git a/ld/testsuite/ld-x86-64/mpx3.dd b/ld/testsuite/ld-x86-64/mpx3.dd
index d5d8049..8ba3d87 100644
--- a/ld/testsuite/ld-x86-64/mpx3.dd
+++ b/ld/testsuite/ld-x86-64/mpx3.dd
@@ -11,7 +11,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 ([0-9a-f]{2} ){4} bnd jmpq [a-f0-9]+ <.plt>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+[a-f0-9]+ <call1@plt>:
[ ]*[a-f0-9]+: f2 ff ([0-9a-f]{2} ){5} bnd jmpq \*0x[a-f0-9]+\(%rip\) # [a-f0-9]+ <call1>
diff --git a/ld/testsuite/ld-x86-64/mpx3n.dd b/ld/testsuite/ld-x86-64/mpx3n.dd
index d8e238e..4dd8c12 100644
--- a/ld/testsuite/ld-x86-64/mpx3n.dd
+++ b/ld/testsuite/ld-x86-64/mpx3n.dd
@@ -11,7 +11,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400290 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+4002b0 <call1@plt>:
+[a-f0-9]+: f2 ff 25 91 01 20 00 bnd jmpq \*0x200191\(%rip\) # 600448 <call1>
diff --git a/ld/testsuite/ld-x86-64/mpx4.dd b/ld/testsuite/ld-x86-64/mpx4.dd
index 1bcb13b..c7af5b2 100644
--- a/ld/testsuite/ld-x86-64/mpx4.dd
+++ b/ld/testsuite/ld-x86-64/mpx4.dd
@@ -11,7 +11,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+400280 <call1@plt>:
[ ]*[a-f0-9]+: f2 ff 25 31 01 20 00 bnd jmpq \*0x200131\(%rip\) # 6003b8 <call1>
diff --git a/ld/testsuite/ld-x86-64/mpx4n.dd b/ld/testsuite/ld-x86-64/mpx4n.dd
index e8777cc..a82be08 100644
--- a/ld/testsuite/ld-x86-64/mpx4n.dd
+++ b/ld/testsuite/ld-x86-64/mpx4n.dd
@@ -11,7 +11,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+400280 <call1@plt>:
+[a-f0-9]+: f2 ff 25 51 01 20 00 bnd jmpq \*0x200151\(%rip\) # 6003d8 <call1>
diff --git a/ld/testsuite/ld-x86-64/plt-main-bnd-now.rd b/ld/testsuite/ld-x86-64/plt-main-bnd-now.rd
index 460b7e2..2478c1f 100644
--- a/ld/testsuite/ld-x86-64/plt-main-bnd-now.rd
+++ b/ld/testsuite/ld-x86-64/plt-main-bnd-now.rd
@@ -1,3 +1,3 @@
#...
- +\[[ 0-9]+\] \.plt\.bnd +.*
+ +\[[ 0-9]+\] \.plt\.sec +.*
#pass
diff --git a/ld/testsuite/ld-x86-64/pr21038b-now.d b/ld/testsuite/ld-x86-64/pr21038b-now.d
index 2bafb8d..b9a8c4d 100644
--- a/ld/testsuite/ld-x86-64/pr21038b-now.d
+++ b/ld/testsuite/ld-x86-64/pr21038b-now.d
@@ -1,4 +1,4 @@
-#name: PR ld/21038 (.plt.bnd, -z now)
+#name: PR ld/21038 (.plt.sec, -z now)
#source: pr21038b.s
#as: --64
#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
@@ -57,7 +57,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+240 <func@plt>:
+[a-f0-9]+: f2 ff 25 b1 0d 20 00 bnd jmpq \*0x200db1\(%rip\) # 200ff8 <func>
diff --git a/ld/testsuite/ld-x86-64/pr21038b.d b/ld/testsuite/ld-x86-64/pr21038b.d
index 69b5c65..3457d4d 100644
--- a/ld/testsuite/ld-x86-64/pr21038b.d
+++ b/ld/testsuite/ld-x86-64/pr21038b.d
@@ -1,4 +1,4 @@
-#name: PR ld/21038 (.plt.bnd)
+#name: PR ld/21038 (.plt.sec)
#as: --64
#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
#objdump: -dw -Wf
@@ -56,7 +56,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+240 <func@plt>:
+[a-f0-9]+: f2 ff 25 d1 0d 20 00 bnd jmpq \*0x200dd1\(%rip\) # 201018 <func>
diff --git a/ld/testsuite/ld-x86-64/pr21038c-now.d b/ld/testsuite/ld-x86-64/pr21038c-now.d
index bdce4e0..4b6db6f 100644
--- a/ld/testsuite/ld-x86-64/pr21038c-now.d
+++ b/ld/testsuite/ld-x86-64/pr21038c-now.d
@@ -1,4 +1,4 @@
-#name: PR ld/21038 (.plt.got and .plt.bnd, -z now)
+#name: PR ld/21038 (.plt.got and .plt.sec, -z now)
#source: pr21038c.s
#as: --64
#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
@@ -72,7 +72,7 @@ Disassembly of section .plt.got:
+[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1>
+[a-f0-9]+: 90 nop
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+288 <func2@plt>:
+[a-f0-9]+: f2 ff 25 61 0d 20 00 bnd jmpq \*0x200d61\(%rip\) # 200ff0 <func2>
diff --git a/ld/testsuite/ld-x86-64/pr21038c.d b/ld/testsuite/ld-x86-64/pr21038c.d
index 719a6e1..eb6f207 100644
--- a/ld/testsuite/ld-x86-64/pr21038c.d
+++ b/ld/testsuite/ld-x86-64/pr21038c.d
@@ -1,4 +1,4 @@
-#name: PR ld/21038 (.plt.got and .plt.bnd)
+#name: PR ld/21038 (.plt.got and .plt.sec)
#as: --64
#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
#objdump: -dw -Wf
@@ -71,7 +71,7 @@ Disassembly of section .plt.got:
+[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1>
+[a-f0-9]+: 90 nop
-Disassembly of section .plt.bnd:
+Disassembly of section .plt.sec:
0+288 <func2@plt>:
+[a-f0-9]+: f2 ff 25 89 0d 20 00 bnd jmpq \*0x200d89\(%rip\) # 201018 <func2>