(symbol_find_exact): Split out from..
(symbol_find_base): ..here.
* symbols.h: Replace CONST by const throughout.
(symbol_find_exact): Declare.
* config/obj-elf.c: #include "struc-symbol.h".
(elf_frob_file): If group name matches an exported symbol, use that
symbol for the signature and ".group" as the section name.
+2002-06-07 Alan Modra <amodra@bigpond.net.au>
+
+ * symbols.c: Replace CONST by const throughout.
+ (symbol_find_exact): Split out from..
+ (symbol_find_base): ..here.
+ * symbols.h: Replace CONST by const throughout.
+ (symbol_find_exact): Declare.
+ * config/obj-elf.c: #include "struc-symbol.h".
+ (elf_frob_file): If group name matches an exported symbol, use that
+ symbol for the signature and ".group" as the section name.
+
Thu Jun 6 17:42:12 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/tc-sh.c (parse_at): @(symbol,pc) is A_DISP_PC again,
#include "safe-ctype.h"
#include "subsegs.h"
#include "obstack.h"
+#include "struc-symbol.h"
#ifndef ECOFF_DEBUGGING
#define ECOFF_DEBUGGING 0
for (i = 0; i < list.num_group; i++)
{
const char *group_name = elf_group_name (list.head[i]);
+ const char *sec_name;
asection *s;
flagword flags;
+ struct symbol *sy;
+ int has_sym;
flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP;
for (s = list.head[i]; s != NULL; s = elf_next_in_group (s))
}
}
- s = subseg_force_new (group_name, 0);
+ sec_name = group_name;
+ sy = symbol_find_exact (group_name);
+ has_sym = 0;
+ if (sy != NULL
+ && (sy == symbol_lastP
+ || (sy->sy_next != NULL
+ && sy->sy_next->sy_previous == sy)))
+ {
+ has_sym = 1;
+ sec_name = ".group";
+ }
+ s = subseg_force_new (sec_name, 0);
if (s == NULL
|| !bfd_set_section_flags (stdoutput, s, flags)
|| !bfd_set_section_alignment (stdoutput, s, 2))
/* Pass a pointer to the first section in this group. */
elf_next_in_group (s) = list.head[i];
+ if (has_sym)
+ elf_group_id (s) = sy->bsym;
s->_raw_size = 4 * (list.elt_count[i] + 1);
s->contents = frag_more (s->_raw_size);
/* symbols.c -symbol table-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001
+ 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
symbolS *
symbol_make (name)
- CONST char *name;
+ const char *name;
{
symbolS *symbolP;
symbolS *
symbol_find (name)
- CONST char *name;
+ const char *name;
{
#ifdef STRIP_UNDERSCORE
return (symbol_find_base (name, 1));
#endif /* STRIP_UNDERSCORE */
}
+symbolS *
+symbol_find_exact (name)
+ const char *name;
+{
+#ifdef BFD_ASSEMBLER
+ {
+ struct local_symbol *locsym;
+
+ locsym = (struct local_symbol *) hash_find (local_hash, name);
+ if (locsym != NULL)
+ return (symbolS *) locsym;
+ }
+#endif
+
+ return ((symbolS *) hash_find (sy_hash, name));
+}
+
symbolS *
symbol_find_base (name, strip_underscore)
- CONST char *name;
+ const char *name;
int strip_underscore;
{
if (strip_underscore && *name == '_')
*copy = '\0';
}
-#ifdef BFD_ASSEMBLER
- {
- struct local_symbol *locsym;
-
- locsym = (struct local_symbol *) hash_find (local_hash, name);
- if (locsym != NULL)
- return (symbolS *) locsym;
- }
-#endif
-
- return ((symbolS *) hash_find (sy_hash, name));
+ return symbol_find_exact (name);
}
/* Once upon a time, symbols were kept in a singly linked list. At
return S_GET_NAME (s) == 0;
}
-CONST char *
+const char *
S_GET_NAME (s)
symbolS *s;
{
/* symbols.h -
- Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
extern int symbols_case_sensitive;
char *decode_local_label_name PARAMS ((char *s));
-symbolS *symbol_find PARAMS ((CONST char *name));
-symbolS *symbol_find_base PARAMS ((CONST char *name, int strip_underscore));
+symbolS *symbol_find PARAMS ((const char *name));
+symbolS *symbol_find_exact PARAMS ((const char *name));
+symbolS *symbol_find_base PARAMS ((const char *name, int strip_underscore));
symbolS *symbol_find_or_make PARAMS ((const char *name));
-symbolS *symbol_make PARAMS ((CONST char *name));
-symbolS *symbol_new PARAMS ((CONST char *name, segT segment, valueT value,
+symbolS *symbol_make PARAMS ((const char *name));
+symbolS *symbol_new PARAMS ((const char *name, segT segment, valueT value,
fragS * frag));
-symbolS *symbol_create PARAMS ((CONST char *name, segT segment, valueT value,
+symbolS *symbol_create PARAMS ((const char *name, segT segment, valueT value,
fragS * frag));
symbolS *colon PARAMS ((const char *sym_name));
void local_colon PARAMS ((int n));
extern int S_IS_LOCAL PARAMS ((symbolS *));
extern int S_IS_EXTERN PARAMS ((symbolS *));
extern int S_IS_STABD PARAMS ((symbolS *));
-extern CONST char *S_GET_NAME PARAMS ((symbolS *));
+extern const char *S_GET_NAME PARAMS ((symbolS *));
extern segT S_GET_SEGMENT PARAMS ((symbolS *));
extern void S_SET_SEGMENT PARAMS ((symbolS *, segT));
extern void S_SET_EXTERNAL PARAMS ((symbolS *));