From: Matthias Klose Date: Thu, 10 Feb 2022 12:05:47 +0000 (+0000) Subject: c4643efe7b X-Git-Tag: archive/raspbian/2.37.90.20220207-1+rpi1~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cdb306b2ba22ba63acd79fa459b632dac1a2aaa6;p=binutils.git c4643efe7b # DP: Fix objcopy --only-keep-debug, taken from the trunk (7c4643efe7b) # DP: Fix objcopy --only-keep-debug, taken from the trunk (7c4643efe7b) Gbp-Pq: Name 7c4643efe7b.diff --- diff --git a/binutils/objcopy.c b/binutils/objcopy.c index d16d8ee67..d53aa5c60 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -4085,9 +4085,6 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) goto loser; } - if (make_nobits) - elf_section_type (osection) = SHT_NOBITS; - size = bfd_section_size (isection); size = bfd_convert_section_size (ibfd, isection, obfd, size); if (copy_byte >= 0) @@ -4181,6 +4178,9 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) goto loser; } + if (make_nobits) + elf_section_type (osection) = SHT_NOBITS; + /* All went well. */ return;