Commit Graph

1544 Commits

Author SHA1 Message Date
Ian Lance Taylor
945f125b45 * coff-rs6000.c (rs6000coff_mkarchive): Return false.
(rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used.
	Also removed unused variable namelen.
	(rs6000coff_write_armap): Declare orl_count and stridx parameters.
1994-02-09 17:59:32 +00:00
Ken Raeburn
fa965415f5 * coff-alpha.c (reloc_nil): New function.
(alpha_howto_table): Use it as special_function to prevent certain relocs from
being adjusted by bfd_perform_relocation.  IGNORE reloc should be
partial_inplace.
(alpha_ecoff_get_relocated_section_contents): Accept a LITERAL reloc on an
"ldl" instruction too.
1994-02-08 20:58:20 +00:00
Peter Schauer
7c202d3775 * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub):  Cast to char * instead of int
	before performing pointer arithmetic.
1994-02-08 08:57:46 +00:00
Jeff Law
9ed21f0ebf * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this
configuration.
        (hppa*-*-*elf*): This configuration used hppa-elf now.

        * som.c: This file is also used for HOST_HPPAOSF.

        * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.

        * hosts/hppaosf.h: New host configuration file.

        * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as
        BSD handles both SOM and ELF object files.

        * config/hppaosf.mh (HDEFINES): Delete.  No longer needed.
        (RANLIB): Doesn't do anything, define it to be "echo".

        * config/hppaosf.mt: New target makefile fragment for a PA running
        OSF1.
1994-02-08 05:17:01 +00:00
Jeff Law
6941fd4d64 * som.c: This file is also used for HOST_HPPAOSF.
* targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.
1994-02-08 05:09:34 +00:00
Jeff Law
1c8c89a8b2 New host configuration file. 1994-02-08 04:58:32 +00:00
Ian Lance Taylor
66f1cff54b * archures.c (enum bfd_architecture): Added bfd_arch_powerpc.
(archures_init_table): If SELECT_ARCHITECTURES is not defined,
	added bfd_powerpc_arch.
	* bfd-in2.h: Rebuilt.
	* cpu-powerpc.c: New file.
	* Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c.
	Rebuilt dependencies.
1994-02-08 00:38:00 +00:00
Ian Lance Taylor
384c17918b PowerPC CPU support. 1994-02-08 00:35:31 +00:00
Ian Lance Taylor
bf96913525 * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power
of an SHT_STRTAB section from sh_addr and sh_addralign, rather
	than just setting them to zero.
1994-02-07 20:04:46 +00:00
David MacKenzie
b9d5cdf003 * elfcode.h (prep_headers, swap_out_syms): Check for NULL return
from bfd_new_strtab.
	(elf_compute_section_file_positions): Check for false return from
	swap_out_syms.

	* linker.c (default_indirect_link_order): Check for NULL return
	from bfd_get_relocated_section_contents.

	* syms.c: Make example application in doc call xmalloc, not
	bfd_xmalloc.

	* aoutx.h (NAME(aout,slurp_symbol_table),
	aout_link_get_symbols, NAME(aout,link_hash_table_create)):
	* bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs):
	* ecoff.c (ecoff_bfd_link_hash_table_create):
	* ecofflink.c (bfd_ecoff_debug_init):
	* format.c (bfd_check_format_matches):
	* linker.c (_bfd_generic_link_hash_table_create):
	(_bfd_generic_final_link):
	* reloc16.c (bfd_coff_reloc16_relax_section):
	(bfd_coff_reloc16_get_relocated_section_contents):
	* elf32-hppa.c (hppa_elf_build_arg_reloc_stub):
	* elf32-mips.c (mips_elf_final_link):
	* elfcode.h (bfd_new_strtab):
	(bfd_add_2_to_strtab):
	(elf_slurp_symbol_table):
	(elf_corefile_note):
	* libbfd.c (bfd_zmalloc):
	Use malloc and check the result, instead of bfd_xmalloc.
