diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-04-21 05:23:51 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-04-21 05:24:03 -0700 |
commit | 6f6fd151cbf226bbaa66e44977f57b7c6dc33d89 (patch) | |
tree | 0ef4a78de35fde84a58c5964f7822a19a95c620c /bfd/elf64-alpha.c | |
parent | 1f7f2abbc31ee9e6d4faca58bef14d8ee8cb1bd2 (diff) | |
download | gdb-6f6fd151cbf226bbaa66e44977f57b7c6dc33d89.zip gdb-6f6fd151cbf226bbaa66e44977f57b7c6dc33d89.tar.gz gdb-6f6fd151cbf226bbaa66e44977f57b7c6dc33d89.tar.bz2 |
elf: Strip zero-sized dynamic sections
ELF size_dynamic_sections is called by the ELF backend linker after all
the linker input files have been seen but before the section sizes have
been set. After the sections sizes have been set, target-specific,
global optimizations may make some dynamic sections zero-sized if they
are no longer needed.
Add ELF strip_zero_sized_dynamic_sections so that ELF backend linker can
strip zero-sized dynamic sections after the sections sizes have been set.
bfd/
PR ld/25849
* elf-bfd.h (elf_backend_data): Add
elf_backend_strip_zero_sized_dynamic_sections.
(_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
* elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
New macro.
* elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
function.
* elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
New macro.
(elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
ld/
PR ld/25849
* ldelfgen.c (ldelf_map_segments): Call
elf_backend_strip_zero_sized_dynamic_sections.
* testsuite/ld-alpha/tlsbinr.rd: Updated.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r-- | bfd/elf64-alpha.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 9f79d8e..8f73212 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -5538,6 +5538,9 @@ static const struct elf_size_info alpha_elf_size_info = #define elf_backend_special_sections \ elf64_alpha_special_sections +#define elf_backend_strip_zero_sized_dynamic_sections \ + _bfd_elf_strip_zero_sized_dynamic_sections + /* A few constants that determine how the .plt section is set up. */ #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 |