From: Per Bothner Date: Tue, 22 Dec 1992 23:40:27 +0000 (+0000) Subject: * bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour; X-Git-Tag: gdb-4_18~20487 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e238aa74b140ff264f366c6dc62404170bef0e8;p=external%2Fbinutils.git * 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c62496f..af55750 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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) * bfd.c: Add struct hppa_core_data to tdata union. diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 03bce58..426d2fa 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -174,17 +174,19 @@ do_mostlyclean: do_clean: do_mostlyclean rm -f libbfd.a TAGS do_distclean: do_clean - rm -f Makefile config.status + rm -f Makefile config.status sysdep.h do_realclean: do_distclean mostlyclean: do_mostlyclean $(MAKE) subdir_do DO=mostlyclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) clean: do_clean $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) -distclean: do_distclean +distclean: $(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 do_realclean # Mark everything as depending on config.status, since the timestamp on # sysdep.h might actually move backwards if we reconfig and relink it diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index f10a697..3dd4fac 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -272,7 +272,7 @@ static void DEFUN(reloc_processing,(relent,reloc, symbols, abfd, section) , ptr = *(relent->sym_ptr_ptr); if (ptr - && ptr->the_bfd == abfd + && bfd_asymbol_bfd(ptr) == abfd && ((ptr->flags & BSF_OLD_COMMON)== 0)) { diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 2386acf..fe10087 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1415,7 +1415,7 @@ DEFUN(coff_count_linenumbers,(abfd), for (p = abfd->outsymbols, i = 0; i < limit; i++, 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); if (q->lineno) { /* @@ -1447,10 +1447,10 @@ DEFUN(coff_symbol_from,(ignore_abfd, symbol), bfd *ignore_abfd AND 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; - 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 *) symbol; @@ -1769,7 +1769,7 @@ DEFUN(coff_write_alien_symbol,(abfd, symbol, written), { coff_symbol_type *c = coff_symbol_from(abfd, symbol); 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 @@ -2015,7 +2015,8 @@ DEFUN(coff_write_linenumbers,(abfd), /* Find all the linenumbers in this section */ while (*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) { /* Found a linenumber entry, output */ struct internal_lineno out; @@ -3658,7 +3659,7 @@ SUBSUBSECTION #ifndef CALC_ADDEND #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)) \ { \ cache_ptr->addend = -(ptr->section->vma + ptr->value); \ diff --git a/bfd/configure.in b/bfd/configure.in index 7acef62..373af01 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -17,11 +17,8 @@ files="hosts/${my_host}.h" links="sysdep.h" if [ ! -f ${srcdir}/${files} ] ; then - if [ -n "${my_host}" ] ; then - echo '***' No file ${srcdir}/${files} 1>&2 - fi - echo '***' ${srcname} does not support host ${host} 1>&2 - exit 1 + files=../bfd/hosts/std-host.h + echo "[${srcname} has no specific support for host ${host} -- using std-host]" fi host_makefile_frag= diff --git a/bfd/hppa.c b/bfd/hppa.c index 5ae90ee..caa887d 100644 --- a/bfd/hppa.c +++ b/bfd/hppa.c @@ -62,7 +62,7 @@ fill_spaces(abfd, file_hdr, dbx_subspace, dbx_strings_subspace) struct subspace_dictionary_record subspace; int index; /* 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. */ 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 } } + + if (gdb_debug_index == -1) + return; + /* read symbols subspace and strings subspace in possibly arbitrary order. */ bfd_seek (abfd, gdb_debug_index, SEEK_SET);