Commit Graph

374 Commits

Author SHA1 Message Date
Alan Modra 8ad3436c79 Move translated part of bug report string back into .c files so
xgettext can find it.  Regnerate .pot files.
2000-04-04 14:32:35 +00:00
Alan Modra 41b49281c1 Use "gcc -MM" for dependencies, and update them. 2000-04-04 10:53:56 +00:00
Kevin Buettner 653f71caaf AIX 4.3 changes 2000-04-03 21:48:31 +00:00
Ian Lance Taylor 9e422a2e27 2000-04-03 H.J. Lu <hjl@gnu.org>
* cache.c (bfd_open_file): Unlink the output file only if
	it has none zero size.
2000-04-03 19:19:11 +00:00
Alan Modra c555c5c58e Don't emit relative relocations for non-loaded sections in shared objects.
Fix for DWARF-2 sections .debug_info and .debug_line.
2000-04-03 12:42:18 +00:00
Hans-Peter Nilsson 1642229ef3 * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and
BFD_RELOC_16 to switch for extended relocs.
	(MY_swap_ext_reloc_in): New.
	(MY_swap_ext_reloc_out): New.
	(NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather
	than NAME(aout,swap_ext_reloc_in) for extended relocs.
	(NAME(aout,squirt_out_relocs)): Similarly use
	MY_swap_ext_reloc_out.
	(aout_link_reloc_link_order): Use MY_put_ext_reloc if defined.
2000-04-03 11:44:45 +00:00
Jeff Law 4259e8b62b * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to
the R_PCRWORD_B case.
2000-04-03 06:55:06 +00:00
Alan Modra 65d7f9a691 Set CHUNK size to 16 bytes to prevent download failures on lame targets. 2000-03-30 23:49:07 +00:00
Doug Evans 8b125cdefa * elf32-m32r.c (m32r_elf_generic_reloc): new function. All
HOWTO references to bfd_elf_generic_reloc, that have
	partial_inplace == true, now use the new function.  The function
	is based on the recent rewrite of m32r_elf_lo16_reloc(), and
	extends its fixes to the R_M32R_{16,24,32} relocs.
	The new logic in m32r_elf_lo16_reloc() has been removed, and
	it instead calls the new routine to obtain that functionality.
2000-03-30 22:16:39 +00:00
Alan Modra adde6300e0 ATMEL AVR microcontroller support. 2000-03-27 08:39:14 +00:00
H.J. Lu cd6f9321da 2000-03-24 H.J. Lu <hjl@gnu.org>
* elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype.
	(elf64_alpha_find_reloc_at_ofs): Likewise.
2000-03-24 20:50:30 +00:00
Geoffrey Keating 4fb431855b Add missing parts of ChangeLog entry for my change of 2000/02/19 00:59:26 to coff-rs6000.c. 2000-03-23 23:37:38 +00:00
Alan Modra d5afc56eb1 Extend the allowed bitfield range (ie. that for which
complain_overflow_bitfield doesn't complain) from -2**(n-1)..2**n-1 to
-2**n..2**n.  This might mean that some reloc overflows are no longer
caught, but it solves the address wrap problem for 16-bit relocs
nicely.  In any case, ports that rely on complain_overflow_bitfield
for reloc overflow checking were not getting a very good check
previously.  A bitfield range in a machine instruction is typically
either the signed or unsigned n bit numbers, not the overlap of these
two ranges.
2000-03-17 02:02:38 +00:00
Catherine Moore 4c72e23a26 * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. 2000-03-14 18:16:05 +00:00
Jeff Law c4d5c859ba * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
of shrinks properly, including the last reloc.
2000-03-14 17:50:00 +00:00
Jeff Law 003e46d0ac * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
check for R_MOVL2.
2000-03-13 23:57:25 +00:00
Alan Modra 911c6daef6 Return bfd_error_wrong_format on a format mismatch. 2000-03-11 23:09:42 +00:00
Geoffrey Keating 7893e6a2a7 * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper
sign-extension and big-endian compensation for
R_MIPS_64 even in ld -r.
2000-03-11 02:23:10 +00:00
Geoffrey Keating bb2d6cd7b1 In bfd/:
* 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-11 02:16:25 +00:00
Alan Modra 88b6bae086 Fix typos in comments, and restore comment formatting destroyed by emacs at
some stage.
2000-03-11 01:16:52 +00:00
Doug Evans c1b7949f6e * reloc.c (reloc_howto_struct): Fix partial_inplace comment.
* bfd-in2.h: Rebuild.
2000-03-07 21:04:31 +00:00
Nick Clifton 11c8a8d1b7 fix LINK6 code. 2000-03-06 19:49:58 +00:00
Catherine Moore b47e35fc72 * elf.c (swap_out_syms): Check for null type_ptr. 2000-03-06 15:44:25 +00:00
Ian Lance Taylor 8ba8a4628f 2000-03-01 Hans-Peter Nilsson <hp@axis.com>
* aout-target.h (MY(write_object_contents)): Remove unused
	and unusable "#if CHOOSE_RELOC_SIZE".
	* pc532-mach.c (MY(write_object_contents)): Ditto.
	* netbsd.h (MY(write_object_contents)): Ditto.
	* hp300hpux.c (MY(write_object_contents)): Ditto.
	* freebsd.h (MY(write_object_contents)): Ditto.
	* aout-tic30.c (tic30_aout_write_object_contents): Ditto.
2000-03-02 01:38:33 +00:00
Nick Clifton 8603339400 Fix building with --enable-targets=all 2000-03-01 20:39:07 +00:00
H.J. Lu 5cc7c785d2 2000-03-01 H.J. Lu <hjl@gnu.org>
* 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-03-01 19:40:54 +00:00
Nick Clifton 17505c5cfa Add WinCE support. 2000-02-28 18:56:11 +00:00
Ian Lance Taylor 37fb6db111 2000-02-27 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump
	architecture if the object causing the bump is dynamic.
	* elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise,
	and also don't it for memory ordering.
	(sparc64_elf_write_relocs): Take src_rela out of the loop.
2000-02-28 03:50:32 +00:00
Ian Lance Taylor 67d83c76c5 * dwarf2.c (read_abbrevs): Use _raw_size directly rather than
calling bfd_get_section_size_before_reloc.
	(decode_line_info): Likewise.
	(_bfd_dwarf2_find_nearest_line): Likewise.
2000-02-28 03:39:28 +00:00
Ian Lance Taylor e56f75e906 2000-02-27 Eli Zaretskii <eliz@is.elta.co.il>
* Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the
	name of the libtool directory.
	* Makefile.in: Rebuild.
2000-02-27 17:08:06 +00:00
Jeff Law 36e89602d2 * som.c (SOM_HOWTO): Define.
(som_hppa_howto_table): Use it.
2000-02-26 01:45:22 +00:00
Alexandre Oliva 9d23b7fed1 * config.bfd: Enable 64 bit support for GNU/Linux/sparc. 2000-02-25 19:39:00 +00:00
Alexandre Oliva 246c66877d * config.bfd: Enable 64 bit support for Solaris7+/sparc. 2000-02-25 19:18:17 +00:00
Catherine Moore ba20314ec2 * som.c (som_misc_symbol_info): Add field
secondary_def.
        (som_bfd_derive_misc_symbol_info):  Initialize
        secondary_def.
        (som_build_and_write_symbol_table): Keep track
        of secondary_def field.
        (som_slurp_symbol_table): Set BSF_WEAK symbol flag
        if secondary_def field is set.
        (som_bfd_ar_write_symbol_stuff): Initialize
        secondary_def.
2000-02-24 13:41:02 +00:00
Nick Clifton ecb651f0ab Accept 16-bit addresses. 2000-02-23 22:27:55 +00:00
Alan Modra 5b93d8bb51 Add IBM 370 support. 2000-02-23 13:52:23 +00:00
Ian Lance Taylor 1287d1cc37 2000-02-22 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): If a version symbol is
	not defined, don't add a second ELF_VER_CHR.
2000-02-22 08:06:01 +00:00
Ian Lance Taylor a432cc3d1c * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for
invalid relocation types, and change them to R_386_NONE.
2000-02-22 05:52:59 +00:00
Alan Modra f6af82bd44 This lot mainly cleans up `comparison between signed and unsigned' gcc
warnings.  One usused var, and a macro parenthesis fix too.  Also check
input sections are elf when doing gc in elflink.h.
2000-02-21 12:01:27 +00:00
Ian Lance Taylor 494e2c585a ELF HPPA doesn't work at present; remove it until it does.
* config.bfd: Comment out setting targ_defvec to
	bfd_elf32_hppa_vec.
	* Makefile.am: Rebuild dependencies.
	(BFD32_BACKENDS): Remove elf32-hppa.lo.
	(BFD32_BACKENDS_CFILES): Remove elf32-hppa.c.
	(SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h.
	* Makefile.in: Rebuild.
	* targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec.
2000-02-21 05:33:40 +00:00
Geoffrey Keating 2fca4467d0 * coffcode.h (coff_set_arch_mach_hook): Use free(), because there
is no bfd_free().  Revert bfd_free part of previous change.
2000-02-19 01:11:19 +00:00
Geoffrey Keating 5ea1af0d5d * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size
arrays.
(coff_compute_section_file_positions): Use bfd_free to pair
bfd_malloc.
(coff_write_object_contents): Likewise.

* coff-rs6000.c (xcoff_howto_table_16): New variable.
(xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs.
2000-02-19 00:59:26 +00:00
Richard Henderson c61b871721 * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect
and hide_symbol members.
        (elf_link_hash_copy_indirect): Remove.
        (elf_link_hash_hide_symbol): Remove.
        (struct elf_backend_data): Add elf_backend_copy_indirect_symbol
        and elf_backend_hide_symbol.
        (_bfd_elf_link_hash_copy_indirect): Declare.
        (_bfd_elf_link_hash_hide_symbol): Declare.
        * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
        (_bfd_elf_link_hash_hide_symbol): Likewise.
        (_bfd_elf_link_hash_table_init): Don't init killed members.
        * elflink.h (elf_link_add_object_symbols): Use the bed function
        pointers not elf_link_hash_{copy_indirect,hide_symbol}.
        (elf_link_assign_sym_version): Likewise.
        * elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
        (elf_backend_hide_symbol): Likewise.
        (elfNN_bed): Update for new members.
2000-02-18 09:23:06 +00:00
Kevin Buettner 6ad49cca4c AIX 4.3 core dump changes. 2000-02-17 09:01:28 +00:00
Joern Rennecke d4845d5762 bfd:
Reinstate bits of sh4 support that got accidentally deleted.
Add sh-dsp support.

bfd:

	* archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
	(bfd_mach_sh3_dsp): Likewise.
	(bfd_mach_sh4): Reinstate.
	(bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
	* bfd-in2.h: Regenerate.
	* coff-sh.c (struct sh_opcode): flags is no longer short.
	(USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
	(sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
	(sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
	(sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
	(sh_opcodes): No longer const.
	(sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
	(sh_insn_uses_reg): Check for USESAS and USESR8.
	(sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
	(_bfd_sh_align_load_span): Return early for SH4.
	Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
	Take into account that field b of a parallel processing insn
	could be mistaken for a separate insn.
	* cpu-sh.c (arch_info_struct): New array elements for
	sh2, sh-dsp and sh3-dsp.
	Reinstate element for sh4.
	(SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
	(SH4_NEXT): Reinstate.
	(SH3_NEXT, SH3E_NEXT): Adjust.
	* elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
	* elf32-sh.c (sh_elf_set_private_flags): New function.
	(sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
	(sh_elf_merge_private_data): New function.
	(elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
	(bfd_elf32_bfd_copy_private_bfd_data): Define.
	(bfd_elf32_bfd_merge_private_bfd_data): Change to
	sh_elf_merge_private_data.

gas:

	* config/tc-sh.c ("elf/sh.h"): Include.
	(sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables.
	(md.begin): Initialize target_arch.
	Only include opcodes in has table that match selected architecture.
	(parse_reg): Recognize register names for sh-dsp.
	(parse_at): Recognize post-modify addressing.
	(get_operands): The leading space is now optional.
	(get_specific): Remove FDREG_N support.  Add support for sh-dsp
	arguments.  Update valid_arch.
	(build_Mytes): Add support for SDT_REG_N.
	(find_cooked_opcode): New function, broken out of md_assemble.
	(assemble_ppi, sh_elf_final_processing): New functions.
	(md_assemble): Use find_cooked_opcode and assemble_ppi.
	(md_longopts, md_parse_option): New option: -dsp.
	* config/tc-sh.h (elf_tc_final_processing): Define.
	(sh_elf_final_processing): Declare.

include/elf:

	* sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros.
	(EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise.
	(EF_SH_HAS_FP, EF_SH3E, EF_SH4, EF_SH_MERGE_MACH): Likewise.

opcodes:

	* sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions.
	(print_insn_ppi): Likewise.
	(print_insn_shx): Use info->mach to select appropriate insn set.
	Add support for sh-dsp.  Remove FD_REG_N support.
	* sh-opc.h (sh_nibble_type): Add new values for sh-dsp support.
	(sh_arg_type): Likewise.  Remove FD_REG_N.
	(sh_dsp_reg_nums): New enum.
	(arch_sh1, arch_sh2, arch_sh3, arch_sh3e, arch_sh4): New macros.
	(arch_sh_dsp, arch_sh3_dsp, arch_sh1_up, arch_sh2_up): Likewise.
	(arch_sh3_up, arch_sh3e_up, arch_sh4_up, arch_sh_dsp_up): Likewise.
	(arch_sh3_dsp_up): Likewise.
	(sh_opcode_info): New field: arch.
	(sh_table): Split up insn with FD_REG_N into ones with F_REG_N and
	D_REG_N.  Fill in arch field.  Add sh-dsp insns.
2000-02-17 00:33:36 +00:00
Richard Henderson 2920b85c63 * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and
hide_symbol members.
        (elf_link_hash_copy_indirect): New.
        (elf_link_hash_hide_symbol): New.
        * elflink.h (elf_link_add_object_symbols): Break out copy from
        indirect new new symbol to elf.c.
        (elf_link_assign_sym_version): Break out privatization of
        non-exported symbol to elf.c.
        * elf.c (_bfd_elf_link_hash_copy_indirect): New.
        (_bfd_elf_link_hash_hide_symbol): New.
        (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol.
2000-02-13 23:11:32 +00:00
Ian Lance Taylor 7f8d5fc90b * section.c (_bfd_strip_section_from_output): Add info parameter.
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.
2000-02-13 22:45:29 +00:00
Timothy Wall 6c784c9aab Add hooks to support TI COFF handling. 2000-02-10 21:21:55 +00:00
Joern Rennecke 84dcfba7a2 Fix problem where -relax could reorder multiple consecutive sets of the
same register:
	* coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG,
	USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros.
	* (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes.
	* (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg,
	sh_insns_uses_or_sets_freg): New functions.
	* (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros.
	* (sh_insns_conflict): Use new functions and new macros to
	detect conflicts when two instructions both set same integer registers,
	both set same fp register, and both set special register.
2000-02-10 20:17:33 +00:00
Timothy Wall 363d7b14a5 Set arch/mach info prior to swapping in sections, so that the swapping
routines have access to the arch/mach info.
2000-02-09 13:41:44 +00:00