Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
obj-aout.c File Reference
#include "as.h"
#include "aout/aout64.h"
#include "obstack.h"

Go to the source code of this file.

Defines

#define OBJ_HEADER   "obj-aout.h"

Functions

void obj_aout_frob_symbol (symbolS *sym, int *punt ATTRIBUTE_UNUSED)
void obj_aout_frob_file_before_fix (void)
static void obj_aout_line (int ignore ATTRIBUTE_UNUSED)
static void obj_aout_weak (int ignore ATTRIBUTE_UNUSED)
static void obj_aout_type (int ignore ATTRIBUTE_UNUSED)
static void aout_pop_insert (void)
static int obj_aout_s_get_other (symbolS *sym)
static void obj_aout_s_set_other (symbolS *sym, int o)
static int obj_aout_sec_sym_ok_for_reloc (asection *sec ATTRIBUTE_UNUSED)
static void obj_aout_process_stab (segT seg ATTRIBUTE_UNUSED, int w, const char *s, int t, int o, int d)
static int obj_aout_s_get_desc (symbolS *sym)
static void obj_aout_s_set_desc (symbolS *sym, int d)
static int obj_aout_s_get_type (symbolS *sym)
static void obj_aout_s_set_type (symbolS *sym, int t)
static int obj_aout_separate_stab_sections (void)

Variables

const pseudo_typeS aout_pseudo_table []

Define Documentation

#define OBJ_HEADER   "obj-aout.h"

Definition at line 22 of file obj-aout.c.


Function Documentation

static void aout_pop_insert ( void  ) [static]

Definition at line 215 of file obj-aout.c.

Here is the call graph for this function:

Definition at line 121 of file obj-aout.c.

{
  /* Relocation processing may require knowing the VMAs of the sections.
     Since writing to a section will cause the BFD back end to compute the
     VMAs, fake it out here....  */
  bfd_byte b = 0;
  bfd_boolean x = TRUE;
  if (bfd_section_size (stdoutput, text_section) != 0)
    x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0,
                              (bfd_size_type) 1);
  else if (bfd_section_size (stdoutput, data_section) != 0)
    x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
                              (bfd_size_type) 1);

  assert (x);
}

Here is the call graph for this function:

void obj_aout_frob_symbol ( symbolS *  sym,
int *punt  ATTRIBUTE_UNUSED 
)

Definition at line 30 of file obj-aout.c.

{
  flagword flags;
  asection *sec;
  int desc, type, other;

  flags = symbol_get_bfdsym (sym)->flags;
  desc = aout_symbol (symbol_get_bfdsym (sym))->desc;
  type = aout_symbol (symbol_get_bfdsym (sym))->type;
  other = aout_symbol (symbol_get_bfdsym (sym))->other;
  sec = S_GET_SEGMENT (sym);

  /* Only frob simple symbols this way right now.  */
  if (! (type & ~ (N_TYPE | N_EXT)))
    {
      if (type == (N_UNDF | N_EXT)
         && sec == &bfd_abs_section)
       {
         sec = bfd_und_section_ptr;
         S_SET_SEGMENT (sym, sec);
       }

      if ((type & N_TYPE) != N_INDR
         && (type & N_TYPE) != N_SETA
         && (type & N_TYPE) != N_SETT
         && (type & N_TYPE) != N_SETD
         && (type & N_TYPE) != N_SETB
         && type != N_WARNING
         && (sec == &bfd_abs_section
             || sec == &bfd_und_section))
       return;
      if (flags & BSF_EXPORT)
       type |= N_EXT;

      switch (type & N_TYPE)
       {
       case N_SETA:
       case N_SETT:
       case N_SETD:
       case N_SETB:
         /* Set the debugging flag for constructor symbols so that
            BFD leaves them alone.  */
         symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;

         /* You can't put a common symbol in a set.  The way a set
            element works is that the symbol has a definition and a
            name, and the linker adds the definition to the set of
            that name.  That does not work for a common symbol,
            because the linker can't tell which common symbol the
            user means.  FIXME: Using as_bad here may be
            inappropriate, since the user may want to force a
            particular type without regard to the semantics of sets;
            on the other hand, we certainly don't want anybody to be
            mislead into thinking that their code will work.  */
         if (S_IS_COMMON (sym))
           as_bad (_("Attempt to put a common symbol into set %s"),
                  S_GET_NAME (sym));
         /* Similarly, you can't put an undefined symbol in a set.  */
         else if (! S_IS_DEFINED (sym))
           as_bad (_("Attempt to put an undefined symbol into set %s"),
                  S_GET_NAME (sym));

         break;
       case N_INDR:
         /* Put indirect symbols in the indirect section.  */
         S_SET_SEGMENT (sym, bfd_ind_section_ptr);
         symbol_get_bfdsym (sym)->flags |= BSF_INDIRECT;
         if (type & N_EXT)
           {
             symbol_get_bfdsym (sym)->flags |= BSF_EXPORT;
             symbol_get_bfdsym (sym)->flags &=~ BSF_LOCAL;
           }
         break;
       case N_WARNING:
         /* Mark warning symbols.  */
         symbol_get_bfdsym (sym)->flags |= BSF_WARNING;
         break;
       }
    }
  else
    symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;

  aout_symbol (symbol_get_bfdsym (sym))->type = type;

  /* Double check weak symbols.  */
  if (S_IS_WEAK (sym) && S_IS_COMMON (sym))
    as_bad (_("Symbol `%s' can not be both weak and common"),
           S_GET_NAME (sym));
}

