| Index: bfd/elf32-m32r.c
|
| diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
|
| index e3e3bb051b5e300b87a6bc69dcb35998c150f24b..71e8fc781f86f6f5696e798c2cd253f69403c4e6 100644
|
| --- a/bfd/elf32-m32r.c
|
| +++ b/bfd/elf32-m32r.c
|
| @@ -1,6 +1,5 @@
|
| /* M32R-specific support for 32-bit ELF.
|
| - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
| - 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
| + Copyright 1996-2013 Free Software Foundation, Inc.
|
|
|
| This file is part of BFD, the Binary File Descriptor library.
|
|
|
| @@ -1390,7 +1389,8 @@ m32r_elf_add_symbol_hook (bfd *abfd,
|
| flags);
|
| if (s == NULL)
|
| return FALSE;
|
| - bfd_set_section_alignment (abfd, s, 2);
|
| + if (! bfd_set_section_alignment (abfd, s, 2))
|
| + return FALSE;
|
| }
|
|
|
| bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",
|
| @@ -1585,7 +1585,7 @@ m32r_elf_link_hash_table_create (bfd *abfd)
|
| struct elf_m32r_link_hash_table *ret;
|
| bfd_size_type amt = sizeof (struct elf_m32r_link_hash_table);
|
|
|
| - ret = bfd_malloc (amt);
|
| + ret = bfd_zmalloc (amt);
|
| if (ret == NULL)
|
| return NULL;
|
|
|
| @@ -1598,15 +1598,6 @@ m32r_elf_link_hash_table_create (bfd *abfd)
|
| return NULL;
|
| }
|
|
|
| - ret->sgot = NULL;
|
| - ret->sgotplt = NULL;
|
| - ret->srelgot = NULL;
|
| - ret->splt = NULL;
|
| - ret->srelplt = NULL;
|
| - ret->sdynbss = NULL;
|
| - ret->srelbss = NULL;
|
| - ret->sym_cache.abfd = NULL;
|
| -
|
| return &ret->root.root;
|
| }
|
|
|
| @@ -3295,8 +3286,7 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd,
|
| }
|
|
|
| /* Mark some specially defined symbols as absolute. */
|
| - if (strcmp (h->root.root.string, "_DYNAMIC") == 0
|
| - || h == htab->root.hgot)
|
| + if (h == htab->root.hdynamic || h == htab->root.hgot)
|
| sym->st_shndx = SHN_ABS;
|
|
|
| return TRUE;
|
| @@ -3756,6 +3746,10 @@ m32r_elf_check_relocs (bfd *abfd,
|
| while (h->root.type == bfd_link_hash_indirect
|
| || h->root.type == bfd_link_hash_warning)
|
| h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
| +
|
| + /* PR15323, ref flags aren't set for references in the same
|
| + object. */
|
| + h->root.non_ir_ref = 1;
|
| }
|
|
|
| /* Some relocs require a global offset table. */
|
| @@ -3991,7 +3985,9 @@ static const struct bfd_elf_special_section m32r_elf_special_sections[] =
|
| };
|
|
|
| static enum elf_reloc_type_class
|
| -m32r_elf_reloc_type_class (const Elf_Internal_Rela *rela)
|
| +m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
|
| + const asection *rel_sec ATTRIBUTE_UNUSED,
|
| + const Elf_Internal_Rela *rela)
|
| {
|
| switch ((int) ELF32_R_TYPE (rela->r_info))
|
| {
|
|
|