<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>> **Action**: James Henderson to provide results of feature comparison versus GNU objcopy.</div><div><br></div><div>A couple of weeks ago, I did an analysis of the GNU objcopy command-line switches versus the llvm-objcopy ones. I did not go into depth to compare behaviour of the individual switches - I only verified that such switches exist. Following are my results. It's worth noting that a number of missing features are for file formats that llvm-objcopy does not currently support (especially COFF).<br></div><div><br></div><div><span style="font-family:monospace,monospace">GNU feature/option | llvm-objcopy feature/ |
<span style="font-family:monospace,monospace"> Notes</span>
</span></div><div><span style="font-family:monospace,monospace"> | option |<br></span></div><div><span style="font-family:monospace,monospace">===========================+============================+===<span style="font-family:monospace,monospace">======<span style="font-family:monospace,monospace">=============</span></span><br>objcopy <filename> | <span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">llvm-objcopy <filename> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">
<span style="font-family:monospace,monospace">objcopy <infile> <outfile> </span>|
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">llvm-objcopy |<br></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> |
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> <infile></span></span></span> <outfile></span></span> |</span></div><div><span style="font-family:monospace,monospace">-I/--input-target | -I--input-target | "binary" only</span></div><div><span style="font-family:monospace,monospace">-O/--output-target | -O/--output-target | "binary"/ELF only</span></div><div><span style="font-family:monospace,monospace">-B/--binary-architecture | -B/--binary-architecture |</span></div><div><span style="font-family:monospace,monospace">-F/--target | -F/--target | <br></span></div><div><span style="font-family:monospace,monospace">--debugging | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-p/--preserve-dates | -p/--preserve-dates |</span></div><div><span style="font-family:monospace,monospace">-j/--only-section | -j/--only-section |</span></div><div><span style="font-family:monospace,monospace">--add-gnu-debuglink | --add-gnu-debuglink |</span></div><div><span style="font-family:monospace,monospace">-R/--remove-section | -R/--remove-section
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>|</span></div><div><span style="font-family:monospace,monospace">-S/--strip-all | -S/--strip-all
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
| --strip-all-gnu is</span></div><div><span style="font-family:monospace,monospace"> | | closer to GNU objcopy</span></div><div><span style="font-family:monospace,monospace">-g/--strip-debug | --strip-debug
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
| <span style="font-family:monospace,monospace">'-g'</span>
not supported<br></span></div><div><span style="font-family:monospace,monospace">--strip-unneeded | --strip-unneeded
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-N/--strip-symbol | -N/--strip-symbol
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>|</span></div><div><span style="font-family:monospace,monospace">--strip-unneeded-symbol | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">--only-keep-debug | --only-keep-debug
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>|</span></div><div><span style="font-family:monospace,monospace">--extract-symbol | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-K/--keep-symbol | -K/--keep-symbol |</span></div><div><span style="font-family:monospace,monospace">--keep-file-symbols | --keep-file-symbols |</span></div><div><span style="font-family:monospace,monospace">--localize-hidden | --localize-hidden |</span></div><div><span style="font-family:monospace,monospace">-L/--localize-symbol | -L/--localize-symbol |</span></div><div><span style="font-family:monospace,monospace">--globalize-symbol | --globalize-symbol |</span></div><div><span style="font-family:monospace,monospace">-G/--keep-global-symbol | -G/--keep-global-symbol |</span></div><div><span style="font-family:monospace,monospace">-W/--weaken-symbol | -W/--weaken-symbol |<br></span></div><div><span style="font-family:monospace,monospace">--weaken | --weaken
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-w/--wildcard | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-x/--discard-all | -x/--discard-all
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-X/--discard-locals | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></div><div><span style="font-family:monospace,monospace">-i/--interleave | <span style="font-family:monospace,monospace">*None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
| </span>
</span></div><div><span style="font-family:monospace,monospace">
<span style="font-family:monospace,monospace">--interleave-width | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">-b/--byte | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--gap-fill | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--pad-to | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--set-start | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-start |
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">*None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
</span></span>|<br></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--adjust-start | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-addresses |
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span>
</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--adjust-vma |
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-section-address | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--adjust-section-vma | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|<br></span></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-section-lma | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-section-vma | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--[no-]change-warnings | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--[no-]adjust-warnings | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--set-section-flags | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
| Use --rename-section<br></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--add-section | --add-section
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--rename-section | --rename-section
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--long-section-names | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
| COFF only</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--change-leading-char | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--remove-leading-char | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--reverse-bytes | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--redefine-sym | --redefine-sym
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--redefine-syms | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--srec-len | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--srec-forceS3 | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--strip-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--strip-unneeded-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--keep-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--localize-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--globalize-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--keep-global-symbols | --keep-global-symbols |</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--weaken-symbols | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--alt-machine-code | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--writable-text | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--readonly-text | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--pure | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--impure | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--prefix-symbols | --prefix-symbols
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--prefix-sections | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--prefix-alloc-sections | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--file-alignment | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--heap | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--image-base | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--section-alignment | *None available*
<span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> </span></span>
|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--stack | *None available* |</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--subsystem | *None available* |<br></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--compress-debug-sections | --compress-debug-sections |</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--decompress-debug-sections| --decompress-debug-sections|</span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--verbose | *None available* |<br></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">objcopy @<file> | *None available* |<br></span>
</span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><br><div class="gmail_quote"><div dir="ltr">On Mon, 22 Oct 2018 at 11:00, James Henderson <<a href="mailto:jh7370.2008@my.bristol.ac.uk">jh7370.2008@my.bristol.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Thursday of the recent developers meeting, we had a round-table<br>
discussing llvm-objcopy. Below are some notes I took from that<br>
meeting. The discussion was fairly free-flowing, so the notes are not<br>
particularly in depth. If anybody has any other comments relating to<br>
this meeting, feel free to add to this!<br>
<br>
Feature request: converting from 32-bit ELF to 64-bit ELF:<br>
-- Size in sections broken, needs updating to not just be a public<br>
member variable.<br>
<br>
Making llvm-objcopy into a library:<br>
-- Errors need to be non-fatal (return llvm::Error).<br>
-- Would be nice to provide this as a writable portion of libObject.<br>
<br>
**Action**: James Henderson to provide results of feature comparison<br>
versus GNU objcopy.<br>
<br>
Multiple file formats:<br>
-- Don't try to use a common intermediate representation for all<br>
object file formats!<br>
-- Separate backends for different file formats.<br>
---- Would like to avoid people "forgetting" to implement some<br>
switches when implementing a new backend, leading to silent ignoring<br>
of switches (maybe use subclasses etc).<br>
---- Shouldn't need to implement each option, beyond an "unsupported"<br>
message or similar.<br>
<br>
Output should be stable:<br>
-- Currently not the case for section header table (is deterministic,<br>
but might be unnecessarily different to input).<br>
-- No need to go to heroic efforts, if not realistic, or a better<br>
alternative is possible.<br>
<br>
Discussion on being able to modify the program header table:<br>
-- Jake reluctant to.<br>
-- But if real use case presents itself, should be okay.<br>
-- Some requirements to add segments post-link.<br>
-- Embedded use-cases may well break the immutable program header<br>
table requirement.<br>
<br>
File bugs upstream for visibility:<br>
-- **Action**: Jake Ehrlich to request himself, James Henderson,<br>
Jordan Rupprecht, and Alexander Shaposhnikov (four current main<br>
upstream developers/reviewers of llvm-objcopy) added as default-CC for<br>
llvm-objcopy bugs.<br>
<br>
Compatibility with GNU objcopy is a top concern:<br>
-- Where diverged, believed that GNU behaviour doesn't make sense, but<br>
open to alternative.<br>
-- File bugs/propose changes if issues encountered.<br>
<br>
Regards,<br>
<br>
James<br>
</blockquote></div>