Here is the call graph for this function:

static void obj_aout_line ( int ignore  ATTRIBUTE_UNUSED) [static]

Definition at line 139 of file obj-aout.c.

{
  /* Assume delimiter is part of expression.
     BSD4.2 as fails with delightful bug, so we
     are not being incompatible here.  */
  new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

static void obj_aout_process_stab ( segT seg  ATTRIBUTE_UNUSED,
int  w,
const char *  s,
int  t,
int  o,
int  d 
) [static]

Definition at line 239 of file obj-aout.c.

{
  aout_process_stab (w, s, t, o, d);
}

Here is the call graph for this function:

static int obj_aout_s_get_desc ( symbolS *  sym) [static]

Definition at line 250 of file obj-aout.c.

{
  return aout_symbol (symbol_get_bfdsym (sym))->desc;
}

Here is the call graph for this function:

static int obj_aout_s_get_other ( symbolS *  sym) [static]

Definition at line 221 of file obj-aout.c.

{
  return aout_symbol (symbol_get_bfdsym (sym))->other;
}

Here is the call graph for this function:

static int obj_aout_s_get_type ( symbolS *  sym) [static]

Definition at line 262 of file obj-aout.c.

{
  return aout_symbol (symbol_get_bfdsym (sym))->type;
}

Here is the call graph for this function:

static void obj_aout_s_set_desc ( symbolS *  sym,
int  d 
) [static]

Definition at line 256 of file obj-aout.c.

Here is the call graph for this function:

static void obj_aout_s_set_other ( symbolS *  sym,
int  o 
) [static]

Definition at line 227 of file obj-aout.c.

{
  aout_symbol (symbol_get_bfdsym (sym))->other = o;
}

Here is the call graph for this function:

static void obj_aout_s_set_type ( symbolS *  sym,
int  t 
) [static]

Definition at line 268 of file obj-aout.c.

Here is the call graph for this function:

static int obj_aout_sec_sym_ok_for_reloc ( asection *sec  ATTRIBUTE_UNUSED) [static]

Definition at line 233 of file obj-aout.c.

{
  return obj_sec_sym_ok_for_reloc (sec);
}
static int obj_aout_separate_stab_sections ( void  ) [static]

Definition at line 274 of file obj-aout.c.

{
  return 0;
}
static void obj_aout_type ( int ignore  ATTRIBUTE_UNUSED) [static]

Definition at line 183 of file obj-aout.c.

{
  char *name;
  int c;
  symbolS *sym;

  name = input_line_pointer;
  c = get_symbol_end ();
  sym = symbol_find_or_make (name);
  *input_line_pointer = c;
  SKIP_WHITESPACE ();
  if (*input_line_pointer == ',')
    {
      ++input_line_pointer;
      SKIP_WHITESPACE ();
      if (*input_line_pointer == '@')
       {
         ++input_line_pointer;
         if (strncmp (input_line_pointer, "object", 6) == 0)
           S_SET_OTHER (sym, 1);
         else if (strncmp (input_line_pointer, "function", 8) == 0)
           S_SET_OTHER (sym, 2);
       }
    }

  /* Ignore everything else on the line.  */
  s_ignore (0);
}

Here is the call graph for this function:

static void obj_aout_weak ( int ignore  ATTRIBUTE_UNUSED) [static]

Definition at line 151 of file obj-aout.c.

{
  char *name;
  int c;
  symbolS *symbolP;

  do
    {
      name = input_line_pointer;
      c = get_symbol_end ();
      symbolP = symbol_find_or_make (name);
      *input_line_pointer = c;
      SKIP_WHITESPACE ();
      S_SET_WEAK (symbolP);
      if (c == ',')
       {
         input_line_pointer++;
         SKIP_WHITESPACE ();
         if (*input_line_pointer == '\n')
           c = '\n';
       }
    }
  while (c == ',');
  demand_empty_rest_of_line ();
}

Here is the call graph for this function:


Variable Documentation

const pseudo_typeS aout_pseudo_table[]
Initial value:
{
  {"line", obj_aout_line, 0},      
  {"ln", obj_aout_line, 0}, 

  {"weak", obj_aout_weak, 0},      

  {"type", obj_aout_type, 0},

  
  {"def", s_ignore, 0},
  {"dim", s_ignore, 0},
  {"endef", s_ignore, 0},
  {"ident", s_ignore, 0},
  {"line", s_ignore, 0},
  {"ln", s_ignore, 0},
  {"scl", s_ignore, 0},
  {"size", s_ignore, 0},
  {"tag", s_ignore, 0},
  {"val", s_ignore, 0},
  {"version", s_ignore, 0},

  {"optim", s_ignore, 0},   

  
  {"ABORT", s_abort, 0},

  {NULL, NULL, 0}
}

Definition at line 316 of file obj-aout.c.