From: Matthias Klose Date: Sun, 30 Jan 2022 16:51:18 +0000 (+0000) Subject: c4643efe7b X-Git-Tag: archive/raspbian/2.37.90.20220130-2+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=26d544b85dcdb0d349ad5bdfbb21f3ba155feedf;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;