aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-01 06:11:54 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-01 06:12:06 -0700
commite10c9c620c3335731bb0052987affdc40942fd71 (patch)
tree0e893264f7a0258c4b625d209353dde5a2e9f2c8 /bfd
parent1c5c938ad860811644774ecea66e044110967cf2 (diff)
downloadfsf-binutils-gdb-e10c9c620c3335731bb0052987affdc40942fd71.zip
fsf-binutils-gdb-e10c9c620c3335731bb0052987affdc40942fd71.tar.gz
fsf-binutils-gdb-e10c9c620c3335731bb0052987affdc40942fd71.tar.bz2
x86: Correct unwind information for the second PLT
For i386, generate unwind information for the second PLT. For x32, correct alignment of .eh_frame section for the second PLT. bfd/ PR ld/22061 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create .eh_frame section for the second PLT. * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct alignment of .eh_frame section for the second PLT. ld/ PR ld/22061 * testsuite/ld-i386/ibt-plt-1.d: Updated. * testsuite/ld-i386/ibt-plt-2a.d: Likewise. * testsuite/ld-i386/ibt-plt-2c.d: Likewise. * testsuite/ld-i386/ibt-plt-3a.d: Likewise. * testsuite/ld-i386/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise. * testsuite/ld-i386/ibt-plt-2b.d: Pass --hash-style=sysv to ld and dump unwind information. * testsuite/ld-i386/ibt-plt-2d.d: Likewise. * testsuite/ld-i386/ibt-plt-3b.d: Likewise. * testsuite/ld-i386/ibt-plt-3d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-i386.c14
-rw-r--r--bfd/elf64-x86-64.c5
3 files changed, 25 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8c6e8b1..20bdf16 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22061
+ * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
+ .eh_frame section for the second PLT.
+ * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
+ alignment of .eh_frame section for the second PLT.
+
2017-09-01 Nick Clifton <nickc@redhat.com>
PR 22059
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 7b6d21f..a983301 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -6144,6 +6144,20 @@ error_alignment:
htab->plt_got_eh_frame = sec;
}
+
+ if (htab->plt_second != NULL)
+ {
+ sec = bfd_make_section_anyway_with_flags (dynobj,
+ ".eh_frame",
+ flags);
+ if (sec == NULL)
+ info->callbacks->einfo (_("%F: failed to create the second PLT .eh_frame section\n"));
+
+ if (!bfd_set_section_alignment (dynobj, sec, 2))
+ goto error_alignment;
+
+ htab->plt_second_eh_frame = sec;
+ }
}
}
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 0edb174..969a053 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -6737,9 +6737,10 @@ error_alignment:
".eh_frame",
flags);
if (sec == NULL)
- info->callbacks->einfo (_("%F: failed to create BND PLT .eh_frame section\n"));
+ info->callbacks->einfo (_("%F: failed to create the second PLT .eh_frame section\n"));
- if (!bfd_set_section_alignment (dynobj, sec, 3))
+ if (!bfd_set_section_alignment (dynobj, sec,
+ ABI_64_P (dynobj) ? 3 : 2))
goto error_alignment;
htab->plt_second_eh_frame = sec;