aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
AgeCommit message (Collapse)AuthorFilesLines
2001-09-21Fix compile time warningsNick Clifton1-2/+10
2001-09-20 * bfd.c (bfd_archive_filename): New function.Alan Modra1-17/+11
* bfd-in2.h: Regenerate. * aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename in error messages where the bfd is an input bfd. * aout-cris.c: Likewise. * coff-arm.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * ecofflink.c: Likewise. * elf-hppa.h: Likewise. * elf.c: Likewise. * elf32-arm.h: Likewise. * elf32-cris.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-sparc.c: Likewise. * elf32-v850.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peicode.h: Likewise. * srec.c: Likewise. * xcofflink.c: Likewise. * elf32-arm.h: Make _bfd_error_handler calls K&R compatible. * elflink.c (_bfd_elf_create_linker_section): Better grammar for error message. * coff-mcore.c (coff_mcore_relocate_section): Internalionalise error message. * elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types. Consolidate error messages, and split long messages to two lines.
2001-09-20coordinate info->symbolic and info->allow_shlib_undefinedNick Clifton1-1/+3
2001-09-18Touches most files in bfd/, so likely will be blamed for everything..Alan Modra1-193/+189
o bfd_read and bfd_write lose an unnecessary param and become bfd_bread and bfd_bwrite. o bfd_*alloc now all take a bfd_size_type arg, and will error if size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files or bugs in linker scripts etc. o file_ptr becomes a bfd_signed_vma. Besides matching sizes with various other types involved in handling sections, this should make it easier for bfd to support a 64 bit off_t on 32 bit hosts that provide it. o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*) generally available. They now cast their args to bfd_vma and bfd_byte * as appropriate, which removes a swag of casts from the source. o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and aout-encap.c. o Zillions of formatting and -Wconversion fixes.
2001-09-07 * elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handlingThiemo Seufer1-1/+1
of R_MIPS_PC16. * config/tc-mips.c (append_insn): Handle BFD_RELOC_16_PCREL. (macro_build): Use BFD_RELOC_16_PCREL_S2 only for embedded PIC, BFD_RELOC_16_PCREL for the rest. (mips_ip): Likewise. (md_pcrel_from): return the right offset for the differently shifted pcrel relocs. (md_apply_fix): Handle BFD_RELOC_16_PCREL. * gas/mips/beq.d: Check branches to external labels. * gas/mips/beq.s: Likewise. * gas/mips/bge.d: Likewise. * gas/mips/bge.s: Likewise. * gas/mips/bgeu.d: Likewise. * gas/mips/bgeu.s: Likewise. * gas/mips/blt.d: Likewise. * gas/mips/blt.s: Likewise. * gas/mips/bltu.d: Likewise. * gas/mips/bltu.s: Likewise. * gas/mips/elempic.d: Switch from R_MIPS_GNU_REL16_S2 to R_MIPS_PC16. * gas/mips/empic.d: Likewise. * gas/mips/empic.s: Likewise. * gas/mips/telempic.d: Likewise. * gas/mips/tempic.d: Likewise.
2001-08-312001-08-31 H.J. Lu <hjl@gnu.org>H.J. Lu1-2/+9
* elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename with bad relocation.
2001-08-312001-08-31 Eric Christopher <echristo@redhat.com>Eric Christopher1-17/+9
Jason Eckhardt <jle@redhat.com> * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32, mips32_4k and mips64. * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. * bfd/cpu-mips.c: Ditto. * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. * bfd/bfd-in2.h: Regenerate.
2001-08-302001-08-30 H.J. Lu <hjl@gnu.org>H.J. Lu1-5/+5
* elf32-mips.c (mips_elf_calculate_relocation): Revert the last 2 changes. (_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic relocations for weak definitions.
2001-08-302001-08-30 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+2
* elf32-mips.c (mips_elf_calculate_relocation): Don't create dynamic relocation for undefined weak symbols when creating executables. Check h->root.root.type, instead of h->root.type.
2001-08-272001-08-27 H.J. Lu <hjl@gnu.org>H.J. Lu1-2/+5
* elf32-mips.c (mips_elf_create_dynamic_relocation): Add more sanity check. (mips_elf_calculate_relocation): Create dynamic relocation for symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR bit is not set.
2001-08-272001-08-27 H.J. Lu <hjl@gnu.org>H.J. Lu1-5/+17
* elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype. (_bfd_mips_elf_copy_indirect_symbol): Likewise. (_bfd_elf32_mips_grok_prstatus): Likewise. (_bfd_elf32_mips_grok_psinfo): Likewise. (_bfd_mips_elf_hide_symbol): Make it static and cast to `struct mips_elf_link_hash_entry *'. (_bfd_mips_elf_copy_indirect_symbol): Make it static.
2001-08-25 * elf32-mips.c (elf_mips_abi_name): Return the right ABI string forThiemo Seufer1-6/+6
E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64
2001-07-042001-07-04 H.J. Lu <hjl@gnu.org>H.J. Lu1-0/+3
* bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4400, bfd_mach_mips4600 and bfd_mach_mips5000.
2001-06-30 * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directlyAlan Modra1-9/+6
instead of _bfd_elfcore_section_from_phdr. * elf-bfd.h (_bfd_elfcore_section_from_phdr): Remove. * elf.c (_bfd_elfcore_section_from_phdr): Remove. (_bfd_elfcore_make_pseudosection): Expedite tail-call. (elfcore_grok_prstatus): Likewise. (elfcore_grok_lwpstatus): Likewise. (bfd_get_elf_phdr_upper_bound): Likewise. (elfcore_make_note_pseudosection): Formatting. (_bfd_elfcore_strndup): Formatting. * elf32-mips.c (mips_elf_sym_is_global): Formatting. (_bfd_elf32_mips_grok_prstatus): Expedite tail-call.
2001-06-30 * elf-bfd.h: Add prototypes for _bfd_elfcore_make_pseudosectionAlan Modra1-0/+69
and _bfd_elfcore_strndup. (struct elf_backend_data): Add elf_backend_grok_prstatus and elf_backend_grok_psinfo. * elf.c (_bfd_elfcore_make_pseudosection): New function. (elfcore_grok_prstatus): Use it. (elfcore_make_note_pseudosection): Likewise. (elfcore_strndup): Rename to... (_bfd_elfcore_strndup): Here, and make global. (elfcore_grok_psinfo): Use _bfd_elfcore_strndup. (elfcore_grok_note): Call elf_backend_grok_prstatus and elf_backend_grok_psinfo if available. * elf32-mips.c (_bfd_elf32_mips_grok_prstatus): New function. (_bfd_elf32_mips_grok_psinfo): New function. (elf_backend_grok_prstatus): Define. (elf_backend_grok_psinfo): Define. * elfxx-target.h (elf_backend_grok_prstatus): Default to NULL. (elf_backend_grok_psinfo): Likewise. (elfNN_bed): Include elf_backend_grok_prstatus and elf_backend_grok_psinfo.
2001-06-172001-06-17 H.J. Lu <hjl@gnu.org>H.J. Lu1-8/+37
* elf32-mips.c (mips_elf_link_hash_entry): Add a new field, readonly_reloc, to record if a relocation in the .rel.dyn section is against a read-only section. (mips_elf_link_hash_newfunc): Initialize the readonly_reloc field to false. (_bfd_mips_elf_check_relocs): Record if there is a relocation in the .rel.dyn section against a read-only section by setting DF_TEXTREL or readonly_reloc. (_bfd_mips_elf_copy_indirect_symbol): Copy readonly_reloc if it is true. (_bfd_mips_elf_adjust_dynamic_symbol): Record DF_TEXTREL if there is a relocation in the .rel.dyn section against a read-only section. (_bfd_mips_elf_size_dynamic_sections): Set DT_TEXTREL if DF_TEXTREL is set.
2001-06-10 * elflink.h: Whitespace changes.Alan Modra1-1/+1
(elf_link_read_relocs_from_section): Use "unsigned int" iterator rather than "unsigned char". (elf_link_output_relocs): Likewise. (elf_link_input_bfd): Likewise. (elf_reloc_link_order): LIkewise. * elf.c: s/CONST/const/. Whitespace changes. * elf32-mips.c: Formatting fix. * Makefile.am (SOURCE_HFILES): Include xcoff-target.h, remove xcoff.h. * Makefile.in: Regenerate. * po/Make-in: Remove trailing tab.
2001-06-072001-06-07 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+2
* elf32-mips.c (_bfd_mips_elf_object_p): Set the bad symtab for SGI only. * config.bfd: Remove ecoff from Linux/mips.
2001-05-23Add MIPS r12k supportNick Clifton1-1/+3
2001-05-23Replace sh_size/sh_entsize with NUM_SHDR_ENTRIESNick Clifton1-5/+4
2001-05-08Remove extraneous character in first line.Ian Lance Taylor1-1/+1
2001-05-07 * ecoff.c (bfd_debug_section): Fix initialization.Alan Modra1-5/+5
* elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it is always a positive integer. Cast away sign mismatch. * elf32-mips.c: Fix misleading comment and typo. (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use correct data type. * elflink.c: Fix typo. (_bfd_elf_create_dynamic_sections): Remove superfluous initialization. * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch.
2001-04-302000-04-27 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+2
* elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1 only for ELF_LINK_FORCED_LOCAL. * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise. * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL if the symbol has hidden or internal visibility.
2001-04-24Add OpenRISC supportNick Clifton1-2/+9
2001-04-082001-04-05 Steven J. Hill <sjhill@cotw.com>H.J. Lu1-4/+14
* config.bfd (mips*el*-*-linux-gnu*): Use traditional little endian MIPS ELF target. * config.bfd (mips*-*-linux-gnu*): Use traditional big endian MIPS ELF target. * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional 64bit big endian MIPS ELF target. (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little endian MIPS ELF target. * configure: Regenerated. * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and little endian targets. (mips_elf_sym_is_global): Handle traditional targets. * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional 64bit big endian MIPS ELF target. (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little endian MIPS ELF target. * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec and bfd_elf64_tradlittlemips_vec.
2001-03-222001-03-21 Diego Novillo <dnovillo@redhat.com>Diego Novillo1-2/+5
(_bfd_mips_elf_relocate_section): Give a better error message when a relocation is not recognized.
2001-03-08Update copyright noticesNick Clifton1-1/+1
2001-02-11Apply several patches from Maciej W. RozyckiNick Clifton1-36/+77
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.