aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
AgeCommit message (Collapse)AuthorFilesLines
2000-12-12Fix formatting.Nick Clifton1-21/+40
2000-12-09Pass dwarf2_find_line_info as last parameter to invocation ofNick Clifton1-1/+2
_bfd_dwarf2_find_nearest_line.
2000-12-08Generalize DWARF2 and COFF support.Nick Clifton1-1/+1
2000-12-072000-12-06 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-0/+23
From Ralf Baechle <ralf@gnu.org> * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit BFDs containing no sections or empty .text, .data or .bss sections to be merged, regardless of their flags.
2000-12-02Add MIPS SB1 machineNick Clifton1-0/+7
2000-12-02Add MIPS V and MIPS 64 machine numbersNick Clifton1-0/+24
2000-12-01Add MIPS32 as a seperate MIPS architectureNick Clifton1-10/+21
2000-11-292000-11-28 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-434/+414
* elf32-mips.c: Fix formatting.
2000-10-142000-10-13 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-8/+9
From Ralf Baechle <ralf@gnu.org> * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument local_p. Add symbol value only for non-R_MIPS_REL32 relocations against local symbols. (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01.
2000-10-022000-10-01 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-1/+1
From Ralf Baechle <ralf@gnu.org> * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld produces binaries with got[1] = 0x80000001 to differenciate them for the dynamic linker from the broken binaries produced by old versions.
2000-09-14Add support for the MIPS32Nick Clifton1-0/+7
2000-07-232000-07-23 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-2/+2
* elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead of dynobj for SGI_COMPAT checks.
2000-07-21Detect and report corrupt relocsNick Clifton1-0/+7
2000-07-202000-07-19 H.J. Lu <hjl@gnu.org>H.J. Lu1-0/+1
* elf32-arm.h (elf32_arm_size_dynamic_sections): Also set DF_TEXTREL if DT_TEXTREL is set. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. * bfd/elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if DT_RPATH is set. Set the DT_FLAGS and DT_FLAGS_1 entries if necessary.
2000-07-182000-07-18 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-2/+3
* elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add paranthesis in if statement.
2000-07-172000-07-17 Koundinya K <kk@ddeorg.soft.net>Ulf Carlsson1-150/+220
Enable the support for Traditional MIPS. * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand return ict_none appropriately for traditional mips targets. (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips. (STUB_MOVE): Conditionalize for traditonal mips. (STUB_LI16): Likewise. (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making room for RTPROC header. (_bfd_mips_elf_modify_segment_map): For a normal mips executable set the permission for the PT_DYNAMIC as read, write and execute. (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING for traditonal mips. (_bfd_mips_elf_create_dynamic_sections): Add the symbol _DYNAMIC_LINKING for traditonal mips. (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP in case of traditonal mips. (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT entry is required. For a function if PLT is not required then set the corresponding hash table entry to 0. (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for traditonal mips. (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a shared object set the value to 0. (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol _DYNAMIC_LINKING for traditonal mips. (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP for traditonal mips.
2000-07-11The MIPS thinks that addresses are signed. Sign extend MIPS ECOFFAndrew Cagney1-1/+1
addresses.
2000-07-092000-07-09 Koundinya K <kk@ddeorg.soft.net>Ulf Carlsson1-0/+42
* elf32-mips.c (sort_dynamic_relocs): New Function. (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs via qsort to sort the dynamic relocations in increasing r_symndx value.
2000-07-032000-07-03 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-0/+17
* elf32-mips.c: Include elf32-target.h again for the traditional MIPS targets.
2000-06-202000-06-20 Maciej W. Rozycki <macro@ds2.pg.gda.pl>Ulf Carlsson1-1/+24
* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function. (elf_backend_copy_indirect_symbol): Map to the new function.
2000-06-202000-06-20 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-67/+147
* elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual sections elf_{text,data}_{section,symbol}. * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove. (_bfd_mips_elf_hide_symbol): New function. (elf_backend_hide_symbol): Map to the new function. (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD definitions of mips_elf_{text,data}_{section,symbol}. (mips_elf_local_relocation_p): Try to find the direct symbol based on new check_forced argument. (mips_elf_calculate_relocation): Use new version of mips_elf_local_relocation_p. (mips_elf_relocate_section): Likewise. (_bfd_mips_elf_relocate_section): Likewise. (mips_elf_sort_hash_table): Only assert that have enough GOT space. (mips_elf_got16_entry): Match all 32 bits to the existing GOT entry if the relocation based on the new external argument. (mips_elf_create_dynamic_relocation): Assert that we have a section contents allocated where we can swap out the dynamic relocations. (mips_elf_calculate_relocation): Find the real hash-table entry correctly by using h->root.root.type. Only create a dynamic relocation entry if the symbol is defined in a shared library. Create an external GOT entry for the GOT16 relocation if the symbol was forced local. (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a dynamic index if the symbol was forced local. 2000-06-20 Maciej W. Rozycki <macro@ds2.pg.gda.pl> * elf32-mips.c: Fix typos in comments.
2000-06-172000-06-17 Ulf Carlsson <ulfc@engr.sgi.com>Ulf Carlsson1-0/+13
* elf32-mips.c (mips_elf_calculate_relocation): Explicitly write GOT entries if we're doing a static link or -Bsymbolic link.
2000-05-232000-05-23 H.J. Lu <hjl@gnu.org>H.J. Lu1-2/+2
* elf32-mips.c (mips_elf_calculate_relocation): Check h->root.other not h->other. * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo.
2000-05-232000-05-23 H.J. Lu <hjl@gnu.org>H.J. Lu1-2/+4
* elf32-i386.c (elf_i386_relocate_section): Don't allow the undefined symbol with the non-default visibility attributes. * elf-hppa.h (elf_hppa_relocate_section): Likewise. * elf32-arm.h (elf32_arm_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-mips.c (mips_elf_calculate_relocation): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2000-05-22Use bfd_generic_verify_endian_match() and fix it to only check when endiannessNick Clifton1-15/+2
is known.
2000-04-13Remove U suffix from constants for K&R compilers.Alan Modra1-4/+4
Fix a couple of 64 bit nits.
2000-04-11Fit 64-bit nits.Alan Modra1-1/+1
2000-03-11* elf32-mips.c (_bfd_mips_elf_relocate_section): Do properGeoffrey Keating1-4/+45
sign-extension and big-endian compensation for R_MIPS_64 even in ld -r.
2000-03-11In bfd/:Geoffrey Keating1-15/+149
* elf32-mips.c (mips_elf_next_relocation): Rename from mips_elf_next_lo16_relocation, and generalize to look for any relocation type. (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset. (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16. (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16. (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2. (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64. (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32. (bfd_elf32_bfd_reloc_type_lookup): Add new relocs. (mips_rtype_to_howto): Likewise. (mips_elf_calculate_relocation): Handle new relocs. (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs are paired. The addend for R_MIPS_GNU_REL16_S2 is shifted right two bits. In gas/: * config/tc-mips.c (mips_ip): Don't put stuff in .rodata when embedded-pic. * config/tc-mips.c (SWITCH_TABLE): The ELF embedded-pic implementation doesn't have special handling for switch statements. (macro_build): Allow for code in sections other than .text. (macro): Likewise. (mips_ip): Likewise. (md_apply_fix): Do pc-relative relocation madness for MIPS ELF. Don't perform relocs if we will be outputting them. (tc_gen_reloc): For ELF, just use fx_addnumber for pc-relative relocations. Allow BFD_RELOC_16_PCREL_S2 relocs when embedded-pic. In gas/testsuite/: * gas/mips/empic.d: New file. * gas/mips/empic.s: New file. * gas/mips/mips16-e.d: New file. * gas/mips/mips16-e.s: New file. * gas/mips/mips16-f.d: New file. * gas/mips/mips16-f.s: New file. * gas/mips/mips.exp: Add empic, mips16-e. Add mips16-f as an expected failure. In include/elf: * mips.h: Add R_MIPS_GNU_REL_HI16, R_MIPS_GNU_REL_LO16, R_MIPS_GNU_REL16_S2, R_MIPS_PC64 and R_MIPS_PC32 relocation numbers.
2000-03-01Fix building with --enable-targets=allNick Clifton1-5/+7
2000-03-012000-03-01 H.J. Lu <hjl@gnu.org>H.J. Lu1-5/+8
* aoutx.h (aout_link_input_section_std): Pass "true" to the undefined_symbol callback. (aout_link_input_section_ext): Likewise. * bout.c (get_value): Likewise. * coff-a29k.c (coff_a29k_relocate_section): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_conten): Likewise. (alpha_relocate_section): Likewise. * coff-arm.c (coff_arm_relocate_section): Likewise. * coff-i960.c (coff_i960_relocate_section): Likewise. * coff-mcore.c (coff_mcore_relocate_section): Likewise. * coff-mips.c (mips_relocate_section): Likewise. * coff-ppc.c (coff_ppc_relocate_section): Likewise. * coff-sh.c (sh_relocate_section): Likewise. * coff-tic80.c (coff_tic80_relocate_section): Likewise. * cofflink.c (_bfd_coff_generic_relocate_section): Likewise. * elf-m10200.c (mn10200_elf_relocate_section): Likewise. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. * elflink.h (elf_link_output_extsym): Likewise. * pe-mips.c (coff_pe_mips_relocate_section): Likewise. * reloc.c (bfd_generic_get_relocated_section_conten): Likewise. * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise. * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the undefined_symbol callback when building shared library with -Bsymbolic and undefined symbols are allowed. Otherwise, pass "true". * elf32-arm.h (elf32_arm_relocate_section): Likewise. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mips.c (mips_elf_calculate_relocation): Likewise. (elf32_mips_get_relocated_section_content): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2000-02-13 * section.c (_bfd_strip_section_from_output): Add info parameter.Ian Lance Taylor1-1/+1
If it passed as non-NULL, use it to check whether any input BFD has an input section which uses this output section. Change all callers. * bfd-in2.h: Rebuild. * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of 1999-11-29. * bfd-in2.h: Rebuild.
1999-12-03 * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16Ian Lance Taylor1-0/+1
value by 4 before storing it back in the field. From Koundinya. K <kk@ddeorg.soft.net>.
1999-11-18 * elf-bfd.h (struct elf_backend_data): Reorder collect andRichard Henderson1-0/+1
type_change_ok; add sign_extend_vma. * elf32-mips.c (elf_backend_sign_extend_vma): Define. * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma. (elf_swap_shdr_in, elf_swap_phdr_in): Likewise. * elfxx-target.h (elf_backend_sign_extend_vma): Default. (elfNN_bed): Follow struture changes.
1999-10-08* elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERALGeoffrey Keating1-37/+21
relocs also need the GP value. (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs properly. Handle sign-extension for R_MIPS_64 correctly. Correct the GP value for R_MIPS_LITERAL relocs too. Handle R_MIPS_64 relocs properly on big-endian MIPS. (mips_elf_sign_extend): Behave properly with 'long long'. (mips_elf_highest): Correct typo.
1999-09-28* elf32-mips.c (mips_elf_relocate_hi16): Unused, delete.Geoffrey Keating1-126/+0
(mips_elf_relocate_got_local): Unused, delete. (mips_elf_relocate_global_got): Unused, delete.
1999-08-27 * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate localMark Mitchell1-6/+12
GOT entries for GOT16 relocations; they're not required.
1999-08-17 * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMICIan Lance Taylor1-2/+2
for special section symbols. * elflink.h (elf_merge_symbol): If we have no old BFD, check BSF_DYNAMIC on the section symbol to see whether the old BFD is dynamic.
1999-08-15 * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunateMark Mitchell1-2/+2
coincidence of variable names between old and new code.
1999-08-10 * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): AlwaysMark Mitchell1-14/+19
output DT_MIPS_GOTSYM. (_bfd_mips_elf_finish_dynamic_sections): Use the same value as DT_MIPS_SYMTABNO if there are no global GOT symbols.
1999-08-10 * elf32-mips.c (mips_elf_create_dynamic_relocation): ChangeMark Mitchell1-54/+126
prototype. Handle local symbols. Add commentary. (mips_elf_calculate_relocation): Adjust accordingly. (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32 relocations.
1999-08-09 * elf32-mips.c (elf_mips_howto_table): Fix src_mask forMark Mitchell1-3/+7
R_MIPS_GOT16 and R_MIPS_CALL16. (mips_elf_got16_entry): Use mips_elf_high to calculate the value to use wheen looking for a preexisting GOT entry.
1999-08-06 * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index byMark Mitchell1-9/+13
the size of a GOT entry here. (mips_elf_calculate_relocation): Don't create a local GOT entry for the symbol in a GOT16 relocation; just for it's high-order bit (_bfd_mips_elf_relocate_section): Fix thinko.
1999-08-04 * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16Mark Mitchell1-7/+15
handling for REL relocations. And only left-shift R_MIPS26 relocation addends where necessary.
1999-08-04 * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ...Mark Mitchell1-17/+23
(mips_elf_next_lo16_relocation): Don't compute the addend here. Just return the relocation found. (mips_elf_relocate_section): Pull the LO16 addend out of the section itself when using REL relocations.
1999-08-03 * elf32-mips.c (mips_elf_calculate_relocation): RestoreMark Mitchell1-0/+13
_DYNAMIC_LINK handling and handling of undefined symbols in shared libraries.
1999-08-03Fix typoMark Mitchell1-1/+1
1999-08-03 * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26Mark Mitchell1-9/+21
and R_MIPS16_26 relocations correctly when relocating. (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 and R_MIPS_CALL_LO16 are for global symbols.
1999-08-01Fix typoMark Mitchell1-6/+4
1999-08-01 * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case whereMark Mitchell1-6/+16
there are no global symbols requiring GOT entries. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise.