Skip to content

Commit

Permalink
[Contrib] Fix error message at callback_get_section_size() (#4221)
Browse files Browse the repository at this point in the history
* [Contrib] Fix error message at callback_get_section_size()

* Trigger notification
  • Loading branch information
cchung100m authored and tqchen committed Nov 6, 2019
1 parent 1eca1ad commit ddaa953
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit ddaa953

Please sign in to comment.