* 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.
This commit is contained in:
Per Bothner 1992-12-22 23:40:27 +00:00
parent cc9a3bd637
commit 0e238aa74b
6 changed files with 36 additions and 16 deletions

View file

@ -1,3 +1,19 @@
Mon Dec 21 16:33:34 1992 Per Bothner (bothner@rtl.cygnus.com)
* hosts/std-host.h: New file. Attempt at a generic/default
set of definitions, to discourage porting to new hosts by copying.
* hosts/news.h: Removed.
* hosts/sparc.h: Use std-host.h.
* 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.
Mon Dec 21 17:24:13 1992 Stu Grossman (grossman at cygnus.com) Mon Dec 21 17:24:13 1992 Stu Grossman (grossman at cygnus.com)
* bfd.c: Add struct hppa_core_data to tdata union. * bfd.c: Add struct hppa_core_data to tdata union.

View file

@ -174,17 +174,19 @@ do_mostlyclean:
do_clean: do_mostlyclean do_clean: do_mostlyclean
rm -f libbfd.a TAGS rm -f libbfd.a TAGS
do_distclean: do_clean do_distclean: do_clean
rm -f Makefile config.status rm -f Makefile config.status sysdep.h
do_realclean: do_distclean do_realclean: do_distclean
mostlyclean: do_mostlyclean mostlyclean: do_mostlyclean
$(MAKE) subdir_do DO=mostlyclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) $(MAKE) subdir_do DO=mostlyclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
clean: do_clean clean: do_clean
$(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
distclean: do_distclean distclean:
$(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
clobber realclean: do_readlclean make do_distclean
clobber realclean:
$(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) $(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
make do_realclean
# Mark everything as depending on config.status, since the timestamp on # Mark everything as depending on config.status, since the timestamp on
# sysdep.h might actually move backwards if we reconfig and relink it # sysdep.h might actually move backwards if we reconfig and relink it

View file

@ -272,7 +272,7 @@ static void DEFUN(reloc_processing,(relent,reloc, symbols, abfd, section) ,
ptr = *(relent->sym_ptr_ptr); ptr = *(relent->sym_ptr_ptr);
if (ptr if (ptr
&& ptr->the_bfd == abfd && bfd_asymbol_bfd(ptr) == abfd
&& ((ptr->flags & BSF_OLD_COMMON)== 0)) && ((ptr->flags & BSF_OLD_COMMON)== 0))
{ {

View file

@ -1415,7 +1415,7 @@ DEFUN(coff_count_linenumbers,(abfd),
for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) { for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) {
asymbol *q_maybe = *p; asymbol *q_maybe = *p;
if (q_maybe->the_bfd->xvec->flavour == bfd_target_coff_flavour) { if (bfd_asymbol_flavour(q_maybe) == bfd_target_coff_flavour) {
coff_symbol_type *q = coffsymbol(q_maybe); coff_symbol_type *q = coffsymbol(q_maybe);
if (q->lineno) { if (q->lineno) {
/* /*
@ -1447,10 +1447,10 @@ DEFUN(coff_symbol_from,(ignore_abfd, symbol),
bfd *ignore_abfd AND bfd *ignore_abfd AND
asymbol *symbol) asymbol *symbol)
{ {
if (symbol->the_bfd->xvec->flavour != bfd_target_coff_flavour) if (bfd_asymbol_flavour(symbol) != bfd_target_coff_flavour)
return (coff_symbol_type *)NULL; return (coff_symbol_type *)NULL;
if (symbol->the_bfd->tdata.coff_obj_data == (coff_data_type*)NULL) if (bfd_asymbol_bfd(symbol)->tdata.coff_obj_data == (coff_data_type*)NULL)
return (coff_symbol_type *)NULL; return (coff_symbol_type *)NULL;
return (coff_symbol_type *) symbol; return (coff_symbol_type *) symbol;
@ -1769,7 +1769,7 @@ DEFUN(coff_write_alien_symbol,(abfd, symbol, written),
{ {
coff_symbol_type *c = coff_symbol_from(abfd, symbol); coff_symbol_type *c = coff_symbol_from(abfd, symbol);
if (c != (coff_symbol_type *)NULL) { if (c != (coff_symbol_type *)NULL) {
native->u.syment.n_flags = c->symbol.the_bfd->flags; native->u.syment.n_flags = bfd_asymbol_bfd(&c->symbol)->flags;
} }
} }
#endif #endif
@ -2015,7 +2015,8 @@ DEFUN(coff_write_linenumbers,(abfd),
/* Find all the linenumbers in this section */ /* Find all the linenumbers in this section */
while (*q) { while (*q) {
asymbol *p = *q; asymbol *p = *q;
alent *l = BFD_SEND(p->the_bfd, _get_lineno, (p->the_bfd, p)); alent *l =
BFD_SEND(bfd_asymbol_bfd(p), _get_lineno, (bfd_asymbol_bfd(p), p));
if (l) { if (l) {
/* Found a linenumber entry, output */ /* Found a linenumber entry, output */
struct internal_lineno out; struct internal_lineno out;
@ -3658,7 +3659,7 @@ SUBSUBSECTION
#ifndef CALC_ADDEND #ifndef CALC_ADDEND
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
if (ptr && ptr->the_bfd == abfd \ if (ptr && bfd_asymbol_bfd(ptr) == abfd \
&& ((ptr->flags & BSF_OLD_COMMON)== 0)) \ && ((ptr->flags & BSF_OLD_COMMON)== 0)) \
{ \ { \
cache_ptr->addend = -(ptr->section->vma + ptr->value); \ cache_ptr->addend = -(ptr->section->vma + ptr->value); \

View file

@ -17,11 +17,8 @@ files="hosts/${my_host}.h"
links="sysdep.h" links="sysdep.h"
if [ ! -f ${srcdir}/${files} ] ; then if [ ! -f ${srcdir}/${files} ] ; then
if [ -n "${my_host}" ] ; then files=../bfd/hosts/std-host.h
echo '***' No file ${srcdir}/${files} 1>&2 echo "[${srcname} has no specific support for host ${host} -- using std-host]"
fi
echo '***' ${srcname} does not support host ${host} 1>&2
exit 1
fi fi
host_makefile_frag= host_makefile_frag=

View file

@ -62,7 +62,7 @@ fill_spaces(abfd, file_hdr, dbx_subspace, dbx_strings_subspace)
struct subspace_dictionary_record subspace; struct subspace_dictionary_record subspace;
int index; int index;
/* indices of subspace entries for $TEXT$ and $GDB_DEBUG$ */ /* indices of subspace entries for $TEXT$ and $GDB_DEBUG$ */
int text_index = 0, gdb_debug_index = 0; long text_index = 0, gdb_debug_index = -1;
/* initialize in case we don't find any dbx symbols. */ /* initialize in case we don't find any dbx symbols. */
dbx_subspace->subspace_length = dbx_strings_subspace->subspace_length = 0; dbx_subspace->subspace_length = dbx_strings_subspace->subspace_length = 0;
@ -110,6 +110,10 @@ fill_spaces(abfd, file_hdr, dbx_subspace, dbx_strings_subspace)
#endif #endif
} }
} }
if (gdb_debug_index == -1)
return;
/* read symbols subspace and strings subspace in possibly arbitrary /* read symbols subspace and strings subspace in possibly arbitrary
order. */ order. */
bfd_seek (abfd, gdb_debug_index, SEEK_SET); bfd_seek (abfd, gdb_debug_index, SEEK_SET);