X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felfxx-mips.c;h=fa572958d47dd3c049b251582d7edcfeb7d89756;hb=5f74bc130d437ca83b9f94507f92838aa516cb01;hp=99e9fbc0f7634c87271cfe5e7d236642d4fc8e1f;hpb=9c5bfbb7fd76589a332126f99a4e195e46da207f;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 99e9fbc0f7..fa572958d4 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -3008,6 +3008,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, } else { + /* ??? Could we use RELOC_FOR_GLOBAL_SYMBOL here ? */ + /* For global symbols we look up the symbol in the hash-table. */ h = ((struct mips_elf_link_hash_entry *) elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); @@ -3021,7 +3023,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, /* See if this is the special _gp_disp symbol. Note that such a symbol must always be a global symbol. */ - if (strcmp (h->root.root.root.string, "_gp_disp") == 0 + if (strcmp (*namep, "_gp_disp") == 0 && ! NEWABI_P (input_bfd)) { /* Relocations against _gp_disp are permitted only with @@ -3054,11 +3056,11 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, addresses. */ symbol = 0; else if (info->shared - && !info->no_undefined + && info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; - else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 || - strcmp (h->root.root.root.string, "_DYNAMIC_LINKING") == 0) + else if (strcmp (*namep, "_DYNAMIC_LINK") == 0 || + strcmp (*namep, "_DYNAMIC_LINKING") == 0) { /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol or _DYNAMIC_LINKING(for normal mips) symbol @@ -3075,7 +3077,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - (!info->shared || info->no_undefined + ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) + || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR) || ELF_ST_VISIBILITY (h->root.other))))) return bfd_reloc_undefined; symbol = 0; @@ -4053,6 +4056,10 @@ _bfd_elf_mips_mach (flags) case E_MIPS_ARCH_32R2: return bfd_mach_mipsisa32r2; break; + + case E_MIPS_ARCH_64R2: + return bfd_mach_mipsisa64r2; + break; } } @@ -7189,6 +7196,10 @@ mips_set_isa_flags (abfd) case bfd_mach_mipsisa32r2: val = E_MIPS_ARCH_32R2; break; + + case bfd_mach_mipsisa64r2: + val = E_MIPS_ARCH_64R2; + break; } elf_elfheader (abfd)->e_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH); elf_elfheader (abfd)->e_flags |= val; @@ -7474,7 +7485,7 @@ _bfd_mips_elf_modify_segment_map (abfd) unsigned int i, c; struct elf_segment_map *n; - low = 0xffffffff; + low = ~(bfd_vma) 0; high = 0; for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++) { @@ -8926,6 +8937,7 @@ struct mips_mach_extension { static const struct mips_mach_extension mips_mach_extensions[] = { /* MIPS64 extensions. */ + { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 }, { bfd_mach_mips_sb1, bfd_mach_mipsisa64 }, /* MIPS V extensions. */ @@ -9272,6 +9284,8 @@ _bfd_mips_elf_print_private_bfd_data (abfd, ptr) fprintf (file, _(" [mips64]")); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2) fprintf (file, _(" [mips32r2]")); + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2) + fprintf (file, _(" [mips64r2]")); else fprintf (file, _(" [unknown ISA]")); @@ -9293,18 +9307,11 @@ _bfd_mips_elf_print_private_bfd_data (abfd, ptr) struct bfd_elf_special_section const _bfd_mips_elf_special_sections[]= { - { ".sdata", 0, NULL, 0, - SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".sbss", 0, NULL, 0, - SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".lit4", 0, NULL, 0, - SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".lit8", 0, NULL, 0, - SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".ucode", 0, NULL, 0, - SHT_MIPS_UCODE, 0 }, - { ".mdebug", 0, NULL, 0, - SHT_MIPS_DEBUG, 0 }, - { NULL, 0, NULL, 0, - 0, 0 } + { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 }, + { ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 }, + { NULL, 0, 0, 0, 0 } };