diff options
author | Fred Fish <fnf@specifix.com> | 1993-08-07 20:27:19 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1993-08-07 20:27:19 +0000 |
commit | 379dd9658225106674625254fa36004958819b47 (patch) | |
tree | 178285bd482d4acab9a3746823a10590b79e177e /gdb/elfread.c | |
parent | d8ab5dbf8242fb349183f9bf7ec7bf55f0a26587 (diff) | |
download | gdb-379dd9658225106674625254fa36004958819b47.zip gdb-379dd9658225106674625254fa36004958819b47.tar.gz gdb-379dd9658225106674625254fa36004958819b47.tar.bz2 |
* elfread.c (elf_symtab_read): Properly sort out the bss symbols
from the data symbols and give them the correct minimal_symbol_type.
Add file static symbols to the minimal symbol table, not just
global symbols. Ignore symbols that are section names and file names.
* dwarfread.c (add_partial_symbol): Add comment about limitations
of DWARF symbols for distinquishing data from bss when adding
minimal symbols. Add file local symbols to minimal symbols.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index fbe9bc5..af625fe 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -235,10 +235,17 @@ elf_symtab_read (abfd, addr, objfile) for (i = 0; i < number_of_symbols; i++) { sym = symbol_table[i]; - /* Select global/weak symbols that are defined in a specific section. - Note that bfd now puts abs symbols in their own section, so - all symbols we are interested in will have a section. */ - if ((sym -> flags & (BSF_GLOBAL | BSF_WEAK)) + /* Bfd flags ELF symbol table STT_SECTION and STT_FILE symbols with + BSF_DEBUGGING. We don't want these in the minimal symbols, so + skip over them. */ + if (sym -> flags & BSF_DEBUGGING) + { + continue; + } + /* Select global/local/weak symbols that are defined in a specific + section. Note that bfd puts abs symbols in their own section, + so all symbols we are interested in will have a section. */ + if ((sym -> flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK)) && (sym -> section != NULL)) { /* Bfd symbols are section relative. */ @@ -252,18 +259,46 @@ elf_symtab_read (abfd, addr, objfile) no way of figuring this out for absolute symbols. */ if (sym -> section -> flags & SEC_CODE) { - ms_type = mst_text; + if (sym -> flags & BSF_GLOBAL) + { + ms_type = mst_text; + } + else + { + ms_type = mst_file_text; + } } else if (sym -> section -> flags & SEC_DATA) { - ms_type = mst_data; + if (sym -> flags & BSF_GLOBAL) + { + if (sym -> section -> flags & SEC_HAS_CONTENTS) + { + ms_type = mst_data; + } + else + { + ms_type = mst_bss; + } + } + else + { + if (sym -> section -> flags & SEC_HAS_CONTENTS) + { + ms_type = mst_file_data; + } + else + { + ms_type = mst_file_bss; + } + } } 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 or data. */ + is in. Ignore them if they aren't text, data, or bss. */ /* ms_type = mst_unknown; */ continue; /* Skip this symbol. */ } |