X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-mcore.c;h=99e9c73596e6a9b75da947294ffdb26455c60bf2;hb=6edf473a3032f789c1b99047708fc966ea91c656;hp=6a8b70a443a2f0b462ba42e7f76c1240e2fe20a0;hpb=30727aa6d12fb866494020c0b62ab265a2bdcdfe;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 6a8b70a443..99e9c73596 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -322,18 +322,8 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) flagword new_flags; /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian.\n"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -454,7 +444,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym * sym = (Elf_Internal_Sym *) 0; unsigned long r_symndx; struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0; - unsigned short oldinst; + unsigned short oldinst = 0; /* Unknown relocation handling */ if ((unsigned) r_type >= (unsigned) R_MCORE_max @@ -532,13 +522,14 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, rel->r_offset))) + input_section, rel->r_offset, true))) return false; ret = false;