X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felfxx-mips.c;h=d4b90de3c34381f423aa2bc016f23a9d4c775177;hb=5e2b0d475efa4aa40e098f49074f3c2afd854f48;hp=a3448491eb9ac188a6ed1b5935541fd4826c49b7;hpb=ff1e98b937b0538db997dcf79867f799152d7d33;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index a3448491eb..d4b90de3c3 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -3792,6 +3792,17 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, BFD_ASSERT (bfd_get_section_by_name (abfd, ".dynamic") == NULL); symbol = 0; } + else if (ELF_MIPS_IS_OPTIONAL (h->root.other)) + { + /* This is an optional symbol - an Irix specific extension to the + ELF spec. Ignore it for now. + XXX - FIXME - there is more to the spec for OPTIONAL symbols + than simply ignoring them, but we do not handle this for now. + For information see the "64-bit ELF Object File Specification" + which is available from here: + http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf */ + symbol = 0; + } else { if (! ((*info->callbacks->undefined_symbol) @@ -8867,8 +8878,7 @@ _bfd_elf_mips_get_relocated_section_contents case bfd_reloc_undefined: if (!((*link_info->callbacks->undefined_symbol) (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), - input_bfd, input_section, (*parent)->address, - TRUE))) + input_bfd, input_section, (*parent)->address, TRUE))) goto error_return; break; case bfd_reloc_dangerous: @@ -9994,3 +10004,16 @@ const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] = { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 }, { NULL, 0, 0, 0, 0 } }; + +/* Ensure that the STO_OPTIONAL flag is copied into h->other, + even if this is not a defintion of the symbol. */ +void +_bfd_mips_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, + const Elf_Internal_Sym *isym, + bfd_boolean definition, + bfd_boolean dynamic ATTRIBUTE_UNUSED) +{ + if (! definition + && ELF_MIPS_IS_OPTIONAL (isym->st_other)) + h->other |= STO_OPTIONAL; +}