diff options
author | Alan Modra <amodra@gmail.com> | 2017-08-14 09:25:17 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-08-14 09:25:17 +0930 |
commit | 79a94a2ad1e6e2f227de07427481e4bb8be84504 (patch) | |
tree | 9cdf64ff2ae956d9ffd96d87bc1404eee27f933e /bfd/elf-eh-frame.c | |
parent | 34c4758cc210e2ca042b0373938e57fd6844f89d (diff) | |
download | gdb-79a94a2ad1e6e2f227de07427481e4bb8be84504.zip gdb-79a94a2ad1e6e2f227de07427481e4bb8be84504.tar.gz gdb-79a94a2ad1e6e2f227de07427481e4bb8be84504.tar.bz2 |
PR21441, Unnecessary padding of .eh_frame section
Until all .eh_frame sections have been edited we don't know their
sizes. So it isn't possible to properly decide whether a non-empty
.eh_frame section follows a given section until editing is complete.
bfd/
PR 21441
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
alignment padding here.
* elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
in a reverse pass over sections.
ld/
PR 21441
* testsuite/ld-x86-64/pr21038a.d: Adjust.
* testsuite/ld-x86-64/pr21038a-now.d: Adjust.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r-- | bfd/elf-eh-frame.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 52ba9c6..7e0d63f 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1594,16 +1594,7 @@ _bfd_elf_discard_section_eh_frame offset += size_of_output_cie_fde (ent); } - /* Pad the last FDE out to the output section alignment if there are - following sections, in order to ensure no padding between this - section and the next. (Relies on the output section alignment - being the maximum of all input sections alignments, which is the - case unless someone is overriding alignment via scripts.) */ eh_alignment = 4; - if (sec->map_head.s != NULL - && (sec->map_head.s->size != 4 - || sec->map_head.s->map_head.s != NULL)) - eh_alignment = 1 << sec->output_section->alignment_power; offset = (offset + eh_alignment - 1) & -eh_alignment; sec->rawsize = sec->size; sec->size = offset; |