* elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum
[deliverable/binutils-gdb.git] / bfd / elf32-i860.c
index 2857a168116fe8c86549e20d257e559dc757a581..7b5d0520c214d31c72d0b6daf7de060f225dc35f 100644 (file)
@@ -1,5 +1,5 @@
 /* Intel i860 specific support for 32-bit ELF.
-   Copyright 1993, 2000 Free Software Foundation, Inc.
+   Copyright 1993, 1995, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    Full i860 support contributed by Jason Eckhardt <jle@cygnus.com>.
 
@@ -541,7 +541,6 @@ static reloc_howto_type elf32_i860_howto_table [] =
         0xffffffff,            /* dst_mask */
         false),                /* pcrel_offset */
 };
-
 \f
 static unsigned char elf_code_to_howto_index[R_860_max + 1];
 
@@ -696,9 +695,9 @@ elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
      arelent *bfd_reloc;
      Elf64_Internal_Rela *elf_reloc;
 {
-  bfd_reloc->howto = lookup_howto (ELF32_R_TYPE (elf_reloc->r_info));
+  bfd_reloc->howto
+    = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));
 }
-
 \f
 /* Specialized relocation handler for R_860_SPLITn.  These relocations
    involves a 16-bit field that is split into two contiguous parts.  */
@@ -711,7 +710,7 @@ elf32_i860_relocate_splitn (input_bfd, rello, contents, value)
 {
   bfd_vma insn;
   reloc_howto_type *howto;
-  howto  = lookup_howto (ELF32_R_TYPE (rello->r_info));
+  howto = lookup_howto ((unsigned) ELF32_R_TYPE (rello->r_info));
   insn = bfd_get_32 (input_bfd, contents + rello->r_offset);
 
   /* Relocate.  */
@@ -738,7 +737,7 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
 {
   bfd_vma insn;
   reloc_howto_type *howto;
-  howto  = lookup_howto (ELF32_R_TYPE (rello->r_info));
+  howto = lookup_howto ((unsigned) ELF32_R_TYPE (rello->r_info));
   insn = bfd_get_32 (input_bfd, contents + rello->r_offset);
 
   /* Adjust for PC-relative relocation.  */
@@ -770,7 +769,7 @@ elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value)
 {
   bfd_vma insn;
   reloc_howto_type *howto;
-  howto  = lookup_howto (ELF32_R_TYPE (rello->r_info));
+  howto = lookup_howto ((unsigned) ELF32_R_TYPE (rello->r_info));
   insn = bfd_get_32 (input_bfd, contents + rello->r_offset);
 
   /* Adjust for PC-relative relocation.  */
@@ -926,18 +925,16 @@ elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section,
        }
 
       /* This is a final link.  */
-      howto  = lookup_howto (ELF32_R_TYPE (rel->r_info));
-      h      = NULL;
-      sym    = NULL;
-      sec    = NULL;
+      howto = lookup_howto ((unsigned) ELF32_R_TYPE (rel->r_info));
+      h     = NULL;
+      sym   = NULL;
+      sec   = NULL;
 
       if (r_symndx < symtab_hdr->sh_info)
        {
          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);
 
          name = bfd_elf_string_from_elf_section
            (input_bfd, symtab_hdr->sh_link, sym->st_name);
@@ -1091,7 +1088,6 @@ elf32_i860_is_local_label_name (abfd, name)
 
   return _bfd_elf_is_local_label_name (abfd, name);
 }
-
 \f
 #define TARGET_BIG_SYM         bfd_elf32_i860_vec
 #define TARGET_BIG_NAME                "elf32-i860"
This page took 0.025161 seconds and 4 git commands to generate.