Commit Graph

643 Commits

Author SHA1 Message Date
Alan Modra f69da49f95 Reclaim reloc space for symbols that have been forced local. 2000-08-27 08:10:16 +00:00
Nick Clifton 724982f606 Allow common symbols to have an alignment of 1 if explicitly requested, and
not overridden by other definitions.
2000-08-24 17:41:40 +00:00
Nick Clifton 371e71b8de Fix bugs detecting w65 architecture. 2000-08-22 20:11:36 +00:00
H.J. Lu a963dc6ade 2000-08-22 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (elf_link_hash_table): Add runpath.

	* bfd-in.h (bfd_elf_get_runpath_list): New prototype.
	* bfd-in2.h: Rebuilt.

	* elf.c (_bfd_elf_link_hash_table_init): Initialize the
	"runpath" field to NULL.
	(bfd_elf_get_runpath_list): New function.

	* elflink.h (elf_link_add_object_symbols): Record DT_RPATH and
	DT_RUNPATH entries.
2000-08-22 19:33:16 +00:00
Alexandre Oliva 9bdafcced4 * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W,
R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them
explicitly.  Improve validation of r_type.
2000-08-22 04:58:25 +00:00
Nick Clifton 7a9af8c4a0 Zero out the dynamic allocated content space. Add a comment to remind us that
one day this ought to be fixed.
2000-08-21 23:42:56 +00:00
Jason Eckhardt ded0649cd5 2000-08-21 Jason Eckhardt <jle@cygnus.com>
bfd:
	* elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate
	field with the newly relocated value instead of adding it to the
	existing immediate field.
	(elf32_i860_relocate_splitn): Likewise.
	(elf32_i860_relocate_highadj): Likewise.

gas:
	* config/tc-i860.c (md_apply_fix3): Do not insert the immediate
	if the fixup resulted in a relocation.
2000-08-21 23:26:19 +00:00
Jason Eckhardt d670a150a1 2000-08-16 Jason Eckhardt <jle@cygnus.com>
* elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it
        was previously just a stub).
