summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-06-22 14:26:09 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-06-30 04:14:00 -0700
commitcaff3f89af65c96a1c8bb57af4f34b234480774f (patch)
treeea3af6459bd4b040d0d3a9a93b36d2aa6f3360b0
parent68ca21b238e2260f34371eb1db0f2d15eec20ce8 (diff)
downloadbinutils-gdb-users/hjl/gdb-8.0-branch.tar.gz
x86-64: Move the error_alignment label forwardusers/hjl/gdb-8.0-branch
Move the error_alignment label forward to avoid clang warning on if (!bfd_set_section_alignment (ebfd, sec, 2)) goto error_alignment; htab = elf_x86_64_hash_table (info); error_alignment: info->callbacks->einfo (_("%F%A: failed to align section\n"), sec); "%F" causes a fatal linker error and immediate exit. sec = htab->elf.sgotplt; Also fix alignment on program property note section. * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move the error_alignment label forward. Properly align program property note section. (cherry picked from commit 5d8763a38211dd79459485ba0be4f76849ef8200)
-rw-r--r--bfd/elf64-x86-64.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 2e10ad1bd9a..e19115329a5 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -7386,8 +7386,13 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
if (sec == NULL)
info->callbacks->einfo (_("%F: failed to create GNU property section\n"));
- if (!bfd_set_section_alignment (ebfd, sec, 2))
- goto error_alignment;
+ if (!bfd_set_section_alignment (ebfd, sec,
+ ABI_64_P (ebfd) ? 3 : 2))
+ {
+error_alignment:
+ info->callbacks->einfo (_("%F%A: failed to align section\n"),
+ sec);
+ }
elf_section_type (sec) = SHT_NOTE;
}
@@ -7546,11 +7551,7 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
properly aligned even if create_dynamic_sections isn't called. */
sec = htab->elf.sgot;
if (!bfd_set_section_alignment (dynobj, sec, 3))
- {
-error_alignment:
- info->callbacks->einfo (_("%F%A: failed to align section\n"),
- sec);
- }
+ goto error_alignment;
sec = htab->elf.sgotplt;
if (!bfd_set_section_alignment (dynobj, sec, 3))