From 2ed9700cf81c88dff0a9b575a1c3fd17bc4c2635 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Thu, 18 Oct 2012 17:29:54 +0000 Subject: * objcopy.c (is_strip_section_1): Don't strip .reloc section by default. --- binutils/objcopy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'binutils/objcopy.c') diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 40250adc4b..f44ebcd942 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -102,7 +102,7 @@ enum strip_action }; /* Which symbols to remove. */ -static enum strip_action strip_symbols; +static enum strip_action strip_symbols = STRIP_UNDEF; enum locals_action { @@ -977,7 +977,13 @@ is_strip_section_1 (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) || strip_symbols == STRIP_ALL || discard_locals == LOCALS_ALL || convert_debugging) - return TRUE; + { + /* 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_get_section_name (abfd, sec), ".reloc") != 0) + return TRUE; + } if (strip_symbols == STRIP_DWO) return is_dwo_section (abfd, sec); -- cgit v1.2.1