* subsegs.c: Renamed non-BFD_ASSEMBLER subseg_new to subseg_set.
[deliverable/binutils-gdb.git] / gas / config / obj-aout.c
index c074df2cd58d6fedb7caf50c4f4c3845b1768d00..2d7d2ca8fb10fb1ba87fe64f469870eebd34271c 100644 (file)
@@ -19,6 +19,9 @@ to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 #include "as.h"
 #include "aout/stab_gnu.h"
+#ifdef BFD_ASSEMBLER
+#include "aout/aout64.h"
+#endif
 #include "obstack.h"
 
 #ifndef BFD_ASSEMBLER
@@ -30,11 +33,8 @@ const short seg_N_TYPE[] =
   N_DATA,
   N_BSS,
   N_UNDF,                      /* unknown */
-  N_UNDF,                      /* absent */
-  N_UNDF,                      /* pass1 */
   N_UNDF,                      /* error */
-  N_UNDF,                      /* bignum/flonum */
-  N_UNDF,                      /* difference */
+  N_UNDF,                      /* expression */
   N_UNDF,                      /* debug */
   N_UNDF,                      /* ntv */
   N_UNDF,                      /* ptv */
@@ -62,8 +62,8 @@ const segT N_TYPE_seg[N_TYPE + 2] =
 #endif
 
 static void obj_aout_stab PARAMS ((int what));
-static void obj_aout_line PARAMS ((void));
-static void obj_aout_desc PARAMS ((void));
+static void obj_aout_line PARAMS ((int));
+static void obj_aout_desc PARAMS ((int));
 
 const pseudo_typeS obj_pseudo_table[] =
 {
@@ -110,17 +110,6 @@ obj_aout_frob_symbol (sym, punt)
   asection *sec;
   int desc, type, other;
 
-  /* Is this part format-dependent?  */
-  if (sym->sy_forward)
-    {
-      S_SET_VALUE (sym,
-                  S_GET_VALUE (sym)
-                  + S_GET_VALUE (sym->sy_forward)
-                  + sym->sy_forward->sy_frag->fr_address
-                  );
-      sym->sy_forward = 0;
-    }
-
   flags = sym->bsym->flags;
   desc = S_GET_DESC (sym);
   type = S_GET_TYPE (sym);
@@ -128,13 +117,25 @@ obj_aout_frob_symbol (sym, punt)
   sec = sym->bsym->section;
 
   /* Only frob simple symbols this way right now.  */
-  if (! (type & ~0x1f))
+  if (! (type & ~ (N_TYPE | N_EXT)))
     {
       if (sec == &bfd_abs_section
          || sec == &bfd_und_section)
        return;
       if (flags & BSF_EXPORT)
-       type |= 1;
+       type |= N_EXT;
+
+      /* Set the debugging flag for constructor symbols so that BFD
+        leaves them alone.  */
+      switch (type & N_TYPE)
+       {
+       case N_SETA:
+       case N_SETT:
+       case N_SETD:
+       case N_SETB:
+         sym->bsym->flags |= BSF_DEBUGGING;
+         break;
+       }
     }
   else
     {
@@ -243,7 +244,8 @@ obj_emit_symbols (where, symbol_rootP)
 #endif /* ! BFD_ASSEMBLER */
 
 static void
-obj_aout_line ()
+obj_aout_line (ignore)
+     int ignore;
 {
   /* Assume delimiter is part of expression.
      BSD4.2 as fails with delightful bug, so we
@@ -314,7 +316,7 @@ obj_aout_stab (what)
        {
        case 'd':
          S_SET_NAME (symbolP, NULL);   /* .stabd feature. */
-         S_SET_VALUE (symbolP, (char*) obstack_next_free (&frags) - frag_now->fr_literal);
+         S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
          symbolP->sy_frag = frag_now;
          break;
 
@@ -383,7 +385,7 @@ obj_aout_stab (what)
     {
       if (S_GET_TYPE (symbolP) == N_SLINE)
        {
-         listing_source_line (S_GET_DESC (symbolP));
+         listing_source_line ((unsigned int) S_GET_DESC (symbolP));
        }
       else if (S_GET_TYPE (symbolP) == N_SO || S_GET_TYPE (symbolP) == N_SOL)
        {
@@ -399,7 +401,8 @@ obj_aout_stab (what)
 }                              /* obj_aout_stab() */
 
 static void
-obj_aout_desc ()
+obj_aout_desc (ignore)
+     int ignore;
 {
   register char *name;
   register char c;
@@ -450,19 +453,6 @@ obj_crawl_symbol_chain (headers)
   symbolS **symbolPP;
   int symbol_number = 0;
 
-  /* JF deal with forward references first... */
-  for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
-    {
-      if (symbolP->sy_forward)
-       {
-         S_SET_VALUE (symbolP, S_GET_VALUE (symbolP)
-                      + S_GET_VALUE (symbolP->sy_forward)
-                      + symbolP->sy_forward->sy_frag->fr_address);
-
-         symbolP->sy_forward = 0;
-       }                       /* if it has a forward reference */
-    }                          /* walk the symbol chain */
-
   tc_crawl_symbol_chain (headers);
 
   symbolPP = &symbol_rootP;    /*->last symbol chain link. */
@@ -473,7 +463,7 @@ obj_crawl_symbol_chain (headers)
          S_SET_SEGMENT (symbolP, SEG_TEXT);
        }                       /* if pusing data into text */
 
-      S_SET_VALUE (symbolP, S_GET_VALUE (symbolP) + symbolP->sy_frag->fr_address);
+      resolve_symbol_value (symbolP);
 
       /* OK, here is how we decide which symbols go out into the brave
         new symtab.  Symbols that do are:
@@ -617,15 +607,15 @@ DEFUN_VOID (s_sect)
 
   if (strcmp (section_name, ".text") == 0)
     {
-      subseg_new (SEG_TEXT, (subsegT) exp);
+      subseg_set (SEG_TEXT, (subsegT) exp);
     }
 
   if (strcmp (section_name, ".data") == 0)
     {
       if (flagseen['R'])
-       subseg_new (SEG_TEXT, (subsegT) exp + 1000);
+       subseg_set (SEG_TEXT, (subsegT) exp + 1000);
       else
-       subseg_new (SEG_DATA, (subsegT) exp);
+       subseg_set (SEG_DATA, (subsegT) exp);
     }
 
   *section_name_end = c;
This page took 0.024962 seconds and 4 git commands to generate.