Commit graph

3203 commits

Author SHA1 Message Date
Ian Lance Taylor
551f302cc8 * coffcode.h (coff_bfd_is_local_label_name): Define as
_bfd_coff_is_local_label_name if not already defined.
	* coffgen.c (_bfd_coff_is_local_label_name): New function.
	* libcoff-in.h (_bfd_coff_is_local_label_name): Declare.
	* libcoff.h: Rebuild.
1997-02-28 04:10:14 +00:00
Ian Lance Taylor
35a3e78edb * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label
to _bfd_is_local_label_name.
	(bfd_target): Likewise.
	* syms.c (bfd_is_local_label): Define as function, not macro.
	(bfd_is_local_name): Define.
	* libbfd.c (bfd_generic_is_local_label_name): Rename from
	bfd_generic_is_local_label, and take a string rather than a
	symbol.
	* libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define.
	(_bfd_nosymbols_bfd_is_local_label_name): Define.
 	(bfd_generic_is_local_label): Don't declare.
	(bfd_generic_is_local_label_name): Declare.
	* bfd-in2.h, libbfd.h: Rebuild.
	* All backends: Change local_label to local_label_name.
1997-02-28 02:07:54 +00:00
Ian Lance Taylor
85d6f0b476 * elf32-mips.c (struct mips_got_info): Add assigned_gotno field.
(mips_elf_relocate_got_local): Change return type to boolean.
	Don't assume that the first zero entry is unassigned; instead, use
	assigned_gotno.
	(mips_elf_relocate_section): Check return value of
	mips_elf_relocate_got_local.
	(mips_elf_create_got_section): Initialize assigned_gotno field.
1997-02-27 23:38:19 +00:00
Martin Hunt
56819c99a1 Wed Feb 26 15:19:51 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d30v.c (bfd_elf_d30v_reloc): Add code to do 32-bit
	relocations.
1997-02-26 23:22:00 +00:00
Stan Shebs
55ef0d903c * targets.c (bfd_target_vector): Add ecoff_biglittle_vec. 1997-02-26 23:07:19 +00:00
Ian Lance Taylor
fa802cb057 * elflink.h (elf_link_input_bfd): Don't skip symbols from sections
that have no contents merely because linker_mark is not set.
1997-02-26 18:35:56 +00:00
Ian Lance Taylor
b08f5ac27a * elf.c (elf_fake_sections): Use SHT_NOTE for any section whose
name begins with ".note".
	(map_sections_to_segments): Add a PT_NOTE segment for any loadable
	section whose name begins with ".note".
	(get_program_header_size): Corresponding change.
