]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Align x86-64 .got/.got.plt sections to 8 bytes
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jul 2016 22:33:47 +0000 (15:33 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jul 2016 22:33:47 +0000 (15:33 -0700)
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.

bfd/ChangeLog
bfd/elf64-x86-64.c

index 7898512b9490df6296a846ddb60244fecaeeb843..7f6414635996ed18fe1ea0771bda54a8dc62f710 100644 (file)
@@ -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.
index f9202085b38968cdada56b190a210ebcfd3b409f..c8bbed8bc05edae0c1ca09225f8bf70b570b3b41 100644 (file)
@@ -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;
 }