diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-09-15 12:18:05 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-09-15 12:26:43 -0700 |
commit | c35b4e8cee990d0d1c33b631912333e623a37477 (patch) | |
tree | 1907014a7e277db93992f57fee6ff9a478d6e8fb /bfd | |
parent | 79254a5260cf49887b4017700bd75b27f483b322 (diff) | |
download | gdb-users/hjl/pr22101.zip gdb-users/hjl/pr22101.tar.gz gdb-users/hjl/pr22101.tar.bz2 |
Remove invalid .dynamic section with --only-keep-debugusers/hjl/pr22101
Remove invalid .dynamic section with --only-keep-debug.
bfd/
PR binutils/22101
* elf.c (rewrite_elf_program_header): Remove the segment from
output if all sections in input have been removed.
binutils/x
PR binutils/22101
* objcopy.c (strip_main): Also remove invalid .dynamic section
with --only-keep-debug.
(copy_main): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elf.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -6721,6 +6721,11 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) } } + /* Remove the segment from output if all sections in input have + been removed. */ + if (first_section != NULL && section_count == 0) + continue; + /* Allocate a segment map big enough to contain all of the sections we have selected. */ amt = sizeof (struct elf_segment_map); |