* ecofflink.c: New file to hold ECOFF debug information linking

routines.
	* ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
	ecoff_add_string, ecoff_get_debug): Removed.  Functionality now in
	ecofflink.c.
	(ecoff_get_extr, ecoff_set_index): New functions.
	(ecoff_slurp_symbolic_info): Don't save raw_size.
	(ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
	(ecoff_compute_section_file_positions): Don't set EXEC_P just
	because there is a start address.
	(ecoff_write_object_contents): Handle external symbols here.  Use
	ecofflink.c functions to write out debugging information.
	* elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
	mips_elf_set_index): New functions.
	(mips_elf_seclet_link): Discard empty sections, the .options
	section and .gptab sections.  Handle linking .mdebug section.
	* libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
	* libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
	* bfd-in.h: Added prototypes for routines in ecofflink.c (some are
	called by gas, so they are public).
	* bfd-in2.h: Rebuilt.
	* Makefile.in (BFD_LIBS): Added ecofflink.o.
	(CFILES): Added ecofflink.c.
	(ecofflink.o): New target.  Rebuilt dependencies.
This commit is contained in:
Ian Lance Taylor 1993-11-24 07:21:28 +00:00
parent 71efdf833f
commit 8d12f138ea
6 changed files with 320 additions and 977 deletions

View File

@ -1,3 +1,30 @@
Wed Nov 24 02:02:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* ecofflink.c: New file to hold ECOFF debug information linking
routines.
* ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
ecoff_add_string, ecoff_get_debug): Removed. Functionality now in
ecofflink.c.
(ecoff_get_extr, ecoff_set_index): New functions.
(ecoff_slurp_symbolic_info): Don't save raw_size.
(ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
(ecoff_compute_section_file_positions): Don't set EXEC_P just
because there is a start address.
(ecoff_write_object_contents): Handle external symbols here. Use
ecofflink.c functions to write out debugging information.
* elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
mips_elf_set_index): New functions.
(mips_elf_seclet_link): Discard empty sections, the .options
section and .gptab sections. Handle linking .mdebug section.
* libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
* libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
* bfd-in.h: Added prototypes for routines in ecofflink.c (some are
called by gas, so they are public).
* bfd-in2.h: Rebuilt.
* Makefile.in (BFD_LIBS): Added ecofflink.o.
(CFILES): Added ecofflink.c.
(ecofflink.o): New target. Rebuilt dependencies.
Mon Nov 22 22:26:42 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
* som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
@ -28,6 +55,11 @@ Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
(som_canonicalize_reloc): Implement.
(som_set_reloc_info, som_slurp_reloc_table): New functions.
Sun Nov 21 13:46:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
* hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define.
* hosts/sparclynx.h: Include lynx.h instead of duplicating it.
Fri Nov 19 14:34:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* coff-a29k.c (a29k_reloc): For R_IREL, don't left shift

View File

