aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
AgeCommit message (Collapse)AuthorFilesLines
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.
1999-08-01 * elf32-mips.c (mips_elf_calculate_relocation): Undefined weakMark Mitchell1-8/+17
symbols are considered to have the value zero. (_bfd_mips_elf_relocate_section): Don't try to perform a relocation for an undefined symbol. (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local GOT16 relocations.
1999-07-29 * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms ifRichard Henderson1-1/+1
dynamic_sections_created.
1999-07-29 * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ...Richard Henderson1-14/+25
(mips_rtype_to_howto): ... new function. (_bfd_mips_elf_relocate_section): Use it.
1999-07-28 * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo.Mark Mitchell1-1/+1
1999-07-21 * elf32-mips.c (mips_elf_calculate_relocation): Get the GP valueIan Lance Taylor1-0/+1
when looking at a R_MIPS_GOT16 relocation.
1999-07-19Fix typo in last change.Mark Mitchell1-11/+9
1999-07-19 * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GPMark Mitchell1-11/+33
removed in previous change. (_bfd_mips_elf_relocate_section): Adjust GP relative relocations in relocateable output.
1999-07-18 * elflink.h (elf_link_adjust_relocs): New function.Mark Mitchell1-22/+62
(elf_bfd_final_link): Use it. (elf_link_input_bfd): Deal with the fact that there can be two relocation sections for a single section. (elf_reloc_link_order): Likewise. * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for a relocateable object. (_bfd_mips_elf_relocate_section): Handle relocateable links.
1999-07-16 * elf32-mips.c (mips_elf_local_relocation_p): New staticIan Lance Taylor1-21/+55
function. (mips_elf_next_lo16_addend): Call bfd_set_error on failure. (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p. Always set *require_jalxp. (mips_elf_stub_section_p): Mark abfd parameter as unused. (_bfd_mips_elf_relocate_section): Only look for LO16 following GOT16 if the GOT16 is against a local symbol. Don't return false for an undefined symbol. If there is an overflow, assert that we have a name.
1999-07-15 * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't requireMark Mitchell1-11/+23
a PT_PHDR program headers. (_bfd_mips_elf_final_link): Don't assume there are going to be section symbols when we're not building a shared object. (_bfd_mips_elf_check_relocs): Make sure we have a GOT when we need one.
1999-07-15 * elf32-mips.c (mips_elf_stub_section_p): New function.Mark Mitchell1-14/+150
(mips_elf_calculate_relocation): Handle MIPS16 stub functions. (mips_elf_relocate_section): Adjust calling sequence for mips_elf_calculate_relocation and mips_elf_perform_relocation. (mips_elf_perform_relocation): Turn `jal' into `jalx' where required.
1999-07-14 * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves ofMark Mitchell1-14/+12
things relocated by R_MIPS16_GPREL. (mips_elf_perform_relocation): Likewise.
1999-07-14 * elf32-mips.c (struct mips_got_info): Add global_gotno.Richard Henderson1-5/+36
(_bfd_mips_elf_size_dynamic_sections): Set it. (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow. (mips_elf_sort_hash_table): Set max_non_got_dynindex based off new argument max_local.
1999-07-14 * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bitMark Mitchell1-2/+8
subwords when handling an R_MIPS16_26 relocation. (mips_elf_perform_relocation): Don't be paranoid abour right-shift semantics.
1999-07-14 * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask andMark Mitchell1-41/+42
dst_mask to match reality. (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL. (mips_elf_obtain_contents): Use bfd_get. (mips_elf_perform_relocation): Handle R_MIPS16_GPREL. (mips_elf_relocate_section): Likewise.
1999-07-13 * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26.Mark Mitchell1-35/+100
(mips_elf_relocate_section): Adjust calling sequence for mips_elf_perform_relocation. (mips_elf_perform_relocation): Take additional argument. Handle R_MIPS16_26. Use bfd_put for convenience.
1999-07-13 * elf-bfd.h (struct elf_link_local_dynamic_entry): New.Richard Henderson1-63/+10
(struct elf_link_hash_table): Add dynlocal. (_bfd_elf_link_lookup_local_dynindx): Prototype. (_bfd_elf_link_adjust_dynindx): Delete. (_bfd_elf_link_renumber_dynsyms): Prototype. (_bfd_elf,link_record_local_dynamic_symbol): Prototype. * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. (_bfd_elf_link_lookup_local_dynindx): New function. (elf_link_renumber_hash_table_dynsyms): New function. (_bfd_elf_link_renumber_dynsyms): New function. * elflink.h (elf_link_record_local_dynamic_symbol): New function. (struct elf_assign_sym_version_info): Delete removed_dynamic. (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output instead of elf_link_remove_section_and_adjust_dynindices. Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. (elf_link_assign_sym_version): Remove removed_dynamic code. (elf_link_renumber_dynsyms): Delete. (elf_bfd_final_link): Install section and local symbols into .dynsym. * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. (elf_m68k_size_dynamic_sections): Don't set section dynindicies. (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. * elf32-mips.c: Similarly. * elf32-ppc.c: Similarly. * elf32-sparc.c: Similarly. * elf64-alpha.c: Similarly. * elf64-sparc.c: Similarly.
1999-07-13 * elf32-mips.c (mips_elf_calculate_relocation): Do not complainMark Mitchell1-6/+23
when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow when the relocation is against _gp_disp.
1999-07-12 * dwarf2.c (read_attribute): Support DW_FORM_ref8.Mark Mitchell1-26/+84
* elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs to possibly_dynamic_relocs. Adjust usage throughout code. (elf_mips_howto_table): Handle R_MIPS_64 correctly. (elf_mips_ctor64_howto): Likewise. (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. Adjust indentation. (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. * elf64-mips.c (elf_backend_may_use_rel_p): Define.