Ignore:
Timestamp:
Feb 6, 2017, 1:00:00 PM (8 years ago)
Author:
Silvan Scherrer
Message:

binutils: update trunk to version 2.27

Location:
binutils/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • binutils/trunk

  • TabularUnified binutils/trunk/gas/stabs.c

    r970 r1973  
    11/* Generic stabs parsing for gas.
    2    Copyright (C) 1989-2014 Free Software Foundation, Inc.
     2   Copyright (C) 1989-2016 Free Software Foundation, Inc.
    33
    44   This file is part of GAS, the GNU Assembler.
     
    3535int outputting_stabs_line_debug = 0;
    3636
    37 static void s_stab_generic (int, char *, char *);
    38 static void generate_asm_file (int, char *);
     37static void s_stab_generic (int, const char *, const char *);
     38static void generate_asm_file (int, const char *);
    3939
    4040/* Allow backends to override the names used for the stab sections.  */
     
    135135/* Here instead of obj-aout.c because other formats use it too.  */
    136136void
    137 aout_process_stab (what, string, type, other, desc)
    138      int what;
    139      const char *string;
    140      int type, other, desc;
     137aout_process_stab (int what, const char *string, int type, int other, int desc)
    141138{
    142139  /* Put the stab information in the symbol table.  */
     
    177174
    178175static void
    179 s_stab_generic (int what, char *stab_secname, char *stabstr_secname)
     176s_stab_generic (int          what,
     177                const char * stab_secname,
     178                const char * stabstr_secname)
    180179{
    181180  long longint;
    182   char *string, *saved_string_obstack_end;
     181  const char *string;
     182  char *saved_string_obstack_end;
    183183  int type;
    184184  int other;
     
    430430  if (saved_secname == 0 || strcmp (saved_secname, stab_secname))
    431431    {
    432       stabstr_secname = (char *) xmalloc (strlen (stab_secname) + 4);
    433       strcpy (stabstr_secname, stab_secname);
    434       strcat (stabstr_secname, "str");
     432      stabstr_secname = concat (stab_secname, "str", (char *) NULL);
    435433      if (saved_secname)
    436434        {
     
    449447
    450448void
    451 s_desc (ignore)
    452      int ignore ATTRIBUTE_UNUSED;
     449s_desc (int ignore ATTRIBUTE_UNUSED)
    453450{
    454451  char *name;
     
    458455  int temp;
    459456
    460   name = input_line_pointer;
    461   c = get_symbol_end ();
     457  c = get_symbol_name (&name);
    462458  p = input_line_pointer;
    463459  *p = c;
    464   SKIP_WHITESPACE ();
     460  SKIP_WHITESPACE_AFTER_NAME ();
    465461  if (*input_line_pointer != ',')
    466462    {
     
    489485stabs_generate_asm_file (void)
    490486{
    491   char *file;
     487  const char *file;
    492488  unsigned int lineno;
    493489
    494   as_where (&file, &lineno);
     490  file = as_where (&lineno);
    495491  if (use_gnu_debug_info_extensions)
    496492    {
     
    499495
    500496      dir = remap_debug_filename (getpwd ());
    501       dir2 = (char *) alloca (strlen (dir) + 2);
    502       sprintf (dir2, "%s%s", dir, "/");
     497      dir2 = concat (dir, "/", NULL);
    503498      generate_asm_file (N_SO, dir2);
     499      free (dir2);
    504500      xfree ((char *) dir);
    505501    }
     
    511507
    512508static void
    513 generate_asm_file (int type, char *file)
     509generate_asm_file (int type, const char *file)
    514510{
    515511  static char *last_file;
     
    518514  char sym[30];
    519515  char *buf;
    520   char *tmp = file;
    521   char *file_endp = file + strlen (file);
     516  const char *tmp = file;
     517  const char *file_endp = file + strlen (file);
    522518  char *bufp;
    523519
     
    538534     doubled up backslashes), the symbol name, and the other characters
    539535     that make up a stabs file directive.  */
    540   bufp = buf = (char *) xmalloc (2 * strlen (file) + strlen (sym) + 12);
     536  bufp = buf = XNEWVEC (char, 2 * strlen (file) + strlen (sym) + 12);
    541537
    542538  *bufp++ = '"';
     
    544540  while (tmp < file_endp)
    545541    {
    546       char *bslash = strchr (tmp, '\\');
     542      const char *bslash = strchr (tmp, '\\');
    547543      size_t len = (bslash) ? (size_t) (bslash - tmp + 1) : strlen (tmp);
    548544
     
    582578  static int label_count;
    583579  char *hold;
    584   char *file;
     580  const char *file;
    585581  unsigned int lineno;
    586582  char *buf;
     
    597593  hold = input_line_pointer;
    598594
    599   as_where (&file, &lineno);
     595  file = as_where (&lineno);
    600596
    601597  /* Don't emit sequences of stabs for the same line.  */
     
    634630  if (in_dot_func_p)
    635631    {
    636       buf = (char *) alloca (100 + strlen (current_function_label));
     632      buf = XNEWVEC (char, 100 + strlen (current_function_label));
    637633      sprintf (buf, "%d,0,%d,%s-%s\n", N_SLINE, lineno,
    638634               sym, current_function_label);
     
    640636  else
    641637    {
    642       buf = (char *) alloca (100);
     638      buf = XNEWVEC (char, 100);
    643639      sprintf (buf, "%d,0,%d,%s\n", N_SLINE, lineno, sym);
    644640    }
     
    649645  input_line_pointer = hold;
    650646  outputting_stabs_line_debug = 0;
     647  free (buf);
    651648}
    652649
     
    660657  char *hold = input_line_pointer;
    661658  char *buf;
    662   char *file;
    663659  unsigned int lineno;
    664660
    665661  if (! void_emitted_p)
    666662    {
    667       input_line_pointer = "\"void:t1=1\",128,0,0,0";
     663      input_line_pointer = (char *) "\"void:t1=1\",128,0,0,0";
    668664      s_stab ('s');
    669665      void_emitted_p = 1;
    670666    }
    671667
    672   as_where (&file, &lineno);
     668  as_where (&lineno);
    673669  if (asprintf (&buf, "\"%s:F1\",%d,0,%d,%s",
    674670                funcname, N_FUN, lineno + 1, startlabname) == -1)
Note: See TracChangeset for help on using the changeset viewer.