projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
[deliverable/binutils-gdb.git]
/
gdb
/
elfread.c
diff --git
a/gdb/elfread.c
b/gdb/elfread.c
index 7aee37cc5db37685ce7c0f5e5607d8d692a3976b..cecae4205b841b6d3477e498eb1d827d60da8074 100644
(file)
--- a/
gdb/elfread.c
+++ b/
gdb/elfread.c
@@
-372,34
+372,47
@@
elf_symtab_read (struct objfile *objfile, int dynamic)
}
else if (sym->flags & BSF_LOCAL)
{
}
else if (sym->flags & BSF_LOCAL)
{
+ int special_local_sym_p = 0;
/* Named Local variable in a Data section. Check its
name for stabs-in-elf. The STREQ macro checks the
first character inline, so we only actually do a
strcmp function call on names that start with 'B'
or 'D' */
/* Named Local variable in a Data section. Check its
name for stabs-in-elf. The STREQ macro checks the
first character inline, so we only actually do a
strcmp function call on names that start with 'B'
or 'D' */
- index = SECT_OFF_MAX;
if (STREQ ("Bbss.bss", sym->name))
{
index = SECT_OFF_BSS (objfile);
if (STREQ ("Bbss.bss", sym->name))
{
index = SECT_OFF_BSS (objfile);
+ special_local_sym_p = 1;
}
else if (STREQ ("Ddata.data", sym->name))
{
index = SECT_OFF_DATA (objfile);
}
else if (STREQ ("Ddata.data", sym->name))
{
index = SECT_OFF_DATA (objfile);
+ special_local_sym_p = 1;
}
else if (STREQ ("Drodata.rodata", sym->name))
{
index = SECT_OFF_RODATA (objfile);
}
else if (STREQ ("Drodata.rodata", sym->name))
{
index = SECT_OFF_RODATA (objfile);
+ special_local_sym_p = 1;
}
}
- if (
index != SECT_OFF_MAX
)
+ if (
special_local_sym_p
)
{
/* Found a special local symbol. Allocate a
sectinfo, if needed, and fill it in. */
if (sectinfo == NULL)
{
{
/* Found a special local symbol. Allocate a
sectinfo, if needed, and fill it in. */
if (sectinfo == NULL)
{
+ int max_index;
+ size_t size;
+
+ max_index
+ = max (SECT_OFF_BSS (objfile),
+ max (SECT_OFF_DATA (objfile),
+ SECT_OFF_RODATA (objfile)));
+ size = (sizeof (struct stab_section_info)
+ + (sizeof (CORE_ADDR)
+ * (max_index - 1)));
sectinfo = (struct stab_section_info *)
sectinfo = (struct stab_section_info *)
- xmmalloc (objfile->md, size
of (*sectinfo)
);
- memset (sectinfo, 0,
-
sizeof (*sectinfo))
;
+ xmmalloc (objfile->md, size);
+ memset (sectinfo, 0,
size);
+
sectinfo->num_sections = max_index
;
if (filesym == NULL)
{
complaint (&symfile_complaints,
if (filesym == NULL)
{
complaint (&symfile_complaints,
@@
-740,8
+753,9
@@
elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
/* Found it! Allocate a new psymtab struct, and fill it in. */
maybe->found++;
pst->section_offsets = (struct section_offsets *)
/* Found it! Allocate a new psymtab struct, and fill it in. */
maybe->found++;
pst->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
- for (i = 0; i < SECT_OFF_MAX; i++)
+ obstack_alloc (&objfile->psymbol_obstack,
+ SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
+ for (i = 0; i < maybe->num_sections; i++)
(pst->section_offsets)->offsets[i] = maybe->sections[i];
return;
}
(pst->section_offsets)->offsets[i] = maybe->sections[i];
return;
}
This page took
0.02441 seconds
and
4
git commands to generate.