scripts: Improve gen_kobject_list.py variable address determination
The gen_kobject_list.py script looks at DWARF debug information in the elf file to determine the address of variables. Make sure that when looking at DW_FORM_exprloc, it looks at both DW_OP_addr and DW_OP_plus_uconst. Signed-off-by: Nick Goote <ngoote@gmail.com>
This commit is contained in:
parent
41676df683
commit
0b8714bcde
1 changed files with 6 additions and 0 deletions
|
@ -171,6 +171,7 @@ def debug_die(die, text):
|
|||
# -- ELF processing
|
||||
|
||||
DW_OP_addr = 0x3
|
||||
DW_OP_plus_uconst = 0x23
|
||||
DW_OP_fbreg = 0x91
|
||||
STACK_TYPE = "z_thread_stack_element"
|
||||
thread_counter = 0
|
||||
|
@ -622,6 +623,11 @@ def find_kobjects(elf, syms):
|
|||
addr = ((loc.value[1] << 0 ) | (loc.value[2] << 8) |
|
||||
(loc.value[3] << 16) | (loc.value[4] << 24))
|
||||
|
||||
# Handle a DW_FORM_exprloc that contains a DW_OP_addr, followed immediately by
|
||||
# a DW_OP_plus_uconst.
|
||||
if len(loc.value) >= 7 and loc.value[5] == DW_OP_plus_uconst:
|
||||
addr += (loc.value[6])
|
||||
|
||||
if addr == 0:
|
||||
# Never linked; gc-sections deleted it
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue