/* Generic symbol-table support for the BFD library.
- Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
| process_symbol (symbol_table[i]);
| }
- All storage for the symbols themselves is in an obstack
+ All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
. {* Symbol is from dynamic linking information. *}
.#define BSF_DYNAMIC 0x8000
.
+. {* The symbol denotes a data object. Used in ELF, and perhaps
+. others someday. *}
+.#define BSF_OBJECT 0x10000
+.
. flagword flags;
.
. {* A pointer to the section to which this symbol is
#include "bfdlink.h"
#include "aout/stab_gnu.h"
+static char coff_section_type PARAMS ((const char *));
+
/*
DOCDD
INODE
DESCRIPTION
Return true if the given symbol @var{sym} in the BFD @var{abfd} is
a compiler generated local label, else return false.
-.#define bfd_is_local_label(abfd, sym) \
-. BFD_SEND (abfd, _bfd_is_local_label,(abfd, sym))
+*/
+
+boolean
+bfd_is_local_label (abfd, sym)
+ bfd *abfd;
+ asymbol *sym;
+{
+ if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
+ return false;
+ if (sym->name == NULL)
+ return false;
+ return bfd_is_local_label_name (abfd, sym->name);
+}
+
+/*
+FUNCTION
+ bfd_is_local_label_name
+
+SYNOPSIS
+ boolean bfd_is_local_label_name(bfd *abfd, const char *name);
+
+DESCRIPTION
+ Return true if a symbol with the name @var{name} in the BFD
+ @var{abfd} is a compiler generated local label, else return
+ false. This just checks whether the name has the form of a
+ local label.
+
+.#define bfd_is_local_label_name(abfd, name) \
+. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
*/
/*
}
/* This presumes that a symbol can not be both BSF_DEBUGGING and
- BSF_DYNAMIC, nor both BSF_FUNCTION and BSF_FILE. */
+ BSF_DYNAMIC, nor more than one of BSF_FUNCTION, BSF_FILE, and
+ BSF_OBJECT. */
fprintf (file, " %c%c%c%c%c%c%c",
((type & BSF_LOCAL)
? (type & BSF_GLOBAL) ? '!' : 'l'
(type & BSF_WARNING) ? 'W' : ' ',
(type & BSF_INDIRECT) ? 'I' : ' ',
(type & BSF_DEBUGGING) ? 'd' : (type & BSF_DYNAMIC) ? 'D' : ' ',
- (type & BSF_FUNCTION) ? 'F' : (type & BSF_FILE) ? 'f' : ' ');
+ ((type & BSF_FUNCTION)
+ ? 'F'
+ : ((type & BSF_FILE)
+ ? 'f'
+ : ((type & BSF_OBJECT) ? 'O' : ' '))));
}
{
{"*DEBUG*", 'N'},
{".bss", 'b'},
+ {"zerovars", 'b'}, /* MRI .bss */
{".data", 'd'},
+ {"vars", 'd'}, /* MRI .data */
{".rdata", 'r'}, /* Read only data. */
{".rodata", 'r'}, /* Read only data. */
{".sbss", 's'}, /* Small BSS (uninitialized data). */
{".scommon", 'c'}, /* Small common. */
{".sdata", 'g'}, /* Small initialized data. */
{".text", 't'},
+ {"code", 't'}, /* MRI .text */
{0, 0}
};
static char
coff_section_type (s)
- char *s;
+ const char *s;
{
CONST struct section_to_type *t;
Not enough memory exists to create private data for @var{osec}.
.#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
-. BFD_SEND (ibfd, _bfd_copy_private_symbol_data, \
+. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
. (ibfd, isymbol, obfd, osymbol))
*/
{
/* No stabs debugging information. Set *pinfo so that we
can return quickly in the info != NULL case above. */
- *pinfo = info;
+ *pinfo = (PTR) info;
return true;
}
if (reloc_vector != NULL)
free (reloc_vector);
- *pinfo = info;
+ *pinfo = (PTR) info;
}
/* We are passed a section relative offset. The offsets in the
break;
}
- name = str + bfd_get_32 (abfd, stab + STRDXOFF);
+ name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
/* An empty string indicates the end of the compilation
unit. */
{
stab += STABSIZE;
directory_name = current_file_name;
- current_file_name = str + bfd_get_32 (abfd, stab + STRDXOFF);
+ current_file_name = ((char *) str
+ + bfd_get_32 (abfd, stab + STRDXOFF));
}
main_file_name = current_file_name;
case N_SOL:
/* The name of an include file. */
- current_file_name = str + bfd_get_32 (abfd, stab + STRDXOFF);
+ current_file_name = ((char *) str
+ + bfd_get_32 (abfd, stab + STRDXOFF));
break;
case N_SLINE:
case N_FUN:
/* A function name. */
val = bfd_get_32 (abfd, stab + VALOFF);
- name = str + bfd_get_32 (abfd, stab + STRDXOFF);
+ name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
/* An empty string here indicates the end of a function, and
the value is relative to fnaddr. */