@ -72,7 +72,7 @@ BFD_H = bfd.h
# Some of these files should be in BFD*_BACKENDS below, but some programs
# won't link without them. So, in order for some of the minimal-bfd
# hacks to work, they're also included here for now.
# gdb: ecoff.o elf.o
# gdb: ecoff.o ecofflink.o elf.o
# objdump: elf.o
#
# Also, Jim Kingdon notes:
@ -86,7 +86,7 @@ BFD_LIBS = \
archive.o archures.o bfd.o cache.o coffgen.o core.o ctor.o \
format.o init.o libbfd.o opncls.o reloc.o \
seclet.o section.o syms.o targets.o \
ecoff.o elf.o srec.o
ecoff.o ecofflink.o elf.o srec.o
# This list is alphabetized to make it easier to keep in sync
# with the decls and initializer in archures.c.
@ -216,7 +216,7 @@ ALL_CFLAGS=$(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES)
CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \
archures.c coff-i386.c aout64.c aout32.c sunos.c demo64.c \
coff-i960.c srec.c tekhex.c oasys.c ieee.c \
ecoff.c coff-m68k.c coff-u68k.c coff-apollo.c \
ecoff.c ecofflink.c coff-m68k.c coff-u68k.c coff-apollo.c \
coff-a29k.c coff-rs6000.c coffgen.c format.c \
section.c core.c syms.c stab-syms.c reloc.c init.c ctor.c \
seclet.c coff-m88k.c coff-mips.c coff-sh.c trad-core.c newsos3.c \
@ -228,7 +228,8 @@ CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \
elf.c elf32.c elf32-sparc.c elf32-i386.c elf32-i860.c elf32-m68k.c \
elf32-hppa.c elf32-m88k.c elf32-mips.c elf32-gen.c \
elf64.c elf64-gen.c \
nlm.c nlm32.c nlm32-gen.c nlm32-i386.c nlm32-sparce.c nlm64.c nlm64-gen.c \
nlm.c nlm32.c nlm32-gen.c nlm32-i386.c nlm32-sparc.c \
nlm64.c nlm64-gen.c \
coff-alpha.c cpu-alpha.c \
hp300bsd.c hp300hpux.c \
i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
@ -501,8 +502,8 @@ bfd.ps:
libbfd.o : libbfd.c
opncls.o : opncls.c
bfd.o : bfd.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
libcoff.h libecoff.h libelf.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h libelf.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
archive.o : archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
targets.o : targets.c
cache.o : cache.c
@ -529,6 +530,8 @@ ecoff.o : ecoff.c seclet.h $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h \
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
libcoff.h libecoff.h
ecofflink.o : ecofflink.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h
coff-m68k.o : coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \
libcoff.h coffcode.h seclet.h coffswap.h
coff-u68k.o : coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
@ -625,6 +628,8 @@ elf32-m88k.o : elf32-m88k.c libelf.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-target.h
elf32-mips.o : elf32-mips.c seclet.h libelf.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
elf32-target.h
elf32-gen.o : elf32-gen.c libelf.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-target.h
@ -638,12 +643,12 @@ nlm32.o : nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
nlm32-gen.o : nlm32-gen.c libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlm-target.h
nlm32-i386.o : nlm32-i386.c libnlm.h nlmswap.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h $(INCDIR)/nlm/i386-ext.h nlm-target.h
nlm32-sparc.o : nlm32-sparc.c \
libnlm.h nlmswap.h \
$(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h $(INCDIR)/nlm/i386-ext.h nlm-target.h
nlm32-i386.o : nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
nlm32-sparc.o : nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
nlm64.o : nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
nlm64-gen.o : nlm64-gen.c libnlm.h $(INCDIR)/nlm/common.h \
@ -661,7 +666,7 @@ hp300hpux.o : hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
i386lynx.o : i386lynx.c libaout.h $(INCDIR)/aout/aout64.h \
aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
cf-i386lynx.o : i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
cf-i386lynx.o : cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h seclet.h \
coffswap.h
m68klynx.o : m68klynx.c libaout.h $(INCDIR)/aout/aout64.h \
@ -670,9 +675,9 @@ m68klynx.o : m68klynx.c libaout.h $(INCDIR)/aout/aout64.h \
cf-m68klynx.o : cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h seclet.h \
coffswap.h
sparclynx.o : sparclynx.c libaout.h $(INCDIR)/aout/aout64.h \
aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
sparclynx.o : sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h aout-target.h
cf-sparclynx.o : cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h seclet.h \
coffswap.h

View File

@ -160,17 +160,50 @@ typedef enum bfd_format {
bfd_type_end} /* marks the end; don't use it! */
bfd_format;
/* Object file flag values */
/* Values that may appear in the flags field of a BFD. These also
appear in the object_flags field of the bfd_target structure, where
they indicate the set of flags used by that backend (not all flags
are meaningful for all object file formats) (FIXME: at the moment,
the object_flags values have mostly just been copied from backend
to another, and are not necessarily correct). */
/* No flags. */
#define NO_FLAGS 0x00
/* BFD contains relocation entries. */
#define HAS_RELOC 0x01
/* BFD is directly executable. */
#define EXEC_P 0x02
/* BFD has line number information (basically used for F_LNNO in a
COFF header). */
#define HAS_LINENO 0x04
/* BFD has debugging information. */
#define HAS_DEBUG 0x08
/* BFD has symbols. */
#define HAS_SYMS 0x10
/* BFD has local symbols (basically used for F_LSYMS in a COFF
header). */
#define HAS_LOCALS 0x20
/* BFD is a dynamic object. */
#define DYNAMIC 0x40
/* Text section is write protected (if D_PAGED is not set, this is
like an a.out NMAGIC file) (the linker sets this by default, but
clears it for -r or -N). */
#define WP_TEXT 0x80
/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
linker sets this by default, but clears it for -r or -n or -N). */
#define D_PAGED 0x100
/* BFD is relaxable (this means that bfd_relax_section may be able to
do something). */
#define BFD_IS_RELAXABLE 0x200
/* symbols and relocation */
@ -188,9 +221,6 @@ typedef enum bfd_symclass {
} symclass;
typedef int symtype; /* Who knows, yet? */
/* general purpose part of a symbol;
target specific parts will be found in libcoff.h, liba.out.h etc */
@ -385,24 +415,18 @@ CAT(NAME,_bfd_make_debug_symbol)
/* User program access to BFD facilities */
extern CONST short _bfd_host_big_endian;
#define HOST_BYTE_ORDER_BIG_P (*(char *)&_bfd_host_big_endian)
/* The bfd itself */
/* Cast from const char * to char * so that caller can assign to
a char * without a warning. */
#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
#define bfd_get_format(abfd) ((abfd)->format)
#define bfd_get_target(abfd) ((abfd)->xvec->name)
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
#define bfd_get_file_flags(abfd) ((abfd)->flags)
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
#define bfd_my_archive(abfd) ((abfd)->my_archive)
#define bfd_has_map(abfd) ((abfd)->has_armap)
#define bfd_header_twiddle_required(abfd) \
((((abfd)->xvec->header_byteorder_big_p) \
!= (boolean)HOST_BYTE_ORDER_BIG_P) ? true:false)
#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
#define bfd_usrdata(abfd) ((abfd)->usrdata)
@ -411,13 +435,61 @@ extern CONST short _bfd_host_big_endian;
#define bfd_get_symcount(abfd) ((abfd)->symcount)
#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
#define bfd_count_sections(abfd) ((abfd)->section_count)
#define bfd_get_architecture(abfd) ((abfd)->obj_arch)
#define bfd_get_machine(abfd) ((abfd)->obj_machine)
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
#define BYTE_SIZE 1
#define SHORT_SIZE 2
#define LONG_SIZE 4
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (bool)), true)
/* Byte swapping routines. */
bfd_vma bfd_getb64 PARAMS ((unsigned char *));
bfd_vma bfd_getl64 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getb_signed_64 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getl_signed_64 PARAMS ((unsigned char *));
bfd_vma bfd_getb32 PARAMS ((unsigned char *));
bfd_vma bfd_getl32 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getb_signed_32 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getl_signed_32 PARAMS ((unsigned char *));
bfd_vma bfd_getb16 PARAMS ((unsigned char *));
bfd_vma bfd_getl16 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getb_signed_16 PARAMS ((unsigned char *));
bfd_signed_vma bfd_getl_signed_16 PARAMS ((unsigned char *));
void bfd_putb64 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl64 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
/* ECOFF linking routines. */
#ifdef __STDC__
struct ecoff_debug_info;
struct ecoff_debug_swap;
struct ecoff_extr;
struct symbol_cache_entry;
#endif
extern boolean bfd_ecoff_debug_accumulate
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
bfd *input_bfd, struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap,
boolean relocateable));
extern boolean bfd_ecoff_debug_link_other
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd));
extern boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
boolean relocateable,
boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
bfd_size_type)));
extern bfd_size_type bfd_ecoff_debug_size
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap));
extern boolean bfd_ecoff_write_debug
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where));
/* And more from the source. */

View File

@ -461,6 +461,37 @@ void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
/* ECOFF linking routines. */
#ifdef __STDC__
struct ecoff_debug_info;
struct ecoff_debug_swap;
struct ecoff_extr;
struct symbol_cache_entry;
#endif
extern boolean bfd_ecoff_debug_accumulate
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
bfd *input_bfd, struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap,
boolean relocateable));
extern boolean bfd_ecoff_debug_link_other
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd));
extern boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
boolean relocateable,
boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
bfd_size_type)));
extern bfd_size_type bfd_ecoff_debug_size
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap));
extern boolean bfd_ecoff_write_debug
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where));
/* And more from the source. */
void
bfd_init PARAMS ((void));
@ -1615,6 +1646,7 @@ struct _bfd
struct trad_core_struct *trad_core_data;
struct som_data_struct *som_data;
struct hpux_core_struct *hpux_core_data;
struct hppabsd_core_struct *hppabsd_core_data;
struct sgi_core_struct *sgi_core_data;
struct lynx_core_struct *lynx_core_data;
struct osf_core_struct *osf_core_data;

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ typedef struct
union
{
unsigned int hppa_arg_reloc;
struct ecoff_extr *mips_extr;
PTR any;
}
tc_data;