Skip to content

Commit 9ca0d5e

Browse files
wentongwunashif
authored andcommitted
scripts: elf_helper.py: add analyze for DW_TAG_typedef
add analyze for DW_TAG_typedef in order to catch all the kernel objects. Fixes: #16760. Signed-off-by: Wentong Wu <[email protected]>
1 parent c18ff87 commit 9ca0d5e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/elf_helper.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ def analyze_die_array(die):
336336
type_env[die.offset] = ArrayType(die.offset, elements, type_offset)
337337

338338

339+
def analyze_typedef(die):
340+
type_offset = die_get_type_offset(die)
341+
342+
if type_offset not in type_env.keys():
343+
return
344+
345+
type_env[die.offset] = type_env[type_offset]
346+
347+
339348
def addr_deref(elf, addr):
340349
for section in elf.iter_sections():
341350
start = section['sh_addr']
@@ -404,6 +413,8 @@ def find_kobjects(self, syms):
404413
analyze_die_const(die)
405414
elif die.tag == "DW_TAG_array_type":
406415
analyze_die_array(die)
416+
elif die.tag == "DW_TAG_typedef":
417+
analyze_typedef(die)
407418
elif die.tag == "DW_TAG_variable":
408419
variables.append(die)
409420

0 commit comments

Comments
 (0)