Commit Graph

30 Commits

Author SHA1 Message Date
Ken Raeburn 32090b8e4f * elf.c, elfcode.h, libelf.h: Serious reorganization.
Deleted `thunk' structure, merged into tdata, duplicate data eliminated.
Rearranged functions, grouping by function.
Broke up many functions in elfcode.h, re-ordered many parts of file writing
to handle unpredictable state of section relocation table as provided by
various applications.
Still needs cleanup: Merge functions back together, split out data structure
with only data that is used only when writing out object file.

* elf.c (bfd_elf_generic_reloc): New function, taken from coff-mips.c.
* elf32-sparc.c (elf_sparc_howto_table): Use it, to work around
bfd_perform_relocation lossage.
1993-07-19 19:12:59 +00:00
Ken Raeburn 79f1d6a385 kill it dead 1993-04-13 05:32:52 +00:00
Ian Lance Taylor c0f6093b0c * Minor cleanups provoked by gcc warnings:
* aoutx.h (NAME(aout, reloc_type_lookup)),
	cpu-h8300.c (local_bfd_reloc_type_lookup),
	cpu-z8k.c (local_bfd_reloc_type_lookup): Added default case to
	switches.
	* archive.c (do_slurp_bsd_armap, do_slurp_coff_armap),
	ieee.c (ieee_slurp_section_data),
	elf.c (elf_make_sections, elf_fake_sections,
	elf_compute_section_file_positions, elf_write_object_contents):
	Removed unused variables.
	* archures.c: Removed /* from within comment.
	* bout.c (b_out_squirt_out_relocs): Initialize r_extern.
	* oasys.c (oasys_write_data): Initialize i.
1993-02-23 21:08:32 +00:00
Ian Lance Taylor 8feff71726 * bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup and
bfd_make_debug_symbol; they were already in the target structure.
	* Adjusted all uses of JUMP_TABLE.
	* coffgen.c, libcoff-in.h (coff_bfd_make_debug_symbol): Renamed
	from coff_make_debug_symbol.
	* libcoff.h: Updated accordingly.
1993-02-23 20:24:06 +00:00
Ian Lance Taylor 0dc1bc8b3f Added 1993 copyrights to files that I have changed in 1993. Some were
missing 1992 copyrights, although they changed in 1992.
1993-02-16 16:54:20 +00:00
Ken Raeburn c3efeb9248 fix libbfd.h declaration, by tweaking elf.c comment, so bfd can compile 1992-12-30 02:48:29 +00:00
Fred Fish e555d76415 * bfd.c (bfd_get_size): New function that gets an upper bound
on the possible size of any object in a bfd.
	* elf.c (bfd_elf_find_section, elf_get_str_section,
	elf_get_symtab_upper_bound):  Rewrite to avoid NULL pointer
	dereferences.
	* elf.c (elf_big_vec, elf_little_vec):  Document last three
	members initialized to NULL.
1992-12-28 01:51:57 +00:00
Per Bothner 287c221dd2 Various changes to improve archive support. See ChangeLog. 1992-12-16 00:01:59 +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
Steve Chamberlain 294eaca479 Some of these are guesses, if you know different, just yell.
Thu Oct  8 08:52:48 1992  Steve Chamberlain  (sac@thepub.cygnus.com)

	 Now a bfd knows whether underscores are normally prepended
	 to symbols in its file format. Helps with error messages.

	* aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, coff-h8300.c,
	coff-z8k.c: targets set so they have leading underscore
	* coff-i386.c, coff-i960.c, coff-m68k.c, coff-mips.c, coff-m88k.c,
	coff-rs6000.c, coff-we32k.c, elf.c, ieee.c, srec.c: targets set
	without leading underscore flag
	* targets.c: add symbol leading char to xvec description
	* bfd-in.h (bfd_get_symbol_leading_char): new macro.
1992-10-08 16:02:09 +00:00
Brendan Kehoe 13ff13438b * elf.c (section_from_elf_index): Return bfd_abs_section, not 0,
since we should never have a NULL section.
	(elf_slurp_symbol_table): If st_shndx doesn't match any of our
	tests, set the section to bfd_abs_section.
1992-09-25 22:05:15 +00:00
Fred Fish 3dfa6cfb66 * config/stratus.mt (CC): Remove definition.
* elf.c (bfd_section_from_shdr, elf_section_from_bfd_section,
	section_from_elf_index):  Add SHT_BEPROGBITS case for i860 in
	big endian mode.
	* elf.c (bfd_section_from_shdr):  Test for the possibility that
	section_from_elf_index returns NULL and don't dereference it.
1992-08-01 20:51:09 +00:00
Fred Fish 97225e37f7 * elf.c: Remove "(void)" casts from function calls where the
return value is ignored, in accordance with GNU coding standards.
1992-07-04 03:24:37 +00:00
Fred Fish ec6b2951da * libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition.
* reloc.c (bfd_default_reloc_type_lookup):  Make cast on return
	type match actual return type.
	* elf_print_symbol (section_name):  Make CONST.
1992-06-24 04:56:01 +00:00
John Gilmore 796aae470c * elf.c (bfd_elf_find_section): Mark as INTERNAL_FUNCTION so
its prototype will be included in libbfd.h.  Change result type
to struct * (rather than equivalent typedef) so it can be used in
the prototype, where they typedef won't be known.
* libbfd.h:  Updated version.
1992-06-20 02:04:20 +00:00
Fred Fish 91f781ffbb * elf.c (bfd_section_from_shdr, elf_slurp_symbol_table):
Correct misconception that there can be only one symbol table.
	Only call elf_slurp_symbol_table on the full symbol table, not
	the dynamic one which is only a subset of the full one.

	(The bfd library was slurping in the first ELF symbol table it
	found and then ignoring any others.  For dynamically linked
	executables, this happened to be the dynamic symbol table, which
	is a subset of the full symbol table and only contains the
	symbols that need to be used in dynamic linking.)
1992-06-17 20:58:46 +00:00
John Gilmore 80bdcb77bd * elf.c (elf_obj_tdata): Merge elf_obj_tdata_struct and
elf_core_tdata_struct into a single common struct.  Core files
wouldn't have worked at all without this.
(bfd_elf_find_section):  New function for GDB's undercover use
to find string sections that BFD hides from it.
(elf_get_str_section):  Avoid multiple alloc&reads for same data; lint.
(elf_object_p, elf_core_file_p):  Allocate internal file header
storage dynamically.
* bfd.c (union {...} tdata):  Remove elf_core_tdata_struct.
* demo64.c:  Prevent "empty translation unit" warnings from idiots.
1992-06-11 08:10:04 +00:00
Fred Fish 808dfd5aab Fix couple of function args that expect to be passed CONST pointers, and
boolean functions that were returning NULL, which can be "void *" rather
than just bare 0.
1992-04-14 21:41:30 +00:00
Mark Eichin 37ac3b76ec Massive changes. Elf sections are now processed into BFD sections only
if they make sense as independent sections; symbols and relocs are
turned into BFD symbols and relocs; objects are now created.
	objdump and copy mostly work on .o files.
	this check-in will be followed by gdb testing.
	the code has *not* yet been split up the way coff is to
support multiple architectures and bit widths.
	no ChangeLog entries yet; too big... nearly everything changed.
1992-04-13 15:01:54 +00:00
Fred Fish d4acec2c22 Fix to use a single disposable copy of section header table and program
header table entries.
1992-03-28 21:10:05 +00:00
Fred Fish d01cd8fc75 Makefile.in: Add dependencies for various coff-*.o files.
elf.c:  Remove extraneous paren from core_prpsinfo and core_prpstatus
macros, rename core_prpstatus to core_prstatus.  Replace references to
old section "size" member with new "_raw_size" member.  Implement
elf_make_empty_symbol, which is now used.
1992-01-29 05:16:49 +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
Fred Fish e83f304031 Enclose corename and execname inside a HAVE_PROCFS ifdef, since they
are unused when it is not defined.
1991-12-18 03:51:33 +00:00
Steve Chamberlain c3eb25fc25 * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c,
coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c,
	coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c,
	newos3.c, stab-syms.c, syms.c: All these files have had their
	#includes altered to point to the new places.
1991-12-01 05:24:02 +00:00
Fred Fish eb8983c9ca Fix bug in elf.c (missing "break" statements in cases), add ncr and
SVR4 i386 support to configuration.
1991-11-30 04:20:07 +00:00
John Gilmore 8c4a1ace3d ALIGN->BFD_ALIGN 1991-11-22 16:45:04 +00:00
Fred Fish a6c1d73165 Don't try to create a bfd section for the first ELF section header table
entry, since it is just a placeholder with no name.
1991-11-09 21:48:15 +00:00
Fred Fish e0796d2213 Add partial support for ELF format corefiles. Still needs code to extract
register values from corefiles and make them available to bfd clients.
1991-10-24 10:26:26 +00:00
Steve Chamberlain 9ce0058ca6 *** empty log message *** 1991-10-03 14:49:10 +00:00