Commit Graph

923 Commits

Author SHA1 Message Date
Jeff Law 142f59f4a9 * som.c (som_begin_writing): Align text in all executables to
make HPUX kernel happy.  Fixes strip/objcopy for shared
        executables.
1994-03-20 17:27:51 +00:00
Jim Kingdon 47dc9b52c2 * bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
* libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
	* cisco-core.c: New file.
	* Makefile.in: Change accordingly.
	* configure.in: Recognize cisco_core_vec.
	* config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec.
	* targets.c: Add cisco_core_vec.
	* bfd-in2.h: Rebuilt.
1994-03-19 21:13:58 +00:00
Jeff Law 00806436cd * som.c (som_begin_writing): Account for alignment needs of
subspaces too when writing executables.  Never request a negative
        bss size.  Fixes some problems with demand paged executables,
        still having problems with pure executables and shared executables.
1994-03-19 15:08:12 +00:00
Jeff Law 1576691751 * som.h (som_copyable_section_data_struct): New structure
containing all the private section information which needs
	to be copied from input section to output section during
	objcopy or strip.
	(som_section_data_struct): Remove several fields now in
	som_copyable_section_data_struct.  Make the space and
	subspace dictionaries be pointers (to save space when
	only reading objects).

	* som.c (bfd_som_set_section_attributes): Now returns a boolean;
	some references changed.  Allocate a copyable data stucture if
	none exists.  Store info into the copyable data structure.
	(bfd_som_set_subsection_attributes): Likewise.
	(som_is_space, som_is_subspace, som_is_container): New functions.
	Use these instead of directly accessing private data.
	(som_prep_headers): Allocate space and subspace headers here.
	Fill in some fields in the space/subspace headers from the
	copyable data.
	(som_bfd_copy_private_section_data): Only copy the stuff
	that we really need to make objcopy and strip work.  Allocate
	the copy_data structure for the output bfd before copying.
1994-03-19 06:41:54 +00:00
Jim Kingdon f3f29240da * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not
bfd_zalloc for rawptr, because later on we may call free, not
	bfd_release, on it.

	* bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
	* libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
	* cisco-core.c: New file.
	* Makfile.in: Change accordingly.
	* bfd-in2.h: Rebuilt.
1994-03-19 06:17:08 +00:00
Jeff Law 4359a7ef33 * som.h (struct som_exec_data): New structure to hold exec
info that must be preserved when running objcopy/strip.
	(struct somdata): Add new "exec_data" field and accessor
	macro.  Add some comments on how the various fields are used.
	(som_section_data_struct): Make is_space and is_subspace bitfields.
	Delete unused subspace_index.  All references now use the
	target_index field within the section structure itself.

	* som.c (make_unique_section): Delete unused declaration.
	(som_bfd_copy_private_bfd_data): New function.
	(som_object_setup): Allocate space for and save exec information
	that needs to be copied during objcopy/strip.
	(som_mkobject): Do not allocate space for a file header here.
	It is not used when only reading SOM objects.
	(som_prep_headers): Allocate space for and attach a file header
	to the output bfd.  For executables, use the saved system_id
	value rather than trying to guess the right value.  Do not abort
	wwhen setting file_hdr->entry* for executables.
	(som_begin_writing): For executables, set the exec_entry and
	exec_flags fields.
	(som_copy_private_backend_section_data): Always return a value.
1994-03-19 05:06:54 +00:00
Jeff Law 08b3c4f997 * libhppa.h (PA_PAGESIZE): Define.
* som.c (SOM_ALIGN): Define.
        (som_begin_writing): If writing an executable, initialize all
        fields in the exec header to zero.  Update fields in the exec
        header as sizes of loadable subspaces are computed.  Carefully
        preserve alignments when building executables.  Actually write the
        exec after all the fields are filled in.
1994-03-19 03:54:49 +00:00
Jeff Law 3b4994959e * Better long-filename handling. Reads SOM ABI compliant extended
names, but doesn't quite write compliant extended names yet.
        * som.c (som_slurp_extended_name_table): Delete function.  The
        generic code will handle things correctly.
        (som_slurp_armap): Seek to the beginning of the next member.
        (normalize): New function.
        (som_bfd_ar_write_symbol_stuff): Take the size of the extended
        name table into account when computing the file offsets in the
        SOM dictionary.  Make sure to align to an even boundary.
        (som_write_armap): Initialize the checksum to zero.
        (ar_maxchars): Fix.  Opps.
1994-03-19 02:17:15 +00:00
Ken Raeburn ff9785703d * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit
machine.  Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13.
1994-03-19 01:39:36 +00:00
Ken Raeburn 5a66538bcb * bfd-in.h (BFD_VERSION): Use @VERSION@.
* Makefile.in (bfd.h): Replace it with contents of VERSION file.
* bfd-in2.h: Regenerated.
1994-03-17 23:47:00 +00:00
Ken Raeburn 6f4aac6cb9 (trad_unix_bfd_is_local_label): Fixed typo where
this was also named trad_unix_bfd_copy_private_bfd_data.
1994-03-17 23:38:36 +00:00
Ian Lance Taylor 7838792b0c * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove
duplicate definition.
	(osf_core_bfd_is_local_label): Define.