1997-02-25 21:07:13 +00:00
Ian Lance Taylor
7b4be6688c * elf32-mips.c (mips_elf_relocate_section): Check for misaligned
jal and for jal overflow.
1997-02-25 05:33:28 +00:00
Ian Lance Taylor
d044b40a40 From Eric Youngdale <eric@andante.jic.com>:
* elflink.h (elf_link_add_archive_symbols): If a default symbol is
	not found, try looking it up again without the version name.
	(elf_link_add_object_symbols): Always link against the dynamic
	symbol table of a dynamic object.  When linking against a dynamic
	object, include version strings in symbol names, and set up
	version information.  Add indirect symbols for default versions.
	(elf_link_create_dynamic_sections): Add special version sections.
	(struct elf_assign_sym_version_info): Define.
	(struct elf_find_verdep_info): Define.
	(NAME(bfd_elf,size_dynamic_sections)): Add verdefs parameter.  Set
	up version sections.
	(elf_adjust_dynamic_symbol): Ignore indirect symbols.
	(elf_link_find_version_dependencies): New static function.
	(elf_link_assign_sym_version): New static function.
	(elf_link_renumber_dynsyms): New static function.
	(struct elf_final_link_info): Add symver_sec field.
	(elf_bfd_final_link): Initialize finfo.symver_sec.  Don't count
	local symbols of a dynamic object.  Handle DT_VER* constants.
	(elf_link_output_extsym): Simplify BFD_ASSERT checking for a
	dynamic object.  Skip indirect symbols from ELF objects.  Remove
	the version name before choosing a hash bucket.  Write out the
	version information if appropriate.
	(elf_link_input_bfd): Check for DYNAMIC, not ET_DYN.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
	(bfd_elf64_size_dynamic_sections): Likewise.
	* bfd-in2.h: Rebuild.
	* elf-bfd.h (struct elf_link_hash_entry): Add verinfo field.
	Change elf_link_hash_flags to unsigned short.
	(ELF_LINK_HIDDEN): Define.
	(struct elf_obj_tdata): Add fields dynversym_hdr, dynverref_hdr,
	dynverdef_hdr, dynversym_section, dynverdef_section,
	dynverref_section, cverdefs, cverrefs, verdef, verref.
	(elf_dynversym, elf_dynverdef, elf_dynverref): Define.
	(_bfd_elf_swap_verdef_in, _bfd_elf_swap_verdef_out): Declare.
	(_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Declare.
	(_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Declare.
	(_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Declare.
	(_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Declare.
	(_bfd_elf_slurp_version_tables): Declare.
	* elf.c (_bfd_elf_swap_verdef_in): New function.
	(_bfd_elf_swap_verdef_out): Likewise.
	(_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Likewise.
	(_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Likewise.
	(_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Likewise.
	(_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Likewise.
	(_bfd_elf_print_private_bfd_data): Add DT_VER* constants.  Print
	version information if there is any.
	(_bfd_elf_link_hash_newfunc): Initialize verinfo field.
	(bfd_section_from_shdr): Handle SHT_GNU_ver* section types.
	(elf_fake_sections): Handle .gnu.version* section names.
	(assign_section_numbers): Handle SHT_GNU_ver* section types.
	(_bfd_elf_slurp_version_tables): New function.
	* elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't include
	version name in string entered in dynamic hash table.
	* elfcode.h: Include fnmatch.h.
	* elf32-i386.c (elf_i386_relocate_section): Handle a dynamic
	symbol which was forced to become local.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
	* elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
1997-02-24 23:13:07 +00:00
Jeff Law
af2903b4f0 Update some comments to reflect current reality. 1997-02-24 18:13:23 +00:00
Jeff Law
7b951eed4d * elf32-mn10200.c (mn10200_elf_final_link_relocate): Simplify
somewhat.
        (mn10200_elf_relax_section): Correctly compute a symbol's value
        when the symbol is local, but not in the same section as we are
        relaxing.  Implement abs24 -> abs16, imm24 -> imm16 and d24 -> d16
        relaxing.
Another 1.3% size reduction for hello world.  Only relaxing left todo is
imm16 -> imm8 and d16 -> d8 where applicable.
1997-02-21 23:19:34 +00:00
David Edelsohn
77dd1a25d8 * elf32-m32r.c: Rewrite to use ELF backend linker.
Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns.
	Add small data area support (R_M32R_SDA16).
	* reloc.c: Document BFD_RELOC_M32R_SDA16.
	* bfd-in2.h,libbfd.h: Regenerated.
1997-02-21 22:09:40 +00:00
Jeff Law
7c49f021ca Twiddle some comments to more accurately reflect reality. 1997-02-21 07:21:32 +00:00
Jeff Law
c17db7cfb4 Remove debugging printf. 1997-02-21 07:18:35 +00:00
Jeff Law
fd39566111 * elf32-mn10200.c (mn10200_elf_relax_section): New function.
(mn10200_elf_relax_delete_bytes): Likewise.
        (mn10200_elf_symbol_address_p): Likewise.
        (mn10200_elf_get_relocated_section_contents): Likewise.
        (bfd_elf32_bfd_relax_section): Define.
        (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
First cut at relaxing linker for the mn10200:

	jsr:24 -> jsr:16
	jmp:24 -> jmp:16
	jmp:16 -> bra:8
	bCC .+4;bra:8 -> bCC':8


Reduces code size by about 2.5% for hello world.
1997-02-21 07:14:30 +00:00
Ian Lance Taylor
db986c6049 fix with make headers 1997-02-20 22:49:40 +00:00
Jeff Law
64af667971 * elf32-mn10200.c (mn10200_elf_final_link_relocate): New function.
(mn10200_elf_relocate_section): Likewise.
        (elf_backend_relocate_section): Define.
New style linker for the mn10200.
1997-02-20 20:54:28 +00:00
Michael Meissner
c6c7035cfb Since d10v is public now, remove all sanitization statements 1997-02-20 16:05:18 +00:00
Martin Hunt
fd8d7c31c0 Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
	reloc.c, targets.c: New target, elf-*-D30V.

	* bfd-in2.h, configure, libbfd.h: Rebuilt.

	* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
Fred Fish
92a956e87d * reloc.c (struct reloc_howto_struct): Fix typo in comment.
* bfd-in2.h: Regenerated.
start-sanitize-tic80
	* coff-tic80.c (RTYPE2HOWTO): Replace abort with real function.
	(rtype2howto): Add function.
	(tic80_howto_table): Add.
end-sanitize-tic80
1997-02-18 23:01:02 +00:00
Jeff Law
8d1ba96ecc * elf32-v850.c (v850_elf_relocate_section): Make sure r_symndx
is initialized before it is used.
Something Doug noticed.
1997-02-18 17:06:20 +00:00
Ian Lance Taylor
8ceca98345 * hp300hpux.c (convert_sym_type): Don't convert a secondary common
symbol into a weak undefined symbol; leave it as a common symbol.
1997-02-17 16:29:21 +00:00
Ian Lance Taylor
54626f1aa4 * elflink.h (elf_link_add_object_symbols): Don't issue a warning
about a symbol defined in a dynamic object if it has already been
	defined in a regular object.
1997-02-15 00:12:47 +00:00
Ian Lance Taylor
8696b2db70 Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de)
* reloc.c (BFD_RELOC_ALPHA_CODEADDR): New relocation for
	openVMS/Alpha.
	* evax.h (ALPHA_R_CODEADDR): New relocation.
	* evax-alpha.c (ALPHA_R_CODEADDR): 64 bit procedure relocation for
	openVMS/Alpha.
	* evax-etir.c (ALPHA_R_CODEADDR): Output object code for this
	relocation.
	* bfd-in2.h, libbfd.h: Rebuild.

	Restrict symbol length to 64 bytes, case preserving:
	* evax-emh.c (_bfd_evax_write_emh): Remove case hacking.
	* evax-misc.c (_bfd_evax_case_hack_symbol): Remove.
	(_bfd_evax_length_hash_symbol): Added.
	* evax-etir.c (_bfd_evax_write_etir): Call
	_bfd_evax_length_hash_symbol before output of symbol.
	* evax-egsd.c (_bfd_evax_write_egsd): Likewise.
	* evax.h (flag_hash_long_names, flag_show_after_trunc): Remove.

	* evax-emh.c: Output filename to object file without path.

	* evax-egsd.c: New sections for local and global commons.

	* evax-alpha.c, evax-emh.c, evax-egsd.c, evax-etir.c,
	evax-misc.c, evax.h: Remove 8 bit characters from copyright
	notices.  Replace AXP with Alpha.
1997-02-14 02:13:19 +00:00
Ian Lance Taylor
236969ac80 Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de)
* makefile.vms: Add gcc flags to allow compiling with current gcc
	snapshot
	(targmatch.h): New dependency.
1997-02-14 01:54:51 +00:00
Ian Lance Taylor
3a8dddb286 Thu Feb 13 20:50:02 1997 Klaus Kaempf (kkaempf@progis.de)
* makefile.vms: New file.
1997-02-14 01:50:50 +00:00
Ian Lance Taylor
62332d05fd * sunos.c (sunos_create_dynamic_sections): We need the dynamic
sections if we are creating a shared library.
1997-02-12 23:14:36 +00:00
David Edelsohn
3883007ed1 * configure.host (i386-windows): Don't set host64=true. 1997-02-11 23:46:10 +00:00
Ian Lance Taylor
a4183ba5c9 * elf32-mips.c (reloc_type): Add R_MIPS16_GPREL.
(elf_mips16_gprel_howto): New static variable.
	(mips16_gprel_reloc): New static function.
	(bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_GPREL.
	(mips_info_to_howto_rel): Handle R_MIPS16_GPREL.
	(mips_elf_relocate_section): Handle R_MIPS16_GPREL.
	* reloc.c (BFD_RELOC_MIPS16_GPREL): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
1997-02-11 20:30:12 +00:00
David Edelsohn
b9c5ee689d * elf32-m32r.c (elf_m32r_howto_table): Change partial_inplace to true
for R_M32R_{16,32,24,HI16_ULO,HI16_SLO,LO16}.
1997-02-11 19:45:51 +00:00
Gavin Romig-Koch
276c2d7dc8 Add r5900 1997-02-11 13:26:34 +00:00
Ian Lance Taylor
ba4a45946c * elflink.h (elf_link_input_bfd): If we've discarded a section,
the output section will be the absolute section; don't print an
	assertion message for that case when doing a relocateable link.
PR 11647.
1997-02-07 17:40:24 +00:00
Ian Lance Taylor
e900e695a2 * elf32-mips.c (FN_STUB, CALL_STUB, CALL_FP_STUB): Define.
(struct mips_elf_link_hash_entry): Add new fields fn_stub,
	need_fn_sub, call_stub, and call_fp_stub.
	(struct mips_elf_link_hash_table): Add field mips16_stubs_seen.
	(mips_elf_link_hash_newfunc): Initialize new fields.
	(mips_elf_link_hash_table_create): Likewise.
	(mips_elf_relocate_section): Redirect relocations to use mips16
	stubs when appropriate.
	(mips_elf_check_relocs): Attach stub sections to the appropriate
	symbol.  Set need_fn_stub when appropriate.
	(mips_elf_always_size_sections): New static function.
	(mips_elf_check_mips16_stubs): New static function.
	(elf_backend_always_size_sections): Define.
	* elf-bfd.h (struct elf_obj_tdata): Add local_stubs field.
1997-02-06 22:15:37 +00:00
Ian Lance Taylor
258b1f5d18 * elflink.h (elf_link_input_bfd): Discard local symbols that are
attached to sections which are not being included in the link.
1997-02-06 22:02:51 +00:00
Ian Lance Taylor
5b61a02aae * cofflink.c (_bfd_coff_generic_relocate_section): Ignore the
symbol value when computing the addend for a pc_relative
	pcrel_offset reloc.
1997-02-05 18:21:08 +00:00
Ian Lance Taylor
5a50eec623 * cofflink.c (_bfd_coff_generic_relocate_section): If doing a
relocateable link, just skip pc_relative pcrel_offset relocs.
	* coff-arm.c (coff_arm_rtype_to_howto): Return a different howto
	structure for an ARM26 reloc which can be resolved.
	(coff_arm_adjust_symndx): Only convert ARM26 to ARM26D if the
	reloc can be resolved.
PR 11599.
1997-02-03 20:31:39 +00:00
Ian Lance Taylor
bcb686ca09 * coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
error in overflow check for R_RELBYTE.
PR 11591.
1997-02-03 16:54:36 +00:00
Ian Lance Taylor
e9797c8ae5 comment fix 1997-01-31 23:15:42 +00:00
Ian Lance Taylor
6c58561e7a * ieee.c (ieee_slurp_section_data): Pick up the start address.
From Mark Rasin <mark.rasin@telrad.co.il>.
1997-01-31 19:15:40 +00:00
Ian Lance Taylor
167dc907f2 * aoutx.h (aout_link_write_symbols): Don't apply discard_l to
debugging symbols.
Mentioned in PR 11540.
1997-01-31 19:08:31 +00:00
Jeff Law
1a2faf1f1e * elf32-mn10200.c (reloc_type): Add 16bit pc-relative reloc.
(elf_mn10200_howto_table): Likewise.
        (mn10200_reloc_map): Likewise.
How did I miss the 16bit pc-relative relocs?!?
1997-01-29 07:02:22 +00:00
David Edelsohn
1d5c6cfdf0 * reloc.c: Add relocs BFD_RELOC_M32R_{HI16_[US]LO,LO16}.
* bfd-in2.h, libbfd.h: Regenerated.
	* elf32-m32r.c: Add support for them.
1997-01-27 20:35:24 +00:00
Ian Lance Taylor
54aa1deab3 * aout-arm.c (MY_swap_std_reloc_in): Remove unused r_length.
* elf32-ppc.c (ppc_elf_check_relocs): Remove unused plt.
start-sanitize-v850
	* elf32-v850.c (v850_elf_final_link_relocate): Remove used
	r_format and r_pcrel.  Always return a value.
end-sanitize-v850
	* riscix.c (MY_final_link_callback): Define to dummy value.
1997-01-27 18:22:54 +00:00
Ian Lance Taylor
9950f925f7 * elf32-i386.c (elf_i386_size_dynamic_sections): When checking for
relocations against the text segment, look up the output name of
	the reloc section.
	* elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
	* elf32-mips.c (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.
1997-01-27 18:13:01 +00:00
Fred Fish
8c00b01dee * coff-tic80.c (tic80coff_vec): Use correct data put/get
routines for little endian data.
	* coffcode.h (coff_write_object_contents): Set magic to
 	TIC80_ARCH_MAGIC for TIc80.
1997-01-23 03:09:05 +00:00
Fred Fish
0716c2e910 * coff-tic80.c (tic80coff_vec): Change to little endian data
as the default.
1997-01-21 20:15:46 +00:00
Ian Lance Taylor
db109ca2d8 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Change type of
auxiliary_filters parameter to be const char * const *.  Accept a
	NULL terminated array.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
	(bfd_elf32_size_dynamic_sections): Update declaration.
	* bfd-in2.h: Rebuild.
1997-01-16 22:48:57 +00:00
Ian Lance Taylor
c7f8d0a524 update copyright 1997-01-16 22:48:24 +00:00
David Edelsohn
e1616e16d8 * libaout.h (machine_type): Reserve several values for sparclet. 1997-01-14 16:47:40 +00:00
Michael Meissner
91eb4378ee Fix sanitize string 1997-01-14 03:45:40 +00:00