/* Or1k-specific support for 32-bit ELF.
- Copyright 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
PIC parts added by Stefan Kristiansson, stefan.kristiansson@saunalahti.fi,
/* This reloc does nothing. */
HOWTO (R_OR1K_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_dont, /* complain_on_overflow */
{
unsigned int i;
- for (i = ARRAY_SIZE (or1k_reloc_map); --i;)
+ for (i = ARRAY_SIZE (or1k_reloc_map); i--;)
if (or1k_reloc_map[i].bfd_reloc_val == code)
return & or1k_elf_howto_table[or1k_reloc_map[i].or1k_reloc_val];
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_OR1K_max);
+ if (r_type >= (unsigned int) R_OR1K_max)
+ {
+ _bfd_error_handler (_("%B: invalid OR1K reloc number: %d"), abfd, r_type);
+ r_type = 0;
+ }
cache_ptr->howto = & or1k_elf_howto_table[r_type];
}
h->needs_copy = 1;
}
- return _bfd_elf_adjust_dynamic_copy (h, s);
+ return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
/* Allocate space in .plt, .got and associated reloc sections for