File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class ELFImage {
86
86
unsigned offset () const { return m_section_header.sh_offset ; }
87
87
unsigned size () const { return m_section_header.sh_size ; }
88
88
unsigned entry_size () const { return m_section_header.sh_entsize ; }
89
- unsigned entry_count () const { return size () / entry_size (); }
89
+ unsigned entry_count () const { return ! entry_size () ? 0 : size () / entry_size (); }
90
90
dword address () const { return m_section_header.sh_addr ; }
91
91
const char * raw_data () const { return m_image.raw_data (m_section_header.sh_offset ); }
92
92
bool is_undefined () const { return m_section_index == SHN_UNDEF; }
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ class ELFLoader {
18
18
char * symbol_ptr (const char * name);
19
19
LinearAddress entry () const { return m_image.entry (); }
20
20
21
+ bool has_symbols () const { return m_image.symbol_count (); }
22
+
21
23
String symbolicate (dword address) const ;
22
24
23
25
private:
Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
115
115
if (!symbol.address )
116
116
break ;
117
117
if (!symbol.ksym ) {
118
- if (current->process ().elf_loader ()) {
118
+ if (current->process ().elf_loader () && current-> process (). elf_loader ()-> has_symbols () ) {
119
119
dbgprintf (" %p %s\n " , symbol.address , current->process ().elf_loader ()->symbolicate (symbol.address ).characters ());
120
120
} else {
121
- dbgprintf (" %p (no ELF loader for process)\n " , symbol.address );
121
+ dbgprintf (" %p (no ELF symbols for process)\n " , symbol.address );
122
122
}
123
123
continue ;
124
124
}
You can’t perform that action at this time.
0 commit comments