This commit is contained in:
Nicolas Kruse 2025-10-12 23:22:52 +02:00
parent bfbe2a290a
commit c4ca95bd61
1 changed files with 3 additions and 1 deletions

View File

@ -163,10 +163,12 @@ class stencil_database():
"""Returns machine code for a specified function name""" """Returns machine code for a specified function name"""
func = self.elf.symbols[name] func = self.elf.symbols[name]
assert func.info == 'STT_FUNC', f"{name} is not a function" assert func.info == 'STT_FUNC', f"{name} is not a function"
index = get_last_call_in_function(func)
if part == 'start': if part == 'start':
index = get_last_call_in_function(func)
return func.data[:index] return func.data[:index]
elif part == 'end': elif part == 'end':
index = get_last_call_in_function(func)
return func.data[index + LENGTH_CALL_INSTRUCTION:] return func.data[index + LENGTH_CALL_INSTRUCTION:]
else: else:
return func.data return func.data