Back to index

cell-binutils  2.17cvs20070401
Defines | Enumerations | Functions | Variables
read.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PERMIT_WHITESPACE
#define SKIP_WHITESPACE()   ((*input_line_pointer == ' ') ? ++input_line_pointer : 0)
#define LEX_NAME   (1) /* may continue a name */
#define LEX_BEGIN_NAME   (2) /* may begin a name */
#define LEX_END_NAME   (4) /* ends a name */
#define is_name_beginner(c)   ( lex_type[(unsigned char) (c)] & LEX_BEGIN_NAME )
#define is_part_of_name(c)   ( lex_type[(unsigned char) (c)] & LEX_NAME )
#define is_name_ender(c)   ( lex_type[(unsigned char) (c)] & LEX_END_NAME )
#define CHAR_MASK   (0xff)
#define NOT_A_CHAR   (CHAR_MASK+1)
#define is_a_char(c)   (((unsigned) (c)) <= CHAR_MASK)
#define discard_rest_of_line   ignore_rest_of_line

Enumerations

enum  linkonce_type {
  LINKONCE_UNSET = 0, LINKONCE_DISCARD, LINKONCE_ONE_ONLY, LINKONCE_SAME_SIZE,
  LINKONCE_SAME_CONTENTS
}

Functions

int is_it_end_of_statement (void)
char * find_end_of_line (char *, int)
void pop_insert (const pseudo_typeS *)
unsigned int get_stab_string_offset (const char *string, const char *stabstr_secname)
void aout_process_stab (int, const char *, int, int, int)
char * demand_copy_string (int *lenP)
char * demand_copy_C_string (int *len_pointer)
char get_absolute_expression_and_terminator (long *val_pointer)
offsetT get_absolute_expression (void)
unsigned int next_char_of_string (void)
void s_mri_sect (char *)
char * mri_comment_field (char *)
void mri_comment_end (char *, int)
void add_include_dir (char *path)
void cons (int nbytes)
void demand_empty_rest_of_line (void)
void emit_expr (expressionS *exp, unsigned int nbytes)
void equals (char *sym_name, int reassign)
void float_cons (int float_type)
void ignore_rest_of_line (void)
int output_leb128 (char *, valueT, int sign)
void pseudo_set (symbolS *symbolP)
void read_a_source_file (char *name)
void read_begin (void)
void read_print_statistics (FILE *)
int sizeof_leb128 (valueT, int sign)
void stabs_generate_asm_file (void)
void stabs_generate_asm_lineno (void)
void stabs_generate_asm_func (const char *, const char *)
void stabs_generate_asm_endfunc (const char *, const char *)
void do_repeat (int, const char *, const char *)
void end_repeat (int)
void do_parse_cons_expression (expressionS *, int)
void generate_lineno_debug (void)
void s_abort (int) ATTRIBUTE_NORETURN
void s_align_bytes (int arg)
void s_align_ptwo (int)
void bss_alloc (symbolS *, addressT, int)
offsetT parse_align (int)
symbolS * s_comm_internal (int, symbolS *(*)(int, symbolS *, addressT))
symbolS * s_lcomm_internal (int, symbolS *, addressT)
void s_app_file_string (char *, int)
void s_app_file (int)
void s_app_line (int)
void s_comm (int)
void s_data (int)
void s_desc (int)
void s_else (int arg)
void s_elseif (int arg)
void s_end (int arg)
void s_endif (int arg)
void s_err (int)
void s_errwarn (int)
void s_fail (int)
void s_fill (int)
void s_float_space (int mult)
void s_func (int)
void s_globl (int arg)
void s_if (int arg)
void s_ifb (int arg)
void s_ifc (int arg)
void s_ifdef (int arg)
void s_ifeqs (int arg)
void s_ignore (int arg)
void s_include (int arg)
void s_irp (int arg)
void s_lcomm (int needs_align)
void s_lcomm_bytes (int needs_align)
void s_leb128 (int sign)
void s_linkonce (int)
void s_lsym (int)
void s_macro (int)
void s_mexit (int)
void s_mri (int)
void s_mri_common (int)
void s_org (int)
void s_print (int)
void s_purgem (int)
void s_rept (int)
void s_set (int)
void s_space (int mult)
void s_stab (int what)
void s_struct (int)
void s_text (int)
void stringer (int append_zero)
void s_xstab (int what)
void s_rva (int)
void s_incbin (int)
void s_weakref (int)

Variables

char * input_line_pointer
char lex_type []
char is_end_of_line []
int target_big_endian
const char comment_chars []
const char line_comment_chars []
const char line_separator_chars []
char ** include_dirs
int include_dir_count
int include_dir_maxlen
addressT abs_section_offset
symbolS * line_label
symbolS * mri_common_symbol
int outputting_stabs_line_debug
char original_case_string []

Define Documentation

#define CHAR_MASK   (0xff)

Definition at line 50 of file read.h.

Definition at line 117 of file read.h.

#define is_a_char (   c)    (((unsigned) (c)) <= CHAR_MASK)

Definition at line 52 of file read.h.

#define is_name_beginner (   c)    ( lex_type[(unsigned char) (c)] & LEX_BEGIN_NAME )

Definition at line 42 of file read.h.

#define is_name_ender (   c)    ( lex_type[(unsigned char) (c)] & LEX_END_NAME )

Definition at line 46 of file read.h.

#define is_part_of_name (   c)    ( lex_type[(unsigned char) (c)] & LEX_NAME )

Definition at line 44 of file read.h.

#define LEX_BEGIN_NAME   (2) /* may begin a name */

Definition at line 39 of file read.h.

#define LEX_END_NAME   (4) /* ends a name */

Definition at line 40 of file read.h.

#define LEX_NAME   (1) /* may continue a name */

Definition at line 38 of file read.h.

#define NOT_A_CHAR   (CHAR_MASK+1)

Definition at line 51 of file read.h.

Definition at line 29 of file read.h.

#define SKIP_WHITESPACE ( )    ((*input_line_pointer == ' ') ? ++input_line_pointer : 0)

Definition at line 32 of file read.h.


Enumeration Type Documentation

Enumerator:
LINKONCE_UNSET 
LINKONCE_DISCARD 
LINKONCE_ONE_ONLY 
LINKONCE_SAME_SIZE 
LINKONCE_SAME_CONTENTS 

Definition at line 86 of file read.h.


Function Documentation

void add_include_dir ( char *  path)

Definition at line 5405 of file read.c.

