summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-06 23:39:08 +0800
committerruki <[email protected]>2025-12-07 17:15:58 +0800
commit6902ff1501858cda51b4a1bf46eb76ffd4022b54 (patch)
treeb73ede6b240fb00144f7051289c1e9a71c225082
parent435a3017657b15c08673e1fe239b7f958321e073 (diff)
fix return value
-rw-r--r--core/src/xmake/utils/bin2coff.c8
-rw-r--r--xmake/modules/private/utils/bin2coff.lua5
2 files changed, 5 insertions, 8 deletions
diff --git a/core/src/xmake/utils/bin2coff.c b/core/src/xmake/utils/bin2coff.c
index 97d7a6722..6c6b3c636 100644
--- a/core/src/xmake/utils/bin2coff.c
+++ b/core/src/xmake/utils/bin2coff.c
@@ -155,26 +155,26 @@ static tb_bool_t xm_utils_bin2coff_dump(tb_stream_ref_t istream,
tb_char_t symbol_start[256] = {0};
tb_char_t symbol_end[256] = {0};
tb_char_t symbol_size[256] = {0};
-
+
// use basename or default to "data"
if (!basename || !basename[0]) {
basename = "data";
}
-
+
// build symbol name
if (symbol_prefix) {
tb_snprintf(symbol_name, sizeof(symbol_name), "%s%s", symbol_prefix, basename);
} else {
tb_snprintf(symbol_name, sizeof(symbol_name), "_binary_%s", basename);
}
-
+
// replace non-alphanumeric with underscore
for (tb_size_t i = 0; symbol_name[i]; i++) {
if (!tb_isalpha(symbol_name[i]) && !tb_isdigit(symbol_name[i]) && symbol_name[i] != '_') {
symbol_name[i] = '_';
}
}
-
+
tb_snprintf(symbol_start, sizeof(symbol_start), "%s_start", symbol_name);
tb_snprintf(symbol_end, sizeof(symbol_end), "%s_end", symbol_name);
tb_snprintf(symbol_size, sizeof(symbol_size), "%s_size", symbol_name);
diff --git a/xmake/modules/private/utils/bin2coff.lua b/xmake/modules/private/utils/bin2coff.lua
index e64162b03..305a1da65 100644
--- a/xmake/modules/private/utils/bin2coff.lua
+++ b/xmake/modules/private/utils/bin2coff.lua
@@ -52,10 +52,7 @@ function _do_bin2coff(binarypath, outputpath, opt)
-- do dump
if utils.bin2coff then
- local ok, err = utils.bin2coff(binarypath, outputpath, symbol_prefix, arch, basename)
- if not ok then
- raise(err or "bin2coff: conversion failed")
- end
+ utils.bin2coff(binarypath, outputpath, symbol_prefix, arch, basename)
else
raise("bin2coff: utils.bin2coff not available (C implementation not compiled)")
end