* scripttempl/elf.sc: Move non-text .dynamic section before
[deliverable/binutils-gdb.git] / bfd / elf32-hppa.c
index cc086095f116cd8e3407f014dfe4a50616b8526a..7fe328e7039e10bf673e792a0dcc43f4f7a04476 100644 (file)
@@ -2141,8 +2141,9 @@ allocate_plt_and_got_and_discard_relocs (h, inf)
   if (!info->shared
       && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
       && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
-         || h->root.type == bfd_link_hash_undefweak
-         || h->root.type == bfd_link_hash_undefined))
+         || (hplink->root.dynamic_sections_created
+             && (h->root.type == bfd_link_hash_undefweak
+                 || h->root.type == bfd_link_hash_undefined))))
     {
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
@@ -4334,7 +4335,7 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
        }
     }
 
-  if (hplink->sgot->_raw_size != 0)
+  if (hplink->sgot != NULL && hplink->sgot->_raw_size != 0)
     {
       /* Fill in the first entry in the global offset table.
         We use it to point to our dynamic section, if we have one.  */
@@ -4352,7 +4353,7 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
        ->this_hdr.sh_entsize = GOT_ENTRY_SIZE;
     }
 
-  if (hplink->splt->_raw_size != 0)
+  if (hplink->splt != NULL && hplink->splt->_raw_size != 0)
     {
       /* Set plt entry size.  */
       elf_section_data (hplink->splt->output_section)
This page took 0.023492 seconds and 4 git commands to generate.