Commit Graph

896 Commits

Author SHA1 Message Date
Jim Kingdon d7fb453182 * libbfd-in.h: Remove alloca cruft. It was missing some necessary
cruft (like the #pragma alloca for AIX).
	In addition to that problem, the C alloca calls xmalloc, which
	means checking for being out of memory can't work right.  The
	following changes remove all uses of alloca from BFD.
	* hosts/solaris2.h: Remove alloca cruft.
	* som.c: Replace alloca with a fixed size auto array.
	* aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
	ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c,
	sunos.c: Replace alloca with malloc and appropriate error checking and
	freeing.
	* linker.c: Replace alloca with obstack_alloc.
	* libbfd.h: Rebuilt.
1994-03-10 02:33:01 +00:00
Jim Kingdon 80425e6c82 * libbfd-in.h: Remove alloca cruft. It was missing some necessary
cruft (like the #pragma alloca for AIX).
	In addition to that problem, the C alloca calls xmalloc, which
	means checking for being out of memory can't work right.  The
	following changes remove all uses of alloca from BFD.
	* hosts/solaris2.h: Remove alloca cruft.
	* som.c: Replace alloca with a fixed size auto array.
	* aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
	ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c:
	Replace alloca with malloc and appropriate error checking and
	freeing.
	* linker.c: Replace alloca with obstack_alloc.
	* libbfd.h: Rebuilt.
1994-03-10 02:09:10 +00:00
Ian Lance Taylor 1404c3656d * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like
MIPS_R_GPREL.
1994-03-08 20:11:44 +00:00
Peter Schauer 802f4fe2f7 Add lost lines to previous ChangeLog entry. 1994-03-07 21:38:41 +00:00
Peter Schauer 25677b5b30 * elf32-hppa.h, elfcode.h: Replace uses of Elf*_Half, Elf*_Word,
Elf*_Off typedefs by their expansion, the typedefs have been
	removed from include/elf/internal.h.
1994-03-05 22:41:41 +00:00
Jeff Law 7b5f6e48f1 * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD. 1994-03-04 04:04:48 +00:00
Jim Kingdon baf200d479 * configure.host: Recognize i[34]86-sequent-*.
* trad-core.c (trad_unix_core_file_p): A non-zero, not zero,
	return from bfd_seek indicates an error.
	New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace
	TRAD_CORE_STACK_OFFSET.
	* hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and
	TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET.
1994-03-03 02:38:24 +00:00
Jeff Law 4e64845ca5 * som.[ch]: Do not include libhppa.h in som.c, instead include
it in som.h.

        * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead
        include it in elf32-hppa.h.
1994-03-02 23:04:29 +00:00
Jeff Law 98ecc94548 * som.c (log2): Return -1 on error rather than aborting.
(setup_sections): Bubble up an error from log2.
1994-03-02 20:32:10 +00:00
Jeff Law 44fd66228a * som.c (hppa_som_gen_reloc_type): Use correct enum type for
field parameter.
        (bfd_som_set_section_attributes): Use unsigned int rather than
        unsigned char to avoid GNU-C extensions.
        (bfd_som_attach_aux_hdr): Return a boolean to indicate success
        or failure rather than aborting on failure.

        * som.h (bfd_som_set_section_attributes): Fix prototype to match
        som.c changes.
        (bfd_som_attach_aux_hdr): Add prototype.
        (hppa_som-gen_reloc_type): Likewise.

        * elf32-hppa.c: Add a couple casts to make HP compiler happy.
        (hppa_look_for_stubs_in_section): Do not return false on failure
        until rest of code is ready to handle it.  Abort for now.
1994-03-02 19:59:03 +00:00
Jim Kingdon d1f8b18147 * bfd-in2.h: Rebuilt. 1994-03-02 02:36:07 +00:00
Kung Hsu bb37e7161e Modified Files:
ChangeLog i386os9k.c Makefile.in

        * i386os9k.c: use new functions bfd_set_error and bfd_get_error.
        * Makefile.in: delete an extra blank.
1994-03-01 21:39:28 +00:00
Kung Hsu 85cc33c754 Modified Files:
ChangeLog configure.in

       * configure.in : Add i396os9k_vec.
1994-03-01 21:09:17 +00:00
Kung Hsu 5143c305dd Modified Files:
ChangeLog
1994-03-01 00:00:06 +00:00
Kung Hsu 2f88343dbe Modified Files:
ChangeLog targets.c Makefile.in cache.c
Added Files:
	i386os9k.c

        * i386os9k.c : new file to handle os9k format bfd.
        * Makefile.in : Handle new file i386os9k.c
        * bfd-in2.h : Add bfd_target_os9k_flavour.
        * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec.
        * cache.c : Initialize cache_sentinel to 0.
1994-02-28 23:49:08 +00:00
Jeff Law f3b477bec4 * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch
action in case where caller specified no argument relocation.
        (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr
        right in the original relocation and the stub's relocation.
1994-02-28 04:25:14 +00:00
Jeff Law 6e58a4e5db * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo. Delete
unused symbols argument.

        * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather
        than asymbol * for original target symbol.  All callers changed.
        Set reloc->sym_ptr_ptr appropriately.
        (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly.
        (hppa_elf_look_for_stubs_in_section): No longer need symbols
        argument.  Use the output symbols when canonicalizing the relocs,
        creating them if necessary.

        * linker.c (_bfd_generic_link_output_symbols): Do not rebuild/clobber
        the output symbols if they already exist.
1994-02-28 00:32:14 +00:00
Stan Shebs fdfe2d1466 Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com)
* targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that
	check all the pointer dereferences.  Enabled via DEBUG_BFD_SEND.
	* bfd-in2.h: Rebuilt.
1994-02-27 23:45:18 +00:00
Stan Shebs 4c8d6c9f4f Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com)
* srec.c (hex_value): Always set to a size of 256 bytes.
	(srec_init): Cosmetic changes.
1994-02-27 23:28:48 +00:00
Jeff Law e08b9ad7a1 * elf32-hppa.c: Second half of major cleanup. More comments,
PARAMize and staticize rest of functions.  Delete unused
	functions.  Delete unused/unnecessary arguments to some functions.
	Group static vars together.  Abort for bad errors until we have
	error code propogation working.  Work on spacing and indention.
	Add FIXMEs for unresolved problems.  Use enums rather than
	#defines for lots of things.  Merge two functions which build
	linker stubs into a single function (so they can easily share a
	ton of common code).
1994-02-27 19:20:44 +00:00
Ian Lance Taylor 68241b2b3f * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc.
* ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
	* elf32-i386.c: Likewise.
	* elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
	#if 0 code.
	(elf_write_phdrs): Make i unsigned.
	(map_program_segments): Make i and n_left unsigned.
	(assign_file_positions_except_relocs): Make i unsigned.
	(write_shdrs_and_ehdr): Make count unsigned.
	(assign_file_positions_for_relocs): Make i unsigned.
	(NAME(bfd,elf_write_object_contents)): Make count unsigned.
	(section_from_elf_index): Make index argument unsigned.
1994-02-26 18:25:23 +00:00
Ian Lance Taylor 96db31875e Various entries. 1994-02-26 05:38:11 +00:00
Jeff Law f5bfdacd47 * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c.
* elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments.
        (elf_hppa_tc_make_sections): Likewise.
        (elf_hppa_final_processing): Add extern decl.

        * elf32-hppa.c: First half of major cleanup.  Add/cleanup lots of
        comments.  PARAMize some static functions.  Delete unused functions.
        Delete unused/unnecessary arguments to many functions.  Group
        static vars together.  Collapse common case statements together
        in many places.  Use default case when possible instead of listing
        each case separately.  Abort for bad errors until we get error
        code propogation working.  Work on spacing and indention problems.
        Add FIXMEs for some unresolved problems.  Delete hopelessly broken
        COMPLEX relocation support (it's never used anyway).
        (hppa_elf_rebuild_insn): Delete.  Moved into libhppa.h.
        (elf_hppa_tc_symbol): Accept and use new arguments (symext chains).
        (elf_hppa_tc_make_sections): Likewise.
1994-02-26 04:58:57 +00:00
Jeff Law 43ebdfcf4e * format.c (bfd_check_format_matches): Initialize matching_vector
to keep gcc -Wall quiet.

        * elfcode.h (elf_slurp_reloca_table): Fix typo.
1994-02-26 03:41:36 +00:00
Jeff Law d643978558 * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)"
not "sizeof (som_symbol_type *)".

        * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)"
        not "sizeof (asymbol").  Opps.
