<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120544>120544</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-objcopy doesn't support -O default
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
stsp
</td>
</tr>
</table>
<pre>
With GNU objcopy you can
convert binary files to the native
arch by using `-I binary -O default`.
But llvm-objcopy doesn't understand
`-O default`.
I tried the linker trick instead, which
is to do:
`ld -r -b binary -o data.o data.txt`
as suggested here:
https://stackoverflow.com/questions/5381254/whats-the-correct-way-to-determine-target-and-architecture-for-gnu-binutils
This works with ld.bfd, but is rejected
by ld.lld. So with llvm tools I've found
no way of achiving this simple task.
For compatibility with GNU objcopy it
would be very nice to support "-O default".
Also see this discussion:
https://github.com/rui314/mold/issues/162#issuecomment-2552723377
And this blog:
https://tratt.net/laurie/blog/2022/whats_the_most_portable_way_to_include_binary_blobs_in_an_executable.html
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8lM2y4yYQhZ8Gb7qkkpDkn4UWnqSUuptkkaSyVPHTlhgjcKCxRm-fQr43M0lNssIWcA59vgYRo5kcYs-6T6z78SASzT70keLjIL3e-j8MzfDTz7-Dl5-Vf2yw-QRKOFZdlXdPDATSOBE2uBmLEcgDzQhOkHkiq64iqBnkBikaNwE7VsXbx4biF9B4E8kSO1Ylq66fEoG1z6X48NIeo2P8RJCcxhBJOM2qa1b59943oGBQ7-bWuDuG_EHdwbhIKDTjP8A6GzWz6mr2Y2rPmutLzWooAhTy75N50IJE-T7Ql-ySi4kQ0zRhJNQwY8CXwkz0iPknHxgfIgl1908MN-vXUvmF8eHPhJGMd5HxoWvONe9axod1FhQLmrFQPgRUVKxiK8gXGgnDYhwWJMKEVAini5ykIVSUAhY3H4rJpUIal8jYmOuorr_NJsLqwz3CmrlZXcrbXrpMBCZCwM-oCHOIcsvT1uoSfvXvy-1zAfLeRnhj_PREuPm0J-48rGIDfwOhZvPMKCl7RbM8LAKJeM8QBh9A-eUhyEhjDW0v3W_bxxCrrqtPVoNEeGLYwBmFGUhMj4cPBIzzb_BynpWvNnqIiC9bbaJKMRrvvgdgMjQn-Z58SKapc9iLt5rxwcSYMGOoj5zxZv-r_LKgo4J3HT_xpjmdsqPTLzNp_fQ9GwqCqHRIjA9WpGCQ8WFfzAdecf4BeKQZx8VHGnN1QlocV7GN5EfjlE0ax1fXjdJ6GUfjRuFG_IIq7YvLmRZ70H2jL81FHLCvT017rHh9qg9zf1aotKz5-dh24lSj4s1R37DttNDduVYH0_OKtzWvL9WlO9Z1yVUjLy1K2VWyO6sbaytchLFlpl_6MB32TPqaV13bHqyQaOP-PHDucIV9lnGeX4vQ79dVpimytrImUvwqQ4Ys9v9xnz9YfwV9SMH2_wMyC70PxSP43Mf_wPk67rPnfwUAAP__2Gad-A">