c4643efe7b
authorMatthias Klose <doko@debian.org>
Thu, 10 Feb 2022 12:05:47 +0000 (12:05 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 10 Feb 2022 12:05:47 +0000 (12:05 +0000)
# 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

binutils/objcopy.c

index d16d8ee67e4dfe550eaa553671552b2300fbf2e0..d53aa5c6000f093b84a47c17b302365ab635526b 100644 (file)
@@ -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;