* coffread.c (record_minimal_symbol): Update.
* dbxread.c (record_minimal_symbol): Update. * elfread.c (record_minimal_symbol): Update. * machoread.c (macho_symtab_add_minsym): Update. * mdebugread.c (record_minimal_symbol, parse_partial_symbols): Update. * minsyms.c (prim_record_minimal_symbol): Update. (prim_record_minimal_symbol_full): Remove 'bfd_section' argument. (prim_record_minimal_symbol_and_info): Likewise. * minsyms.h (prim_record_minimal_symbol_full) (prim_record_minimal_symbol_and_info): Update. * symtab.c (allocate_symbol, initialize_symbol) (allocate_template_symbol): Initialize SYMBOL_SECTION. * xcoffread.c (record_minimal_symbol, scan_xcoff_symtab): Update.
This commit is contained in:
parent
36192a8d54
commit
e6dc44a8f5
10 changed files with 31 additions and 68 deletions
|
@ -1,3 +1,22 @@
|
|||
2013-04-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* coffread.c (record_minimal_symbol): Update.
|
||||
* dbxread.c (record_minimal_symbol): Update.
|
||||
* elfread.c (record_minimal_symbol): Update.
|
||||
* machoread.c (macho_symtab_add_minsym): Update.
|
||||
* mdebugread.c (record_minimal_symbol, parse_partial_symbols):
|
||||
Update.
|
||||
* minsyms.c (prim_record_minimal_symbol): Update.
|
||||
(prim_record_minimal_symbol_full): Remove 'bfd_section'
|
||||
argument.
|
||||
(prim_record_minimal_symbol_and_info): Likewise.
|
||||
* minsyms.h (prim_record_minimal_symbol_full)
|
||||
(prim_record_minimal_symbol_and_info): Update.
|
||||
* symtab.c (allocate_symbol, initialize_symbol)
|
||||
(allocate_template_symbol): Initialize SYMBOL_SECTION.
|
||||
* xcoffread.c (record_minimal_symbol, scan_xcoff_symtab):
|
||||
Update.
|
||||
|
||||
2013-04-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
PR symtab/8423:
|
||||
|
|
|
@ -456,8 +456,6 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
|
|||
enum minimal_symbol_type type, int section,
|
||||
struct objfile *objfile)
|
||||
{
|
||||
struct bfd_section *bfd_section;
|
||||
|
||||
/* We don't want TDESC entry points in the minimal symbol table. */
|
||||
if (cs->c_name[0] == '@')
|
||||
return NULL;
|
||||
|
@ -472,10 +470,8 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bfd_section = cs_to_bfd_section (cs, objfile);
|
||||
return prim_record_minimal_symbol_and_info (cs->c_name, address,
|
||||
type, section,
|
||||
bfd_section, objfile);
|
||||
type, section, objfile);
|
||||
}
|
||||
|
||||
/* coff_symfile_init ()
|
||||
|
|
|
@ -440,35 +440,29 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
|
|||
{
|
||||
enum minimal_symbol_type ms_type;
|
||||
int section;
|
||||
asection *bfd_section;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case N_TEXT | N_EXT:
|
||||
ms_type = mst_text;
|
||||
section = SECT_OFF_TEXT (objfile);
|
||||
bfd_section = DBX_TEXT_SECTION (objfile);
|
||||
break;
|
||||
case N_DATA | N_EXT:
|
||||
ms_type = mst_data;
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
bfd_section = DBX_DATA_SECTION (objfile);
|
||||
break;
|
||||
case N_BSS | N_EXT:
|
||||
ms_type = mst_bss;
|
||||
section = SECT_OFF_BSS (objfile);
|
||||
bfd_section = DBX_BSS_SECTION (objfile);
|
||||
break;
|
||||
case N_ABS | N_EXT:
|
||||
ms_type = mst_abs;
|
||||
section = -1;
|
||||
bfd_section = NULL;
|
||||
break;
|
||||
#ifdef N_SETV
|
||||
case N_SETV | N_EXT:
|
||||
ms_type = mst_data;
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
bfd_section = DBX_DATA_SECTION (objfile);
|
||||
break;
|
||||
case N_SETV:
|
||||
/* I don't think this type actually exists; since a N_SETV is the result
|
||||
|
@ -476,7 +470,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
|
|||
file local. */
|
||||
ms_type = mst_file_data;
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
bfd_section = DBX_DATA_SECTION (objfile);
|
||||
break;
|
||||
#endif
|
||||
case N_TEXT:
|
||||
|
@ -485,7 +478,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
|
|||
case N_FN_SEQ:
|
||||
ms_type = mst_file_text;
|
||||
section = SECT_OFF_TEXT (objfile);
|
||||
bfd_section = DBX_TEXT_SECTION (objfile);
|
||||
break;
|
||||
case N_DATA:
|
||||
ms_type = mst_file_data;
|
||||
|
@ -507,17 +499,14 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
|
|||
ms_type = mst_data;
|
||||
}
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
bfd_section = DBX_DATA_SECTION (objfile);
|
||||
break;
|
||||
case N_BSS:
|
||||
ms_type = mst_file_bss;
|
||||
section = SECT_OFF_BSS (objfile);
|
||||
bfd_section = DBX_BSS_SECTION (objfile);
|
||||
break;
|
||||
default:
|
||||
ms_type = mst_unknown;
|
||||
section = -1;
|
||||
bfd_section = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -526,7 +515,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
|
|||
lowest_text_address = address;
|
||||
|
||||
prim_record_minimal_symbol_and_info
|
||||
(name, address, ms_type, section, bfd_section, objfile);
|
||||
(name, address, ms_type, section, objfile);
|
||||
}
|
||||
|
||||
/* Scan and build partial symbols for a symbol file.
|
||||
|
|
|
@ -211,7 +211,7 @@ record_minimal_symbol (const char *name, int name_len, int copy_name,
|
|||
ms_type,
|
||||
gdb_bfd_section_index (objfile->obfd,
|
||||
bfd_section),
|
||||
bfd_section, objfile);
|
||||
objfile);
|
||||
}
|
||||
|
||||
/* Read the symbol table of an ELF file.
|
||||
|
|
|
@ -167,7 +167,7 @@ macho_symtab_add_minsym (struct objfile *objfile, const asymbol *sym)
|
|||
prim_record_minimal_symbol_and_info
|
||||
(sym->name, symaddr, ms_type,
|
||||
gdb_bfd_section_index (objfile->obfd, sym->section),
|
||||
sym->section, objfile);
|
||||
objfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2256,74 +2256,59 @@ record_minimal_symbol (const char *name, const CORE_ADDR address,
|
|||
struct objfile *objfile)
|
||||
{
|
||||
int section;
|
||||
asection *bfd_section;
|
||||
|
||||
switch (storage_class)
|
||||
{
|
||||
case scText:
|
||||
section = SECT_OFF_TEXT (objfile);
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".text");
|
||||
break;
|
||||
case scData:
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".data");
|
||||
break;
|
||||
case scBss:
|
||||
section = SECT_OFF_BSS (objfile);
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".bss");
|
||||
break;
|
||||
case scSData:
|
||||
section = get_section_index (objfile, ".sdata");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".sdata");
|
||||
break;
|
||||
case scSBss:
|
||||
section = get_section_index (objfile, ".sbss");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".sbss");
|
||||
break;
|
||||
case scRData:
|
||||
section = get_section_index (objfile, ".rdata");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".rdata");
|
||||
break;
|
||||
case scInit:
|
||||
section = get_section_index (objfile, ".init");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".init");
|
||||
break;
|
||||
case scXData:
|
||||
section = get_section_index (objfile, ".xdata");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".xdata");
|
||||
break;
|
||||
case scPData:
|
||||
section = get_section_index (objfile, ".pdata");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".pdata");
|
||||
break;
|
||||
case scFini:
|
||||
section = get_section_index (objfile, ".fini");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".fini");
|
||||
break;
|
||||
case scRConst:
|
||||
section = get_section_index (objfile, ".rconst");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".rconst");
|
||||
break;
|
||||
#ifdef scTlsData
|
||||
case scTlsData:
|
||||
section = get_section_index (objfile, ".tlsdata");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsdata");
|
||||
break;
|
||||
#endif
|
||||
#ifdef scTlsBss
|
||||
case scTlsBss:
|
||||
section = get_section_index (objfile, ".tlsbss");
|
||||
bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsbss");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* This kind of symbol is not associated to a section. */
|
||||
section = -1;
|
||||
bfd_section = NULL;
|
||||
}
|
||||
|
||||
prim_record_minimal_symbol_and_info (name, address, ms_type,
|
||||
section, bfd_section, objfile);
|
||||
section, objfile);
|
||||
}
|
||||
|
||||
/* Master parsing procedure for first-pass reading of file symbols
|
||||
|
@ -3510,7 +3495,7 @@ parse_partial_symbols (struct objfile *objfile)
|
|||
prim_record_minimal_symbol_and_info (name, sh.value,
|
||||
mst_file_text,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
NULL, objfile);
|
||||
objfile);
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
|
@ -3596,13 +3581,11 @@ parse_partial_symbols (struct objfile *objfile)
|
|||
prim_record_minimal_symbol_and_info (name, sh.value,
|
||||
mst_file_data,
|
||||
SECT_OFF_DATA (objfile),
|
||||
NULL,
|
||||
objfile);
|
||||
else
|
||||
prim_record_minimal_symbol_and_info (name, sh.value,
|
||||
mst_file_bss,
|
||||
SECT_OFF_BSS (objfile),
|
||||
NULL,
|
||||
objfile);
|
||||
class = LOC_STATIC;
|
||||
break;
|
||||
|
|
|
@ -892,7 +892,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address,
|
|||
}
|
||||
|
||||
prim_record_minimal_symbol_and_info (name, address, ms_type,
|
||||
section, NULL, objfile);
|
||||
section, objfile);
|
||||
}
|
||||
|
||||
/* See minsyms.h. */
|
||||
|
@ -902,7 +902,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
|
|||
CORE_ADDR address,
|
||||
enum minimal_symbol_type ms_type,
|
||||
int section,
|
||||
asection *bfd_section,
|
||||
struct objfile *objfile)
|
||||
{
|
||||
struct obj_section *obj_section;
|
||||
|
@ -945,17 +944,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
|
|||
SYMBOL_SECTION (msymbol) = section;
|
||||
SYMBOL_OBJ_SECTION (msymbol) = NULL;
|
||||
|
||||
/* Find obj_section corresponding to bfd_section. */
|
||||
if (bfd_section)
|
||||
ALL_OBJFILE_OSECTIONS (objfile, obj_section)
|
||||
{
|
||||
if (obj_section->the_bfd_section == bfd_section)
|
||||
{
|
||||
SYMBOL_OBJ_SECTION (msymbol) = obj_section;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MSYMBOL_TYPE (msymbol) = ms_type;
|
||||
MSYMBOL_TARGET_FLAG_1 (msymbol) = 0;
|
||||
MSYMBOL_TARGET_FLAG_2 (msymbol) = 0;
|
||||
|
@ -980,12 +968,11 @@ struct minimal_symbol *
|
|||
prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
|
||||
enum minimal_symbol_type ms_type,
|
||||
int section,
|
||||
asection *bfd_section,
|
||||
struct objfile *objfile)
|
||||
{
|
||||
return prim_record_minimal_symbol_full (name, strlen (name), 1,
|
||||
address, ms_type, section,
|
||||
bfd_section, objfile);
|
||||
address, ms_type,
|
||||
section, objfile);
|
||||
}
|
||||
|
||||
/* Compare two minimal symbols by address and return a signed result based
|
||||
|
|
|
@ -88,7 +88,6 @@ struct cleanup *make_cleanup_discard_minimal_symbols (void);
|
|||
ADDRESS - the address of the symbol
|
||||
MS_TYPE - the type of the symbol
|
||||
SECTION - the symbol's section
|
||||
BFD_SECTION - the symbol's BFD section; used to find the
|
||||
appropriate obj_section for the minimal symbol. This can be NULL.
|
||||
OBJFILE - the objfile associated with the minimal symbol. */
|
||||
|
||||
|
@ -99,14 +98,12 @@ struct minimal_symbol *prim_record_minimal_symbol_full
|
|||
CORE_ADDR address,
|
||||
enum minimal_symbol_type ms_type,
|
||||
int section,
|
||||
asection *bfd_section,
|
||||
struct objfile *objfile);
|
||||
|
||||
/* Like prim_record_minimal_symbol_full, but:
|
||||
- uses strlen to compute NAME_LEN,
|
||||
- passes COPY_NAME = 0,
|
||||
- passes SECTION = 0,
|
||||
- and passes BFD_SECTION = NULL.
|
||||
- and passes a default SECTION, depending on the type
|
||||
|
||||
This variant does not return the new symbol. */
|
||||
|
||||
|
@ -123,7 +120,6 @@ struct minimal_symbol *prim_record_minimal_symbol_and_info
|
|||
CORE_ADDR,
|
||||
enum minimal_symbol_type,
|
||||
int section,
|
||||
asection *bfd_section,
|
||||
struct objfile *);
|
||||
|
||||
/* Install the minimal symbols that have been collected into the given
|
||||
|
|
|
@ -314,7 +314,6 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
|
|||
prim_record_minimal_symbol_and_info (symname, symbol_value, ms_type,
|
||||
gdb_bfd_section_index (objfile->obfd,
|
||||
section),
|
||||
section,
|
||||
objfile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -922,15 +922,12 @@ record_minimal_symbol (const char *name, CORE_ADDR address,
|
|||
int n_scnum,
|
||||
struct objfile *objfile)
|
||||
{
|
||||
int secnum;
|
||||
asection *bfd_sect;
|
||||
|
||||
if (name[0] == '.')
|
||||
++name;
|
||||
|
||||
xcoff_secnum_to_sections (n_scnum, objfile, &bfd_sect, &secnum);
|
||||
prim_record_minimal_symbol_and_info (name, address, ms_type,
|
||||
secnum, bfd_sect, objfile);
|
||||
secnum_to_section (n_scnum, objfile),
|
||||
objfile);
|
||||
}
|
||||
|
||||
/* xcoff has static blocks marked in `.bs', `.es' pairs. They cannot be
|
||||
|
@ -2346,7 +2343,6 @@ scan_xcoff_symtab (struct objfile *objfile)
|
|||
(namestring, symbol.n_value,
|
||||
sclass == C_HIDEXT ? mst_file_data : mst_data,
|
||||
secnum_to_section (symbol.n_scnum, objfile),
|
||||
secnum_to_bfd_section (symbol.n_scnum, objfile),
|
||||
objfile);
|
||||
break;
|
||||
|
||||
|
@ -2424,7 +2420,6 @@ scan_xcoff_symtab (struct objfile *objfile)
|
|||
(namestring, symbol.n_value,
|
||||
sclass == C_HIDEXT ? mst_file_data : mst_data,
|
||||
secnum_to_section (symbol.n_scnum, objfile),
|
||||
secnum_to_bfd_section (symbol.n_scnum, objfile),
|
||||
objfile);
|
||||
break;
|
||||
}
|
||||
|
@ -2442,7 +2437,6 @@ scan_xcoff_symtab (struct objfile *objfile)
|
|||
(namestring, symbol.n_value,
|
||||
sclass == C_HIDEXT ? mst_file_bss : mst_bss,
|
||||
secnum_to_section (symbol.n_scnum, objfile),
|
||||
secnum_to_bfd_section (symbol.n_scnum, objfile),
|
||||
objfile);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue