#include "as.h"
#include "aout/stab_gnu.h"
+#ifdef BFD_ASSEMBLER
+#include "aout/aout64.h"
+#endif
#include "obstack.h"
#ifndef BFD_ASSEMBLER
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 */
#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[] =
{
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);
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
{
#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
{
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;
{
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)
{
} /* obj_aout_stab() */
static void
-obj_aout_desc ()
+obj_aout_desc (ignore)
+ int ignore;
{
register char *name;
register char c;
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. */
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:
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;