/* Lattice Mico32-specific support for 32-bit ELF
- Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Copyright (C) 2008-2015 Free Software Foundation, Inc.
Contributed by Jon Beniston <jon@beniston.com>
This file is part of BFD, the Binary File Descriptor library.
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
-extern const bfd_target bfd_elf32_lm32fdpic_vec;
+extern const bfd_target lm32_elf32_fdpic_vec;
-#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_lm32fdpic_vec)
+#define IS_FDPIC(bfd) ((bfd)->xvec == &lm32_elf32_fdpic_vec)
static bfd_reloc_status_type lm32_elf_gprel_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
/* This reloc does nothing. */
HOWTO (R_LM32_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_LM32_NONE", /* name */
FALSE, /* partial_inplace */
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_LM32_max);
+ if (r_type >= (unsigned int) R_LM32_max)
+ {
+ _bfd_error_handler (_("%B: invalid LM32 reloc number: %d"), abfd, r_type);
+ r_type = 0;
+ }
cache_ptr->howto = &lm32_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
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
int r32_count = 0;
int rgot_count = 0;
/* Look for deleted sections. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
for (s = ibfd->sections; s != NULL; s = s->next)
{
#define ELF_MACHINE_CODE EM_LATTICEMICO32
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_lm32_vec
+#define TARGET_BIG_SYM lm32_elf32_vec
#define TARGET_BIG_NAME "elf32-lm32"
#define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_lm32fdpic_vec
+#define TARGET_BIG_SYM lm32_elf32_fdpic_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-lm32fdpic"
#undef elf32_bed