+ else if (sym->flags & BSF_LOCAL)
+ {
+ /* 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);
+ }
+ else if (STREQ ("Ddata.data", sym->name))
+ {
+ index = SECT_OFF_DATA (objfile);
+ }
+ else if (STREQ ("Drodata.rodata", sym->name))
+ {
+ index = SECT_OFF_RODATA (objfile);
+ }
+ if (index != SECT_OFF_MAX)
+ {
+ /* Found a special local symbol. Allocate a
+ sectinfo, if needed, and fill it in. */
+ if (sectinfo == NULL)
+ {
+ sectinfo = (struct stab_section_info *)
+ xmmalloc (objfile->md, sizeof (*sectinfo));
+ memset (sectinfo, 0,
+ sizeof (*sectinfo));
+ if (filesym == NULL)
+ {
+ complaint (&symfile_complaints,
+ "elf/stab section information %s without a preceding file symbol",
+ sym->name);
+ }
+ else
+ {
+ sectinfo->filename =
+ (char *) filesym->name;
+ }
+ }
+ if (index != -1)
+ {
+ if (sectinfo->sections[index] != 0)
+ {
+ complaint (&symfile_complaints,
+ "duplicated elf/stab section information for %s",
+ sectinfo->filename);
+ }
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+ "Section index uninitialized.");
+ /* Bfd symbols are section relative. */
+ symaddr = sym->value + sym->section->vma;
+ /* Relocate non-absolute symbols by the section offset. */
+ if (sym->section != &bfd_abs_section)
+ {
+ symaddr += offset;
+ }
+ if (index != -1)
+ sectinfo->sections[index] = symaddr;
+ else
+ internal_error (__FILE__, __LINE__,
+ "Section index uninitialized.");
+ /* The special local symbols don't go in the
+ minimal symbol table, so ignore this one. */
+ continue;
+ }
+ /* Not a special stabs-in-elf symbol, do regular
+ symbol processing. */
+ if (sym->section->flags & SEC_LOAD)
+ {
+ ms_type = mst_file_data;
+ }
+ else
+ {
+ ms_type = mst_file_bss;
+ }
+ }
+ else
+ {
+ ms_type = mst_unknown;
+ }
+ }
+ else
+ {
+ /* FIXME: Solaris2 shared libraries include lots of
+ odd "absolute" and "undefined" symbols, that play
+ hob with actions like finding what function the PC
+ is in. Ignore them if they aren't text, data, or bss. */
+ /* ms_type = mst_unknown; */
+ continue; /* Skip this symbol. */