More fixes for illegal memory accesses triggered by running objdump on fuzzed binaries.
[deliverable/binutils-gdb.git] / bfd / elf32-msp430.c
index 2157eb0c5d0eeb75089e4cd2a37d23810abd6fee..c839ea0d1fc29ce0f4f712d6bca44333ac424dee 100644 (file)
@@ -30,11 +30,11 @@ static reloc_howto_type elf_msp430_howto_table[] =
 {
   HOWTO (R_MSP430_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,/* complain_on_overflow */
+        complain_overflow_dont,/* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MSP430_NONE",       /* name */
         FALSE,                 /* partial_inplace */
@@ -197,11 +197,11 @@ static reloc_howto_type elf_msp430x_howto_table[] =
 {
   HOWTO (R_MSP430_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,/* complain_on_overflow */
+        complain_overflow_dont,/* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MSP430_NONE",       /* name */
         FALSE,                 /* partial_inplace */
@@ -619,7 +619,7 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
     {
       if (r_type >= (unsigned int) R_MSP430x_max)
        {
-         _bfd_error_handler (_("%A: invalid MSP430X reloc number: %d"), abfd, r_type);
+         _bfd_error_handler (_("%B: invalid MSP430X reloc number: %d"), abfd, r_type);
          r_type = 0;
        }
       cache_ptr->howto = elf_msp430x_howto_table + r_type;
@@ -628,7 +628,7 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
 
   if (r_type >= (unsigned int) R_MSP430_max)
     {
-      _bfd_error_handler (_("%A: invalid MSP430 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%B: invalid MSP430 reloc number: %d"), abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_msp430_howto_table[r_type];
@@ -1921,7 +1921,7 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
        default:
          /* Not a conditional branch instruction.  */
          /* fprintf (stderr, "unrecog: %x\n", opcode); */
-         goto error_return;
+         continue;
        }
 
       /* Note that we've changed the relocs, section contents, etc.  */
@@ -2162,6 +2162,7 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
          {
            bfd_vma value = symval;
 
+           value -= (sec->output_section->vma + sec->output_offset);
            value -= irel->r_offset;
            value += irel->r_addend;
           
This page took 0.024509 seconds and 4 git commands to generate.