]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf32-ppc.c
* elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none
[thirdparty/binutils-gdb.git] / bfd / elf32-ppc.c
index 9c61644b5924dd697e4e4ce1b2acb022ff7dc994..09a59b486ae9fb0fdc3cf89baeb212bb162babbf 100644 (file)
@@ -4708,7 +4708,9 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
          || s == htab->glink
          || s == htab->got
          || s == htab->sgotplt
-         || s == htab->sbss)
+         || s == htab->sbss
+         || s == htab->dynbss
+         || s == htab->dynsbss)
        {
          /* We'd like to strip these sections if they aren't needed, but if
             we've exported dynamic symbols from them we must leave them.
@@ -4725,19 +4727,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        }
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
        {
-         if (s->size == 0)
-           {
-             /* If we don't need this section, strip it from the
-                output file.  This is mostly to handle .rela.bss and
-                .rela.plt.  We must create both sections in
-                create_dynamic_sections, because they must be created
-                before the linker maps input sections to output
-                sections.  The linker does that before
-                adjust_dynamic_symbol is called, and it is that
-                function which decides whether anything needs to go
-                into these sections.  */
-           }
-         else
+         if (s->size != 0)
            {
              /* Remember whether there are any relocation sections.  */
              relocs = TRUE;
@@ -4755,6 +4745,15 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 
       if (s->size == 0 && strip_section)
        {
+         /* If we don't need this section, strip it from the
+            output file.  This is mostly to handle .rela.bss and
+            .rela.plt.  We must create both sections in
+            create_dynamic_sections, because they must be created
+            before the linker maps input sections to output
+            sections.  The linker does that before
+            adjust_dynamic_symbol is called, and it is that
+            function which decides whether anything needs to go
+            into these sections.  */
          s->flags |= SEC_EXCLUDE;
          continue;
        }