/* AVR-specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
{
/* Relative distance is too large. */
- /* Always apply WRAPAROUND for avr2 and avr4. */
+ /* Always apply WRAPAROUND for avr2, avr25, and avr4. */
switch (bfd_get_mach (input_bfd))
{
case bfd_mach_avr2:
+ case bfd_mach_avr25:
case bfd_mach_avr4:
break;
case bfd_mach_avr25:
val = E_AVR_MACH_AVR25;
+ break;
case bfd_mach_avr3:
val = E_AVR_MACH_AVR3;
case bfd_mach_avr31:
val = E_AVR_MACH_AVR31;
+ break;
case bfd_mach_avr35:
val = E_AVR_MACH_AVR35;
+ break;
case bfd_mach_avr4:
val = E_AVR_MACH_AVR4;
Elf_Internal_Rela *irelalign;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymbuf = NULL;
- Elf_Internal_Sym *isymend;
bfd_vma toaddr;
struct elf_link_hash_entry **sym_hashes;
struct elf_link_hash_entry **end_hashes;
/* Adjust the local symbols defined in this section. */
isym = (Elf_Internal_Sym *) symtab_hdr->contents;
- isymend = isym + symtab_hdr->sh_info;
- for (; isym < isymend; isym++)
+ /* Fix PR 9841, there may be no local symbols. */
+ if (isym != NULL)
{
- if (isym->st_shndx == sec_shndx
- && isym->st_value > addr
- && isym->st_value < toaddr)
- isym->st_value -= count;
+ Elf_Internal_Sym *isymend;
+
+ isymend = isym + symtab_hdr->sh_info;
+ for (; isym < isymend; isym++)
+ {
+ if (isym->st_shndx == sec_shndx
+ && isym->st_value > addr
+ && isym->st_value < toaddr)
+ isym->st_value -= count;
+ }
}
/* Now adjust the global symbols defined in this section. */
static Elf_Internal_Rela *last_reloc = NULL;
struct elf32_avr_link_hash_table *htab;
+ if (link_info->relocatable)
+ (*link_info->callbacks->einfo)
+ (_("%P%F: --relax and -r may not be used together\n"));
+
htab = avr_link_hash_table (link_info);
if (htab == NULL)
return FALSE;