1994-02-26 00:39:03 +00:00
Ian Lance Taylor fbb8fe5c6e * bfd.c (bfd_get_gp_size): Can't return gp value on an archive.
(bfd_set_gp_size):  Can't set gp value on an archive.
1994-02-25 21:20:18 +00:00
Steve Chamberlain 5e80812667 * srec.c (pass_over): Don't skip too many characters when
end of line seen.
1994-02-25 21:09:09 +00:00
Ian Lance Taylor 626f883f94 * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte
boundary.
1994-02-25 19:42:43 +00:00
Peter Schauer a69b39f0c5 * elfcode.h (elf_core_file_p): Check for core file e_machine match
like in elf_object_p.
1994-02-24 12:37:43 +00:00
Jeff Law 2e7b92cfa9 * elfcode.h (alloca): Delete declaration. 1994-02-24 04:00:30 +00:00
Jeff Law 4f42757e38 * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic
number rather than HP9000S800_ID.  Note som.c is careful
        to make sure CPU_PA_RISC1_0 is always defined.
1994-02-24 02:31:01 +00:00
Ian Lance Taylor 2f0deb19eb * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here.
* ecoff.c (ecoff_write_object_contents): Make sure .bss section
	ends on a page boundary if there is no symbol table.
	(ecoff_bfd_final_link): Don't set symhdr->magic here.
