Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: runtime/tools/bin_to_assembly.py

Issue 2939013002: Fix runtime/tools/bin_to_assembly.py not setting symbol type and size. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tools/bin_to_assembly.py
diff --git a/runtime/tools/bin_to_assembly.py b/runtime/tools/bin_to_assembly.py
index 18ade139c59205d363d6925134842c39c6d6a845..941a050f28cac09993d7fc426d4a7079d74c101b 100755
--- a/runtime/tools/bin_to_assembly.py
+++ b/runtime/tools/bin_to_assembly.py
@@ -57,14 +57,6 @@ def Main():
output_file.write(".global _%s\n" % options.symbol_name)
output_file.write(".balign 32\n")
output_file.write("_%s:\n" % options.symbol_name)
- elif options.target_os in ["linux", "android", "fuchsia"]:
- if options.executable:
- output_file.write(".text\n")
- else:
- output_file.write(".section .rodata\n")
- output_file.write(".global %s\n" % options.symbol_name)
- output_file.write(".balign 32\n")
- output_file.write("%s:\n" % options.symbol_name)
elif options.target_os in ["win"]:
output_file.write("ifndef _ML64_X64\n")
output_file.write(".model flat, C\n")
@@ -76,8 +68,15 @@ def Main():
output_file.write("public %s\n" % options.symbol_name)
output_file.write("%s label byte\n" % options.symbol_name)
else:
- sys.stderr.write("Unknown target_os: %s" % options.target_os)
- return -1
+ if options.executable:
+ output_file.write(".text\n")
+ output_file.write(".type %s STT_FUNC\n" % options.symbol_name)
+ else:
+ output_file.write(".section .rodata\n")
+ output_file.write(".type %s STT_OBJECT\n" % options.symbol_name)
+ output_file.write(".global %s\n" % options.symbol_name)
+ output_file.write(".balign 32\n")
+ output_file.write("%s:\n" % options.symbol_name)
with open(options.input, "rb") as input_file:
if options.target_os in ["win"]:
@@ -88,6 +87,9 @@ def Main():
for byte in input_file.read():
output_file.write(".byte %d\n" % ord(byte))
+ if options.target_os not in ["mac", "ios", "win"]:
+ output_file.write(".size {0}, .-{0}\n".format(options.symbol_name))
+
return 0
if __name__ == "__main__":
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698