This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Align x86-64 .got/.got.plt sections to 8 bytes
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 12 Jul 2016 22:36:07 -0000
- Subject: [binutils-gdb] Align x86-64 .got/.got.plt sections to 8 bytes
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=37567a2cdd8823c5700ec83b757179083446bf07
commit 37567a2cdd8823c5700ec83b757179083446bf07
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jul 12 15:33:47 2016 -0700
Align x86-64 .got/.got.plt sections to 8 bytes
Align x86-64 .got and .got.plt sections to their entry size.
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
.got/.got.plt sections to 8 bytes.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf64-x86-64.c | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7898512..7f64146 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
+ .got/.got.plt sections to 8 bytes.
+
2016-07-12 Nick Clifton <nickc@redhat.com>
* binary.c (binary_set_section_contents): Second grammar fix.
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index f920208..c8bbed8 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1162,6 +1162,17 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
|| !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3))
return FALSE;
}
+
+ /* Align .got section to its entry size. */
+ if (htab->elf.sgot != NULL
+ && !bfd_set_section_alignment (dynobj, htab->elf.sgot, 3))
+ return FALSE;
+
+ /* Align .got.plt section to its entry size. */
+ if (htab->elf.sgotplt != NULL
+ && !bfd_set_section_alignment (dynobj, htab->elf.sgotplt, 3))
+ return FALSE;
+
return TRUE;
}