- oso_el el;
-
- el.name = oso_sym->name;
- el.mtime = oso_sym->value;
- el.num_sections = nbr_sections;
- el.symbols = symbols;
- el.offsets = offsets;
- VEC_safe_push (oso_el, oso_vector, &el);
+ if (sym->name == NULL || *sym->name == '\0')
+ {
+ /* Skip names that don't exist (shouldn't happen), or names
+ that are null strings (may happen). */
+ return;
+ }
+
+ if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
+ {
+ CORE_ADDR symaddr;
+ enum minimal_symbol_type ms_type;
+
+ /* Bfd symbols are section relative. */
+ symaddr = sym->value + sym->section->vma;
+
+ if (sym->section == bfd_abs_section_ptr)
+ ms_type = mst_abs;
+ else if (sym->section->flags & SEC_CODE)
+ {
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ ms_type = mst_text;
+ else
+ ms_type = mst_file_text;
+ }
+ else if (sym->section->flags & SEC_ALLOC)
+ {
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ {
+ if (sym->section->flags & SEC_LOAD)
+ ms_type = mst_data;
+ else
+ ms_type = mst_bss;
+ }
+ else if (sym->flags & BSF_LOCAL)
+ {
+ /* 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
+ return; /* Skip this symbol. */
+
+ reader.record_with_info (sym->name, symaddr, ms_type,
+ gdb_bfd_section_index (objfile->obfd,
+ sym->section));
+ }