Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Contrib] Fix error message at callback_get_section_size() #4221

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/tvm/contrib/binutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .._ffi.base import py_str
from ..api import register_func


@register_func("tvm_callback_get_section_size")
def tvm_callback_get_section_size(binary_path, section_name, toolchain_prefix):
"""Finds size of the section in the binary.
Expand Down Expand Up @@ -53,7 +54,7 @@ def tvm_callback_get_section_size(binary_path, section_name, toolchain_prefix):
size_output = size_output.decode("utf-8")
if size_proc.returncode != 0:
msg = "error in finding section size:\n"
msg += py_str(out)
msg += py_str(size_output)
raise RuntimeError(msg)

# TODO(weberlo): Refactor this method and `*relocate_binary` so they are
Expand Down Expand Up @@ -93,6 +94,7 @@ def tvm_callback_get_section_size(binary_path, section_name, toolchain_prefix):
return section_size + 32
return section_size


@register_func("tvm_callback_relocate_binary")
def tvm_callback_relocate_binary(
binary_path, text_addr, rodata_addr, data_addr, bss_addr, toolchain_prefix):
Expand Down