OSDN Git Service

bfd/
authorAlan Modra <amodra@bigpond.net.au>
Mon, 21 Mar 2005 13:56:47 +0000 (13:56 +0000)
committerAlan Modra <amodra@bigpond.net.au>
Mon, 21 Mar 2005 13:56:47 +0000 (13:56 +0000)
* elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
SEC_LINKER_CREATED.  Attach to dynobj.
(ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
ld/
* scripttempl/elf.sc (SBSS): Don't provide sbss start and end syms.
ld/testsuite/
* ld-powerpc/tlsexe32.r: Update.
* ld-powerpc/tlsso32.d: Update.
* ld-powerpc/tlsso32.g: Update.
* ld-powerpc/tlsso32.r: Update.

bfd/ChangeLog
bfd/elf32-ppc.c

index 014759d..fd44c07 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-22  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
+       SEC_LINKER_CREATED.  Attach to dynobj.
+       (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
+
 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
index 2e9b549..a80cfa4 100644 (file)
@@ -2381,11 +2381,14 @@ ppc_elf_add_symbol_hook (bfd *abfd,
       htab = ppc_elf_hash_table (info);
       if (htab->sbss == NULL)
        {
-         flagword flags = SEC_IS_COMMON;
+         flagword flags = SEC_IS_COMMON | SEC_LINKER_CREATED;
 
-         htab->sbss = bfd_make_section_anyway (abfd, ".sbss");
+         if (!htab->elf.dynobj)
+           htab->elf.dynobj = abfd;
+
+         htab->sbss = bfd_make_section_anyway (htab->elf.dynobj, ".sbss");
          if (htab->sbss == NULL
-             || ! bfd_set_section_flags (abfd, htab->sbss, flags))
+             || ! bfd_set_section_flags (htab->elf.dynobj, htab->sbss, flags))
            return FALSE;
        }
 
@@ -4053,7 +4056,8 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        continue;
 
       if (s == htab->plt
-         || s == htab->got)
+         || s == htab->got
+         || s == htab->sbss)
        {
          /* Strip this section if we don't need it; see the
             comment below.  */
@@ -4099,6 +4103,9 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
          continue;
        }
 
+      if (s == htab->sbss)
+       continue;
+
       /* Allocate memory for the section contents.  */
       s->contents = bfd_zalloc (htab->elf.dynobj, s->size);
       if (s->contents == NULL)