1994-03-17 23:26:03 +00:00
Jim Kingdon 8eb5d4be69 * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c,
elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0)
	returns NULL, it is not an error.  It's possible that some of
	these checks are not necessary (because the size can never be
	zero), but putting in the checks is the conservative thing to do
	in light of the fact that some of these malloc calls replaced
	unchecked alloca calls, in which a zero argument would work fine.
1994-03-17 18:54:48 +00:00
Ian Lance Taylor 4bbf7a4924 * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail
if malloc (0) fails.  bfd_canonicalize_reloc returning 0 is not a
	failure indication, it merely means there are no relocs.
1994-03-17 17:29:15 +00:00
Ian Lance Taylor 1c6042ee10 * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space
after NAME, since SunOS /bin/cc can't handle it.
1994-03-17 16:47:01 +00:00
David MacKenzie ae6710bc98 * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field.
From sukes@glue.umd.edu (Tasuki Hirata).
1994-03-17 00:45:26 +00:00
Jeff Law 35ac8aacf9 * som.c (som_prep_for_fixups): Detect section symbols based
on either the lack of private data or the symbol flags.  Do not
        munge section symbol names anymore -- they no longer confuse GDB.
        (som_begin_writing): Leave space for an exec header if writing
        an executable.
        (som_slurp_symbol_table): Recognize both forms of section symbol
        names "L$0\002" and "$<FOO>$".  Change the name of "L$0\002"
        section symbols to be the name of the section they represent.
        Debugging  symbols begin with "L$0\001", not just "L$".
1994-03-16 08:03:46 +00:00
Jeff Law 5b3577cb7a * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
* bfd-in.h (JUMP_TABLE): Add new entries to the jump table
	for bfd_copy_private_section_data, bfd_copy_private_bfd_data,
	and bfd_is_local_label.

	* targets.c: Add new entries to the bfd_target structure.

	* bfd.c (bfd_copy_private_bfd_data): New definition.

	* section.c (bfd_copy_private_section_data): New definition.

	* syms.c (bfd_is_local_label): New definition.

	* libbfd-in.h (bfd_generic_is_local_label): Declare.

	* libbfd.c (bfd_generic_is_local_label): New function.

	* *-core.c: Provide default definitions for new functions in
	the target vector which all point to bfd_false.

	* aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c
	libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c
	Default new vectors for copying private backend data to bfd_true.
	Default new vector for determining if a symbol is a local label
	to bfd_generic_is_local_label.

	* som.c (som_bfd_copy_private_section_data): New function.
	(som_bfd_is_local_label): New function.
	(som_bfd_copy_private_bfd_data): For now default to bfd_true.

	* elf32-hppa.c (hppa_elf_is_local_label): New function.
1994-03-16 07:02:05 +00:00
Ian Lance Taylor 0069bd06b3 * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table. 1994-03-16 04:57:11 +00:00
David MacKenzie 57a1867e6c * Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
	Indent some of them to GNU standards.

	* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
	cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
	elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
	libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
	Update copyright years.
1994-03-15 15:13:13 +00:00
Jeff Law baef2065d0 * som.c (som_prep_for_fixups): A relocation involving the section
symbol for the *ABS* section is really a relocation involving
        no symbol.
        (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for
        undefined symbols.  Correctly distinguish between debugger symbols
        and section symbols.
1994-03-15 05:21:51 +00:00
Jeff Law b486fb13be * som (setup_sections): Set SEC_DEBUGGING and the section attributes
for spaces and subspaces.
1994-03-15 04:40:51 +00:00
Jeff Law 4c9db344d2 * som.c (som_bfd_count_ar_symbols): Fix typo. 1994-03-14 21:53:29 +00:00
Jeff Law ec743ceff2 * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and
HAS_RELOC based on the object's magic number.
        (make_unique_section): Delete function.  BFD and its users are
        prepared to handle multiple sections with the same name.
        (setup_sections): Allocate space on the BFD's obstack to hold
        section names.  Use bfd_make_setion_anyway rather than the
        obsolete make_unique_section.
        (som_prep_headers): Choose the correct SOM magic number based
        on the BFD's flags.
        (som_bfd_fill_in_ar_symbols): Return false, not NULL on error.
1994-03-14 19:43:01 +00:00
Ian Lance Taylor 45ccfd58d2 * elf32-ppc.c: Renamed from elf32-powerpc.c.
start-sanitize-powerpc-netware
	* nlm32-ppc.c: Renamed from nlm32-powerpc.c.
 	end-sanitize-powerpc-netware
	* Makefile.in, configure.in: Corresponding changes.
1994-03-12 17:48:16 +00:00
Ian Lance Taylor 92177c5242 * elf32-powerpc.c: Extensive changes to update to preliminary ABI.
Many changes to nlm32-powerpc.c as well, but I'm not bothering to make
a ChangeLog entry to avoid sanitization headaches.
1994-03-12 03:30:52 +00:00
Peter Schauer 3e0b555420 * sunos.c (sunos_read_dynamic_info): Assume that dynamic info
is always located at the start of the data section to allow
	recovery of the dynamic info from a stripped executable.
	* ecoff.c (ecoff_styp_to_sec_flags):  Handle STYP_PDATA, STYP_XDATA
	and STYP_COMMENT.
1994-03-11 09:03:07 +00:00
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