aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-12-01 05:42:33 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-12-01 06:35:03 -0800
commitb44ee3a8cf21294eeb079ffbada7eeb559a9c6b4 (patch)
tree4b588c9acba669ccb1dfa6f349e7b7f1b31aa740 /ld/testsuite/ld-i386
parent4770fb94ee04ef767cb2c171a24168d2b5acca04 (diff)
downloadgdb-b44ee3a8cf21294eeb079ffbada7eeb559a9c6b4.zip
gdb-b44ee3a8cf21294eeb079ffbada7eeb559a9c6b4.tar.gz
gdb-b44ee3a8cf21294eeb079ffbada7eeb559a9c6b4.tar.bz2
x86: Delay setting the iplt section alignment
Delay setting its alignment until we know it is non-empty. Otherwise an empty iplt section may change vma and lma of the following sections, which triggers moving dot of the following section backwards, resulting in a warning and section lma not being set properly. It later leads to a "File truncated" error. bfd/ PR ld/23930 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Update the iplt section alignment if it is non-empty. (_bfd_x86_elf_link_setup_gnu_properties): Set plt.iplt_alignment and delay setting the iplt section alignment. * elfxx-x86.h (elf_x86_plt_layout): Add iplt_alignment. ld/ PR ld/23930 * testsuite/ld-i386/i386.exp: Run pr23930. * testsuite/ld-i386/pr23930.d: New file. * testsuite/ld-x86-64/pr23930-32.t: Likewise. * testsuite/ld-x86-64/pr23930-x32.d: Likewise. * testsuite/ld-x86-64/pr23930.d: Likewise. * testsuite/ld-x86-64/pr23930.t: Likewise. * testsuite/ld-x86-64/pr23930a.s: Likewise. * testsuite/ld-x86-64/pr23930b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr23930 and pr23930-x32.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr23930.d11
2 files changed, 12 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 76577c4..f86a54d 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -482,6 +482,7 @@ run_dump_test "pr23486b"
run_dump_test "pr23486c"
run_dump_test "pr23486d"
run_dump_test "pr23854"
+run_dump_test "pr23930"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr23930.d b/ld/testsuite/ld-i386/pr23930.d
new file mode 100644
index 0000000..e9da510
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23930.d
@@ -0,0 +1,11 @@
+#source: ../ld-x86-64/pr23930a.s
+#source: ../ld-x86-64/pr23930b.s
+#as: --32
+#ld: -m elf_i386 -z separate-code -z norelro -T ../ld-x86-64/pr23930-32.t
+#objdump: --disassemble=main
+
+#...
+[a-f0-9]+ <main>:
+[a-f0-9]+: 31 c0 xor %eax,%eax
+[a-f0-9]+: c3 ret
+#pass