1994-02-22 04:25:43 +00:00
Ian Lance Taylor aaca79a831 * hosts/hp300.h: Include <stdlib.h>; don't declare free. 1994-02-22 01:51:38 +00:00
Ian Lance Taylor 2ab0b7f3e3 * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
rather than an array of variable size.
	(som_bfd_fill_in_ar_symbols): Likewise.
	(som_bfd_ar_write_symbol_stuff): Likewise.
1994-02-22 00:01:34 +00:00
Stan Shebs 891dc727a1 Mon Feb 21 10:12:02 1994 Stan Shebs (shebs@andros.cygnus.com)
* Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply
	flags to explicit compile actions.
1994-02-21 18:17:21 +00:00
Ian Lance Taylor 22a71fef07 * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift
operation to avoid OSF 1.3 cc bug.
	* ecoff.c (ecoff_write_object_contents): Make text_size, data_size
	and bss_size bfd_size_type instead of unsigned long.  Make
	text_start and data_start bfd_vma instead of unsigned long.
	* ecofflink.c (ecoff_add_string): Remove incorrect cast of return
	value.
1994-02-21 17:56:38 +00:00
Ian Lance Taylor 037ce95adb * linker.c (_bfd_generic_link_add_archive_symbols): Consider
symbols in the order they appear in the archive map.
1994-02-21 00:18:57 +00:00
Peter Schauer 3a1de3cc03 * coff-alpha.c (reloc_nil): Add forward declaration, add missing
error_message argument.
	* coff-sparc.c (bfd_coff_generic_reloc):  Add forward declaration,
	add missing error_message argument.
	* mipsbsd.c (mips_fix_hi16_s):  Add forward declaration, add missing
	error_message argument.
