diff options
| author | Zichuan Li <34680029+river-li@users.noreply.github.com> | 2024-06-12 13:19:57 -0400 |
|---|---|---|
| committer | Zichuan Li <34680029+river-li@users.noreply.github.com> | 2024-06-19 13:06:04 -0400 |
| commit | aa9c28e91b5c2ef6ab0e2aff7e44f8a16de998f7 (patch) | |
| tree | 9c2c52940f227a9b1640d09119615d0365f3d906 /arch/riscv | |
| parent | 89060ca7644244b3fba94bf746db588e707e7c8d (diff) | |
Add data_variable_at_address and fixed the type propagation issue in riscv
Diffstat (limited to 'arch/riscv')
| -rw-r--r-- | arch/riscv/src/lib.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/riscv/src/lib.rs b/arch/riscv/src/lib.rs index e619df2a..725177ca 100644 --- a/arch/riscv/src/lib.rs +++ b/arch/riscv/src/lib.rs @@ -2865,9 +2865,17 @@ impl FunctionRecognizer for RiscVELFPLTRecognizer { let func_sym = Symbol::imported_function_from_import_address_symbol(sym.as_ref(), func.start()); + bv.define_auto_symbol(func_sym.as_ref()); - func.apply_imported_types(func_sym.as_ref(), None); - true + for ext_sym in &bv.symbols_by_name(func_sym.raw_name()) { + if ext_sym.sym_type() == SymbolType::External { + if let Some(var) = bv.data_variable_at_address(ext_sym.address()) { + func.apply_imported_types(func_sym.as_ref(), Some(var.t())); + return true; + } + } + } + false } } |
