Commit graph

61 commits

Author SHA1 Message Date
Per Bothner
0e238aa74b * bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour;
perhaps we can later remove the the_bfd field from each symbol.
	* syms.c (struct symbol_cache_entry):  Remove unused field
	app_data.  Add comment noting that the_bfd is almost redundant,
	but not quite.
	* aoutx.h, coff-a29k.c, coff-i386.c, coff-i960.c, coffcode.h:
	Use new macros bfd_asymbol_bfd and bfd_asymbol_flavour.
	* hppa.c (fill_spaces):  Make slightly more rebust.
	* configure.in:  Allow std-host as the "default" host.
1992-12-22 23:40:27 +00:00
Ian Lance Taylor
60ac749cab Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)
* Patches from Minh Tran-le <mtranle@paris.intellicorp.com>.
	* configure.in (i386-*-isc*, i386-*-aix*): New targets.
	* configure.host (i386-*-isc*, i386-*-aix*): New hosts.
	* hosts/i386isc.h, config/i386isc.mh: New files for Interactive
	Unix.
	* hosts/i386aix.h, config/i386aix.mh: New files for AIX on PS/2.
	* aix386-core.c: New file for handling core files on AIX on PS/2.
	* targets.c: if AIX386_CORE, use aix386_core_vec.
	* coffcode.h (coff_real_object_p): check for I386SVMAGIC as well
	as I386MAGIC.
1992-12-21 21:17:54 +00:00
Ken Raeburn
785150c948 coffcode.h: bfd_coff_std_swap_table is now const and static 1992-12-04 19:05:41 +00:00
Ken Raeburn
07de8e96b3 syms.c (asymbol): Added new field "app_data", for data particular to the
application.  Some of the linker flags ought to get moved to this field
someday.

archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.

bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.

hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-03 23:03:17 +00:00
John Gilmore
1f29e30b1f * aout-target.h, aoutf1.h, trad-core.c, coffcode.h, libaout.h:
Eliminate all PROTO calls, replace with PARAMS for readability.

* aoutx.h:  Add type to callback parameter.
* coff-mips.c:  Don't call trad-core.h, not needed.
* trad-core.c:  Incorporate trad-core.h declarations.  Fix comments.
* trad-core.h:  Eliminate, unused.
1992-11-28 13:00:18 +00:00
Ian Lance Taylor
8f718ed3bd Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com)
* section.c: New section bit SEC_SHARED_LIBRARY.
	coffcode.h (styp_to_sec_flags): if STYP_NOLOAD && (STYP_TEXT ||
	STYP_DATA), set SEC_SHARED_LIBRARY.  This seems to be correct for
	i386-sysv.
1992-11-06 00:38:59 +00:00
Sean Eric Fagan
061a65a56f (Duplicate change from p3.)
Only change coff auxent header fields when the circumstances require it.  or
at least warrant.
1992-11-04 21:57:47 +00:00
John Gilmore
17f9c81775 (coff_write_object_contents): Zero timestamp field. 1992-10-28 21:44:39 +00:00
Ian Lance Taylor
98fd98bcb4 Moved in from p3:
Tue Oct 27 12:24:34 1992  Ian Lance Taylor  (ian@cygnus.com)

	* coffcode.h (coff_swap_aux_out): set the fcnary info before
	optionally setting the dimen info, since they are in the same
	memory locations.  Also zero out external auxent.
	(coff_write_symbol): don't zero external auxent; now done in
	coff_swap_aux_out.
1992-10-27 20:34:40 +00:00
Steve Chamberlain
c26d7d179c Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* seclet.c (rel): don't load sections without the SEC_LOAD bit.

Thu Oct 15 10:16:35 1992  Steve Chamberlain  (sac@thepub.cygnus.com)

	* coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to
	work out a coff relocation type from a howto's attributes rather
	than using the input r_type field. This fixes PR1677 and allows
	conversion of a.out relocs to coff relocs.

	* coffcode.h (coff_write_relocs): if supplied a relocation
	relative to an absolute symbol, use the right symbol index.

	* reloc.c (bfd_perform_relocation): do a partial link for coff
	relocs right.
