* bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour;
authorPer Bothner <per@bothner.com>
Tue, 22 Dec 1992 23:40:27 +0000 (23:40 +0000)
committerPer Bothner <per@bothner.com>
Tue, 22 Dec 1992 23:40:27 +0000 (23:40 +0000)
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.

bfd/ChangeLog
bfd/Makefile.in
bfd/coff-a29k.c
bfd/coffcode.h
bfd/configure.in
bfd/hppa.c

index c62496fd6c9ce379c9772ee53481cc93d51ff962..af557505715f683878e26141d9ff9737e5a368a7 100644 (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)
 
        * bfd.c:  Add struct hppa_core_data to tdata union.
index 03bce5848775ef55cd839261a61ddb3ef2e211c2..426d2faccbe56ddf1cbff58cc10febe9e8549e0f 100644 (file)
@@ -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
index f10a69750beaff3ec0f7e3465f7e227d1c0244a2..3dd4fac436ac346f09a1e3d7c547af72d487841c 100644 (file)
@@ -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))       
       {                                                
index 2386acf5418d4779910135ea6db01bb09ac5fa24..fe10087194f8e6b9ce8e873b72138fd4650af33b 100644 (file)
@@ -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);  \
index 7acef62c0fb6ee1b5fbe6c980bf56784da6c228a..373af01e1a18a8b4376edce692e1e00c770f7b8e 100644 (file)
@@ -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=
index 5ae90eecfbe9cfa4cd4a9a6564887b56cc78278e..caa887d7e34cc4d201f67b7d627ecf5f55dd5ccc 100644 (file)
@@ -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);