{
  int i;

  if (include_dir_count == 0)
    {
      include_dirs = (char **) xmalloc (2 * sizeof (*include_dirs));
      include_dirs[0] = ".";       /* Current dir.  */
      include_dir_count = 2;
    }
  else
    {
      include_dir_count++;
      include_dirs =
       (char **) realloc (include_dirs,
                        include_dir_count * sizeof (*include_dirs));
    }

  include_dirs[include_dir_count - 1] = path;    /* New one.  */

  i = strlen (path);
  if (i > include_dir_maxlen)
    include_dir_maxlen = i;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void aout_process_stab ( int  ,
const char *  ,
int  ,
int  ,
int   
)

Here is the caller graph for this function:

void bss_alloc ( symbolS *  ,
addressT  ,
int   
)

Definition at line 2150 of file read.c.

{
  char *pfrag;
  segT current_seg = now_seg;
  subsegT current_subseg = now_subseg;
  segT bss_seg = bss_section;

#if defined (TC_MIPS) || defined (TC_ALPHA)
  if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour
      || OUTPUT_FLAVOR == bfd_target_elf_flavour)
    {
      /* For MIPS and Alpha ECOFF or ELF, small objects are put in .sbss.  */
      if (size <= bfd_get_gp_size (stdoutput))
       {
         bss_seg = subseg_new (".sbss", 1);
         seg_info (bss_seg)->bss = 1;
         if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
           as_warn (_("error setting flags for \".sbss\": %s"),
                   bfd_errmsg (bfd_get_error ()));
       }
    }
#endif
  subseg_set (bss_seg, 1);

  if (align)
    {
      record_alignment (bss_seg, align);
      frag_align (align, 0, 0);
    }

  /* Detach from old frag.  */
  if (S_GET_SEGMENT (symbolP) == bss_seg)
    symbol_get_frag (symbolP)->fr_symbol = NULL;

  symbol_set_frag (symbolP, frag_now);
  pfrag = frag_var (rs_org, 1, 1, 0, symbolP, size, NULL);
  *pfrag = 0;

#ifdef S_SET_SIZE
  S_SET_SIZE (symbolP, size);
#endif
  S_SET_SEGMENT (symbolP, bss_seg);

#ifdef OBJ_COFF
  /* The symbol may already have been created with a preceding
     ".globl" directive -- be careful not to step on storage class
     in that case.  Otherwise, set it to static.  */
  if (S_GET_STORAGE_CLASS (symbolP) != C_EXT)
    S_SET_STORAGE_CLASS (symbolP, C_STAT);
#endif /* OBJ_COFF */

  subseg_set (current_seg, current_subseg);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cons ( int  nbytes)

Definition at line 3663 of file read.c.

{
  cons_worker (size, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* demand_copy_C_string ( int len_pointer)

Definition at line 5127 of file read.c.

{
  register char *s;

  if ((s = demand_copy_string (len_pointer)) != 0)
    {
      register int len;

      for (len = *len_pointer; len > 0; len--)
       {
         if (*s == 0)
           {
             s = 0;
             len = 1;
             *len_pointer = 0;
             as_bad (_("this string may not contain \'\\0\'"));
           }
       }
    }

  return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* demand_copy_string ( int lenP)

Definition at line 5154 of file read.c.

{
  register unsigned int c;
  register int len;
  char *retval;

  len = 0;
  SKIP_WHITESPACE ();
  if (*input_line_pointer == '\"')
    {
      input_line_pointer++; /* Skip opening quote.  */

      while (is_a_char (c = next_char_of_string ()))
       {
         obstack_1grow (&notes, c);
         len++;
       }
      /* JF this next line is so demand_copy_C_string will return a
        null terminated string.  */
      obstack_1grow (&notes, '\0');
      retval = obstack_finish (&notes);
    }
  else
    {
      as_bad (_("missing string"));
      retval = NULL;
      ignore_rest_of_line ();
    }
  *lenP = len;
  return (retval);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void demand_empty_rest_of_line ( void  )

Definition at line 3383 of file read.c.

{
  SKIP_WHITESPACE ();
  if (is_end_of_line[(unsigned char) *input_line_pointer])
    input_line_pointer++;
  else
    {
      if (ISPRINT (*input_line_pointer))
       as_bad (_("junk at end of line, first unrecognized character is `%c'"),
               *input_line_pointer);
      else
       as_bad (_("junk at end of line, first unrecognized character valued 0x%x"),
               *input_line_pointer);
      ignore_rest_of_line ();
    }
  
  /* Return pointing just after end-of-line.  */
  know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
}

Here is the call graph for this function:

void do_repeat ( int  ,
const char *  ,
const char *   
)

Definition at line 2805 of file read.c.

{
  sb one;
  sb many;

  sb_new (&one);
  if (!buffer_and_nest (start, end, &one, get_line_sb))
    {
      as_bad (_("%s without %s"), start, end);
      return;
    }

  sb_new (&many);
  while (count-- > 0)
    sb_add_sb (&many, &one);

  sb_kill (&one);

  input_scrub_include_sb (&many, input_line_pointer, 1);
  sb_kill (&many);
  buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void emit_expr ( expressionS exp,
unsigned int  nbytes 
)

Definition at line 3785 of file read.c.

{
  operatorT op;
  register char *p;
  valueT extra_digit = 0;

  /* Don't do anything if we are going to make another pass.  */
  if (need_pass_2)
    return;

  dot_value = frag_now_fix ();

#ifndef NO_LISTING
#ifdef OBJ_ELF
  /* When gcc emits DWARF 1 debugging pseudo-ops, a line number will
     appear as a four byte positive constant in the .line section,
     followed by a 2 byte 0xffff.  Look for that case here.  */
  {
    static int dwarf_line = -1;

    if (strcmp (segment_name (now_seg), ".line") != 0)
      dwarf_line = -1;
    else if (dwarf_line >= 0
            && nbytes == 2
            && exp->X_op == O_constant
            && (exp->X_add_number == -1 || exp->X_add_number == 0xffff))
      listing_source_line ((unsigned int) dwarf_line);
    else if (nbytes == 4
            && exp->X_op == O_constant
            && exp->X_add_number >= 0)
      dwarf_line = exp->X_add_number;
    else
      dwarf_line = -1;
  }

  /* When gcc emits DWARF 1 debugging pseudo-ops, a file name will
     appear as a 2 byte TAG_compile_unit (0x11) followed by a 2 byte
     AT_sibling (0x12) followed by a four byte address of the sibling
     followed by a 2 byte AT_name (0x38) followed by the name of the
     file.  We look for that case here.  */
  {
    static int dwarf_file = 0;

    if (strcmp (segment_name (now_seg), ".debug") != 0)
      dwarf_file = 0;
    else if (dwarf_file == 0
            && nbytes == 2
            && exp->X_op == O_constant
            && exp->X_add_number == 0x11)
      dwarf_file = 1;
    else if (dwarf_file == 1
            && nbytes == 2
            && exp->X_op == O_constant
            && exp->X_add_number == 0x12)
      dwarf_file = 2;
    else if (dwarf_file == 2
            && nbytes == 4)
      dwarf_file = 3;
    else if (dwarf_file == 3
            && nbytes == 2
            && exp->X_op == O_constant
            && exp->X_add_number == 0x38)
      dwarf_file = 4;
    else
      dwarf_file = 0;

    /* The variable dwarf_file_string tells stringer that the string
       may be the name of the source file.  */
    if (dwarf_file == 4)
      dwarf_file_string = 1;
    else
      dwarf_file_string = 0;
  }
#endif
#endif

  if (check_eh_frame (exp, &nbytes))
    return;

  op = exp->X_op;

  /* Allow `.word 0' in the absolute section.  */
  if (now_seg == absolute_section)
    {
      if (op != O_constant || exp->X_add_number != 0)
       as_bad (_("attempt to store value in absolute section"));
      abs_section_offset += nbytes;
      return;
    }

  /* Handle a negative bignum.  */
  if (op == O_uminus
      && exp->X_add_number == 0
      && symbol_get_value_expression (exp->X_add_symbol)->X_op == O_big
      && symbol_get_value_expression (exp->X_add_symbol)->X_add_number > 0)
    {
      int i;
      unsigned long carry;

      exp = symbol_get_value_expression (exp->X_add_symbol);

      /* Negate the bignum: one's complement each digit and add 1.  */
      carry = 1;
      for (i = 0; i < exp->X_add_number; i++)
       {
         unsigned long next;

         next = (((~(generic_bignum[i] & LITTLENUM_MASK))
                 & LITTLENUM_MASK)
                + carry);
         generic_bignum[i] = next & LITTLENUM_MASK;
         carry = next >> LITTLENUM_NUMBER_OF_BITS;
       }

      /* We can ignore any carry out, because it will be handled by
        extra_digit if it is needed.  */

      extra_digit = (valueT) -1;
      op = O_big;
    }

  if (op == O_absent || op == O_illegal)
    {
      as_warn (_("zero assumed for missing expression"));
      exp->X_add_number = 0;
      op = O_constant;
    }
  else if (op == O_big && exp->X_add_number <= 0)
    {
      as_bad (_("floating point number invalid"));
      exp->X_add_number = 0;
      op = O_constant;
    }
  else if (op == O_register)
    {
      as_warn (_("register value used as expression"));
      op = O_constant;
    }

  p = frag_more ((int) nbytes);

#ifndef WORKING_DOT_WORD
  /* If we have the difference of two symbols in a word, save it on
     the broken_words list.  See the code in write.c.  */
  if (op == O_subtract && nbytes == 2)
    {
      struct broken_word *x;

      x = (struct broken_word *) xmalloc (sizeof (struct broken_word));
      x->next_broken_word = broken_words;
      broken_words = x;
      x->seg = now_seg;
      x->subseg = now_subseg;
      x->frag = frag_now;
      x->word_goes_here = p;
      x->dispfrag = 0;
      x->add = exp->X_add_symbol;
      x->sub = exp->X_op_symbol;
      x->addnum = exp->X_add_number;
      x->added = 0;
      x->use_jump = 0;
      new_broken_words++;
      return;
    }
#endif

  /* If we have an integer, but the number of bytes is too large to
     pass to md_number_to_chars, handle it as a bignum.  */
  if (op == O_constant && nbytes > sizeof (valueT))
    {
      extra_digit = exp->X_unsigned ? 0 : -1;
      convert_to_bignum (exp);
      op = O_big;
    }

  if (op == O_constant)
    {
      register valueT get;
      register valueT use;
      register valueT mask;
      valueT hibit;
      register valueT unmask;

      /* JF << of >= number of bits in the object is undefined.  In
        particular SPARC (Sun 4) has problems.  */
      if (nbytes >= sizeof (valueT))
       {
         mask = 0;
         if (nbytes > sizeof (valueT))
           hibit = 0;
         else
           hibit = (valueT) 1 << (nbytes * BITS_PER_CHAR - 1);
       }
      else
       {
         /* Don't store these bits.  */
         mask = ~(valueT) 0 << (BITS_PER_CHAR * nbytes);
         hibit = (valueT) 1 << (nbytes * BITS_PER_CHAR - 1);
       }

      unmask = ~mask;              /* Do store these bits.  */

#ifdef NEVER
      "Do this mod if you want every overflow check to assume SIGNED 2's complement data.";
      mask = ~(unmask >> 1);       /* Includes sign bit now.  */
#endif

      get = exp->X_add_number;
      use = get & unmask;
      if ((get & mask) != 0
         && ((get & mask) != mask
             || (get & hibit) == 0))
       {             /* Leading bits contain both 0s & 1s.  */
         as_warn (_("value 0x%lx truncated to 0x%lx"),
                 (unsigned long) get, (unsigned long) use);
       }
      /* Put bytes in right order.  */
      md_number_to_chars (p, use, (int) nbytes);
    }
  else if (op == O_big)
    {
      unsigned int size;
      LITTLENUM_TYPE *nums;

      know (nbytes % CHARS_PER_LITTLENUM == 0);

      size = exp->X_add_number * CHARS_PER_LITTLENUM;
      if (nbytes < size)
       {
         as_warn (_("bignum truncated to %d bytes"), nbytes);
         size = nbytes;
       }

      if (target_big_endian)
       {
         while (nbytes > size)
           {
             md_number_to_chars (p, extra_digit, CHARS_PER_LITTLENUM);
             nbytes -= CHARS_PER_LITTLENUM;
             p += CHARS_PER_LITTLENUM;
           }

         nums = generic_bignum + size / CHARS_PER_LITTLENUM;
         while (size >= CHARS_PER_LITTLENUM)
           {
             --nums;
             md_number_to_chars (p, (valueT) *nums, CHARS_PER_LITTLENUM);
             size -= CHARS_PER_LITTLENUM;
             p += CHARS_PER_LITTLENUM;
           }
       }
      else
       {
         nums = generic_bignum;
         while (size >= CHARS_PER_LITTLENUM)
           {
             md_number_to_chars (p, (valueT) *nums, CHARS_PER_LITTLENUM);
             ++nums;
             size -= CHARS_PER_LITTLENUM;
             p += CHARS_PER_LITTLENUM;
             nbytes -= CHARS_PER_LITTLENUM;
           }

         while (nbytes >= CHARS_PER_LITTLENUM)
           {
             md_number_to_chars (p, extra_digit, CHARS_PER_LITTLENUM);
             nbytes -= CHARS_PER_LITTLENUM;
             p += CHARS_PER_LITTLENUM;
           }
       }
    }
  else
    {
      memset (p, 0, nbytes);

      /* Now we need to generate a fixS to record the symbol value.  */

#ifdef TC_CONS_FIX_NEW
      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
#else
      {
       bfd_reloc_code_real_type r;

       switch (nbytes)
         {
         case 1:
           r = BFD_RELOC_8;
           break;
         case 2:
           r = BFD_RELOC_16;
           break;
         case 4:
           r = BFD_RELOC_32;
           break;
         case 8:
           r = BFD_RELOC_64;
           break;
         default:
           as_bad (_("unsupported BFD relocation size %u"), nbytes);
           r = BFD_RELOC_32;
           break;
         }
       fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp,
                   0, r);
      }
#endif
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void end_repeat ( int  )

Definition at line 2837 of file read.c.

Here is the call graph for this function:

void equals ( char *  sym_name,
int  reassign 
)

Definition at line 5200 of file read.c.

{
  char *stop = NULL;
  char stopc = 0;

  input_line_pointer++;
  if (*input_line_pointer == '=')
    input_line_pointer++;
  if (reassign < 0 && *input_line_pointer == '=')
    input_line_pointer++;

  while (*input_line_pointer == ' ' || *input_line_pointer == '\t')
    input_line_pointer++;

  if (flag_mri)
    stop = mri_comment_field (&stopc);

  assign_symbol (sym_name, reassign >= 0 ? !reassign : reassign);

  if (flag_mri)
    {
      demand_empty_rest_of_line ();
      mri_comment_end (stop, stopc);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* find_end_of_line ( char *  ,
int   
)

Definition at line 5637 of file read.c.

{
  return _find_end_of_line (s, mri_string, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void float_cons ( int  float_type)
void generate_lineno_debug ( void  )

Definition at line 5442 of file read.c.

{
  switch (debug_type)
    {
    case DEBUG_UNSPECIFIED:
    case DEBUG_NONE:
    case DEBUG_DWARF:
      break;
    case DEBUG_STABS:
      stabs_generate_asm_lineno ();
      break;
    case DEBUG_ECOFF:
      ecoff_generate_asm_lineno ();
      break;
    case DEBUG_DWARF2:
      /* ??? We could here indicate to dwarf2dbg.c that something
        has changed.  However, since there is additional backend
        support that is required (calling dwarf2_emit_insn), we
        let dwarf2dbg.c call as_where on its own.  */
      break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 459 of file read.c.

{
  expressionS exp;

  return get_absolute_expr (&exp);
}

Here is the call graph for this function:

Definition at line 5116 of file read.c.

{
  /* FIXME: val_pointer should probably be offsetT *.  */
  *val_pointer = (long) get_absolute_expression ();
  return (*input_line_pointer++);
}

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int get_stab_string_offset ( const char *  string,
const char *  stabstr_secname 
)

Definition at line 83 of file stabs.c.

{
  unsigned int length;
  unsigned int retval;
  segT save_seg;
  subsegT save_subseg;
  segT seg;
  char *p;

  if (! SEPARATE_STAB_SECTIONS)
    abort ();

  length = strlen (string);

  save_seg = now_seg;
  save_subseg = now_subseg;

  /* Create the stab string section.  */
  seg = subseg_new (stabstr_secname, 0);

  retval = seg_info (seg)->stabu.stab_string_size;
  if (retval <= 0)
    {
      /* Make sure the first string is empty.  */
      p = frag_more (1);
      *p = 0;
      retval = seg_info (seg)->stabu.stab_string_size = 1;
      bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
      if (seg->name == stabstr_secname)
       seg->name = xstrdup (stabstr_secname);
    }

  if (length > 0)
    {                       /* Ordinary case.  */
      p = frag_more (length + 1);
      strcpy (p, string);

      seg_info (seg)->stabu.stab_string_size += length + 1;
    }
  else
    retval = 0;

  subseg_set (save_seg, save_subseg);

  return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ignore_rest_of_line ( void  )

Definition at line 3407 of file read.c.

{
  while (input_line_pointer < buffer_limit
        && !is_end_of_line[(unsigned char) *input_line_pointer])
    input_line_pointer++;

  input_line_pointer++;

  /* Return pointing just after end-of-line.  */
  know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
}

Definition at line 5193 of file read.c.

{
  SKIP_WHITESPACE ();
  return (is_end_of_line[(unsigned char) *input_line_pointer]);
}

Here is the caller graph for this function:

void mri_comment_end ( char *  ,
int   
)

Definition at line 1207 of file read.c.

Here is the caller graph for this function:

char* mri_comment_field ( char *  )

Definition at line 1176 of file read.c.

{
  char *s;
#ifdef TC_M68K
  int inquote = 0;

  know (flag_m68k_mri);

  for (s = input_line_pointer;
       ((!is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
       || inquote);
       s++)
    {
      if (*s == '\'')
       inquote = !inquote;
    }
#else
  for (s = input_line_pointer;
       !is_end_of_line[(unsigned char) *s];
       s++)
    ;
#endif
  *stopcp = *s;
  *s = '\0';

  return s;
}

Here is the caller graph for this function:

Definition at line 4953 of file read.c.

{
  register unsigned int c;

  c = *input_line_pointer++ & CHAR_MASK;
  switch (c)
    {
    case '\"':
      c = NOT_A_CHAR;
      break;

    case '\n':
      as_warn (_("unterminated string; newline inserted"));
      bump_line_counters ();
      break;

#ifndef NO_STRING_ESCAPES
    case '\\':
      switch (c = *input_line_pointer++)
       {
       case 'b':
         c = '\b';
         break;

       case 'f':
         c = '\f';
         break;

       case 'n':
         c = '\n';
         break;

       case 'r':
         c = '\r';
         break;

       case 't':
         c = '\t';
         break;

       case 'v':
         c = '\013';
         break;

       case '\\':
       case '"':
         break;             /* As itself.  */

       case '0':
       case '1':
       case '2':
       case '3':
       case '4':
       case '5':
       case '6':
       case '7':
       case '8':
       case '9':
         {
           long number;
           int i;

           for (i = 0, number = 0;
               ISDIGIT (c) && i < 3;
               c = *input_line_pointer++, i++)
             {
              number = number * 8 + c - '0';
             }

           c = number & 0xff;
         }
         --input_line_pointer;
         break;

       case 'x':
       case 'X':
         {
           long number;

           number = 0;
           c = *input_line_pointer++;
           while (ISXDIGIT (c))
             {
              if (ISDIGIT (c))
                number = number * 16 + c - '0';
              else if (ISUPPER (c))
                number = number * 16 + c - 'A' + 10;
              else
                number = number * 16 + c - 'a' + 10;
              c = *input_line_pointer++;
             }
           c = number & 0xff;
           --input_line_pointer;
         }
         break;

       case '\n':
         /* To be compatible with BSD 4.2 as: give the luser a linefeed!!  */
         as_warn (_("unterminated string; newline inserted"));
         c = '\n';
         bump_line_counters ();
         break;

       default:

#ifdef ONLY_STANDARD_ESCAPES
         as_bad (_("bad escaped character in string"));
         c = '?';
#endif /* ONLY_STANDARD_ESCAPES */

         break;
       }
      break;
#endif /* ! defined (NO_STRING_ESCAPES) */

    default:
      break;
    }
  return (c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int output_leb128 ( char *  ,
valueT  ,
int  sign 
)

Definition at line 4630 of file read.c.

{
  if (sign)
    return output_sleb128 (p, (offsetT) value);
  else
    return output_uleb128 (p, value);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2205 of file read.c.

{
  expressionS exp;
  addressT align;

  SKIP_WHITESPACE ();
  if (*input_line_pointer != ',')
    {
    no_align:
      as_bad (_("expected alignment after size"));
      ignore_rest_of_line ();
      return -1;
    }

  input_line_pointer++;
  SKIP_WHITESPACE ();

  align = get_absolute_expr (&exp);
  if (exp.X_op == O_absent)
    goto no_align;

  if (!exp.X_unsigned)
    {
      as_warn (_("alignment negative; 0 assumed"));
      align = 0;
    }

  if (align_bytes && align != 0)
    {
      /* convert to a power of 2 alignment */
      unsigned int alignp2 = 0;
      while ((align & 1) == 0)
       align >>= 1, ++alignp2;
      if (align != 1)
       {
         as_bad (_("alignment not a power of 2"));
         ignore_rest_of_line ();
         return -1;
       }
      align = alignp2;
    }
  return align;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pop_insert ( const pseudo_typeS *  )

Definition at line 470 of file read.c.

{
  const char *errtxt;
  const pseudo_typeS *pop;
  for (pop = table; pop->poc_name; pop++)
    {
      errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop);
      if (errtxt && (!pop_override_ok || strcmp (errtxt, "exists")))
       as_fatal (_("error constructing %s pseudo-op table: %s"), pop_table_name,
                errtxt);
    }
}

Here is the call graph for this function:

void pseudo_set ( symbolS *  symbolP)

Definition at line 3437 of file read.c.

{
  expressionS exp;
  segT seg;

  know (symbolP);           /* NULL pointer is logic error.  */

  if (!S_IS_FORWARD_REF (symbolP))
    (void) expression (&exp);
  else
    (void) deferred_expression (&exp);

  if (exp.X_op == O_illegal)
    as_bad (_("illegal expression"));
  else if (exp.X_op == O_absent)
    as_bad (_("missing expression"));
  else if (exp.X_op == O_big)
    {
      if (exp.X_add_number > 0)
       as_bad (_("bignum invalid"));
      else
       as_bad (_("floating point number invalid"));
    }
  else if (exp.X_op == O_subtract
          && !S_IS_FORWARD_REF (symbolP)
          && SEG_NORMAL (S_GET_SEGMENT (exp.X_add_symbol))
          && (symbol_get_frag (exp.X_add_symbol)
              == symbol_get_frag (exp.X_op_symbol)))
    {
      exp.X_op = O_constant;
      exp.X_add_number = (S_GET_VALUE (exp.X_add_symbol)
                       - S_GET_VALUE (exp.X_op_symbol));
    }

  if (symbol_section_p (symbolP))
    {
      as_bad ("attempt to set value of section symbol");
      return;
    }

  switch (exp.X_op)
    {
    case O_illegal:
    case O_absent:
    case O_big:
      exp.X_add_number = 0;
      /* Fall through.  */
    case O_constant:
      S_SET_SEGMENT (symbolP, absolute_section);
      S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
      set_zero_frag (symbolP);
      break;

    case O_register:
      S_SET_SEGMENT (symbolP, reg_section);
      S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
      set_zero_frag (symbolP);
      break;

    case O_symbol:
      seg = S_GET_SEGMENT (exp.X_add_symbol);
      /* For x=undef+const, create an expression symbol.
        For x=x+const, just update x except when x is an undefined symbol
        For x=defined+const, evaluate x.  */
      if (symbolP == exp.X_add_symbol
         && (seg != undefined_section
             || !symbol_constant_p (symbolP)))
       {
         *symbol_X_add_number (symbolP) += exp.X_add_number;
         break;
       }
      else if (!S_IS_FORWARD_REF (symbolP) && seg != undefined_section)
       {
         symbolS *s = exp.X_add_symbol;

         if (S_IS_COMMON (s))
           as_bad (_("`%s' can't be equated to common symbol '%s'"),
                  S_GET_NAME (symbolP), S_GET_NAME (s));

         S_SET_SEGMENT (symbolP, seg);
         S_SET_VALUE (symbolP, exp.X_add_number + S_GET_VALUE (s));
         symbol_set_frag (symbolP, symbol_get_frag (s));
         copy_symbol_attributes (symbolP, s);
         break;
       }
      S_SET_SEGMENT (symbolP, undefined_section);
      symbol_set_value_expression (symbolP, &exp);
      set_zero_frag (symbolP);
      break;

    default:
      /* The value is some complex expression.  */
      S_SET_SEGMENT (symbolP, expr_section);
      symbol_set_value_expression (symbolP, &exp);
      set_zero_frag (symbolP);
      break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void read_a_source_file ( char *  name)

Definition at line 579 of file read.c.

{
  register char c;
  register char *s;         /* String of symbol, '\0' appended.  */
  register int temp;
  pseudo_typeS *pop;

#ifdef WARN_COMMENTS
  found_comment = 0;
#endif

  buffer = input_scrub_new_file (name);

  listing_file (name);
  listing_newline (NULL);
  register_dependency (name);

  /* Generate debugging information before we've read anything in to denote
     this file as the "main" source file and not a subordinate one
     (e.g. N_SO vs N_SOL in stabs).  */
  generate_file_debug ();

  while ((buffer_limit = input_scrub_next_buffer (&input_line_pointer)) != 0)
    {                       /* We have another line to parse.  */
#ifndef NO_LISTING
      /* In order to avoid listing macro expansion lines with labels
        multiple times, keep track of which line was last issued.  */
      static char *last_eol;

      last_eol = NULL;
#endif
      know (buffer_limit[-1] == '\n');    /* Must have a sentinel.  */

      while (input_line_pointer < buffer_limit)
       {
         /* We have more of this buffer to parse.  */

         /* We now have input_line_pointer->1st char of next line.
            If input_line_pointer [-1] == '\n' then we just
            scanned another line: so bump line counters.  */
         if (is_end_of_line[(unsigned char) input_line_pointer[-1]])
           {
#ifdef md_start_line_hook
             md_start_line_hook ();
#endif
             if (input_line_pointer[-1] == '\n')
              bump_line_counters ();

             line_label = NULL;

             if (LABELS_WITHOUT_COLONS || flag_m68k_mri)
              {
                /* Text at the start of a line must be a label, we
                   run down and stick a colon in.  */
                if (is_name_beginner (*input_line_pointer))
                  {
                    char *line_start = input_line_pointer;
                    char c;
                    int mri_line_macro;

                    LISTING_NEWLINE ();
                    HANDLE_CONDITIONAL_ASSEMBLY ();

                    c = get_symbol_end ();

                    /* In MRI mode, the EQU and MACRO pseudoops must
                      be handled specially.  */
                    mri_line_macro = 0;
                    if (flag_m68k_mri)
                     {
                       char *rest = input_line_pointer + 1;

                       if (*rest == ':')
                         ++rest;
                       if (*rest == ' ' || *rest == '\t')
                         ++rest;
                       if ((strncasecmp (rest, "EQU", 3) == 0
                            || strncasecmp (rest, "SET", 3) == 0)
                           && (rest[3] == ' ' || rest[3] == '\t'))
                         {
                           input_line_pointer = rest + 3;
                           equals (line_start,
                                  strncasecmp (rest, "SET", 3) == 0);
                           continue;
                         }
                       if (strncasecmp (rest, "MACRO", 5) == 0
                           && (rest[5] == ' '
                              || rest[5] == '\t'
                              || is_end_of_line[(unsigned char) rest[5]]))
                         mri_line_macro = 1;
                     }

                    /* In MRI mode, we need to handle the MACRO
                      pseudo-op specially: we don't want to put the
                      symbol in the symbol table.  */
                    if (!mri_line_macro
#ifdef TC_START_LABEL_WITHOUT_COLON
                       && TC_START_LABEL_WITHOUT_COLON(c,
                                                   input_line_pointer)
#endif
                       )
                     line_label = colon (line_start);
                    else
                     line_label = symbol_create (line_start,
                                              absolute_section,
                                              (valueT) 0,
                                              &zero_address_frag);

                    *input_line_pointer = c;
                    if (c == ':')
                     input_line_pointer++;
                  }
              }
           }

         /* We are at the beginning of a line, or similar place.
            We expect a well-formed assembler statement.
            A "symbol-name:" is a statement.

            Depending on what compiler is used, the order of these tests
            may vary to catch most common case 1st.
            Each test is independent of all other tests at the (top) level.
            PLEASE make a compiler that doesn't use this assembler.
            It is crufty to waste a compiler's time encoding things for this
            assembler, which then wastes more time decoding it.
            (And communicating via (linear) files is silly!
            If you must pass stuff, please pass a tree!)  */
         if ((c = *input_line_pointer++) == '\t'
             || c == ' '
             || c == '\f'
             || c == 0)
           c = *input_line_pointer++;

         know (c != ' ');   /* No further leading whitespace.  */

#ifndef NO_LISTING
         /* If listing is on, and we are expanding a macro, then give
            the listing code the contents of the expanded line.  */
         if (listing)
           {
             if ((listing & LISTING_MACEXP) && macro_nest > 0)
              {
                char *copy;
                int len;

                /* Find the end of the current expanded macro line.  */
                s = find_end_of_line (input_line_pointer - 1, flag_m68k_mri);

                if (s != last_eol)
                  {
                    last_eol = s;
                    /* Copy it for safe keeping.  Also give an indication of
                      how much macro nesting is involved at this point.  */
                    len = s - (input_line_pointer - 1);
                    copy = (char *) xmalloc (len + macro_nest + 2);
                    memset (copy, '>', macro_nest);
                    copy[macro_nest] = ' ';
                    memcpy (copy + macro_nest + 1, input_line_pointer - 1, len);
                    copy[macro_nest + 1 + len] = '\0';

                    /* Install the line with the listing facility.  */
                    listing_newline (copy);
                  }
              }
             else
              listing_newline (NULL);
           }
#endif
         /* C is the 1st significant character.
            Input_line_pointer points after that character.  */
         if (is_name_beginner (c))
           {
             /* Want user-defined label or pseudo/opcode.  */
             HANDLE_CONDITIONAL_ASSEMBLY ();

             s = --input_line_pointer;
             c = get_symbol_end ();       /* name's delimiter.  */

             /* C is character after symbol.
               That character's place in the input line is now '\0'.
               S points to the beginning of the symbol.
                 [In case of pseudo-op, s->'.'.]
               Input_line_pointer->'\0' where c was.  */
             if (TC_START_LABEL (c, input_line_pointer))
              {
                if (flag_m68k_mri)
                  {
                    char *rest = input_line_pointer + 1;

                    /* In MRI mode, \tsym: set 0 is permitted.  */
                    if (*rest == ':')
                     ++rest;

                    if (*rest == ' ' || *rest == '\t')
                     ++rest;

                    if ((strncasecmp (rest, "EQU", 3) == 0
                        || strncasecmp (rest, "SET", 3) == 0)
                       && (rest[3] == ' ' || rest[3] == '\t'))
                     {
                       input_line_pointer = rest + 3;
                       equals (s, 1);
                       continue;
                     }
                  }

                line_label = colon (s);   /* User-defined label.  */
                /* Put ':' back for error messages' sake.  */
                *input_line_pointer++ = ':';
#ifdef tc_check_label
                tc_check_label (line_label);
#endif
                /* Input_line_pointer->after ':'.  */
                SKIP_WHITESPACE ();
              }
              else if (input_line_pointer[1] == '='
                     && (c == '='
                        || ((c == ' ' || c == '\t')
                            && input_line_pointer[2] == '=')))
              {
                equals (s, -1);
                demand_empty_rest_of_line ();
              }
              else if ((c == '='
                       || ((c == ' ' || c == '\t')
                            && input_line_pointer[1] == '='))
#ifdef TC_EQUAL_IN_INSN
                           && !TC_EQUAL_IN_INSN (c, s)
#endif
                           )
              {
                equals (s, 1);
                demand_empty_rest_of_line ();
              }
             else
              {
                /* Expect pseudo-op or machine instruction.  */
                pop = NULL;

#ifndef TC_CASE_SENSITIVE
                {
                  char *s2 = s;

                  strncpy (original_case_string, s2, sizeof (original_case_string));
                  original_case_string[sizeof (original_case_string) - 1] = 0;

                  while (*s2)
                    {
                     *s2 = TOLOWER (*s2);
                     s2++;
                    }
                }
#endif
                if (NO_PSEUDO_DOT || flag_m68k_mri)
                  {
                    /* The MRI assembler uses pseudo-ops without
                      a period.  */
                    pop = (pseudo_typeS *) hash_find (po_hash, s);
                    if (pop != NULL && pop->poc_handler == NULL)
                     pop = NULL;
                  }

                if (pop != NULL
                    || (!flag_m68k_mri && *s == '.'))
                  {
                    /* PSEUDO - OP.

                      WARNING: c has next char, which may be end-of-line.
                      We lookup the pseudo-op table with s+1 because we
                      already know that the pseudo-op begins with a '.'.  */

                    if (pop == NULL)
                     pop = (pseudo_typeS *) hash_find (po_hash, s + 1);
                    if (pop && !pop->poc_handler)
                     pop = NULL;

                    /* In MRI mode, we may need to insert an
                      automatic alignment directive.  What a hack
                      this is.  */
                    if (mri_pending_align
                       && (pop == NULL
                           || !((pop->poc_handler == cons
                                && pop->poc_val == 1)
                               || (pop->poc_handler == s_space
                                   && pop->poc_val == 1)
#ifdef tc_conditional_pseudoop
                               || tc_conditional_pseudoop (pop)
#endif
                               || pop->poc_handler == s_if
                               || pop->poc_handler == s_ifdef
                               || pop->poc_handler == s_ifc
                               || pop->poc_handler == s_ifeqs
                               || pop->poc_handler == s_else
                               || pop->poc_handler == s_endif
                               || pop->poc_handler == s_globl
                               || pop->poc_handler == s_ignore)))
                     {
                       do_align (1, (char *) NULL, 0, 0);
                       mri_pending_align = 0;

                       if (line_label != NULL)
                         {
                           symbol_set_frag (line_label, frag_now);
                           S_SET_VALUE (line_label, frag_now_fix ());
                         }
                     }

                    /* Print the error msg now, while we still can.  */
                    if (pop == NULL)
                     {
                       char *end = input_line_pointer;

                       *input_line_pointer = c;
                       s_ignore (0);
                       c = *--input_line_pointer;
                       *input_line_pointer = '\0';
                       if (! macro_defined || ! try_macro (c, s))
                         {
                           *end = '\0';
                           as_bad (_("unknown pseudo-op: `%s'"), s);
                           *input_line_pointer++ = c;
                         }
                       continue;
                     }

                    /* Put it back for error messages etc.  */
                    *input_line_pointer = c;
                    /* The following skip of whitespace is compulsory.
                      A well shaped space is sometimes all that separates
                      keyword from operands.  */
                    if (c == ' ' || c == '\t')
                     input_line_pointer++;

                    /* Input_line is restored.
                      Input_line_pointer->1st non-blank char
                      after pseudo-operation.  */
                    (*pop->poc_handler) (pop->poc_val);

                    /* If that was .end, just get out now.  */
                    if (pop->poc_handler == s_end)
                     goto quit;
                  }
                else
                  {
                    /* WARNING: c has char, which may be end-of-line.  */
                    /* Also: input_line_pointer->`\0` where c was.  */
                    *input_line_pointer = c;
                    input_line_pointer = _find_end_of_line (input_line_pointer, flag_m68k_mri, 1);
                    c = *input_line_pointer;
                    *input_line_pointer = '\0';

                    generate_lineno_debug ();

                    if (macro_defined && try_macro (c, s))
                     continue;

                    if (mri_pending_align)
                     {
                       do_align (1, (char *) NULL, 0, 0);
                       mri_pending_align = 0;
                       if (line_label != NULL)
                         {
                           symbol_set_frag (line_label, frag_now);
                           S_SET_VALUE (line_label, frag_now_fix ());
                         }
                     }

                    md_assemble (s);      /* Assemble 1 instruction.  */

                    *input_line_pointer++ = c;

                    /* We resume loop AFTER the end-of-line from
                      this instruction.  */
                  }
              }
             continue;
           }

         /* Empty statement?  */
         if (is_end_of_line[(unsigned char) c])
           continue;

         if ((LOCAL_LABELS_DOLLAR || LOCAL_LABELS_FB) && ISDIGIT (c))
           {
             /* local label  ("4:")  */
             char *backup = input_line_pointer;

             HANDLE_CONDITIONAL_ASSEMBLY ();

             temp = c - '0';

             /* Read the whole number.  */
             while (ISDIGIT (*input_line_pointer))
              {
                temp = (temp * 10) + *input_line_pointer - '0';
                ++input_line_pointer;
              }

             if (LOCAL_LABELS_DOLLAR
                && *input_line_pointer == '$'
                && *(input_line_pointer + 1) == ':')
              {
                input_line_pointer += 2;

                if (dollar_label_defined (temp))
                  {
                    as_fatal (_("label \"%d$\" redefined"), temp);
                  }

                define_dollar_label (temp);
                colon (dollar_label_name (temp, 0));
                continue;
              }

             if (LOCAL_LABELS_FB
                && *input_line_pointer++ == ':')
              {
                fb_label_instance_inc (temp);
                colon (fb_label_name (temp, 0));
                continue;
              }

             input_line_pointer = backup;
           }                /* local label  ("4:") */

         if (c && strchr (line_comment_chars, c))
           {                /* Its a comment.  Better say APP or NO_APP.  */
             sb sbuf;
             char *ends;
             char *new_buf;
             char *new_tmp;
             unsigned int new_length;
             char *tmp_buf = 0;

             s = input_line_pointer;
             if (strncmp (s, "APP\n", 4))
              {
                /* We ignore it.  */
                ignore_rest_of_line ();
                continue;
              }
             bump_line_counters ();
             s += 4;

             sb_new (&sbuf);
             ends = strstr (s, "#NO_APP\n");

             if (!ends)
              {
                unsigned int tmp_len;
                unsigned int num;

                /* The end of the #APP wasn't in this buffer.  We
                   keep reading in buffers until we find the #NO_APP
                   that goes with this #APP  There is one.  The specs
                   guarantee it...  */
                tmp_len = buffer_limit - s;
                tmp_buf = xmalloc (tmp_len + 1);
                memcpy (tmp_buf, s, tmp_len);
                do
                  {
                    new_tmp = input_scrub_next_buffer (&buffer);
                    if (!new_tmp)
                     break;
                    else
                     buffer_limit = new_tmp;
                    input_line_pointer = buffer;
                    ends = strstr (buffer, "#NO_APP\n");
                    if (ends)
                     num = ends - buffer;
                    else
                     num = buffer_limit - buffer;

                    tmp_buf = xrealloc (tmp_buf, tmp_len + num);
                    memcpy (tmp_buf + tmp_len, buffer, num);
                    tmp_len += num;
                  }
                while (!ends);

                input_line_pointer = ends ? ends + 8 : NULL;

                s = tmp_buf;
                ends = s + tmp_len;

              }
             else
              {
                input_line_pointer = ends + 8;
              }

             scrub_string = s;
             scrub_string_end = ends;

             new_length = ends - s;
             new_buf = (char *) xmalloc (new_length);
             new_tmp = new_buf;
             for (;;)
              {
                int space;
                int size;

                space = (new_buf + new_length) - new_tmp;
                size = do_scrub_chars (scrub_from_string, new_tmp, space);

                if (size < space)
                  {
                    new_tmp[size] = 0;
                    break;
                  }

                new_buf = xrealloc (new_buf, new_length + 100);
                new_tmp = new_buf + new_length;
                new_length += 100;
              }

             if (tmp_buf)
              free (tmp_buf);

             /* We've "scrubbed" input to the preferred format.  In the
               process we may have consumed the whole of the remaining
               file (and included files).  We handle this formatted
               input similar to that of macro expansion, letting
               actual macro expansion (possibly nested) and other
               input expansion work.  Beware that in messages, line
               numbers and possibly file names will be incorrect.  */
             sb_add_string (&sbuf, new_buf);
             input_scrub_include_sb (&sbuf, input_line_pointer, 0);
             sb_kill (&sbuf);
             buffer_limit = input_scrub_next_buffer (&input_line_pointer);
             free (new_buf);
             continue;
           }

         HANDLE_CONDITIONAL_ASSEMBLY ();

#ifdef tc_unrecognized_line
         if (tc_unrecognized_line (c))
           continue;
#endif
         input_line_pointer--;
         /* Report unknown char as error.  */
         demand_empty_rest_of_line ();
       }

#ifdef md_after_pass_hook
      md_after_pass_hook ();
#endif
    }

 quit:

#ifdef md_cleanup
  md_cleanup ();
#endif
  /* Close the input file.  */
  input_scrub_close ();
#ifdef WARN_COMMENTS
  {
    if (warn_comment && found_comment)
      as_warn_where (found_comment_file, found_comment,
                   "first comment found here");
  }
#endif
}

Here is the caller graph for this function:

void read_begin ( void  )

Definition at line 225 of file read.c.

{
  const char *p;

  pobegin ();
  obj_read_begin_hook ();

  /* Something close -- but not too close -- to a multiple of 1024.
     The debugging malloc I'm using has 24 bytes of overhead.  */
  obstack_begin (&notes, chunksize);
  obstack_begin (&cond_obstack, chunksize);

  /* Use machine dependent syntax.  */
  for (p = line_separator_chars; *p; p++)
    is_end_of_line[(unsigned char) *p] = 1;
  /* Use more.  FIXME-SOMEDAY.  */

  if (flag_mri)
    lex_type['?'] = 3;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void read_print_statistics ( FILE *  )

Definition at line 5559 of file read.c.

{
  hash_print_statistics (file, "pseudo-op table", po_hash);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_abort ( int  )
void s_align_bytes ( int  arg)

Definition at line 1399 of file read.c.

{
  s_align (arg, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_align_ptwo ( int  )

Definition at line 1408 of file read.c.

{
  s_align (arg, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_app_file ( int  )

Definition at line 1679 of file read.c.

{
  register char *s;
  int length;

  /* Some assemblers tolerate immediately following '"'.  */
  if ((s = demand_copy_string (&length)) != 0)
    {
      int may_omit
       = (!new_logical_line_flags (s, -1, 1) && appfile);

      /* In MRI mode, the preprocessor may have inserted an extraneous
        backquote.  */
      if (flag_m68k_mri
         && *input_line_pointer == '\''
         && is_end_of_line[(unsigned char) input_line_pointer[1]])
       ++input_line_pointer;

      demand_empty_rest_of_line ();
      if (!may_omit)
       s_app_file_string (s, appfile);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_app_file_string ( char *  ,
int   
)
void s_app_line ( int  )

Definition at line 1722 of file read.c.

{
  char *file = NULL;
  int l;

  /* The given number is that of the next line.  */
  if (appline)
    l = get_absolute_expression ();
  else if (!get_linefile_number (&l))
    {
      ignore_rest_of_line ();
      return;
    }

  l--;

  if (l < -1)
    /* Some of the back ends can't deal with non-positive line numbers.
       Besides, it's silly.  GCC however will generate a line number of
       zero when it is pre-processing builtins for assembler-with-cpp files:

          # 0 "<built-in>"

       We do not want to barf on this, especially since such files are used
       in the GCC and GDB testsuites.  So we check for negative line numbers
       rather than non-positive line numbers.  */
    as_warn (_("line numbers must be positive; line number %d rejected"),
            l + 1);
  else
    {
      int flags = 0;
      int length = 0;

      if (!appline)
       {
         SKIP_WHITESPACE ();

         if (*input_line_pointer == '"')
           file = demand_copy_string (&length);

         if (file)
           {
             int this_flag;

             while (get_linefile_number (&this_flag))
              switch (this_flag)
                {
                  /* From GCC's cpp documentation:
                     1: start of a new file.
                     2: returning to a file after having included
                        another file.
                     3: following text comes from a system header file.
                     4: following text should be treated as extern "C".

                     4 is nonsensical for the assembler; 3, we don't
                     care about, so we ignore it just in case a
                     system header file is included while
                     preprocessing assembly.  So 1 and 2 are all we
                     care about, and they are mutually incompatible.
                     new_logical_line_flags() demands this.  */
                case 1:
                case 2:
                  if (flags && flags != (1 << this_flag))
                    as_warn (_("incompatible flag %i in line directive"),
                            this_flag);
                  else
                    flags |= 1 << this_flag;
                  break;

                case 3:
                case 4:
                  /* We ignore these.  */
                  break;

                default:
                  as_warn (_("unsupported flag %i in line directive"),
                          this_flag);
                  break;
                }

             if (!is_end_of_line[(unsigned char)*input_line_pointer])
              file = 0;
           }
       }

      if (appline || file)
       {
         new_logical_line_flags (file, l, flags);
#ifdef LISTING
         if (listing)
           listing_source_line (l);
#endif
       }
    }
  if (appline || file)
    demand_empty_rest_of_line ();
  else
    ignore_rest_of_line ();
}

Here is the call graph for this function:

void s_comm ( int  )

Definition at line 1526 of file read.c.

{
  s_comm_internal (ignore, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

symbolS* s_comm_internal ( int  ,
symbolS *  *)(int, symbolS *, addressT 
)
void s_data ( int  )
void s_desc ( int  )
void s_else ( int  arg)

Definition at line 409 of file cond.c.

{
  if (current_cframe == NULL)
    {
      as_bad (_("\".else\" without matching \".if\""));
    }
  else if (current_cframe->else_seen)
    {
      as_bad (_("duplicate \"else\""));
      as_bad_where (current_cframe->else_file_line.file,
                  current_cframe->else_file_line.line,
                  _("here is the previous \"else\""));
      as_bad_where (current_cframe->if_file_line.file,
                  current_cframe->if_file_line.line,
                  _("here is the previous \"if\""));
    }
  else
    {
      as_where (&current_cframe->else_file_line.file,
              &current_cframe->else_file_line.line);

      current_cframe->ignoring =
       current_cframe->dead_tree | !current_cframe->ignoring;

      if (LISTING_SKIP_COND ()
         && (current_cframe->previous_cframe == NULL
             || ! current_cframe->previous_cframe->ignoring))
       {
         if (! current_cframe->ignoring)
           listing_list (1);
         else
           listing_list (2);
       }

      current_cframe->else_seen = 1;
    }

  if (flag_mri)
    {
      while (! is_end_of_line[(unsigned char) *input_line_pointer])
       ++input_line_pointer;
    }

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_elseif ( int  arg)

Definition at line 303 of file cond.c.

{
  if (current_cframe == NULL)
    {
      as_bad (_("\".elseif\" without matching \".if\""));
    }
  else if (current_cframe->else_seen)
    {
      as_bad (_("\".elseif\" after \".else\""));
      as_bad_where (current_cframe->else_file_line.file,
                  current_cframe->else_file_line.line,
                  _("here is the previous \"else\""));
      as_bad_where (current_cframe->if_file_line.file,
                  current_cframe->if_file_line.line,
                  _("here is the previous \"if\""));
    }
  else
    {
      as_where (&current_cframe->else_file_line.file,
              &current_cframe->else_file_line.line);

      current_cframe->dead_tree |= !current_cframe->ignoring;
      current_cframe->ignoring = current_cframe->dead_tree;
    }

  if (current_cframe == NULL || current_cframe->ignoring)
    {
      while (! is_end_of_line[(unsigned char) *input_line_pointer])
       ++input_line_pointer;

      if (current_cframe == NULL)
       return;
    }
  else
    {
      expressionS operand;
      int t;

      /* Leading whitespace is part of operand.  */
      SKIP_WHITESPACE ();

      expression_and_evaluate (&operand);
      if (operand.X_op != O_constant)
       as_bad (_("non-constant expression in \".elseif\" statement"));

      switch ((operatorT) arg)
       {
       case O_eq: t = operand.X_add_number == 0; break;
       case O_ne: t = operand.X_add_number != 0; break;
       case O_lt: t = operand.X_add_number < 0; break;
       case O_le: t = operand.X_add_number <= 0; break;
       case O_ge: t = operand.X_add_number >= 0; break;
       case O_gt: t = operand.X_add_number > 0; break;
       default:
         abort ();
         return;
       }

      current_cframe->ignoring = current_cframe->dead_tree || ! t;
    }

  if (LISTING_SKIP_COND ()
      && (current_cframe->previous_cframe == NULL
         || ! current_cframe->previous_cframe->ignoring))
    {
      if (! current_cframe->ignoring)
       listing_list (1);
      else
       listing_list (2);
    }

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

void s_end ( int  arg)
void s_endif ( int  arg)

Definition at line 378 of file cond.c.

{
  struct conditional_frame *hold;

  if (current_cframe == NULL)
    {
      as_bad (_("\".endif\" without \".if\""));
    }
  else
    {
      if (LISTING_SKIP_COND ()
         && current_cframe->ignoring
         && (current_cframe->previous_cframe == NULL
             || ! current_cframe->previous_cframe->ignoring))
       listing_list (1);

      hold = current_cframe;
      current_cframe = current_cframe->previous_cframe;
      obstack_free (&cond_obstack, hold);
    }                       /* if one pop too many */

  if (flag_mri)
    {
      while (! is_end_of_line[(unsigned char) *input_line_pointer])
       ++input_line_pointer;
    }

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_err ( int  )
void s_errwarn ( int  )

Definition at line 1852 of file read.c.

{
  int len;
  /* The purpose for the conditional assignment is not to
     internationalize the directive itself, but that we need a
     self-contained message, one that can be passed like the
     demand_copy_C_string return value, and with no assumption on the
     location of the name of the directive within the message.  */
  char *msg
    = (err ? _(".error directive invoked in source file")
       : _(".warning directive invoked in source file"));

  if (!is_it_end_of_statement ())
    {
      if (*input_line_pointer != '\"')
       {
         as_bad (_("%s argument must be a string"),
                err ? ".error" : ".warning");
         ignore_rest_of_line ();
         return;
       }

      msg = demand_copy_C_string (&len);
      if (msg == NULL)
       return;
    }

  if (err)
    as_bad ("%s", msg);
  else
    as_warn ("%s", msg);
  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

void s_fail ( int  )
void s_fill ( int  )
void s_float_space ( int  mult)

Definition at line 3134 of file read.c.

{
  offsetT count;
  int flen;
  char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT];
  char *stop = NULL;
  char stopc = 0;

  if (flag_mri)
    stop = mri_comment_field (&stopc);

  count = get_absolute_expression ();

  SKIP_WHITESPACE ();
  if (*input_line_pointer != ',')
    {
      as_bad (_("missing value"));
      ignore_rest_of_line ();
      if (flag_mri)
       mri_comment_end (stop, stopc);
      return;
    }

  ++input_line_pointer;

  SKIP_WHITESPACE ();

  /* Skip any 0{letter} that may be present.  Don't even check if the
   * letter is legal.  */
  if (input_line_pointer[0] == '0'
      && ISALPHA (input_line_pointer[1]))
    input_line_pointer += 2;

  /* Accept :xxxx, where the x's are hex digits, for a floating point
     with the exact digits specified.  */
  if (input_line_pointer[0] == ':')
    {
      flen = hex_float (float_type, temp);
      if (flen < 0)
       {
         ignore_rest_of_line ();
         if (flag_mri)
           mri_comment_end (stop, stopc);
         return;
       }
    }
  else
    {
      char *err;

      err = md_atof (float_type, temp, &flen);
      know (flen <= MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT);
      know (flen > 0);
      if (err)
       {
         as_bad (_("bad floating literal: %s"), err);
         ignore_rest_of_line ();
         if (flag_mri)
           mri_comment_end (stop, stopc);
         return;
       }
    }

  while (--count >= 0)
    {
      char *p;

      p = frag_more (flen);
      memcpy (p, temp, (unsigned int) flen);
    }

  demand_empty_rest_of_line ();

  if (flag_mri)
    mri_comment_end (stop, stopc);
}

Here is the call graph for this function:

void s_func ( int  )

Definition at line 5469 of file read.c.

{
  do_s_func (end_p, NULL);
}

Here is the call graph for this function:

void s_globl ( int  arg)
void s_if ( int  arg)

Definition at line 126 of file cond.c.

{
  expressionS operand;
  struct conditional_frame cframe;
  int t;
  char *stop = NULL;
  char stopc;

  if (flag_mri)
    stop = mri_comment_field (&stopc);

  /* Leading whitespace is part of operand.  */
  SKIP_WHITESPACE ();

  if (current_cframe != NULL && current_cframe->ignoring)
    {
      operand.X_add_number = 0;
      while (! is_end_of_line[(unsigned char) *input_line_pointer])
       ++input_line_pointer;
    }
  else
    {
      expression_and_evaluate (&operand);
      if (operand.X_op != O_constant)
       as_bad (_("non-constant expression in \".if\" statement"));
    }

  switch ((operatorT) arg)
    {
    case O_eq: t = operand.X_add_number == 0; break;
    case O_ne: t = operand.X_add_number != 0; break;
    case O_lt: t = operand.X_add_number < 0; break;
    case O_le: t = operand.X_add_number <= 0; break;
    case O_ge: t = operand.X_add_number >= 0; break;
    case O_gt: t = operand.X_add_number > 0; break;
    default:
      abort ();
      return;
    }

  /* If the above error is signaled, this will dispatch
     using an undefined result.  No big deal.  */
  initialize_cframe (&cframe);
  cframe.ignoring = cframe.dead_tree || ! t;
  current_cframe = ((struct conditional_frame *)
                  obstack_copy (&cond_obstack, &cframe, sizeof (cframe)));

  if (LISTING_SKIP_COND ()
      && cframe.ignoring
      && (cframe.previous_cframe == NULL
         || ! cframe.previous_cframe->ignoring))
    listing_list (2);

  if (flag_mri)
    mri_comment_end (stop, stopc);

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_ifb ( int  arg)

Definition at line 189 of file cond.c.

{
  struct conditional_frame cframe;

  initialize_cframe (&cframe);
  
  if (cframe.dead_tree)
    cframe.ignoring = 1;
  else
    {
      int is_eol;

      SKIP_WHITESPACE ();
      is_eol = is_end_of_line[(unsigned char) *input_line_pointer];
      cframe.ignoring = (test_blank == !is_eol);
    }

  current_cframe = ((struct conditional_frame *)
                  obstack_copy (&cond_obstack, &cframe,
                              sizeof (cframe)));

  if (LISTING_SKIP_COND ()
      && cframe.ignoring
      && (cframe.previous_cframe == NULL
         || ! cframe.previous_cframe->ignoring))
    listing_list (2);

  ignore_rest_of_line ();
}

Here is the call graph for this function:

void s_ifc ( int  arg)

Definition at line 262 of file cond.c.

{
  char *stop = NULL;
  char stopc;
  char *s1, *s2;
  int len1, len2;
  int res;
  struct conditional_frame cframe;

  if (flag_mri)
    stop = mri_comment_field (&stopc);

  s1 = get_mri_string (',', &len1);

  if (*input_line_pointer != ',')
    as_bad (_("bad format for ifc or ifnc"));
  else
    ++input_line_pointer;

  s2 = get_mri_string (';', &len2);

  res = len1 == len2 && strncmp (s1, s2, len1) == 0;

  initialize_cframe (&cframe);
  cframe.ignoring = cframe.dead_tree || ! (res ^ arg);
  current_cframe = ((struct conditional_frame *)
                  obstack_copy (&cond_obstack, &cframe, sizeof (cframe)));

  if (LISTING_SKIP_COND ()
      && cframe.ignoring
      && (cframe.previous_cframe == NULL
         || ! cframe.previous_cframe->ignoring))
    listing_list (2);

  if (flag_mri)
    mri_comment_end (stop, stopc);

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_ifdef ( int  arg)

Definition at line 68 of file cond.c.

{
  /* Points to name of symbol.  */
  char *name;
  /* Points to symbol.  */
  symbolS *symbolP;
  struct conditional_frame cframe;
  char c;

  /* Leading whitespace is part of operand.  */
  SKIP_WHITESPACE ();
  name = input_line_pointer;

  if (!is_name_beginner (*name))
    {
      as_bad (_("invalid identifier for \".ifdef\""));
      obstack_1grow (&cond_obstack, 0);
      ignore_rest_of_line ();
      return;
    }

  c = get_symbol_end ();
  symbolP = symbol_find (name);
  *input_line_pointer = c;

  initialize_cframe (&cframe);
  
  if (cframe.dead_tree)
    cframe.ignoring = 1;
  else
    {
      int is_defined;

      /* Use the same definition of 'defined' as .equiv so that a symbol
        which has been referenced but not yet given a value/address is
        considered to be undefined.  */
      is_defined =
       symbolP != NULL
       && (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
       && S_GET_SEGMENT (symbolP) != reg_section;

      cframe.ignoring = ! (test_defined ^ is_defined);
    }

  current_cframe = ((struct conditional_frame *)
                  obstack_copy (&cond_obstack, &cframe,
                              sizeof (cframe)));

  if (LISTING_SKIP_COND ()
      && cframe.ignoring
      && (cframe.previous_cframe == NULL
         || ! cframe.previous_cframe->ignoring))
    listing_list (2);

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_ifeqs ( int  arg)

Definition at line 456 of file cond.c.

{
  char *s1, *s2;
  int len1, len2;
  int res;
  struct conditional_frame cframe;

  s1 = demand_copy_C_string (&len1);

  SKIP_WHITESPACE ();
  if (*input_line_pointer != ',')
    {
      as_bad (_(".ifeqs syntax error"));
      ignore_rest_of_line ();
      return;
    }

  ++input_line_pointer;

  s2 = demand_copy_C_string (&len2);

  res = len1 == len2 && strncmp (s1, s2, len1) == 0;

  initialize_cframe (&cframe);
  cframe.ignoring = cframe.dead_tree || ! (res ^ arg);
  current_cframe = ((struct conditional_frame *)
                  obstack_copy (&cond_obstack, &cframe, sizeof (cframe)));

  if (LISTING_SKIP_COND ()
      && cframe.ignoring
      && (cframe.previous_cframe == NULL
         || ! cframe.previous_cframe->ignoring))
    listing_list (2);

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_ignore ( int  arg)

Definition at line 5553 of file read.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void s_incbin ( int  )
void s_include ( int  arg)

Definition at line 5345 of file read.c.

{
  char *filename;
  int i;
  FILE *try;
  char *path;

  if (!flag_m68k_mri)
    {
      filename = demand_copy_string (&i);
      if (filename == NULL)
       {
         /* demand_copy_string has already printed an error and
            called ignore_rest_of_line.  */
         return;
       }
    }
  else
    {
      SKIP_WHITESPACE ();
      i = 0;
      while (!is_end_of_line[(unsigned char) *input_line_pointer]
            && *input_line_pointer != ' '
            && *input_line_pointer != '\t')
       {
         obstack_1grow (&notes, *input_line_pointer);
         ++input_line_pointer;
         ++i;
       }

      obstack_1grow (&notes, '\0');
      filename = obstack_finish (&notes);
      while (!is_end_of_line[(unsigned char) *input_line_pointer])
       ++input_line_pointer;
    }

  demand_empty_rest_of_line ();
  path = xmalloc ((unsigned long) i + include_dir_maxlen + 5 /* slop */ );

  for (i = 0; i < include_dir_count; i++)
    {
      strcpy (path, include_dirs[i]);
      strcat (path, "/");
      strcat (path, filename);
      if (0 != (try = fopen (path, FOPEN_RT)))
       {
         fclose (try);
         goto gotit;
       }
    }

  free (path);
  path = filename;
gotit:
  /* malloc Storage leak when file is found on path.  FIXME-SOMEDAY.  */
  register_dependency (path);
  input_scrub_insert_file (path);
}

Here is the call graph for this function:

void s_irp ( int  arg)

Definition at line 2049 of file read.c.

{
  char *file, *eol;
  unsigned int line;
  sb s;
  const char *err;
  sb out;

  as_where (&file, &line);

  sb_new (&s);
  eol = find_end_of_line (input_line_pointer, 0);
  sb_add_buffer (&s, input_line_pointer, eol - input_line_pointer);
  input_line_pointer = eol;

  sb_new (&out);

  err = expand_irp (irpc, 0, &s, &out, get_line_sb);
  if (err != NULL)
    as_bad_where (file, line, "%s", err);

  sb_kill (&s);

  input_scrub_include_sb (&out, input_line_pointer, 1);
  sb_kill (&out);
  buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}

Here is the call graph for this function:

void s_lcomm ( int  needs_align)

Definition at line 2275 of file read.c.

{
  s_comm_internal (needs_align, s_lcomm_internal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_lcomm_bytes ( int  needs_align)

Definition at line 2281 of file read.c.

{
  s_comm_internal (needs_align * 2, s_lcomm_internal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

symbolS* s_lcomm_internal ( int  ,
symbolS *  ,
addressT   
)

Definition at line 2256 of file read.c.

{
  addressT align = 0;

  if (needs_align)
    {
      align = parse_align (needs_align - 1);
      if (align == (addressT) -1)
       return NULL;
    }
  else
    /* Assume some objects may require alignment on some systems.  */
    TC_IMPLICIT_LCOMM_ALIGNMENT (size, align);

  bss_alloc (symbolP, size, align);
  return symbolP;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_leb128 ( int  sign)

Definition at line 4829 of file read.c.

{
  expressionS exp;

#ifdef md_flush_pending_output
  md_flush_pending_output ();
#endif

  do
    {
      expression (&exp);
      emit_leb128_expr (&exp, sign);
    }
  while (*input_line_pointer++ == ',');

  input_line_pointer--;
  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

void s_linkonce ( int  )
void s_lsym ( int  )
void s_macro ( int  )
void s_mexit ( int  )
void s_mri ( int  )
void s_mri_common ( int  )
void s_mri_sect ( char *  )
void s_org ( int  )
void s_print ( int  )
void s_purgem ( int  )
void s_rept ( int  )
void s_rva ( int  )

Definition at line 3669 of file read.c.

{
  cons_worker (size, 1);
}

Here is the call graph for this function:

void s_set ( int  )

Definition at line 2916 of file read.c.

{
  char *name;
  char delim;
  char *end_name;

  /* Especial apologies for the random logic:
     this just grew, and could be parsed much more simply!
     Dean in haste.  */
  name = input_line_pointer;
  delim = get_symbol_end ();
  end_name = input_line_pointer;
  *end_name = delim;

  if (name == end_name)
    {
      as_bad (_("expected symbol name"));
      ignore_rest_of_line ();
      return;
    }

  SKIP_WHITESPACE ();

  if (*input_line_pointer != ',')
    {
      *end_name = 0;
      as_bad (_("expected comma after \"%s\""), name);
      *end_name = delim;
      ignore_rest_of_line ();
      return;
    }

  input_line_pointer++;
  *end_name = 0;

  assign_symbol (name, equiv);
  *end_name = delim;

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_space ( int  mult)

Definition at line 2958 of file read.c.

{
  expressionS exp;
  expressionS val;
  char *p = 0;
  char *stop = NULL;
  char stopc = 0;
  int bytes;

#ifdef md_flush_pending_output
  md_flush_pending_output ();
#endif

  if (flag_mri)
    stop = mri_comment_field (&stopc);

  /* In m68k MRI mode, we need to align to a word boundary, unless
     this is ds.b.  */
  if (flag_m68k_mri && mult > 1)
    {
      if (now_seg == absolute_section)
       {
         abs_section_offset += abs_section_offset & 1;
         if (line_label != NULL)
           S_SET_VALUE (line_label, abs_section_offset);
       }
      else if (mri_common_symbol != NULL)
       {
         valueT val;

         val = S_GET_VALUE (mri_common_symbol);
         if ((val & 1) != 0)
           {
             S_SET_VALUE (mri_common_symbol, val + 1);
             if (line_label != NULL)
              {
                expressionS *symexp;

                symexp = symbol_get_value_expression (line_label);
                know (symexp->X_op == O_symbol);
                know (symexp->X_add_symbol == mri_common_symbol);
                symexp->X_add_number += 1;
              }
           }
       }
      else
       {
         do_align (1, (char *) NULL, 0, 0);
         if (line_label != NULL)
           {
             symbol_set_frag (line_label, frag_now);
             S_SET_VALUE (line_label, frag_now_fix ());
           }
       }
    }

  bytes = mult;

  expression (&exp);

  SKIP_WHITESPACE ();
  if (*input_line_pointer == ',')
    {
      ++input_line_pointer;
      expression (&val);
    }
  else
    {
      val.X_op = O_constant;
      val.X_add_number = 0;
    }

  if (val.X_op != O_constant
      || val.X_add_number < - 0x80
      || val.X_add_number > 0xff
      || (mult != 0 && mult != 1 && val.X_add_number != 0))
    {
      resolve_expression (&exp);
      if (exp.X_op != O_constant)
       as_bad (_("unsupported variable size or fill value"));
      else
       {
         offsetT i;

         if (mult == 0)
           mult = 1;
         bytes = mult * exp.X_add_number;
         for (i = 0; i < exp.X_add_number; i++)
           emit_expr (&val, mult);
       }
    }
  else
    {
      if (now_seg == absolute_section || mri_common_symbol != NULL)
       resolve_expression (&exp);

      if (exp.X_op == O_constant)
       {
         long repeat;

         repeat = exp.X_add_number;
         if (mult)
           repeat *= mult;
         bytes = repeat;
         if (repeat <= 0)
           {
             if (!flag_mri)
              as_warn (_(".space repeat count is zero, ignored"));
             else if (repeat < 0)
              as_warn (_(".space repeat count is negative, ignored"));
             goto getout;
           }

         /* If we are in the absolute section, just bump the offset.  */
         if (now_seg == absolute_section)
           {
             abs_section_offset += repeat;
             goto getout;
           }

         /* If we are secretly in an MRI common section, then
            creating space just increases the size of the common
            symbol.  */
         if (mri_common_symbol != NULL)
           {
             S_SET_VALUE (mri_common_symbol,
                        S_GET_VALUE (mri_common_symbol) + repeat);
             goto getout;
           }

         if (!need_pass_2)
           p = frag_var (rs_fill, 1, 1, (relax_substateT) 0, (symbolS *) 0,
                       (offsetT) repeat, (char *) 0);
       }
      else
       {
         if (now_seg == absolute_section)
           {
             as_bad (_("space allocation too complex in absolute section"));
             subseg_set (text_section, 0);
           }

         if (mri_common_symbol != NULL)
           {
             as_bad (_("space allocation too complex in common section"));
             mri_common_symbol = NULL;
           }

         if (!need_pass_2)
           p = frag_var (rs_space, 1, 1, (relax_substateT) 0,
                       make_expr_symbol (&exp), (offsetT) 0, (char *) 0);
       }

      if (p)
       *p = val.X_add_number;
    }

 getout:

  /* In MRI mode, after an odd number of bytes, we must align to an
     even word boundary, unless the next instruction is a dc.b, ds.b
     or dcb.b.  */
  if (flag_mri && (bytes & 1) != 0)
    mri_pending_align = 1;

  demand_empty_rest_of_line ();

  if (flag_mri)
    mri_comment_end (stop, stopc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void s_stab ( int  what)

Definition at line 398 of file stabs.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void s_struct ( int  )
void s_text ( int  )
void s_weakref ( int  )
void s_xstab ( int  what)

Definition at line 406 of file stabs.c.

{
  int length;
  char *stab_secname, *stabstr_secname;
  static char *saved_secname, *saved_strsecname;

  /* @@ MEMORY LEAK: This allocates a copy of the string, but in most
     cases it will be the same string, so we could release the storage
     back to the obstack it came from.  */
  stab_secname = demand_copy_C_string (&length);
  SKIP_WHITESPACE ();
  if (*input_line_pointer == ',')
    input_line_pointer++;
  else
    {
      as_bad (_("comma missing in .xstabs"));
      ignore_rest_of_line ();
      return;
    }

  /* To get the name of the stab string section, simply add "str" to
     the stab section name.  */
  if (saved_secname == 0 || strcmp (saved_secname, stab_secname))
    {
      stabstr_secname = (char *) xmalloc (strlen (stab_secname) + 4);
      strcpy (stabstr_secname, stab_secname);
      strcat (stabstr_secname, "str");
      if (saved_secname)
       {
         free (saved_secname);
         free (saved_strsecname);
       }
      saved_secname = stab_secname;
      saved_strsecname = stabstr_secname;
    }
  s_stab_generic (what, saved_secname, saved_strsecname);
}

Here is the call graph for this function:

int sizeof_leb128 ( valueT  ,
int  sign 
)

Definition at line 4572 of file read.c.

{
  if (sign)
    return sizeof_sleb128 ((offsetT) value);
  else
    return sizeof_uleb128 (value);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void stabs_generate_asm_endfunc ( const char *  ,
const char *   
)

Here is the caller graph for this function:

void stabs_generate_asm_file ( void  )

Definition at line 487 of file stabs.c.

{
  char *file;
  unsigned int lineno;

  as_where (&file, &lineno);
  if (use_gnu_debug_info_extensions)
    {
      char *dir, *dir2;

      dir = getpwd ();
      dir2 = alloca (strlen (dir) + 2);
      sprintf (dir2, "%s%s", dir, "/");
      generate_asm_file (N_SO, dir2);
    }
  generate_asm_file (N_SO, file);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void stabs_generate_asm_func ( const char *  ,
const char *   
)

Definition at line 653 of file stabs.c.

{
  static int void_emitted_p;
  char *hold = input_line_pointer;
  char *buf;
  char *file;
  unsigned int lineno;

  if (! void_emitted_p)
    {
      input_line_pointer = "\"void:t1=1\",128,0,0,0";
      s_stab ('s');
      void_emitted_p = 1;
    }

  as_where (&file, &lineno);
  asprintf (&buf, "\"%s:F1\",%d,0,%d,%s",
           funcname, N_FUN, lineno + 1, startlabname);
  input_line_pointer = buf;
  s_stab ('s');
  free (buf);

  input_line_pointer = hold;
  current_function_label = xstrdup (startlabname);
  in_dot_func_p = 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void stabs_generate_asm_lineno ( void  )

Definition at line 576 of file stabs.c.

{
  static int label_count;
  char *hold;
  char *file;
  unsigned int lineno;
  char *buf;
  char sym[30];
  /* Remember the last file/line and avoid duplicates.  */
  static unsigned int prev_lineno = -1;
  static char *prev_file = NULL;

  /* Rather than try to do this in some efficient fashion, we just
     generate a string and then parse it again.  That lets us use the
     existing stabs hook, which expect to see a string, rather than
     inventing new ones.  */

  hold = input_line_pointer;

  as_where (&file, &lineno);

  /* Don't emit sequences of stabs for the same line.  */
  if (prev_file == NULL)
    {
      /* First time thru.  */
      prev_file = xstrdup (file);
      prev_lineno = lineno;
    }
  else if (lineno == prev_lineno
          && strcmp (file, prev_file) == 0)
    {
      /* Same file/line as last time.  */
      return;
    }
  else
    {
      /* Remember file/line for next time.  */
      prev_lineno = lineno;
      if (strcmp (file, prev_file) != 0)
       {
         free (prev_file);
         prev_file = xstrdup (file);
       }
    }

  /* Let the world know that we are in the middle of generating a
     piece of stabs line debugging information.  */
  outputting_stabs_line_debug = 1;

  generate_asm_file (N_SOL, file);

  sprintf (sym, "%sL%d", FAKE_LABEL_NAME, label_count);
  ++label_count;

  if (in_dot_func_p)
    {
      buf = (char *) alloca (100 + strlen (current_function_label));
      sprintf (buf, "%d,0,%d,%s-%s\n", N_SLINE, lineno,
              sym, current_function_label);
    }
  else
    {
      buf = (char *) alloca (100);
      sprintf (buf, "%d,0,%d,%s\n", N_SLINE, lineno, sym);
    }
  input_line_pointer = buf;
  s_stab ('n');
  colon (sym);

  input_line_pointer = hold;
  outputting_stabs_line_debug = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void stringer ( int  append_zero)

Variable Documentation

Definition at line 185 of file read.c.

Definition at line 212 of file tc-alpha.c.

Definition at line 172 of file read.c.

Definition at line 175 of file read.c.

char** include_dirs

Definition at line 169 of file read.c.

Definition at line 135 of file tc-ns32k.c.

Definition at line 129 of file read.c.

char lex_type[]

Definition at line 108 of file read.c.

Definition at line 215 of file tc-alpha.c.

symbolS* line_label

Definition at line 189 of file read.c.

Definition at line 219 of file tc-alpha.c.

Definition at line 194 of file read.c.

Definition at line 153 of file read.c.

Definition at line 35 of file stabs.c.

Definition at line 164 of file read.c.