mirror of https://github.com/Nonannet/copapy.git
get_op_after_last_call_in_function fixed
This commit is contained in:
parent
b6c6d6bbf6
commit
93097307f3
|
|
@ -73,10 +73,8 @@ def get_op_after_last_call_in_function(func: elf_symbol) -> int:
|
||||||
# Find last relocation in function
|
# Find last relocation in function
|
||||||
assert func.relocations, f'No call function in stencil function {func.name}.'
|
assert func.relocations, f'No call function in stencil function {func.name}.'
|
||||||
reloc = func.relocations[-1]
|
reloc = func.relocations[-1]
|
||||||
if reloc.bits < 32:
|
assert reloc.bits <= 32, "Relocation segment might be larger then 32 bit"
|
||||||
return reloc.fields['r_offset'] - func.fields['st_value'] - reloc.fields['r_addend'] + 4
|
return reloc.fields['r_offset'] - func.fields['st_value'] + 4
|
||||||
else:
|
|
||||||
return reloc.fields['r_offset'] - func.fields['st_value'] - reloc.fields['r_addend']
|
|
||||||
|
|
||||||
|
|
||||||
def symbol_is_stencil(sym: elf_symbol) -> bool:
|
def symbol_is_stencil(sym: elf_symbol) -> bool:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue