Do not put small common symbols into .sbss if ld -r
authorMichael Meissner <gnu@the-meissners.org>
Fri, 24 May 1996 18:30:52 +0000 (18:30 +0000)
committerMichael Meissner <gnu@the-meissners.org>
Fri, 24 May 1996 18:30:52 +0000 (18:30 +0000)
bfd/ChangeLog
bfd/elf32-ppc.c

index 5defe84..298a524 100644 (file)
@@ -1,3 +1,8 @@
+Fri May 24 14:28:38 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
+
+       * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not put small common
+       symbols into .sbss if this is a relocatable link.
+
 Thu May 23 12:26:24 1996  Ian Lance Taylor  <ian@cygnus.com>
 
        * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Warn about
index 4b31b09..abe5a05 100644 (file)
@@ -1974,12 +1974,14 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
          if (h != NULL
              && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
            break;
+         /* fall through */
 
        case R_PPC_REL14:
        case R_PPC_REL14_BRTAKEN:
        case R_PPC_REL14_BRNTAKEN:
          if (h == NULL)
            break;
+         /* fall through */
 
        default:
          if (info->shared
@@ -2047,7 +2049,7 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      asection **secp;
      bfd_vma *valp;
 {
-  if (sym->st_shndx == SHN_COMMON && sym->st_size <= bfd_get_gp_size (abfd))
+  if (sym->st_shndx == SHN_COMMON && !info->relocateable && sym->st_size <= bfd_get_gp_size (abfd))
     {
       /* Common symbols less than or equal to -G nn bytes are automatically
         put into .sdata.  */