/* IMPORTS */
-extern boolean option_longmap;
-
/* LOCALS */
#define TABSIZE 1009
static ldsym_type *global_symbol_hash_table[TABSIZE];
#endif
int
-DEFUN (hash_string, (key),
- CONST char *key)
+hash_string (key)
+ CONST char *key;
{
register CONST char *cp;
register int k;
__inline
#endif
ldsym_type *
-DEFUN (search, (key, hashval),
- CONST char *key AND
- int hashval)
+search (key, hashval)
+ CONST char *key;
+ int hashval;
{
ldsym_type *bp;
for (bp = global_symbol_hash_table[hashval]; bp; bp = bp->link)
/* Get the symbol table entry for the global symbol named KEY.
Create one if there is none. */
ldsym_type *
-DEFUN (ldsym_get, (key),
- CONST char *key)
+ldsym_get (key)
+ CONST char *key;
{
register int hashval;
register ldsym_type *bp;
/* Like `ldsym_get' but return 0 if the symbol is not already known. */
ldsym_type *
-DEFUN (ldsym_get_soft, (key),
- CONST char *key)
+ldsym_get_soft (key)
+ CONST char *key;
{
register int hashval;
/* Determine which bucket. */
ks_file = fopen (keepsyms_file, "r");
if (!ks_file)
{
- info ("%X%P: can't open keep-symbols file `%s'\n", keepsyms_file);
+ info_msg ("%X%P: cannot open keep-symbols file `%s'\n", keepsyms_file);
goto egress;
}
errno = 0;
if (!feof (ks_file))
/* error occurred */
{
- info ("%X%P: error reading keep-symbols file `%s': %E\n",
+ info_msg ("%X%P: error reading keep-symbols file `%s': %E\n",
keepsyms_file);
out = end;
goto egress;
if (obstack_next_free (&obstack) != obstack_base (&obstack) + 1)
/* eof in middle of symbol */
{
- info ("%X%P: eof reached mid-line while reading keep-symbols file `%s'\n",
+ info_msg ("%X%P: eof reached mid-line while reading keep-symbols file `%s'\n",
keepsyms_file);
out = end;
goto egress;
found = 1;
}
if (!found)
- info ("%P: symbol `%s' (requested to be kept) not found\n", ptr);
+ info_msg ("%P: symbol `%s' (requested to be kept) not found\n", ptr);
}
/* It'd be slightly faster to move this pass above the previous one,
but that'd mean any symbols preserved in this pass would generate
/* If this is a definition,
update it if necessary by this file's start address. */
if (p->flags & BSF_LOCAL)
- info (" %V %s\n", p->value, p->name);
+ info_msg (" %V %s\n", p->value, p->name);
}
}
}
static void
-DEFUN (print_file_stuff, (f),
- lang_input_statement_type * f)
+print_file_stuff (f)
+ lang_input_statement_type * f;
{
fprintf (config.map_file, " %s\n", f->filename);
if (f->just_syms_flag)
else
{
asection *s;
- if (true || option_longmap)
+ if (true)
{
for (s = f->the_bfd->sections;
s != (asection *) NULL;
}
}
- if (option_longmap)
- {
- lang_for_each_file (list_file_locals);
- }
}
extern lang_output_section_statement_type *create_object_symbols;
/* The value is the start of this section in the output file*/
newsym->value = 0;
/* FIXME: Usurping BSF_KEEP_G flag, since it's defined as
- "used by the linker" and I can't find any other code that
- uses it. Should be a cleaner way of doing this (like an
- "application flags" field in the symbol structure?). */
- newsym->flags = BSF_LOCAL | BSF_KEEP_G;
+ "used by the linker" and I can't find any other code that
+ uses it. Should be a cleaner way of doing this (like an
+ "application flags" field in the symbol structure?). */
+ newsym->flags = BSF_LOCAL | BSF_KEEP_G | BSF_FILE;
newsym->section = s;
*output_buffer++ = newsym;
break;
if (p->section == 0)
p->section = &bfd_abs_section;
- if (flag_is_global (p->flags))
+ if ((p->flags & BSF_GLOBAL)
+ || (p->flags & BSF_WEAK))
{
- /* We are only interested in outputting
- globals at this stage in special circumstances */
+ /* If this symbol is marked as occurring now, rather than
+ at the end, output it now. This is used for COFF C_EXT
+ FCN symbols. FIXME: There must be a better way. */
if (bfd_asymbol_bfd (p) == entry->the_bfd
- && flag_is_not_at_end (p->flags))
+ && (p->flags & BSF_NOT_AT_END))
{
- /* And this is one of them */
*(output_buffer++) = p;
p->flags |= BSF_KEEP;
}
{
/* Dont think about indirect symbols */
}
- else if (flag_is_debugger (p->flags))
+ else if (p->flags & BSF_DEBUGGING)
{
/* Only keep the debugger symbols if no stripping required */
if (strip_symbols == STRIP_NONE)
{
/* These must be global. */
}
- else if (flag_is_ordinary_local (p->flags))
+ else if (p->flags & BSF_LOCAL)
{
if (discard_locals == DISCARD_ALL)
{
*output_buffer++ = p;
}
}
- else if (p->flags & BSF_CTOR)
+ else if (p->flags & BSF_CONSTRUCTOR)
{
- /* Throw it away */
+ if (strip_symbols != STRIP_ALL)
+ {
+ *output_buffer++ = p;
+ }
}
else
{
if (keepsyms_file != 0
&& strip_symbols != STRIP_SOME)
{
- info ("%P `-retain-symbols-file' overrides `-s' and `-S'\n");
+ info_msg ("%P: `-retain-symbols-file' overrides `-s' and `-S'\n");
strip_symbols = STRIP_SOME;
}
if (strip_symbols != STRIP_ALL)
linker symbol table
*/
boolean
-DEFUN (ldsym_undefined, (sym),
- CONST char *sym)
+ldsym_undefined (sym)
+ CONST char *sym;
{
ldsym_type *from_table = ldsym_get_soft (sym);
if (from_table != (ldsym_type *) NULL)
}
void
-DEFUN_VOID (ldsym_init)
+ldsym_init ()
{
obstack_begin (&global_sym_obstack, 20000);
}