• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisiónc35b4e8cee990d0d1c33b631912333e623a37477 (tree)
Tiempo2017-09-16 04:26:43
AutorH.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Log Message

Remove invalid .dynamic section with --only-keep-debug

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.

Cambiar Resumen

Diferencia incremental

--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6721,6 +6721,11 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
67216721 }
67226722 }
67236723
6724+ /* Remove the segment from output if all sections in input have
6725+ been removed. */
6726+ if (first_section != NULL && section_count == 0)
6727+ continue;
6728+
67246729 /* Allocate a segment map big enough to contain
67256730 all of the sections we have selected. */
67266731 amt = sizeof (struct elf_segment_map);
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -4206,6 +4206,8 @@ strip_main (int argc, char *argv[])
42064206 break;
42074207 case OPTION_ONLY_KEEP_DEBUG:
42084208 strip_symbols = STRIP_NONDEBUG;
4209+ /* Also remove invalid .dynamic section. */
4210+ handle_remove_section_option (".dynamic");
42094211 break;
42104212 case OPTION_KEEP_FILE_SYMBOLS:
42114213 keep_file_symbols = 1;
@@ -4582,6 +4584,8 @@ copy_main (int argc, char *argv[])
45824584
45834585 case OPTION_ONLY_KEEP_DEBUG:
45844586 strip_symbols = STRIP_NONDEBUG;
4587+ /* Also remove invalid .dynamic section. */
4588+ handle_remove_section_option (".dynamic");
45854589 break;
45864590
45874591 case OPTION_KEEP_FILE_SYMBOLS: