Rev 5222 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5222 | Rev 6324 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* symbols.c -symbol table- |
1 | /* symbols.c -symbol table- |
2 | Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
- | |
3 | 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, |
- | |
4 | 2011, 2012 Free Software Foundation, Inc. |
2 | Copyright (C) 1987-2015 Free Software Foundation, Inc. |
Line 5... | Line 3... | ||
5 | 3 | ||
Line 6... | Line 4... | ||
6 | This file is part of GAS, the GNU Assembler. |
4 | This file is part of GAS, the GNU Assembler. |
7 | 5 | ||
Line 104... | Line 102... | ||
104 | to the object file format. */ |
102 | to the object file format. */ |
Line 105... | Line 103... | ||
105 | 103 | ||
106 | static char * |
104 | static char * |
107 | save_symbol_name (const char *name) |
105 | save_symbol_name (const char *name) |
108 | { |
106 | { |
109 | unsigned int name_length; |
107 | size_t name_length; |
Line 110... | Line 108... | ||
110 | char *ret; |
108 | char *ret; |
111 | 109 | ||
112 | name_length = strlen (name) + 1; /* +1 for \0. */ |
110 | name_length = strlen (name) + 1; /* +1 for \0. */ |
Line 265... | Line 263... | ||
265 | symbolS * |
263 | symbolS * |
266 | colon (/* Just seen "x:" - rattle symbols & frags. */ |
264 | colon (/* Just seen "x:" - rattle symbols & frags. */ |
267 | const char *sym_name /* Symbol name, as a cannonical string. */ |
265 | const char *sym_name /* Symbol name, as a cannonical string. */ |
268 | /* We copy this string: OK to alter later. */) |
266 | /* We copy this string: OK to alter later. */) |
269 | { |
267 | { |
270 | register symbolS *symbolP; /* Symbol we are working with. */ |
268 | symbolS *symbolP; /* Symbol we are working with. */ |
Line 271... | Line 269... | ||
271 | 269 | ||
272 | /* Sun local labels go out of scope whenever a non-local symbol is |
270 | /* Sun local labels go out of scope whenever a non-local symbol is |
273 | defined. */ |
271 | defined. */ |
274 | if (LOCAL_LABELS_DOLLAR |
272 | if (LOCAL_LABELS_DOLLAR |
Line 482... | Line 480... | ||
482 | /* Die if we can't insert the symbol. */ |
480 | /* Die if we can't insert the symbol. */ |
Line 483... | Line 481... | ||
483 | 481 | ||
484 | void |
482 | void |
485 | symbol_table_insert (symbolS *symbolP) |
483 | symbol_table_insert (symbolS *symbolP) |
486 | { |
484 | { |
Line 487... | Line 485... | ||
487 | register const char *error_string; |
485 | const char *error_string; |
488 | 486 | ||
Line 489... | Line 487... | ||
489 | know (symbolP); |
487 | know (symbolP); |
Line 510... | Line 508... | ||
510 | it into the symbol table. Return a pointer to it. */ |
508 | it into the symbol table. Return a pointer to it. */ |
Line 511... | Line 509... | ||
511 | 509 | ||
512 | symbolS * |
510 | symbolS * |
513 | symbol_find_or_make (const char *name) |
511 | symbol_find_or_make (const char *name) |
514 | { |
512 | { |
Line 515... | Line 513... | ||
515 | register symbolS *symbolP; |
513 | symbolS *symbolP; |
Line 516... | Line 514... | ||
516 | 514 | ||
517 | symbolP = symbol_find (name); |
515 | symbolP = symbol_find (name); |
Line 1662... | Line 1660... | ||
1662 | 1660 | ||
1663 | fb labels get the same treatment, except that ^B is used in place |
1661 | fb labels get the same treatment, except that ^B is used in place |
Line 1664... | Line 1662... | ||
1664 | of ^A. */ |
1662 | of ^A. */ |
1665 | 1663 | ||
1666 | char * /* Return local label name. */ |
1664 | char * /* Return local label name. */ |
1667 | dollar_label_name (register long n, /* we just saw "n$:" : n a number. */ |
1665 | dollar_label_name (long n, /* we just saw "n$:" : n a number. */ |
1668 | register int augend /* 0 for current instance, 1 for new instance. */) |
1666 | int augend /* 0 for current instance, 1 for new instance. */) |
1669 | { |
1667 | { |
1670 | long i; |
1668 | long i; |
1671 | /* Returned to caller, then copied. Used for created names ("4f"). */ |
1669 | /* Returned to caller, then copied. Used for created names ("4f"). */ |
1672 | static char symbol_name_build[24]; |
1670 | static char symbol_name_build[24]; |
1673 | register char *p; |
1671 | char *p; |
Line 1674... | Line 1672... | ||
1674 | register char *q; |
1672 | char *q; |
1675 | char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */ |
1673 | char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */ |
1676 | 1674 | ||
Line 1835... | Line 1833... | ||
1835 | long augend /* 0 for nb, 1 for n:, nf. */) |
1833 | long augend /* 0 for nb, 1 for n:, nf. */) |
1836 | { |
1834 | { |
1837 | long i; |
1835 | long i; |
1838 | /* Returned to caller, then copied. Used for created names ("4f"). */ |
1836 | /* Returned to caller, then copied. Used for created names ("4f"). */ |
1839 | static char symbol_name_build[24]; |
1837 | static char symbol_name_build[24]; |
1840 | register char *p; |
1838 | char *p; |
1841 | register char *q; |
1839 | char *q; |
1842 | char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */ |
1840 | char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */ |
Line 1843... | Line 1841... | ||
1843 | 1841 | ||
1844 | know (n >= 0); |
1842 | know (n >= 0); |
1845 | #ifdef TC_MMIX |
1843 | #ifdef TC_MMIX |