binutils/
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Mar 2009 00:48:10 +0000 (00:48 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Mar 2009 00:48:10 +0000 (00:48 +0000)
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.

binutils/ChangeLog
binutils/objcopy.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/copy-4.d [new file with mode: 0644]
binutils/testsuite/binutils-all/objcopy.exp

index 111002d08fe90c1a1e0b09be846cc7eddd60cec4..880d6e4f5c8e790f8f718e50c99ab2a26ba1f96a 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/9933
+       * objcopy.c (filter_symbols): Properly handle common symbols
+       in relocatable file.
+
 2009-03-06  Nick Clifton  <nickc@redhat.com>
 
        * po/es.po: Updated Spanish translation.
index 6523110e79a782b1298f961c6a3ffc92f092f3d5..07d4f3f3a4dcb214f66348d8eb493ae3d1c19e48 100644 (file)
@@ -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
index 74feea2ad0031366d6c695bf3280b5fb6b190eb6..81e6c17848a929a904198309deebc600ee63c67c 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2009-03-03  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * config/hppa.sed: Fix spelling.
diff --git a/binutils/testsuite/binutils-all/copy-4.d b/binutils/testsuite/binutils-all/copy-4.d
new file mode 100644 (file)
index 0000000..41fccf0
--- /dev/null
@@ -0,0 +1,9 @@
+#PROG: strip
+#source: bintest.s
+#strip: --strip-unneeded
+#nm: -n
+#name: strip --strip-unneeded on common symbol
+
+#...
+0+04 C common_symbol
+#pass
index 997b543a9d1859c9c6c994ade6503e89109ad24e..d45d717cfa0bc7701a8e95747eebf64d8e35daa1 100644 (file)
@@ -835,6 +835,7 @@ if [is_elf_format] {
 
 run_dump_test "copy-2"
 run_dump_test "copy-3"
+run_dump_test "copy-4"
 
 if [is_elf_format] {
     run_dump_test "strip-1"
This page took 0.028453 seconds and 4 git commands to generate.