X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf64-sh64.c;h=b168934e9633c89b8a803844f9cdee6b3c5c2d3c;hb=f742faa65b6878de6c7731e0055b30e5798e867c;hp=901bfa5bda6b89821c5be42c8b32130d730280a0;hpb=0bb2d96afee35ad4b023efc2df2791c56f68cfe6;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 901bfa5bda..b168934e96 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1754,7 +1754,7 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, if (outrel.r_offset == (bfd_vma) -1) skip = true; - else if (outrel.r_offset == (bfd_vma) -1) + else if (outrel.r_offset == (bfd_vma) -2) skip = true, relocate = true; outrel.r_offset += (input_section->output_section->vma @@ -2929,7 +2929,8 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma *valp; { /* We want to do this for relocatable as well as final linking. */ - if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL) + if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL + && info->hash->creator->flavour == bfd_target_elf_flavour) { struct elf_link_hash_entry *h; @@ -3227,14 +3228,14 @@ sh64_elf64_link_hash_table_create (abfd) struct elf_sh64_link_hash_table *ret; ret = ((struct elf_sh64_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf_sh64_link_hash_table))); + bfd_malloc (sizeof (struct elf_sh64_link_hash_table))); if (ret == (struct elf_sh64_link_hash_table *) NULL) return NULL; if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, sh64_elf64_link_hash_newfunc)) { - bfd_release (abfd, ret); + free (ret); return NULL; } @@ -3607,6 +3608,9 @@ sh64_elf64_discard_copies (h, ignore) { struct elf_sh64_pcrel_relocs_copied *s; + if (h->root.root.type == bfd_link_hash_warning) + h = (struct elf_sh64_link_hash_entry *) h->root.root.u.i.link; + /* We only discard relocs for symbols defined in a regular object. */ if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) return true;