summaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2009-03-10 00:48:10 +0000
committerH.J. Lu <hjl@lucon.org>2009-03-10 00:48:10 +0000
commitbe991180f724a51478447c0200980727d0a4e7d0 (patch)
tree02c630952efdfcd541342fb3b64b1251731c9e7f /binutils/objcopy.c
parent1e8197c721e5294cfa201a73a5fd3c7693980034 (diff)
downloadbinutils-redhat-be991180f724a51478447c0200980727d0a4e7d0.tar.gz
binutils/
2009-03-09 H.J. Lu <hongjiu.lu@intel.com> PR binutils/9933 * objcopy.c (filter_symbols): Properly handle common symbols in relocatable file. binutils/testsuite/ 2009-03-09 H.J. Lu <hongjiu.lu@intel.com> PR binutils/9933 * binutils-all/copy-4.d: New. * binutils-all/objcopy.exp: Run copy-4.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 6523110e79..07d4f3f3a4 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1028,7 +1028,8 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms,
used_in_reloc = TRUE;
}
else if (relocatable /* Relocatable file. */
- && (flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
+ && ((flags & (BSF_GLOBAL | BSF_WEAK)) != 0
+ || bfd_is_com_section (bfd_get_section (sym))))
keep = TRUE;
else if (bfd_decode_symclass (sym) == 'I')
/* Global symbols in $idata sections need to be retained