1994-02-19 11:29:48 +00:00
Ian Lance Taylor 99ec1f66c1 start-sanitize-powerpc-netware
Support for PowerPC NetWare.
	* config.bfd (powerpc-*-netware*): New target; use ppc-nlm.
	* config/ppc-nlm.mt: New file.
	* configure.in (nlm32_powerpc_vec): New target vector; use
	nlm32-powerpc.o, nlm32.o, nlm.o.
	* targets.c (nlm32_powerpc_vec): Declare.
	* Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o.
	(CFILES): Should add nlm32-powerpc.c, but didn't, because the
	dependencies can't be sanitized.
	end-sanitize-powerpc-netware

	Initial support for PowerPC ELF.  Done without an ABI, and
	probably to be changed when I get an ABI.
	* config.bfd (powerpc-*-sysv4*): New target; use ppc-elf.
	* config/ppc-elf.mt: New file.
	* configure.in (bfd_elf32_powerpc_vec): New target vector; use
	elf32-powerpc.o, elf32.o, elf.o.
	* elf32-powerpc.c: New file.
	* elfcode.h (prep_headers): Add bfd_arch_powerpc case.
	(elf_set_arch_mach): Likewise.
	* targets.c (bfd_elf32_powerpc_vec): Declare.
	* Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o.
	(CFILES): Add elf32-powerpc.c.
	Rebuilt dependencies.
1994-02-18 17:09:13 +00:00
Ian Lance Taylor 42f62ead47 Various entries. 1994-02-17 20:56:49 +00:00
David MacKenzie d1ad85a6e6 * bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
	(bfd_error_type): Renamed from bfd_ec.  Prepend "bfd_error_" to
	all values.
	* bfd-in2.h: Regenerated.
	* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
	aoutf1.h, aoutx.h, archive.c, archures.c,
	bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
	coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
	ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
	elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
	i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
	lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
	nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
	ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
	srec.c, sunos.c, syms.c, targets.c, tekhex.c,
	trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
Jeff Law 7430a99137 * som.c: Remove FIXMEs for things which have been dealt with. 1994-02-16 06:28:25 +00:00
Ken Raeburn 54196ea170 i960-bout linker fixes, i960 coff config changes 1994-02-16 01:00:57 +00:00
Jeff Law c6cdb69ae4 * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM
symbols, not the BFD symbols.
        (som_bfd_ar_write_symbol_stuff): Likewise.
1994-02-15 17:01:39 +00:00
Jeff Law 24a1f6a05f * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't
have any symbols.
1994-02-15 07:48:56 +00:00
Jeff Law 6e033f8639 * Finish basic read-write support for SOM archive libraries. Bugs
surely remain as this hasn't been tested all that much.
	* som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define.
	(struct som_misc_symbol_info): New structure to hold info necessary
	to build both normal and library symbol tables.
	(som_derive_misc_symbol_info): New function to derive info necessary
	to build both normal and library symbol tables.
	(som_build_and_write_symbol_table): Use new function to derive misc
	symbol information.
	(som_slurp_symbol_table): Update backend private data for symbols
	appropriately.
	(som_bfd_prep_for_ar_write): New function.
	(som_bfd_ar_symbol_hash): New function.
	(som_bfd_ar_write_symbol_stuff): New function.
	(som_write_armap): Flesh out.
	(som_vec): Fix ar padding character.

	* som.c: Consistently use memset rather than bzero.
1994-02-15 07:05:04 +00:00
Stu Grossman 5cf354ef0e * hosts/rs6000lynx.h: Create this to enable Lynx host support. 1994-02-15 01:29:26 +00:00
Stu Grossman 8b8ddedb93 * coff-rs6000.c: Add Lynx core file support, use HOST_AIX, where
appropriate.
	* rs6000-core.c:  Use HOST_AIX instead of COREFILES_PLEASE.
	* config/rs6000.mh:  Remove defs of ARCHIVES_PLEASE and
	COREFILES_PLEASE.
	* config/rs6000lynx.mh:  Turn on Lynx core file support.
	* hosts/rs6000.h:  #define HOST_AIX.
1994-02-15 01:28:16 +00:00
Jeff Law 50c5c4ad12 * som.h (som_symbol_data): Safely access backend private data
for BFD symbols.  All callers changed.
1994-02-14 06:15:00 +00:00
Jeff Law 3c37f9ca0c * som.c (som_bfd_count_ar_symbols): New helper function.
(som_bfd_fill_in_ar_symbols): New helper function.
        (som_slurp_armap): New function to read a SOM LST.
1994-02-13 23:34:52 +00:00