1992-10-23 17:34:37 +00:00
Ian Lance Taylor
b26059aa44 Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com)
* changes to support i386-sysv with shared libraries:
	* coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined,
	check for .data2; if _LIB is defined, check for it; map
	SEC_NEVER_LOAD to STYP_NOLOAD.
	(styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD.
	(make_a_section_from_file): if TWO_DATA_SECS, accept .data2.
	(coff_write_object_contents): force vaddr of .lib to 0; set scnptr
	if section has contents, not just if it is loadable; if
	TWO_DATA_SECS, check for .data2
	(coff_set_section_contents): set vma of .lib section to number of
	.lib sections.
	* coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND;
	don't define coff_write_armap to bsd_write_armap.
	* hosts/i386v.h: don't include <utime.h>, since it is not provided
	by SVR3.2.
1992-10-23 15:28:15 +00:00
John Gilmore
5f9ca96038 * aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c,
coffcode.h, elf.c, libaout.h, libbfd.h, srec.c:  Lint.
1992-10-15 09:44:59 +00:00
John Gilmore
f8e0194018 * aout-adobe.c, aoutf1.h, archive.c, bout.c, coff-rs6000.c,
coffcode.h, elf.c, ieee.c, libaout.h, libbfd.c, oasys.c,
sco-core.c:  Lint:  Second argument of bfd_seek is always file_ptr.
Third argument is SEEK_SET or SEEK_CUR.  Result is always 0 or -1.
1992-10-15 09:00:09 +00:00
Ian Lance Taylor
acc7c4933d Tue Sep 29 08:30:21 1992 Ian Lance Taylor (ian@cygnus.com)
* Portability fixes from p3:
	coffcode.h (coff_write_relocs): removed sanity check until it
	works on all targets (per advice from sac).
	config/hp9000.mh: new file to define USG.
	hppa.c: #undef hppa before the JUMP_TABLE.
	hosts/hppahpux.h: #define NATIVE_HPPAHPUX_COMPILER if not
	__STDC__.
	targets.c (bfd_target_list): if NATIVE_HPPAHPUX_COMPILER, make
	local variable target volatile to avoid mysterious bug in
	HP9000/700 cc.
1992-09-29 15:47:03 +00:00
John Gilmore
df4d92f60f Lint; remove bcopy/bzero. 1992-09-26 05:39:13 +00:00
Steve Chamberlain
8ad2a31dd8 Fri Sep 25 11:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* coff-z8k.c: getting closer
	* coffcode.h (coff_get_relocated_section_contents): allow
	EXTRA_CASES hooks for different arches to provide different reloc
	types.
	* seclet.h: #ifndef around it to allow multiple inclusion
	* srec.c: minor doc fix
1992-09-25 18:14:29 +00:00
Ian Lance Taylor
dc999ad933 Fri Sep 11 15:37:06 1992 Ian Lance Taylor (ian@cygnus.com)
* coffcode.h (coff_renumber_symbols): set the last renumbered
	symbol pointer to NULL, as expected by coff_write_linenumbers.
	(coff_write_relocs): apparently a non-zero addend is OK for reloc
	type R_IHCONST used on the 29k.
1992-09-11 22:43:53 +00:00
Steve Chamberlain
9465d03ed5 * coffcode.h (coff_add_missing_symbols): if symbols don't come
from a coff file (csym is null), dont deref them

	* ieee.c (parse_expression): get the answer right when adding an
	abs+(sec+off), (ieee_generic_stat_arch_elt): call ieee_object_p
	on elts so that filename is filled in.
1992-08-24 19:10:06 +00:00
Steve Chamberlain
800aef7c5c Lint stuff which didn't make it last time 1992-06-22 16:07:05 +00:00
Steve Chamberlain
3860075f3f Fri Jun 19 20:23:21 1992 Steve Chamberlain (sac@thepub.cygnus.com)
Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and
	correct calling of howto special functions and fixes from Raeburn
	for gas<>bfdness
	* archures.c: nuke bfd_reloc_code_type
	* bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint
	* coffcode.h (styp_to_sec_flags): STYP_INFO is marked as
	SEC_NEVER_LOAD, various other bfdgas newness
	* reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup
	* targets.c: change jump table vector to above
1992-06-22 15:42:38 +00:00
Ken Raeburn
5e16788678 Don't align sections in I960 coff files.
(I know there's a GDB freeze on, but this only affects writing i960
coff files, and Steve needs it ASAP.)
1992-06-17 20:06:33 +00:00
Ken Raeburn
ce07dd7c0c [time to file a PR on cvs...]
Various changes to get linker working again for a.out:
 * don't set/adjust section file positions or vmas more than once
 * use correct page size and segment size when calculating them
 * deal with some variations in a.out implementations
Tested on sun4 and sun4->sun3 so far, will be testing further but
needed to get wider exposure&testing.  See ChangeLog for details.

Also:
* coffcode.h (coff_write_relocs): Write out swapped reloc, not
pre-swapped version.
* hosts/sparc.h (abort, exit): Hide these names if compiling with
gcc version 2, to avoid warnings.
1992-06-16 12:04:03 +00:00
Steve Chamberlain
780c477aff 29k const fix 1992-05-26 22:20:09 +00:00
Steve Chamberlain
954d412a06 Fix some typos 1992-05-26 19:08:48 +00:00
Ken Raeburn
8070f29df5 Lots of changes from gas-bfd work. Includes:
* working reloc lookup support
 * better support for creation of COFF files from scratch
 * misc doc changes, macro tweaks, "const" additions, typo fixes, etc.
 * one or two ugly kludges that should get cleaned up (but what's one
   or two more, in BFD?)
See ChangeLog for details.
1992-05-26 03:45:31 +00:00
Steve Chamberlain
54862c89ac * coffcode.h (coff_write_object_contents): use RELSZ to work out
size of output reloc struct.
1992-05-02 01:46:50 +00:00
Steve Chamberlain
859f11ffd8 * coff-a29k.c: various changes to the way relocations work to cope
with the "new order" and latent bugs.
	* coffcode.h: lint
1992-05-01 20:00:26 +00:00
Steve Chamberlain
d05511ca57 * coffcode.h (coff_swap_aux_in): lint, (coff_print_symbol): prints
out tagndx too.
	* aoutx.h (swap_std_reloc_out, swap_ext_reloc_out): use the output
	section of a symbol rather than the section of a reffed symbol to
	determine the r_index of an emmitted reloc.
1992-02-21 19:06:34 +00:00
Steve Chamberlain
a213432461 Fix typeo which crept in between compiling and checking in 1992-02-14 01:48:00 +00:00
Steve Chamberlain
a0f3f080c1 * coffcode.h (get_normalized_symtab): fixed bug where symbols
with more than one auxent can cause nasty core dumps.
1992-02-14 01:37:56 +00:00
Steve Chamberlain
d58b7049a7 Fluff removal. 1992-02-07 00:33:57 +00:00
Steve Chamberlain
2f8640fe6a * coffcode.h, libcoff.c: added new fielded to coff_symbol_struct
"done_lineno" so that a symbol which appears twice in the symbol
	table only gets it's linenumbers relocated once. Modifed
	(coff_write_native_symbol) and (coff_make_empty_symbol) to make
1992-02-06 19:22:03 +00:00
Steve Chamberlain
6590a8c953 New entry point in the transfer vector - bfd_relax_section.
* aout-target.h: add to vector, call generic_relax
	* bfd-in.h: add to vector
	* bfd.c: add #define for vector
	* bout.c: add to vector, call generic_relax
	* coffcode.h: add to vector, also now has coff specific relax code
	for the relaxable H8/300 relocs. Also clean up abs section cruft.
	* elf.c: call generic_relax
	* ieee.c: call new vector, clean up some bugs due to the creation
	of bfd_abs_section
	* libbfd.h: add bfd_generic_relax_section EXFUN
	* oasys.c: call generic_relax
	* reloc.c: implement generic_relax
	* seclet.c: moved much of this into coffcode.h
	* srec.c: call generic_relax
	* targets.c: define new transfer vector
1992-01-28 06:01:25 +00:00
Steve Chamberlain
e98e6ec111 Uses the new small reloc type now.
Currently self hosts on sun4 and sun3
1992-01-24 22:44:51 +00:00
Steve Chamberlain
616ebcfd0b * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
	 libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
	 srec.c, syms.c, targets.c : all new documentation and lint
	 removal.
1991-12-08 00:56:56 +00:00
John Gilmore
9898b92969 Lint (detected on hp300bsd & sconix) 1991-12-07 15:37:42 +00:00
Steve Chamberlain
9fda1a399c New documentation style 1991-11-30 21:41:22 +00:00
Steve Chamberlain
3b4f1a5d05 * Makefile.in: added coff-h8300
* configure.in: now h8 is a coff target
	* cpu-h8300.c: fix various disassembly problems
	* libcoff.h: took out some code which has been #0ed for a long
	time.
	* targets.c: added h8 coff
	* coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c
	added new macro RTYPE2HOWTO to take a load of #ifdefs out of
	coffcode.h
	* coffcode.h: Started to change the way machine dependencies are
	handled, from the nest of #ifdefs to macros defined in the
	including coff-<foo>.c
1991-11-27 16:56:08 +00:00
John Gilmore
853f0a7030 * coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in
nonstandard MIPS sections (.rdata, .sdata, etc).
1991-11-22 23:02:29 +00:00
John Gilmore
f8adc62df4 const lint 1991-11-22 19:09:03 +00:00
John Gilmore
8c4a1ace3d ALIGN->BFD_ALIGN 1991-11-22 16:45:04 +00:00
Steve Chamberlain
85e0c72139 Thu Nov 7 11:03:55 1991 Steve Chamberlain (sac at rtl.cygnus.com)
* coffcode.h: Defined new macros [PUT|GET]LINENO_LNNO for
	manipulation of lnno fields in lineno structs in a coff-<f>.h
	independent way. Override it in coff-<f>.h to your favourite
	number if you don't have a 16bit lnno field. (coff_swap_lineno_in)
	(coff_swap_lineno_out): modified to use the new macros.
1991-11-07 19:06:38 +00:00
Per Bothner
e18e24af07 * bfd-in.h (bfd_print_symbol_type_hopw enum): Add new option
bfd_print_symbol_nm, for use by nm.
	* aoutx.h (NAME(aout,print_symbol)):  Add code for new
	bfd_print_symbol_nm option, to print in nm format.
	* coffcode.h (coff_print_symbol), ieee.c (ieee_print_symbol)
	oasys.c (oasys_print_symbol):  Provide stub implementations
	for bfd_print_symbol_nm.
	* syms.c:  New function bfd_decode_symclass, used by nm printer.
	New function bfd_stab_name to look up string name of stab code.
1991-11-03 22:47:50 +00:00
John Gilmore
6d7c88c3d0 * coff-rs6000.c: Change name to "aixcoff-rs6000", to avoid
matching prefix "coff".
* coffcode.h (coff_swap_aux_in, coff_swap_aux_out):  Handle
rs/6000 csect records.
1991-11-01 02:24:43 +00:00
John Gilmore
cbdc790909 RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and John Gilmore. 1991-10-25 07:06:02 +00:00
Steve Chamberlain
33a782f1d2 * coffcode.h (coff_compute_section_file_positions): make it pad
section size out if there are alignment restrictions so that the
	image will be ok on a system where section positions are worked
	out by accumulating sizes rather than from the section headers.
1991-10-21 23:58:49 +00:00
Steve Chamberlain
f58809fd41 * targets.c (proto write_armap). Changed orl_count to unsigned.
* opncls.c (bfd_close_all_done). Added so that generative
	programs like gas can close a bfd without causing bfd confusion.
	* libbfd.h (changed becuase of protos)
	* amdcoff.c: messed with the way that jmp displacements are
	calcualated. This may not yet be totally correct.
	* archive.c (coff_write_armap): rewrote the way that ranlibs are
	written out.
	* coffcode.h (fixup_symbol_value): now doesn't core dump if a non
	abs symbol has no section (like a register symbol).
	(coff_write_symbol) now zeros auxent before filling it up to help
	with sensitive applications.
	* libbfd.c (bfd_write_bigendian_4byte_int): added.
1991-10-21 16:42:54 +00:00
Steve Chamberlain
0d74098420 * bfd-in.h: Added more macros to COFF_SWAP_TABLE.
* bfd.c: Added macros to enable gas to swap coff records.
	* coffcode.h: Make the coff_swap_*_out routines return the number
	of bytes swapped, and cleaned up their prototypes.
	* configure.in: Added ebmon/coff support
	* ecoff.c: Changed null definitions of coff_swap_*_out to conform
	to new prototypes
	* targets.c: Added new entry points for coff swapping
1991-10-11 19:39:29 +00:00
John Gilmore
fb3be09b66 Lint (saber actually). 1991-09-26 22:28:46 +00:00
Stu Grossman
7d003262a7 saber 1991-08-23 05:26:06 +00:00