1994-02-07 05:17:21 +00:00
Jim Kingdon
6b054519ff * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*. 1994-02-05 20:41:44 +00:00
Peter Schauer
bf430317a5 * srec.c (srec_write_record): Put CONST keyword for "src" before
"unsigned", some compilers don't like it after "unsigned".
	* libcoff.h, libcoff-in.h (bfd_perform_slip):  Rename "value" to
	"val" in prototype declaration because some compilers don't like
	arguments whose names are the same as types.
1994-02-05 13:38:52 +00:00
Ian Lance Taylor
9b39ed6bfa * aoutx.h (aout_link_check_ar_symbols): Correct test for whether
object file defines symbol.  Also, if skipping a symbol, skip the
	second symbol of a N_WARNING or N_INDR symbol as well.
1994-02-05 06:17:36 +00:00
Ian Lance Taylor
d352be4f43 * reloc.c (bfd_perform_relocation): Work around one gross hack
with another: actually look at the target name to avoid the broken
	COFF check.
	(bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26,
	BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16.
	* bfd-in2.h: Rebuilt.
1994-02-05 05:13:59 +00:00
Ian Lance Taylor
c8d672fe7a * coffcode.h (combined_entry_type): Changed fix_tag and fix_end
fields to bitfields.  Added fields fix_value and fix_scnlen.
	(sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
	STYP_INFO for the type of a section named .debug.
	(coff_add_missing_symbols): Don't define if RS6000COFF_C.
	(coff_write_object_contents): If RS6000COFF_C, don't call
	coff_add_missing_symbols.
	(coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
	entry has type STY_LD change the x_scnlen into a pointer to a
	symbol and set fix_scnlen.  Also, for a C_BSTAT symbol, change the
	value into a pointer to a symbol and set fix_value.
	* libcoff.h: Rebuilt.
	* coffgen.c (coff_mangle_symbols): Reindent.  If fix_value is set,
	get the symbol offset. Likewise for fix_scnlen.
	(string_size): Change type to bfd_size_type.
	(debug_string_size, debug_string_section): New static variables.
	(coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
	write the symbol name into the .debug section; assume that the
	section has already been created with the right size.
	(coff_write_symbols): Initialize debug_string_size to 0.  If
	bfd_coff_symname_in_debug returns true, don't put symbol name in
	usual string table.  After writing out all symbols, if
	debug_string_size is not 0, check that it matches the size of the
	.debug section.
	(coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
	fields.  If the string offset is 0, always use an empty string as
	the name.
	(coff_make_empty_symbol): Zero out the symbol structure.
1994-02-05 05:11:46 +00:00
David MacKenzie
6a5439a91f Eliminate arg from bfd_xmalloc_by_size_t macro, allowing
undoing of obstack parts of last change.
1994-02-05 03:02:32 +00:00
David MacKenzie
0ee3427297 * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
(bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
	* libbfd-in.h: Define them as macros calling xmalloc and declare
	xmalloc.
	* libbfd.h: Rebuilt.
	* ecofflink.c hash.c ieee.c opncls.c (obstack_chunk_alloc): Define
	to be xmalloc, not bfd_xmalloc_by_size_t.
1994-02-05 02:46:12 +00:00
Ian Lance Taylor
cbc174e7ab * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined
symbol has a value in the ECOFF symbol but not in the BFD symbol,
	keep the value in the ECOFF symbol.  This helps gas.
1994-02-04 04:18:28 +00:00
Ian Lance Taylor
5072b8e530 * linker.c (_bfd_generic_link_output_symbols,
_bfd_generic_link_write_global_symbol): Don't require that all
	references to a common symbol be themselves common symbols.
1994-02-03 23:01:49 +00:00
Ian Lance Taylor
fa2302b8ed * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF. 1994-02-03 21:52:06 +00:00
Jim Kingdon
0324156c66 * bfd-in2.h: Rebuilt. 1994-02-03 04:03:11 +00:00
Jim Kingdon
78c3dc5cee * bfd-in2.h: Rebuilt. 1994-02-03 03:33:20 +00:00
Jim Kingdon
96ad107bcc * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h,
sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT.
1994-02-03 03:31:22 +00:00
Ian Lance Taylor
38e1f0cecd * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type
and size correctly.
	(coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to
	x_csect.x_scnlen.l to match change in coff/internal.h.
	(coff_swap_aux_out): Likewise.
1994-02-02 19:35:14 +00:00
Ian Lance Taylor
ebf3b4cd68 * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c
(alpha_ecoff_backend_data): Change casts of aux_in and aux_out
	fields to match yesterday's changes.
1994-02-02 17:40:46 +00:00
Ian Lance Taylor
192d8ee84b * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass
in the internal_reloc itself, not the type.
	* coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c,
	coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed
	definition of SELECT_RELOC accordingly.
1994-02-02 17:36:17 +00:00
Ian Lance Taylor
330595d00b * coffcode.h (bfd_coff_backend_data): Added new arguments to
_bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
	and number of aux entries.
	(bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
	accordingly.
	* libcoff.h: Rebuilt.
	* coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
	arguments.  If RS6000COFF_C, only treat C_EXT and C_HIDEXT
	specially if this is the last aux entry.
	* coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
	new arguments to swap_aux functions.
1994-02-01 17:11:56 +00:00
Ken Raeburn
26b572e4d9 Makefile.in (check, installcheck): Identify directory in "no testsuites"
message.
1994-01-31 04:20:00 +00:00
Ken Raeburn
4e8108491b * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros
(only testing for m68k and vax at the moment); do verify that the
	preprocessor didn't trash the arch name inside the string version.
	Don't print out "pagesize =" line that prevents output from
	compiling.  Derive BYTES_IN_WORD and ARCH values from sizeof
	results.
	* Makefile.in (aout-params.h): Pass gen-aout a dummy target name.
1994-01-30 20:30:53 +00:00
Ian Lance Taylor
2edc8357de * aoutx.h (aout_link_write_symbols): Write out correct value for
object file symbol.
1994-01-30 18:29:26 +00:00
Ken Raeburn
098630a0e0 * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define
KERNBASE, so hard-code 0x80000000 instead.
1994-01-28 23:42:25 +00:00
Ian Lance Taylor
c315696657 * linker.c (generic_link_add_symbol_list): If symbol is common,
set the BSF_OLD_COMMON flag.
1994-01-27 18:56:42 +00:00
David MacKenzie
d6d4e4c3d0 * format.c (bfd_check_format_matches): Put the new entry in the
correct element of matching_vector.
1994-01-26 21:53:55 +00:00
Ian Lance Taylor
8638431e66 * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2. 1994-01-25 20:48:48 +00:00
Ian Lance Taylor
3b490cdddb * hp300hpux.c (MY(write_object_contents)): Write out the symbols
before writing out the relocs, so that the right symbol indices
	are used.
1994-01-25 18:38:20 +00:00
Ian Lance Taylor
71d58b5976 * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not
try to overlay the internal carsyms on the external symdefs.  That
	can not work if the size of a host pointer is larger than 4 bytes.
1994-01-25 18:20:50 +00:00
Ian Lance Taylor
751446f635 * format.c (bfd_check_format_matches): Cast result of
bfd_xmalloc_by_size_t.
	* opncls.c (_bfd_new_bfd): Avoid ANSI C prototype.
1994-01-25 18:14:25 +00:00
Jim Kingdon
09f7054951 * som.c, som.h (bfd_som_set_section_attributes,
bfd_som_set_subsection_attributes): Change parameters from char
	to int.  Following a prototype with an old-style function definition
	in the presence of widened parameters is a GCC-ism not supported
	by the HP compiler in ANSI mode.
1994-01-25 16:56:24 +00:00
Ian Lance Taylor
13944a3e4c A few more minor formatting cleanups. 1994-01-25 16:53:48 +00:00
Ian Lance Taylor
a927c32d18 * archive.c: Reindented to GNU standards. 1994-01-25 16:47:50 +00:00
David MacKenzie
f4bd7a8f0e * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
"_bfd_" to function names.
	* archive.c (_bfd_create_empty_archive_element_shell),
	libbfd-in.h: Change callers.

	* libbfd.c (bfd_zmalloc): Renamed from zalloc.
	* libbfd.c (bfd_add_to_string_table),
	trad-core.c (trad_unix_core_file_p),
	targets.c (bfd_target_list),
	ptrace-core.c (ptrace_unix_core_file_p),
	opncls.c (new_bfd), libbfd-in.h,
	ieee.c (ieee_make_empty_symbol),
	elf32-hppa.c (hppa_elf_stub_branch_reloc),
	(hppa_elf_stub_reloc): Change callers.
	* libbfd.h: Regenerated.

	* archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
	(_bfd_get_elt_at_filepos),
	coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
	Change callers.

	* format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
	elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
	and default_vector to bfd_default_vector.
	* libbfd.h: Regenerated.
1994-01-25 13:25:26 +00:00
Ian Lance Taylor
3f048f7ff9 * coff-alpha.c (alpha_ecoff_object_p): New function. Set size of
.pdata section based on lnnoptr field, not section header.
	(alpha_relocate_section): Don't bother to check if r_symndx >= 0,
	since it is unsigned.
	(ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than
	coff_object_p.
	* ecoff.c (ecoff_new_section_hook): Set alignment_power field of
	.pdata section to 3.
	(ecoff_compute_section_file_positions): Save the size of the
	.pdata section in the line_filepos field, and actually align the
	.pdata section to an alignment power of 4.
	(ecoff_compute_reloc_file_positions): Set output_has_begun after
	calling ecoff_compute_section_file_positions.
	(ecoff_write_object_contents): Set s_lnnoptr for the .pdata
	section from the line_filepos field.  Set vstamp for the optional
	header from the vstamp of the symbolic header.
	(ecoff_bfd_final_link): Set vstamp of the symbolic header to the
	vstamp used by the first object file in the link.
1994-01-25 01:52:48 +00:00
Ian Lance Taylor
1fe2801ae6 * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align. 1994-01-25 01:50:46 +00:00
Ian Lance Taylor
a20bdb43f0 * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
for a created common section.
	(_bfd_generic_link_add_one_symbol): Likewise.
1994-01-24 23:56:56 +00:00
Ian Lance Taylor
d4fb8fced1 * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
get the index of a common section, rather than always using
	SHN_COMMON (MIPS has multiple common sections).
1994-01-24 23:54:51 +00:00
David MacKenzie
aabda2da07 * format.c (bfd_check_format_matches): New function.
(bfd_check_format): Call it.
	(bfd_matching_formats): Function removed.
	* targets.c: Replace the vector added on Jan 21 with a count of
	entries in default_vector.
	* bfd-in2.h: Regenerated.
1994-01-24 23:33:23 +00:00
Ian Lance Taylor
7a60ed8cb9 * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =). 1994-01-24 20:26:49 +00:00
Ian Lance Taylor
4991ebb987 * bfd/aoutx.h (aout_link_input_section_std,
aout_link_input_section_ext): Pass additional arguments to
	reloc_overflow callback.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
	alpha_relocat_section): Likewise.
	* coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
	* coff-h8500.c (extra_case): Likewise.
	* coff-mips.c (mips_relocate_section): Likewise.
	* coff-z8k.c (extra_case): Likewise.
	* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
1994-01-24 20:23:18 +00:00
Ian Lance Taylor
1cedfe034e * bout.c (calljx_callback, callj_callback): Use get_value to get
the symbol value and check for undefined symbols.
	(get_value): If the symbol is undefined, look it up in the linker
	hash table.
	(b_out_get_relocated_section_contents): For PCREL24 and PCREL13
	use get_value to get the symbol value and check for undefined
	symbols.
	* reloc16.c (bfd_coff_reloc16_get_value): If the symbol is
	undefined, look it up in the linker hash table.
1994-01-24 18:05:08 +00:00
Ian Lance Taylor
ca1c6bec73 * aoutx.h (translate_symbol_table): The string index 0 has a
special meaning for normal symbols, but not for dynamic symbols.
1994-01-24 17:41:21 +00:00