summaryrefslogtreecommitdiff
path: root/xmake/core/base/binutils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-07-18 23:17:40 +0800
committerGitHub <[email protected]>2026-07-18 23:17:40 +0800
commit64439096a06b65556fff59f3b0b4e6a439b44129 (patch)
tree7d2efb39c42d227dd32723ca5e02ba95f86cfda4 /xmake/core/base/binutils.lua
parent108eaa6d115e03f44bd1f105328dbe90a7747b30 (diff)
parentcfebf2a690e1a0ad2255f64eec5bec43eeac0049 (diff)
Merge pull request #7655 from xmake-io/binutilsmaster
fix bin2obj for some archs
Diffstat (limited to 'xmake/core/base/binutils.lua')
-rw-r--r--xmake/core/base/binutils.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/core/base/binutils.lua b/xmake/core/base/binutils.lua
index 7adfe6efa..400d48332 100644
--- a/xmake/core/base/binutils.lua
+++ b/xmake/core/base/binutils.lua
@@ -64,6 +64,8 @@ end
-- - target_minver: the target minimum version (only for macho)
-- - xcode_sdkver: the Xcode SDK version (only for macho)
-- - zeroend: append null terminator (default: false)
+-- - refobj: a reference elf object whose class/endianness/machine/e_flags
+-- are mirrored into the output (default: derived from arch)
function binutils.bin2obj(binaryfile, outputfile, opt)
opt = opt or {}
local format = opt.format
@@ -94,7 +96,7 @@ function binutils.bin2obj(binaryfile, outputfile, opt)
if not binutils._bin2elf then
return nil, "binutils._bin2elf not available (C implementation not compiled)"
end
- return binutils._bin2elf(binaryfile, outputfile, opt.symbol_prefix or "_binary_", opt.arch or "x86_64", opt.basename, opt.zeroend or false)
+ return binutils._bin2elf(binaryfile, outputfile, opt.symbol_prefix or "_binary_", opt.arch or "x86_64", opt.basename, opt.zeroend or false, opt.refobj)
else
return nil, string.format("unsupported format '%s' (supported: coff, elf, macho)", format)
end