2003-04-25 Alan Modra <amodra@bigpond.net.au>
[deliverable/binutils-gdb.git] / bfd / elf64-alpha.c
index 3c5df032443298401bc5af22a355e1ce320fdca8..4a2658abe1f8f4712e8dee3016abf1f2b74ea4ee 100644 (file)
@@ -305,7 +305,9 @@ alpha_elf_dynamic_symbol_p (h, info)
 
   if ((info->shared && !info->symbolic)
       || ((h->elf_link_hash_flags
-          & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
+          & (ELF_LINK_HASH_DEF_DYNAMIC
+             | ELF_LINK_HASH_DEF_REGULAR
+             | ELF_LINK_HASH_REF_REGULAR))
          == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
     return TRUE;
 
@@ -2184,7 +2186,13 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
 
          info.h = NULL;
          info.other = isym->st_other;
-         info.first_gotent = &local_got_entries[r_symndx];
+         if (local_got_entries)
+           info.first_gotent = &local_got_entries[r_symndx];
+         else
+           {
+             info.first_gotent = &info.gotent;
+             info.gotent = NULL;
+           }
        }
       else
        {
@@ -4497,7 +4505,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
          else if (h->root.root.type == bfd_link_hash_undefweak)
            undef_weak_ref = TRUE;
          else if (info->shared
-                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
            ;
@@ -4509,7 +4516,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
                     (!info->shared || info->no_undefined
                      || ELF_ST_VISIBILITY (h->root.other)))))
                return FALSE;
-             ret_val = FALSE;
              continue;
            }
 
@@ -4575,8 +4581,20 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
          value -= gp;
          goto default_reloc;
 
-       case R_ALPHA_GPREL16:
        case R_ALPHA_GPREL32:
+         /* If the target section was a removed linkonce section,
+            r_symndx will be zero.  In this case, assume that the
+            switch will not be used, so don't fill it in.  If we
+            do nothing here, we'll get relocation truncated messages,
+            due to the placement of the application above 4GB.  */
+         if (r_symndx == 0)
+           {
+             r = bfd_reloc_ok;
+             break;
+           }
+         /* FALLTHRU */
+
+       case R_ALPHA_GPREL16:
        case R_ALPHA_GPRELLOW:
          if (dynamic_symbol_p)
             {
@@ -5170,7 +5188,7 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info)
          bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
        }
 
-      /* Initialize the PLT0 entry */
+      /* Initialize the PLT0 entry */
       if (splt->_raw_size > 0)
        {
          bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents);
This page took 0.025095 seconds and 4 git commands to generate.