Skip to content

Commit b28b75b

Browse files
committed
CHB:ELF:always create data blocks for symbols
1 parent 8ff1c07 commit b28b75b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

CodeHawk/CHB/bchlibelf/bCHELFSymbolTable.ml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Copyright (c) 2005-2020 Kestrel Technology LLC
88
Copyright (c) 2020 Henny Sipma
9-
Copyright (c) 2021-2024 Aarno Labs LLC
9+
Copyright (c) 2021-2025 Aarno Labs LLC
1010
1111
Permission is hereby granted, free of charge, to any person obtaining a copy
1212
of this software and associated documentation files (the "Software"), to deal
@@ -285,11 +285,18 @@ object
285285
~tag:"disassembly"
286286
"elf_symbol_table#set_mapping_symbols make_db")
287287
(fun db ->
288+
let p_dbsize =
289+
TR.tfold
290+
~ok:string_of_int
291+
~error:(fun e -> "[Error: " ^ (String.concat "; " e) ^ "]")
292+
(addr#subtract_to_int addr_d) in
288293
begin
289-
(if collect_diagnostics () then
290-
ch_diagnostics_log#add
291-
"data block from symbol table"
292-
(LBLOCK [addr_d#toPretty; STR " - "; addr#toPretty]));
294+
(log_diagnostics_result
295+
~tag:"set mapping symbols:data block from symbol table"
296+
__FILE__ __LINE__
297+
["start: " ^ addr_d#to_hex_string
298+
^ "; end: " ^ addr#to_hex_string
299+
^ "; size: " ^ p_dbsize]);
293300
system_info#add_data_block db;
294301
indata := None
295302
end)
@@ -324,7 +331,9 @@ object
324331
end);
325332
make_db addr
326333
end
327-
| _ -> ()) symbols
334+
| _ ->
335+
let addr = TR.tget_ok (index_to_doubleword addrix) in
336+
make_db addr) symbols
328337

329338
method get_symbol (index:int) =
330339
if H.mem entries index then

0 commit comments

Comments
 (0)