diff options
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index fc74813..5112e51 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -173,8 +173,31 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile) char *info; /* FIXME, is this really char *? */ struct objfile *objfile; { + int section; + + /* Guess the section from the type. This is likely to be wrong in + some cases. */ + switch (ms_type) + { + case mst_text: + case mst_file_text: + section = SECT_OFF_TEXT; + break; + case mst_data: + case mst_file_data: + section = SECT_OFF_DATA; + break; + case mst_bss: + case mst_file_bss: + section = SECT_OFF_BSS; + break; + default: + section = -1; + break; + } + name = obsavestring (name, strlen (name), &objfile -> symbol_obstack); - prim_record_minimal_symbol_and_info (name, address, ms_type, info, -1); + prim_record_minimal_symbol_and_info (name, address, ms_type, info, section); } /* |