summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/binutils/stabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.25/binutils/stabs.c')
-rw-r--r--binutils-2.25/binutils/stabs.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/binutils-2.25/binutils/stabs.c b/binutils-2.25/binutils/stabs.c
index 8b459778..33159e99 100644
--- a/binutils-2.25/binutils/stabs.c
+++ b/binutils-2.25/binutils/stabs.c
@@ -1,6 +1,5 @@
/* stabs.c -- Parse stabs debugging information
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@@ -837,8 +836,6 @@ parse_stab_string (void *dhandle, struct stab_handle *info, int stabtype,
case 'G':
{
- char leading;
- long c;
asymbol **ps;
/* A global symbol. The value must be extracted from the
@@ -847,19 +844,27 @@ parse_stab_string (void *dhandle, struct stab_handle *info, int stabtype,
(debug_type **) NULL);
if (dtype == DEBUG_TYPE_NULL)
return FALSE;
- leading = bfd_get_symbol_leading_char (info->abfd);
- for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps)
+ if (name != NULL)
{
- const char *n;
+ char leading;
+ long c;
- n = bfd_asymbol_name (*ps);
- if (leading != '\0' && *n == leading)
- ++n;
- if (*n == *name && strcmp (n, name) == 0)
- break;
+ leading = bfd_get_symbol_leading_char (info->abfd);
+ for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps)
+ {
+ const char *n;
+
+ n = bfd_asymbol_name (*ps);
+ if (leading != '\0' && *n == leading)
+ ++n;
+ if (*n == *name && strcmp (n, name) == 0)
+ break;
+ }
+
+ if (c > 0)
+ value = bfd_asymbol_value (*ps);
}
- if (c > 0)
- value = bfd_asymbol_value (*ps);
+
if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_GLOBAL,
value))
return FALSE;