Skip to content
Commit 68f54315 authored by Alan Modra's avatar Alan Modra
Browse files

objcopy --only-keep-debug

From: Peilin Ye <peilin.ye@bytedance.com>
objcopy's --only-keep-debug option has been broken for ELF files since
commit 8c803a2d.

  1. binutils/objcopy.c:setup_section() marks non-debug sections as
     SHT_NOBITS, then calls bfd_copy_private_section_data();
  2. If ISEC and OSEC share the same section flags,
     bfd/elf.c:_bfd_elf_init_private_section_data() restores OSEC's
     section type back to ISEC's section type, effectively undoing
     "make_nobits".

	* objcopy.c (setup_section): Act on make_nobits after calling
	bfd_copy_private_section_data.

(cherry picked from commit 7c4643ef)
parent 61ecfbda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment