Commit Graph

384 Commits

Author SHA1 Message Date
Ian Lance Taylor 402ef9d421 1999-09-11 Donn Terry <donn@interix.com>
* coffswap.h (IMAGE_BASE): Don't define.
	* pei-arm.c (IMAGE_BASE): Don't define.
	* pei-i386.c (IMAGE_BASE): Don't define.
	* pei-mcore.c (IMAGE_BASE): Don't define.
	* pei-ppc.c (IMAGE_BASE): Don't define.
1999-09-11 22:10:33 +00:00
Ian Lance Taylor 8add8e3099 1999-09-11 Donn Terry <donn@interix.com>
* cofflink.c (_bfd_coff_link_input_bfd): When writing out a
	symbol, switch on the class when determining whether to modify the
	value.  For PE, don't modify the value of a C_FCN symbol not named
	.bf.
1999-09-11 22:04:16 +00:00
Ian Lance Taylor c0bed66d09 1999-09-11 Donn Terry <donn@interix.com>
* libbfd-in.h (_bfd_abort): Declare.
	(abort): Define.
	* bfd.c (_bfd_abort): New function.
	* libbfd.h: Rebuild.
1999-09-11 21:51:55 +00:00
Ian Lance Taylor a50f8417d5 * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
1999-09-11  Donn Terry  <donn@interix.com>

	* coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE
	special handling.
1999-09-11 21:39:03 +00:00
Ian Lance Taylor b545f675c1 1999-09-11 Donn Terry <donn@interix.com>
* cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped,
	don't write out the associated line numbers.
1999-09-11 21:27:15 +00:00
Ian Lance Taylor 2c546cd84f 1999-09-11 Donn Terry <donn@interix.com>
* cofflink.c (_bfd_coff_write_global_sym): Handle section symbol
	aux entries.
1999-09-11 21:15:16 +00:00
Ian Lance Taylor d510f9a69b 1999-09-11 Donn Terry <donn@interix.com>
* coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING
	for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such
	symbols named .bf.
1999-09-11 21:04:09 +00:00
Ian Lance Taylor eeaf533e61 * elfcode.h (write_relocs): Handle an absolute symbol in REL
relocs as we do for RELA relocs.
1999-09-11 20:14:57 +00:00
Ian Lance Taylor 5d3aaa749f 1999-09-11 Donn Terry <donn@interix.com>
* cofflink.c (coff_link_add_symbols): Don't warn about symbol type
	changes when the base type is unknown.
1999-09-11 15:26:22 +00:00
Ian Lance Taylor 312191a689 1999-09-11 Donn Terry <donn@interix.com>
* coffgen.c (coff_print_symbol): Fix printing of aux record for
	function symbols.
1999-09-11 15:16:14 +00:00
Ian Lance Taylor 703153b566 1999-09-11 Donn Terry <donn@interix.com>
* syms.c (BSF_DEBUGGING_RELOC): Define.
	* coffgen.c (fixup_symbol_value): Relocate a symbol which has
	BSF_DEBUGGING_RELOC set.
	* bfd-in2.h: Rebuild.
1999-09-11 14:41:11 +00:00
Ian Lance Taylor 7b50b349e2 * ecoff.c (bfd_debug_section): Update initialization for new
comdat_info field.
	(_bfd_ecoff_styp_to_sec_flags): Add section parameter.
	* libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration.

1999-09-10  H.J. Lu  <hjl@gnu.org>

	* coff-alpha.c (alpha_ecoff_backend_data): Initialize the new
	_bfd_filnmlen field.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
1999-09-10 23:25:51 +00:00
Jeff Law e48c661ee6 * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries
for FPTR relocs involving local symbols.
1999-09-10 15:46:37 +00:00
Jeff Law 6a0b987115 * elf-hppa.h (elf_hppa_final_link_relocate): Get the right
value for the stub address in a call through a stub.
        Install the value for a local symbol directly into the DLT
        instead of generating a reloc.  Correctly handle FPTR64 relocs.
1999-09-10 14:05:36 +00:00
Jeff Law af7dc6449e * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function.
(elf_hppa_remark_useless_dynamic_symbols): Similarly.
        (elf_hppa_final_link): Call them.
1999-09-10 06:38:05 +00:00
Ian Lance Taylor fc4cc5bb8f * elflink.h (elf_fix_symbol_flags): Move weakdef handling here...
(elf_adjust_dynamic_symbol): ...from here.
1999-09-10 04:22:23 +00:00
Jeff Law b1d5590577 Update some comments. 1999-09-09 14:52:15 +00:00
Jeff Law b726396160 * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR
relocation, remove them.  SECREL64->LTOFF16WF.
        (elf_hppa_final_link_relocate): Handle LTOFF* relocations.  Handle
        DIR* relocations.
        (elf_hppa_relocate_insn): Similarly.
1999-09-09 14:51:33 +00:00
Jeff Law 8267b1550c * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs.
(elf_hppa_relocate_insn): Similarly.
1999-09-09 14:20:18 +00:00
Jeff Law 6849fb4de7 * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and
GPREL* relocations.
        (elf_hppa_relocate_insn): Similarly.
1999-09-09 14:10:24 +00:00
Jeff Law b233eaabc0 * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos.
Handle LTOFF_TP* relocs.
        (elf_hppa_relocate_insn): Similarly.
1999-09-09 13:55:46 +00:00
Jeff Law 571047ad0a * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs.
Consistently deal with addends.  Handle DLTIND14F and DLTREL14F.
        (elf_hppa_relocate_insn): Handle PCREL* relocs.
1999-09-09 13:32:38 +00:00
Jeff Law e5bb3efcc5 * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*,
DIR32, DIR64 and FPTR64 relocations.
        (elf_hppa_relocate_insn): Similarly.
1999-09-09 13:01:11 +00:00
Jeff Law be7582f38a Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com)
* elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the
        address of the .PARISC.global section.
        (elf_hppa_relocate_section): Lookup and pass the PA64 hash
        table entry elf_hppa_final_link_relocate.  Do not give a warning
        for a reloc against an external symbol if it has a PA64 hash
        table entry.
        (elf_hppa_final_link_relocate): Significantly rework.  Handle
        DLTIND relocations.  Compute the final value of the relocation
        before passing the value of elf_hppa_relocate_insn.
        (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling
        relocation support.  Handle DLTIND relocation requests just like
        DLTREL relocation requests.  Simplify branch handling.

1999-09-08  Ulrich Drepper  <drepper@cygnus.com>

        * elf-hppa.h (elf_hppa_relocate_section): Catch problems with
        non-allocated section as done in i386 version.
        (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch
        statement since this is no know relocation.
1999-09-09 12:01:24 +00:00
Jeff Law 084d930bff * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F
relocs.
        (elf_hppa_relocate_insn): Similarly.
1999-09-08 01:00:12 +00:00
Jeff Law 11c19a4e3c * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and
DLTREL14WD relocs.
        (elf_hppa_relocate_insn): Similarly.
1999-09-08 00:50:50 +00:00
Jeff Law c8933571da * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and
DLTREL21L relocs.  Pass the output bfd to elf_hppa_relocate_insn.
        Pass the relocate type rather than the insn format to
        elf_hppa_relocate_insn.
        (elf_hppa_relocate_insn): Make switch dependent on relocation type
        rather than the opcode.  Handle DLTREL21L and DLTREL14R relocs.
1999-09-08 00:09:52 +00:00
Ian Lance Taylor 692b7d62e8 * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field.
(bfd_coff_filnmlen): Define.
	(bfd_coff_std_swap_table): Initialize new field.
	* coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather
	than FILNMLEN.
	(coff_write_symbols): Likewise.
	(coff_get_normalized_symtab): Likewise.
	* coff-sh.c (bfd_coff_small_swap_table): Initialize new field.
	* libcoff.h: Rebuild.
1999-09-07 04:28:27 +00:00
Ian Lance Taylor 4c117b10b2 reformat for 80 column screen 1999-09-07 04:14:35 +00:00
Ian Lance Taylor 75cc718903 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (sort_by_secaddr): New static function if
	COFF_IMAGE_WITH_PE.
	(coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort
	sections by VMA when assigning target_index values.  Always set
	virt_size.
1999-09-07 04:06:50 +00:00
Ian Lance Taylor fdfd89ab43 remove unneeded ifdefs 1999-09-07 03:42:53 +00:00
Ian Lance Taylor 8d3ad4e16f 1999-09-06 Donn Terry <donn@interix.com>
* libcoff-in.h (struct pei_section_tdata): Add pe_flags field.
	* coffcode.h (coff_set_alignment_hook): Set pe_flags field if
	COFF_WITH_PE.
	* libcoff.h: Rebuild.
1999-09-07 03:40:32 +00:00
Ian Lance Taylor 8a1ad8e793 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (coff_set_custom_section_alignment): Add const to
	declaration to match definition.
	(coff_write_object_contents): Don't set F_AR32W(R)? if
	COFF_WITH_PE.
1999-09-07 03:00:32 +00:00
Ian Lance Taylor 6fb72d08dc * coff-i386.c (in_reloc_p): Add declaration.
(i386coff_vec): Simplify initialization of
	application_section_flags.
1999-09-07 02:59:17 +00:00
Ian Lance Taylor 2820a0b713 add comment 1999-09-07 02:58:00 +00:00
Ian Lance Taylor 417335159b 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE
	version.  Move COFF_WITH_PE specific code to new version.
	(stype_to_sec_flags): Likewise.  Add section parameter.
	* coffgen.c (make_a_section_from_file): Set target_index before
	calling styp_to_sec_flags.  Pass section to styp_to_sec_flags.
	* libcoff.h: Rebuild.
1999-09-07 02:11:54 +00:00
Ian Lance Taylor 9296256064 1999-09-06 Donn Terry <donn@interix.com>
* syms.c (stt): Add some PE/PEI section names.
	(bfd_decode_symclass): Return 'w', not 'U', for a weak undefined
	symbol.
	(bfd_symbol_info): Check for 'w'.
1999-09-06 18:44:56 +00:00
Ian Lance Taylor 022a5af495 1999-09-06 Donn Terry <donn@interix.com>
* section.c (struct bfd_comdat_info): Define.
	(asection): Add comdat field.
	(STD_SECTION): Initialize comdat field.
	(bfd_make_section_anyway): Likewise.
	* bfd-in2.h: Rebuild.
1999-09-06 18:34:29 +00:00
Andreas Schwab 0d271c1a5e * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag
to version symbols.
1999-09-06 10:56:08 +00:00
Nick Clifton fed79cc616 use bfd memory allcation routines 1999-09-06 08:57:49 +00:00
Ian Lance Taylor 0bcb993b9f 1999-09-04 Steve Chamberlain <sac@pobox.com>
* cpu-pj.c: New file.
	* elf32-pj.c: New file.
	* config.bfd (pj*): New cpu.
	(pj-*-*, pjl-*-*): New targets.
	* configure.in (bfd_elf32_pj_vec): New target vector.
	(bfd_elf32_pjl_vec): New target vector.
 	* archures.c (bfd_arch_pj): Define.
	* elf.c (prep_headers): Handle bfd_arch_pj.
	* reloc.c: Define BFD_RELOC_PJ_* relocations.
	* targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add
	to target vector list.
	* Makefile.am: Rebuild dependencies.
	(ALL_MACHINES): Add cpu-pj.lo.
	(ALL_MACHINES_CFILES): Add cpu-pj.c.
	(BFD32_BACKENDS): Add elf32-pj.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-pj.c.
	* configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
1999-09-04 17:07:46 +00:00
Ian Lance Taylor 7843f00e2d * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define.
* elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK
	and NON_GOT_REF from weak defined symbol to real symbol.
	* elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF.
	(elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't
	create a COPY reloc.
	* elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF.
	(elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set,
	don't create a COPY reloc.
1999-09-04 16:26:08 +00:00
Ian Lance Taylor dca1443537 rebuild 1999-09-03 18:34:45 +00:00
Ian Lance Taylor 814fe68ac5 * elflink.h (elf_bfd_final_link): When counting relocations, don't
count those in sections we are not including in the link.
1999-09-03 18:34:02 +00:00
Jeff Law 20e29382fd * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK
field in hpux11 shared libraries.
1999-09-02 23:44:54 +00:00
Nick Clifton 4b56dbbd4a Fix memory leak. 1999-09-02 17:56:51 +00:00
Jeff Law f273939b8e Fix minor typos introduced while cleaning up the previous patch. 1999-09-01 20:06:15 +00:00
Jeff Law 2eb429af04 * elf-hppa.h (elf_hppa_add_symbol_hook): New function.
(elf_hppa_final_link, elf_hppa_relocate_section): Likewise.
        (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise.
1999-09-01 19:42:17 +00:00
Ian Lance Taylor d7f1f2b0be fix FSF address 1999-08-31 15:12:20 +00:00
Nick Clifton 994819d267 When possible, keep the original type of the symbol. 1999-08-31 14:07:27 +00:00
Jeff Law 735c91d811 Check in correct version of previous patch. 1999-08-30 21:57:08 +00:00
Jeff Law 0d571602ca * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both
R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the
        tools were configured.
        * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare.
1999-08-30 21:30:36 +00:00
Mark Mitchell 9458945f8f * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local
GOT entries for GOT16 relocations; they're not required.
1999-08-27 00:08:50 +00:00
Nick Clifton 021e3cc067 Path from Roland McGrath <roland@baalperazim.frob.com>
Added arm-netbsd target.
1999-08-24 15:16:53 +00:00
Jeff Law 7da1b1756d * som.c (som_slurp_symbol_table): Fix typo in comment. 1999-08-24 06:26:39 +00:00
Jeff Law 1ca740621c * elf-hppa.h (elf_hppa_fake_sections): Compute section indices
here instead of using elf_section_data...
1999-08-20 23:03:04 +00:00
Nick Clifton ddda4409ce fix bug in previous delta 1999-08-20 07:56:08 +00:00
Nick Clifton 69e70d3056 Add code to emit relocs into a base file. 1999-08-19 13:04:45 +00:00
Nick Clifton 98c1d4aab7 Fix partial REL relocs. 1999-08-19 10:12:28 +00:00
Ian Lance Taylor b2d638c7ec 1999-08-18 Donn Terry <donn@interix.com>
* cofflink.c: Move definitions of N_TMASK, et. al., out of
	_bfd_coff_link_input_bfd into top level.
1999-08-19 00:55:50 +00:00
Ian Lance Taylor 00692651e0 1999-08-18 Donn Terry <donn@interix.com>
* coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE.
	(RTYPE2HOWTO): Return NULL if reloc type is out of range.
	(coff_i386_rtype_to_howto): Likewise.
	* coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG.
	Completely ignore symbols which are all zero.
	(dummy_reloc16_estimate): Add return 0.
	* cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope
	variable copy to name_copy to avoid shadowing outer scope
	variable.
	* libcoff-in.h (coff_data_type): Change raw_syment_count field
	from unsigned int to unsigned long.  Add timestamp field.
	* libcoff.h: Rebuild.

Also comment changes.
1999-08-18 06:00:13 +00:00
Ian Lance Taylor 7bb9db4d63 comment changes from Donn Terry, and indentation changes 1999-08-18 05:59:47 +00:00
Ian Lance Taylor f994ccccd3 add comment from Donn Terry 1999-08-18 05:58:46 +00:00
Ian Lance Taylor 1396cd2d7f 1999-08-17 H.J. Lu <hjl@gnu.org>
* elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in
	macro definition.
1999-08-17 07:53:37 +00:00
Ian Lance Taylor 0035bd7bda * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC
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-17 07:50:30 +00:00
Mark Mitchell 8535d39cc8 * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate
coincidence of variable names between old and new code.
1999-08-15 22:56:21 +00:00
Nick Clifton bcbdc74cb2 Fix interworking problems. 1999-08-12 08:37:15 +00:00
Jeff Law 183df869b6 Fix typo. 1999-08-11 18:15:39 +00:00
Nick Clifton 230801466a Check for overflow on R_ARM_PC24 relocs. 1999-08-11 10:56:35 +00:00
Jeff Law 052e120f44 * elf-hppa.h (elf_hppa_fake_sections): New function.
* elf32-hppa.c (elf_backend_fake_sections): Define.
1999-08-11 09:30:20 +00:00
Jeff Law 3a9acac86a * elf-hppa.h (elf_hppa_final_write_processing): Update for
recent changes to the arch_info structure.
1999-08-10 19:19:22 +00:00
Jeff Law fc91f6585b * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle
R_HPPA_SEGBASE and R_HPPA_SEGREL32.
        * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info
        list.
1999-08-10 18:51:53 +00:00
Mark Mitchell 5499724a85 * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always
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 06:43:11 +00:00
Mark Mitchell 7b1f123191 * elf32-mips.c (mips_elf_create_dynamic_relocation): Change
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-10 06:27:48 +00:00
Mark Mitchell ce00621771 * elflink.h (elf_bfd_final_link): Tweak last change. 1999-08-10 06:22:57 +00:00
Mark Mitchell b037af20d6 * elflink.h (elf_link_size_reloc_section): Use the counts in the
elf-section data to allocate just the right amount of relocation
	space.  Don't allocate the hash space twice.
	(elf_bfd_final_link): Calculate the amount of space to allocate in
	each relocation section.
1999-08-10 03:36:28 +00:00
Jeff Law 432bdd91dd * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in
64bit mode, generate a section relative relocation for a 32bit
        wide relocation.
        (elf_hppa_is_local_label_name): New function.
        * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted.  To be
        shared between 32bit and 64bit port.
1999-08-09 23:47:04 +00:00
Mark Mitchell b944b044fb * elf32-mips.c (elf_mips_howto_table): Fix src_mask for
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-09 22:45:39 +00:00
Ian Lance Taylor 10e80b4145 rebuild with patched automake 1999-08-09 20:22:04 +00:00
Ian Lance Taylor 840a9995b3 1999-08-09 Jakub Jelinek <jj@ultra.linux.cz>
* elf64-sparc.c (sparc64_elf_relocate_section): Back out part of
	the Sep. 4th, 1998 change.  glibc 2.0.x dynamic linker had bug,
	not binutils.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1999-08-09 15:07:32 +00:00
Ian Lance Taylor 91d3970e7d 1999-08-09 Geoff Keating <geoffk@cygnus.com>
* elflink.h (elf_link_output_extsym): Don't output a weak
	reference to an undefined symbol just because it was defined weak
	in a shared object.
1999-08-09 05:42:31 +00:00
Ian Lance Taylor 798c1fb8d7 1999-08-09 Eli Zaretskii <eliz@is.elta.co.il>
* coffgen.c (coff_find_nearest_line): When looking for file, use
	last best match rather than first.  If address is beyond last line
	number record, don't return the last line as the correct value.
1999-08-09 04:04:17 +00:00
Ian Lance Taylor 851edbafcc * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT.
* bfd-in2.h: Rebuild.
1999-08-09 03:20:31 +00:00
Ian Lance Taylor 5dccc1ddaa 1999-08-08 Mark Elbrecht <snowball3@bigfoot.com>
* libcoff-in.h (struct coff_section_alignment_entry): Define.
	* coffcode.h (coff_set_custom_section_alignment): New static
	function.
	(coff_section_alignment_table): New static array.
	(coff_new_section_hook): Use coff_set_customer_section_alignment.
	* coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
	* coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
	* libcoff.h: Rebuild.
1999-08-09 02:56:16 +00:00
Ian Lance Taylor 74eeebeafb * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to
MKDEP.
	* Makefile.in: Rebuild.
1999-08-08 17:26:50 +00:00
Ian Lance Taylor bd826630b1 1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
* section.c (SEC_SHARED): Define.
	* coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
	(styp_to_sec_flags): Likewise.
	* peicode.h (coff_swap_scnhdr_out): Likewise.
	* bfd-in2.h: Rebuild.

1999-08-08  Ian Lance Taylor  <ian@zembu.com>

	* coffcode.h (coff_classify_symbol): Comment out part of
	1999-08-05 change which breaks cygwin DLLs.
1999-08-08 16:50:27 +00:00
Ian Lance Taylor 855b0be7f7 * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*.
* aclocal.m4, configure: Rebuild.
1999-08-08 16:01:13 +00:00
Ian Lance Taylor 22bc497dda * section.c (global_syms): Only initialize union field if
__STDC__.
1999-08-06 23:31:14 +00:00
Mark Mitchell 4f2860cafc * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by
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-06 02:44:41 +00:00
Ian Lance Taylor 5d54c62870 Based on patches from Donn Terry <donn@interix.com>:
* coffcode.h (enum coff_symbol_classification): Define.
	(bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to
	_bfd_coff_classify_symbol.  Change return type.
	(bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global.
	(coff_slurp_symbol_table): Use coff_classify_symbol.
	(coff_classify_symbol): New static function.
	(coff_sym_is_global): Never define.
	(bfd_coff_std_swap_table): Initialize with coff_classify_symbol.
	* cofflink.c (coff_link_check_ar_symbols): Use
	bfd_coff_classify_symbol rather than bfd_coff_sym_is_global.
	(coff_link_add_symbols): Likewise.
	(_bfd_coff_link_input_bfd): Likewise.
	* coff-sh.c (bfd_coff_small_swap_table): Initialize with
	coff_classify_symbol.
	* libcoff.h: Rebuild.
1999-08-05 21:01:37 +00:00
Jeff Law 1560fbe45e * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors
(e_ltpsel, e_rtpsel): Similarly.
1999-08-05 03:50:28 +00:00
Jeff Law 3686090072 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel
and 14bit ertpsel.  Handle 64bit psel.
1999-08-05 00:12:22 +00:00
Mark Mitchell e7c4421855 * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16
handling for REL relocations.  And only left-shift R_MIPS26
	relocation addends where necessary.
1999-08-04 16:32:34 +00:00
Mark Mitchell 23b255aadd * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ...
(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-04 03:52:59 +00:00
Mark Mitchell 3811169e5f * elf32-mips.c (mips_elf_calculate_relocation): Restore
_DYNAMIC_LINK handling and handling of undefined symbols in shared
	libraries.
1999-08-03 16:58:26 +00:00
Ian Lance Taylor 2d14625061 * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation
value of a symbol in a SEC_DEBUGGING section.  Warn when doing a
	relocation against a symbol in an input section with no output
	section.  From Daniel Jacobowitz <drow@false.org>.
1999-08-03 16:40:25 +00:00
Ian Lance Taylor cb94091feb * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used. 1999-08-03 16:31:37 +00:00
Ian Lance Taylor aab0843134 * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to
look for generated file correctly.
	* aclocal.m4, configure: Rebuild.
1999-08-03 16:10:38 +00:00
Mark Mitchell 05fad94de0 Fix typo 1999-08-03 06:06:47 +00:00
Mark Mitchell 5a44662b54 * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26
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-03 06:04:21 +00:00
Richard Henderson 1fa0ddb30b Jakub Jelinek <jj@ultra.linux.cz>
* elflink.h (elf_bfd_final_link): Copy the whole isym, not just
        some fields.
        * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used
        variables and initialize them.
1999-08-02 22:31:18 +00:00
Mark Mitchell 7a12753dad Fix typo 1999-08-01 22:45:06 +00:00
Mark Mitchell 8b237a8965 * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where
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 22:38:53 +00:00
Mark Mitchell 972875741c * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak
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-08-01 20:58:19 +00:00
Richard Henderson a11c78e7dd Jakub Jelinek <jj@ultra.linux.cz>
* elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI
        wants ba,a,pt %xcc instead of %icc.
        Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots
        of large PLT entries.
        (sparc64_elf_plt_ptr_offset): Fix calculation.
        (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT
        addend should be relative to load address, not .plt section start.
        (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries.
1999-07-30 21:42:21 +00:00
Richard Henderson 587ff49e9a Jakub Jelinek <jj@ultra.linux.cz>
* elf-bfd.h (struct elf_backend_data): Add
        print_symbol_all and output_arch_syms backend methods.
        * elfxx-target.h: Likewise.
        * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create,
        sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms,
        sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New
        functions.
        (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER
        symbols in .dynsym, add their names into .dynstr. Put those symbols
        into dynlocal.
        (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER
        pointers to STT_REGISTER symbols in dynsym section.
        (sparc64_elf_print_symbol_all): New function.
        * elf.c (bfd_elf_print_symbol): Allow special backend symbol
        printing using the print_symbol_all hook.
1999-07-30 21:34:44 +00:00
Catherine Moore d512aa072e Correctly handle Vtentry relocs. 1999-07-30 15:09:54 +00:00
Richard Henderson 441d6d7953 * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if
dynamic_sections_created.
1999-07-29 22:20:26 +00:00
Richard Henderson c9b3cbf33c * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ...
(mips_rtype_to_howto): ... new function.
        (_bfd_mips_elf_relocate_section): Use it.
1999-07-29 21:39:01 +00:00
Mark Mitchell b89db8f2f0 * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo. 1999-07-28 08:19:34 +00:00
Nick Clifton f81112823f Change to strip out only symbols that start with LOCAL_LABEL_PREFIX followed
by 'L'.
1999-07-27 14:45:44 +00:00
Ian Lance Taylor 7fd9c19135 1999-07-23 Donn Terry <donn@interix.com>
* libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags
	field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL.
	* cofflink.c (coff_link_add_symbols): If PE, handle section
	symbols specially.
	* libcoff.h: Rebuild.
1999-07-24 03:16:50 +00:00
Ian Lance Taylor 7d923127c0 1999-07-23 Donn Terry <donn@interix.com>
* config.bfd (i[3456]86-*-interix*): New target.
1999-07-24 02:35:30 +00:00
Ian Lance Taylor 242eabea02 1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>
* coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and
	COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with
	.gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD.
	* coff-go32.c: (COFF_LONG_SECTION_NAMES): Define.
	(COFF_SUPPORT_GNU_LINKONCE): Define.
	* coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define.
	(COFF_SUPPORT_GNU_LINKONCE): Define.
1999-07-22 01:39:23 +00:00
Ian Lance Taylor 980e4bf7fe From Mark Elbrecht:
* configure.bat: Remove; obsolete.
1999-07-22 01:07:15 +00:00
Ian Lance Taylor 9c8ac5a997 From Mark Elbrecht:
* makefile.dos: Remove; obsolete.
1999-07-22 00:55:12 +00:00
Ian Lance Taylor b23b8e6e55 rebuild 1999-07-22 00:51:51 +00:00
Ian Lance Taylor 957ccf4406 1999-07-21 H.J. Lu <hjl@gnu.org>
* config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes.
1999-07-22 00:51:11 +00:00
Ian Lance Taylor 75987f837d 1999-07-21 Philippe De Muyter <phdm@macqel.be>
* cofflink.c (_bfd_coff_generic_relocate_section): Issue an error
	message	and fail if a symbol index is out of range.
1999-07-22 00:29:35 +00:00
Ian Lance Taylor 2841ecd078 * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value
when looking at a R_MIPS_GOT16 relocation.
1999-07-21 23:32:29 +00:00
Nick Clifton 8a70eff3a2 Use CREATE_BIG_COFF_TARGET_VEC 1999-07-20 08:52:54 +00:00
Mark Mitchell f1a5f37efe Fix typo in last change. 1999-07-19 20:11:22 +00:00
Mark Mitchell 0db63c1868 * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP
removed in previous change.
	(_bfd_mips_elf_relocate_section): Adjust GP relative relocations
 	in relocateable output.
1999-07-19 20:06:24 +00:00
Ian Lance Taylor 272dc76f04 * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target
structure.
1999-07-19 19:22:02 +00:00
Ian Lance Taylor accc7f6940 * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
if they appear to be specially created by the linker.
1999-07-19 19:08:33 +00:00
Nick Clifton c3c89269f8 Add new field to bfd_target structure.
Initialise this field for all known bfd targets.
Add new search function to targets.c
1999-07-19 14:55:16 +00:00
Andreas Schwab a9602746fa * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash
and rel_hdr.
1999-07-19 09:11:14 +00:00
Mark Mitchell 31367b81b7 * elflink.h (elf_link_adjust_relocs): New function.
(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-18 06:31:29 +00:00
Richard Henderson f65054f7be Jakub Jelinek <jj@ultra.linux.cz>
* elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID.
        (sparc64_elf_get_reloc_upper_bound,
        sparc64_elf_get_dynamic_reloc_upper_bound,
        sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
        sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs):
        New functions.
        (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use
        ELF64_R_TYPE_ID/DATA where appropriate.
1999-07-16 21:28:40 +00:00
Richard Henderson d6bcbdc1fe Jakub Jelinek <jj@ultra.linux.cz>
* elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove
        DT_SPARC_PLTFMT.
1999-07-16 21:25:28 +00:00
Ian Lance Taylor 6387d6028b * elf32-mips.c (mips_elf_local_relocation_p): New static
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-16 19:09:22 +00:00
Andreas Schwab 318da145ed * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused
variables `link' and `elfsec'.
	(elf_bfd_final_link): Remove unused variable `os'.
1999-07-16 08:10:27 +00:00
Mark Mitchell 435394bff7 * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require
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 16:57:57 +00:00
Ian Lance Taylor ac352105e1 1999-07-15 J.T. Conklin <jtc@redback.com>
* config.bfd (i[3456]86-*-vxworks*): New target.
1999-07-15 14:38:23 +00:00
Mark Mitchell 197b9ca0f9 * elf32-mips.c (mips_elf_stub_section_p): New function.
(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-15 13:12:02 +00:00
Ian Lance Taylor 3a6ae6163b * configure.in: Bump version number to 2.9.5.
* configure: Rebuild.
1999-07-15 11:48:14 +00:00
Jeff Law 6e2bf930a0 è
* elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle
        64bit format.
        (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type
        to derive final type instead of hardwiring a selection.
1999-07-15 02:06:03 +00:00
Jeff Law 1b83fcb388 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle
64bit format.
        (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type
        to derive final type instead of hardwiring a selection.
1999-07-15 02:06:02 +00:00
Mark Mitchell 6296902ea5 * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of
things relocated by R_MIPS16_GPREL.
	(mips_elf_perform_relocation): Likewise.
1999-07-14 19:00:32 +00:00
Richard Henderson 2ac8ce5fe0 * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss. 1999-07-14 16:14:49 +00:00
Richard Henderson b3be9b46c2 * elf32-mips.c (struct mips_got_info): Add global_gotno.
(_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 14:23:13 +00:00
Mark Mitchell 1e52e2ee34 * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit
subwords when handling an R_MIPS16_26 relocation.
	(mips_elf_perform_relocation): Don't be paranoid abour right-shift
	semantics.
1999-07-14 11:46:04 +00:00
Mark Mitchell b7233c24e1 * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and
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-14 09:45:46 +00:00
Mark Mitchell 81edd86dd1 * dwarf2.c (read_attribute): Support DW_FORM_ref8.
* 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.
1999-07-14 08:49:40 +00:00
Mark Mitchell e53bd91b0f * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26.
(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 23:55:08 +00:00
Richard Henderson 28a7f3e70d * elf.c (assign_file_positions_for_segments): Thinko last change.
Always overwrite p_flags.
1999-07-13 20:10:26 +00:00
Richard Henderson 3018b44153 * elf-bfd.h (struct elf_backend_data): Add want_dynbss.
* elflink.c (_bfd_elf_create_dynamic_sections): Only create
        .dynbss and .rel[a].bss if want_dynbss.
        * elfxx-target.h (elf_backend_want_dynbss): Provide default.
1999-07-13 18:31:17 +00:00
Richard Henderson 30b30c2181 * elf-bfd.h (struct elf_link_local_dynamic_entry): New.
(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 18:21:29 +00:00
Richard Henderson e1ee1229a2 * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. 1999-07-13 17:30:21 +00:00
Mark Mitchell 97a4bb053f * elf32-mips.c (mips_elf_calculate_relocation): Do not complain
when _gp_disp is undefined.  Do not check R_MIPS_LO16 for overflow
	when the relocation is against _gp_disp.
1999-07-13 15:23:22 +00:00