* elf.c (_bfd_elf_rela_local_sym): New.
[deliverable/binutils-gdb.git] / bfd / elf64-alpha.c
index 7d9206efaad8d79e279e0fc577d27efe082a2e87..783f01030805b9d9dc304805258d2955c089e0b5 100644 (file)
@@ -136,7 +136,7 @@ static boolean elf64_alpha_merge_ind_symbols
 static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs
   PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int));
 static enum elf_reloc_type_class elf64_alpha_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 \f
 struct alpha_elf_link_hash_entry
 {
@@ -1572,7 +1572,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
       else
        {
          /* Cache the symbols for elf_link_input_bfd.  */
-         symtab_hdr->contents = extsyms;
+         symtab_hdr->contents = (unsigned char *) extsyms;
        }
     }
 
@@ -3318,9 +3318,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
        {
          sym = local_syms + r_symndx;
          sec = local_sections[r_symndx];
-         relocation = (sec->output_section->vma
-                       + sec->output_offset
-                       + sym->st_value);
+         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
        }
       else
        {
@@ -3516,7 +3514,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
                outrel.r_addend = addend;
                addend = 0, relocation = 0;
              }
-           else if (info->shared && (input_section->flags & SEC_ALLOC))
+           else if (info->shared
+                    && r_symndx != 0
+                    && (input_section->flags & SEC_ALLOC))
              {
                outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
                outrel.r_addend = relocation + addend;
@@ -4131,10 +4131,10 @@ elf64_alpha_final_link (abfd, info)
 }
 
 static enum elf_reloc_type_class
-elf64_alpha_reloc_type_class (type)
-     int type;
+elf64_alpha_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF64_R_TYPE (rela->r_info))
     {
     case R_ALPHA_RELATIVE:
       return reloc_class_relative;
This page took 0.02569 seconds and 4 git commands to generate.