* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Test
authorAlan Modra <amodra@gmail.com>
Mon, 1 Dec 2003 06:28:56 +0000 (06:28 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 1 Dec 2003 06:28:56 +0000 (06:28 +0000)
hash table type rather than testing creator flavour.
* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
Only create stub_file bfd if hash table creator is as expected.
(gld${EMULATION_NAME}_finish): Test stub_file.

ld/ChangeLog
ld/emultempl/elf32.em
ld/emultempl/hppaelf.em

index 97b220d7d1c7a802847d260585a79fc60320b327..f8a9f89fd5bb02bec43e94719004937ee1db6958 100644 (file)
@@ -1,3 +1,11 @@
+2003-12-01  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Test
+       hash table type rather than testing creator flavour.
+       * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
+       Only create stub_file bfd if hash table creator is as expected.
+       (gld${EMULATION_NAME}_finish): Test stub_file.
+
 2003-11-28  Marcel Moolenaar  <marcel@xcllnt.net>
 
        * emulparams/elf64_ia64_fbsd.sh (TEXT_START_ADDR): Define.
index 6e1f815d5fe8c1527946c52b48a43ada164ae381..c386be8ce2fbb01ff30b1186fbd20dfda0c616f1 100644 (file)
@@ -845,7 +845,7 @@ gld${EMULATION_NAME}_before_allocation (void)
   const char *rpath;
   asection *sinterp;
 
-  if (link_info.hash->creator->flavour == bfd_target_elf_flavour)
+  if (link_info.hash->type == bfd_link_elf_hash_table)
     _bfd_elf_tls_setup (output_bfd, &link_info);
 
   /* If we are going to make any variable assignments, we need to let
index 1ee43ac0ca158d2c552bfa17a821602d71b3d634..e9445f279196a5e5e8d9ba40f6070f8067594105 100644 (file)
@@ -66,6 +66,13 @@ hppaelf_after_parse (void)
 static void
 hppaelf_create_output_section_statements (void)
 {
+  extern const bfd_target bfd_elf32_hppa_linux_vec;
+  extern const bfd_target bfd_elf32_hppa_vec;
+
+  if (link_info.hash->creator != &bfd_elf32_hppa_linux_vec
+      && link_info.hash->creator != &bfd_elf32_hppa_vec)
+    return;
+
   stub_file = lang_add_input_file ("linker stubs",
                                   lang_input_file_is_fake_enum,
                                   NULL);
@@ -256,7 +263,7 @@ gld${EMULATION_NAME}_finish (void)
 
   /* If generating a relocatable output file, then we don't
      have to examine the relocs.  */
-  if (link_info.relocatable)
+  if (stub_file != NULL && !link_info.relocatable)
     {
       int ret = elf32_hppa_setup_section_lists (output_bfd, &link_info);
 
@@ -298,7 +305,7 @@ gld${EMULATION_NAME}_finish (void)
        }
 
       /* Now build the linker stubs.  */
-      if (stub_file->the_bfd->sections != NULL)
+      if (stub_file != NULL && stub_file->the_bfd->sections != NULL)
        {
          if (! elf32_hppa_build_stubs (&link_info))
            einfo ("%X%P: can not build stubs: %E\n");