2000-08-16 21:58:55 +00:00
Alexandre Oliva bb0deeff61 * elflink.c (_bfd_elf_create_got_section): Don't abort().
Formatting fixes.
(_bfd_elf_create_dynamic_sections): Likewise.
2000-08-16 18:02:16 +00:00
Jakub Jelinek be040dbb5b * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address
for undefined symbols to be the beginning of the section.

	* elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate
	four extra entries at the beginning of the .rela.plt section.
	(sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt
	section to account for the four reserved entries in the .plt section.
2000-08-16 17:42:21 +00:00
Geoffrey Keating 31612ca61a * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0
to the list of NOPs we recognize after a branch-and-link.
Use the ori NOP when one is needed.

* coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation
for large archives.
2000-08-16 00:34:19 +00:00
Jim Wilson c43c2cc5fa Add support for IA-64 specific elf header flags.
bfd/
2000-08-14  Jim Wilson  <wilson@cygnus.com>
	* elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle
	EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP.
	(elf64_ia64_print_private_bfd_data): Likewise.  Also handle
	EF_IA_64_ABSOLUTE.
gas/
2000-08-14  Jim Wilson  <wilson@cygnus.com>
	* config/tc-ia64.c (md_longopts): Add -mconstant-gp and -mauto-pic.
	(md_parse_option):  Add OPTION_MCONSTANT_GP and OPTION_MAUTO_PIC.
	(md_begin): Change assignment to md.flag to OR in the new bit.
include/elf/
2000-08-14  Jim Wilson  <wilson@cygnus.com>
	* elf/ia64.h (EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP,
	EF_IA_64_NOFUNCDESC_CONS_GP, EF_IA_64_ABSOLUTE): Define.
2000-08-14 20:13:39 +00:00
Alexandre Oliva 1630fd2bf1 * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static. 2000-08-11 14:35:41 +00:00
Jason Eckhardt fdeafce79e 2000-08-10 Jason Eckhardt <jle@cygnus.com>
* elf32-i860.c (elf32_i860_relocate_section): New function.
        (i860_final_link_relocate): New function.
        (elf32_i860_relocate_splitn): New function.
        (elf32_i860_relocate_pc16): New function.
        (elf32_i860_relocate_highadj): New function.
        (elf32_i860_howto): Minor adjustments to some relocations.
        (elf_info_to_howto_rel): Define.
        (elf_backend_relocate_section): Define.
2000-08-10 21:09:42 +00:00
Nick Clifton 9b485d32de Fix formatting 2000-08-10 19:41:07 +00:00
Bernd Schmidt 00fdaf47d5 Fix bug in sh_elf_reloc_loop 2000-08-10 10:00:56 +00:00
Jason Eckhardt 305d537e30 gas:
2000-08-08  Jason Eckhardt  <jle@cygnus.com>

	* config/tc-i860.h: Rework completely for BFD_ASSEMBLER.
	(i860_fix_info): New enum.
	(MD_APPLY_FIX3): Define.
	(WORKING_DOT_WORD): Define.
	(TC_HANDLES_FX_DONE): Define.
	(DIFF_EXPR_OK): Define.
	(LISTING_HEADER): Define.
	(TARGET_FORMAT): Select target format based on endian flag.
	(TARGET_BYTES_BIG_ENDIAN): Default to little endian.
	(target_big_endian): Add external declaration.

	* config/tc-i860.c: All existing code reworked completely. Other
	new code shown below.
	(SYNTAX_SVR4): Define.
	(target_warn_expand): New variable.
	(md_shortopts): Declare and define (-Qy, -Qn, and -V options).
	(md_longopts): Declare and define with new options (-EL, -EB,
	and -mwarn-expand).
	(md_show_usage): New function.
	(md_operand): New function.
	(obtain_reloc_for_imm16): New function.
	(md_apply_fix3): New function.
	(tc_gen_reloc): New function.

include:
2000-08-08  Jason Eckhardt  <jle@cygnus.com>

	* opcode/i860.h: Small formatting adjustments.

opcode:
2000-08-08  Jason Eckhardt  <jle@cygnus.com>

	* i860-dis.c (print_br_address): Change third argument from int
	to long.

bfd:
2000-08-08  Jason Eckhardt  <jle@cygnus.com>
	* elf32-i860.c (elf32_i860_howto_table): Updated some fields.
2000-08-09 03:33:42 +00:00
Kazu Hirata dce618356b Apply Nick Clifton's suggestion. 2000-08-07 19:46:11 +00:00
Kazu Hirata 46f5aac8f5 2000-08-07 Kazu Hirata <kazu@hxi.com>
* ieee.c: Fix a comment typo.
	* elf64-ia64.c: Likewise.
2000-08-07 19:39:55 +00:00
Jason Eckhardt 0e5136c692 2000-08-05 Jason Eckhardt <jle@cygnus.com>
* elf32-i860 (elf32_i860_howto_table): New structure.
        (lookup_howto): New function.
        (elf32_i860_reloc_type_lookup): New function.
        (elf32_i860_info_to_howto_rela): New function.
        (elf_code_to_howto_index): New structure.
        (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela.
        (bfd_elf32_bfd_reloc_type_lookup): Re-define as
        elf32_i860_reloc_type_lookup.
2000-08-05 16:48:52 +00:00
Jeff Law 7dca057bba * som.c (struct fixup_format): Constify `format'.
(som_hppa_howto_table): Use SOM_HOWTO macro.
        (try_prev_fixup, hppa_som_reloc): Decorate unused parameter.
        (som_bfd_reloc_type_lookup): Likewise.
        (compare_subspaces): Remove unused `count1', `count2'.
        (som_begin_writing): Remove unused `total_reloc_size'.
        (som_bfd_derive_misc_symbol_info): Decorate unused parameter.
        (som_print_symbol, som_bfd_is_local_label_name): Likewise.
        (som_set_reloc_info): Constify `cp'. Remove unused `addend'.
        (som_find_nearest_line): Decorate unused parameter(s).
        (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise.
        (som_bfd_link_split_section): Likewise.
2000-08-04 15:17:37 +00:00
Nick Clifton dcb5e6e634 If the destination of a BLX instruction is aligned on a half word boundary,
set the H bit.
2000-08-04 00:07:42 +00:00
Nick Clifton bc67d8a6e3 Restore reverted code. Fix bug in reverted code which was eliminating too
many segments.
2000-08-03 19:40:29 +00:00
H.J. Lu c0f7859bc6 2000-08-03 H.J. Lu <hjl@gnu.org>
* section.c: Back out the change made by Nick Clifton
	<nickc@cygnus.com> on 2000-07-31. It breaks stripping dynamic
	binaries.
	* bfd-in2.h: Likewise.
	* elf.c: Likewise.
2000-08-03 13:50:35 +00:00
Alexandre Oliva 61ff180434 * elf32-sh.c (sh_elf_reloc_loop): Warning removal. 2000-08-03 09:30:50 +00:00
Jason Eckhardt a87fdb8d10 2000-07-31 Jason Eckhardt <jle@cygnus.com>
* reloc.c (BFD_RELOC_860_*): New bfd relocs for i860.
        * bfd-in2.h, libbfd.h: Regenerate.
2000-08-01 01:45:29 +00:00
Nick Clifton a022216bd4 Minor formatting fixes. 2000-07-31 18:49:56 +00:00
Nick Clifton 5c440b1e3b Improve section to segment mapping code. 2000-07-31 18:45:26 +00:00
Jason Eckhardt 24208c5c83 200007-22 Jason Eckhardt <jle@cygnus.com>
* cpu-i860.c: Added comments.

	* elf32-i860.c (TARGET_LITTLE_SYM): Defined to
	bfd_elf32_i860_little_vec.
	(TARGET_LITTLE_NAME): Defined to "elf32-i860-little".
	(ELF_MAXPAGESIZE): Changed to 4096.

	* targets.c (bfd_elf32_i860_little_vec): Declaration of
	new target.
	(bfd_target_vector): Added bfd_elf32_i860_little_vec.

	* config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added
	config for little endian elf32 i860.
	(targ_defvec): Define for the new config above
	as "bfd_elf32_i860_little_vec".
	(targ_selvecs): Define for the new config above
	as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec"

	* configure.in (bfd_elf32_i860_little_vec): Added recognition
	of new target vec.

	* configure: Regenerated.
2000-07-28 21:15:04 +00:00
Jason Eckhardt 9d75133528 2000-07-22 Jason Eckhardt <jle@cygnus.com>
* include/opcode/i860.h (btne, bte, bla): Changed these opcodes
	to use sbroff ('r') instead of split16 ('s').
	(J, K, L, M): New operand types for 16-bit aligned fields.
	(ld.x, {p}fld.x, fst.x, pst.d): Changed these opcodes to
	use I, J, K, L, M instead of just I.
	(T, U): New operand types for split 16-bit aligned fields.
	(st.x): Changed these opcodes to use S, T, U instead of just S.
	(andh, andnoth, orh, xorh): Deleted 3-register forms as they do not
	exist on the i860.
	(pfgt.sd, pfle.sd): Deleted these as they do not exist on the i860.
	(pfeq.ss, pfeq.dd): New opcodes.
	(st.s): Fixed incorrect mask bits.
	(fmlow): Fixed incorrect mask bits.
	(fzchkl, pfzchkl): Fixed incorrect mask bits.
	(faddz, pfaddz): Fixed incorrect mask bits.
	(form, pform): Fixed incorrect mask bits.
	(pfld.l): Fixed incorrect mask bits.
	(fst.q): Fixed incorrect mask bits.
	(all floating point opcodes): Fixed incorrect mask bits for
	handling of dual bit.

	* include/elf/i860.h: New file.
	(elf_i860_reloc_type): Defined ELF32 i860 relocations.

	* bfd/cpu-i860.c: Added comments.

	* bfd/elf32-i860.c (TARGET_LITTLE_SYM): Defined to
	bfd_elf32_i860_little_vec.
	(TARGET_LITTLE_NAME): Defined to "elf32-i860-little".
	(ELF_MAXPAGESIZE): Changed to 4096.

	* bfd/targets.c (bfd_elf32_i860_little_vec): Declaration of
	new target.
	(bfd_target_vector): Added bfd_elf32_i860_little_vec.

	* bfd/config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added
	config for little endian elf32 i860.
	(targ_defvec): Define for the new config above
	as "bfd_elf32_i860_little_vec".
	(targ_selvecs): Define for the new config above
	as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec"

	* bfd/configure.in (bfd_elf32_i860_little_vec): Added recognition
	of new target vec.

	* bfd/configure: Regenerated.

	* opcodes/i860-dis.c: New file.
	(print_insn_i860): New function.
	(print_br_address): New function.
	(sign_extend): New function.
	(BITWISE_OP): New macro.
	(I860_REG_PREFIX): New macro.
	(grnames, frnames, crnames): New structures.

	* opcodes/disassemble.c (ARCH_i860): Define.
	(disassembler): Add check for bfd_arch_i860 to set disassemble
	function to print_insn_i860.

	* include/dis-asm.h (print_insn_i860): Add prototype.

	* opcodes/Makefile.in (CFILES): Added i860-dis.c.
	(ALL_MACHINES): Added i860-dis.lo.
	(i860-dis.lo): New dependences.

	* opcodes/configure.in: New bits for bfd_i860_arch.

	* opcodes/configure: Regenerated.
2000-07-28 21:10:20 +00:00
H.J. Lu 456981d715 2000-07-27 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_merge_symbol): Take one more argument,
	dt_needed, to indicate if the symbol comes from a DT_NEEDED
	entry. Don't overide the existing weak definition if dt_needed
	is true.
	(elf_link_add_object_symbols): Pass dt_needed to
	elf_merge_symbol ().
2000-07-28 00:49:07 +00:00
Nick Clifton 755cfd2922 Zero the allocated contents of reloc sections. 2000-07-27 22:35:08 +00:00
Geoffrey Keating adfdf8387c * configure.host (*-*-aix*): AIX has 'long long' always. 2000-07-25 19:29:42 +00:00
Geoffrey Keating 1a6df346e3 * coff-rs6000.c (xcoff_write_one_armap_big): New procedure.
(xcoff_write_armap_big): Write both 32-bit and 64-bit armaps.
(xcoff_write_archive_contents_big): Don't update the offset
of the symbol table, xcoff_write_armap will do it.
2000-07-25 19:25:40 +00:00
Nick Clifton 3eb6f68f1b Regenerate auto-generated files 2000-07-24 17:22:17 +00:00
Ulf Carlsson 313ba8d62b 2000-07-23 Ulf Carlsson <ulfc@engr.sgi.com>
* elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead
	of dynobj for SGI_COMPAT checks.
2000-07-23 20:51:35 +00:00
Nick Clifton e702a51c72 oops - omitted from previous delta 2000-07-21 23:40:12 +00:00
Nick Clifton 20bccb3485 Applied Michael's Sokolov's patch to implement --embedded-relocs for m68k coff. 2000-07-21 23:31:53 +00:00
Nick Clifton 7a3120d9a6 Detect and report corrupt relocs 2000-07-21 19:56:19 +00:00
H.J. Lu 4d538889a8 2000-07-20 H.J. Lu <hjl@gnu.org>
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check
	info->new_dtags when setting DT_FLAGS_1. It will only be set
	by the new linker options. It shouldn't break anything.
2000-07-21 03:58:32 +00:00
H.J. Lu b586af581d 2000-07-20 H.J. Lu <hjl@gnu.org>
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1
	only if info->new_dtags is true.
2000-07-21 02:16:31 +00:00
H.J. Lu c25373b76a 2000-07-20 H.J. Lu <hjl@gnu.org>
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set
	DT_RUNPATH and DT_FLAGS only if info->new_dtags is true.
2000-07-20 21:16:58 +00:00
Hans-Peter Nilsson 3bd336f7c8 Fix typo in CRIS entry 2000-07-20 16:35:18 +00:00
Hans-Peter Nilsson 06c15ad74f * Makefile.am (ALL_MACHINES): Add cpu-cris.lo.
(ALL_MACHINES_CFILES): Add cpu-cris.c.
	(BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo.
	(BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c.
	(cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules.
	* Makefile.in: Rebuild.
	* aclocal.m4: Rebuild.
	* aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris.
	* archures.c (enum bfd_architecture): Add bfd_arch_cris.
	(bfd_cris_arch): Declare.
	(bfd_archures_list): Add bfd_cris_arch.
	* bfd-in2.h: Rebuild.
	* config.bfd: (cris-*-*): New target.
	* configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors.
	* configure: Rebuild.
	* elf.c (prep_headers): Add bfd_arch_cris.
	* libbfd.h: Rebuild.
	* libaout.h (enum machine_type): Add M_CRIS.
	* reloc.c: Add CRIS relocations.
	* targets.c (bfd_target bfd_elf32_cris_vec, cris_aout_vec):
	Declare.
	(bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec.
	* cpu-cris.c, aout-cris.c, elf32-cris.c: New files.
	* po/POTFILES.in, po/bfd.pot: Regenerate.
2000-07-20 16:21:07 +00:00
H.J. Lu d6cf28795d 2000-07-19 H.J. Lu <hjl@gnu.org>
* 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-20 03:21:59 +00:00
H.J. Lu 7481689898 2000-07-19 H.J. Lu <hjl@gnu.org>
* bfd-in.h (bfd_elf_set_dt_needed_soname): New.
	* bfd-in2.h: Rebuild.

	* elf-bfd.h (elf_obj_tdata): Add dt_soname.
	(elf_dt_soname): New.

	* elf.c (bfd_elf_set_dt_needed_soname): New.

	* elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED
	entry if the shared object loaded by DT_NEEDED is used to
	resolve the reference in a regular object.
2000-07-20 03:16:18 +00:00
H.J. Lu 36a30e65ca 2000-07-19 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG,
	DT_DEPAUDIT and DT_AUDIT as strings.
2000-07-20 02:19:23 +00:00
Nick Clifton 1d713d9eaf Fix formatting 2000-07-20 00:31:39 +00:00
H.J. Lu d48188b96e 2000-07-19 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM.
2000-07-19 18:26:38 +00:00
H.J. Lu 9455883401 2000-07-19 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW,
	DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ,
	DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ,
	DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1,
	DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT,
	DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT,
	DT_FLAGS_1, DT_USED and DT_CHECKSUM.
2000-07-19 18:02:13 +00:00