+2022-04-12 Nick Clifton <nickc@redhat.com>
+
+ PR 28992
+ * objcopy.c (is_strip_section_1): Do not delete debuglink sections
+ when stripping debug information.
+
2022-04-06 Nick Clifton <nickc@redhat.com>
PR 28981
{
/* By default we don't want to strip .reloc section.
This section has for pe-coff special meaning. See
- pe-dll.c file in ld, and peXXigen.c in bfd for details. */
- if (strcmp (bfd_section_name (sec), ".reloc") != 0)
+ pe-dll.c file in ld, and peXXigen.c in bfd for details.
+ Similarly we do not want to strip debuglink sections. */
+ const char * kept_sections[] =
+ {
+ ".reloc",
+ ".gnu_debuglink",
+ ".gnu_debugaltlink"
+ };
+ int i;
+
+ for (i = ARRAY_SIZE (kept_sections);i--;)
+ if (strcmp (bfd_section_name (sec), kept_sections[i]) == 0)
+ break;
+ if (i == -1)
return true;
}