* objfiles.h (struct objfile): Add memebers `data' and `num_data'.
[binutils-gdb.git] / bfd / elf32-xstormy16.c
index df0d7ca405beec8c3ec50e46f5ff694223b67063..af9a04882fed9bd61a199c702b501768537f3731 100644 (file)
@@ -1,5 +1,5 @@
 /* XSTORMY16-specific support for 32-bit ELF.
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -101,22 +101,22 @@ static reloc_howto_type xstormy16_elf_howto_table [] =
         "R_XSTORMY16_16",      /* name */
         FALSE,                 /* partial_inplace */
         0,                     /* src_mask */
-        0xffffffff,            /* dst_mask */
+        0xffff,                /* dst_mask */
         FALSE),                /* pcrel_offset */
 
   /* An 8 bit absolute relocation.  */
-  HOWTO (R_XSTORMY16_8,        /* type */
+  HOWTO (R_XSTORMY16_8,                /* type */
         0,                     /* rightshift */
         0,                     /* size (0 = byte, 1 = short, 2 = long) */
         8,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_unsigned, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_XSTORMY16_8",       /* name */
         FALSE,                 /* partial_inplace */
         0,                     /* src_mask */
-        0xffffffff,            /* dst_mask */
+        0xff,                  /* dst_mask */
         FALSE),                /* pcrel_offset */
 
   /* A 32 bit pc-relative relocation.  */
@@ -174,9 +174,9 @@ static reloc_howto_type xstormy16_elf_howto_table [] =
         complain_overflow_signed, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_XSTORMY16_REL_12",  /* name */
-        TRUE,                  /* partial_inplace */
+        FALSE,                 /* partial_inplace */
         0,                     /* src_mask */
-        0x0fff,                /* dst_mask */
+        0x0ffe,                /* dst_mask */
         TRUE),                 /* pcrel_offset */
 
   /* A 24-bit absolute relocation suitable for the jump instructions.  */
@@ -423,7 +423,7 @@ xstormy16_elf_check_relocs (abfd, info, sec, relocs)
   asection *splt;
   bfd *dynobj;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   symtab_hdr = &elf_tdata(abfd)->symtab_hdr;
@@ -609,7 +609,7 @@ xstormy16_elf_relax_section (dynobj, splt, info, again)
   /* Assume nothing changes.  */
   *again = FALSE;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   /* We only relax the .plt section at the moment.  */
@@ -739,7 +739,7 @@ xstormy16_elf_always_size_sections (output_bfd, info)
   bfd *dynobj;
   asection *splt;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -766,7 +766,7 @@ xstormy16_elf_always_size_sections (output_bfd, info)
    zero.
 
    This function is responsible for adjusting the section contents as
-   necessary, and (if using Rela relocs and generating a relocateable
+   necessary, and (if using Rela relocs and generating a relocatable
    output file) adjusting the reloc addend as necessary.
 
    This function does not have to worry about setting the reloc
@@ -780,7 +780,7 @@ xstormy16_elf_always_size_sections (output_bfd, info)
    The global hash table entry for the global symbols can be found
    via elf_sym_hashes (input_bfd).
 
-   When generating relocateable output, this function must handle
+   When generating relocatable output, this function must handle
    STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
    going to be the section symbol corresponding to the output
    section, which means that the addend must be adjusted
@@ -805,7 +805,7 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   bfd *dynobj;
   asection *splt;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
@@ -845,9 +845,7 @@ xstormy16_elf_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);
 
          name = bfd_elf_string_from_elf_section
            (input_bfd, symtab_hdr->sh_link, sym->st_name);