[llvm-dev] llvm-objcopy round-table summary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] llvm-objcopy round-table summary

韩玉 via llvm-dev
Hi,

On Thursday of the recent developers meeting, we had a round-table
discussing llvm-objcopy. Below are some notes I took from that
meeting. The discussion was fairly free-flowing, so the notes are not
particularly in depth. If anybody has any other comments relating to
this meeting, feel free to add to this!

Feature request: converting from 32-bit ELF to 64-bit ELF:
-- Size in sections broken, needs updating to not just be a public
member variable.

Making llvm-objcopy into a library:
-- Errors need to be non-fatal (return llvm::Error).
-- Would be nice to provide this as a writable portion of libObject.

**Action**: James Henderson to provide results of feature comparison
versus GNU objcopy.

Multiple file formats:
-- Don't try to use a common intermediate representation for all
object file formats!
-- Separate backends for different file formats.
---- Would like to avoid people "forgetting" to implement some
switches when implementing a new backend, leading to silent ignoring
of switches (maybe use subclasses etc).
---- Shouldn't need to implement each option, beyond an "unsupported"
message or similar.

Output should be stable:
-- Currently not the case for section header table (is deterministic,
but might be unnecessarily different to input).
-- No need to go to heroic efforts, if not realistic, or a better
alternative is possible.

Discussion on being able to modify the program header table:
-- Jake reluctant to.
-- But if real use case presents itself, should be okay.
-- Some requirements to add segments post-link.
-- Embedded use-cases may well break the immutable program header
table requirement.

File bugs upstream for visibility:
-- **Action**: Jake Ehrlich to request himself, James Henderson,
Jordan Rupprecht, and Alexander Shaposhnikov (four current main
upstream developers/reviewers of llvm-objcopy) added as default-CC for
llvm-objcopy bugs.

Compatibility with GNU objcopy is a top concern:
-- Where diverged, believed that GNU behaviour doesn't make sense, but
open to alternative.
-- File bugs/propose changes if issues encountered.

Regards,

James
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] llvm-objcopy round-table summary

韩玉 via llvm-dev
> **Action**: James Henderson to provide results of feature comparison versus GNU objcopy.

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).

GNU feature/option         | llvm-objcopy feature/      | Notes
                           | option                     |
===========================+============================+======================
objcopy <filename>         | llvm-objcopy <filename>    |
objcopy <infile> <outfile> | llvm-objcopy               |
                           |   <infile> <outfile>       |
-I/--input-target          | -I--input-target           | "binary" only
-O/--output-target         | -O/--output-target         | "binary"/ELF only
-B/--binary-architecture   | -B/--binary-architecture   |
-F/--target                | -F/--target                |
--debugging                | *None available*           |
-p/--preserve-dates        | -p/--preserve-dates        |
-j/--only-section          | -j/--only-section          |
--add-gnu-debuglink        | --add-gnu-debuglink        |
-R/--remove-section        | -R/--remove-section        |
-S/--strip-all             | -S/--strip-all             | --strip-all-gnu is
                           |                            | closer to GNU objcopy
-g/--strip-debug           | --strip-debug              | '-g' not supported
--strip-unneeded           | --strip-unneeded           |
-N/--strip-symbol          | -N/--strip-symbol          |
--strip-unneeded-symbol    | *None available*           |
--only-keep-debug          | --only-keep-debug          |
--extract-symbol           | *None available*           |
-K/--keep-symbol           | -K/--keep-symbol           |
--keep-file-symbols        | --keep-file-symbols        |
--localize-hidden          | --localize-hidden          |
-L/--localize-symbol       | -L/--localize-symbol       |
--globalize-symbol         | --globalize-symbol         |
-G/--keep-global-symbol    | -G/--keep-global-symbol    |
-W/--weaken-symbol         | -W/--weaken-symbol         |
--weaken                   | --weaken                   |
-w/--wildcard              | *None available*           |
-x/--discard-all           | -x/--discard-all           |
-X/--discard-locals        | *None available*           |
-i/--interleave            | *None available*           |
--interleave-width         | *None available*           |
-b/--byte                  | *None available*           |
--gap-fill                 | *None available*           |
--pad-to                   | *None available*           |
--set-start                | *None available*           |
--change-start             | *None available*           |
--adjust-start             | *None available*           |
--change-addresses         | *None available*           |
--adjust-vma               | *None available*           |
--change-section-address   | *None available*           |
--adjust-section-vma       | *None available*           |
--change-section-lma       | *None available*           |
--change-section-vma       | *None available*           |
--[no-]change-warnings     | *None available*           |
--[no-]adjust-warnings     | *None available*           |
--set-section-flags        | *None available*           | Use --rename-section
--add-section              | --add-section              |
--rename-section           | --rename-section           |
--long-section-names       | *None available*           | COFF only
--change-leading-char      | *None available*           |
--remove-leading-char      | *None available*           |
--reverse-bytes            | *None available*           |
--redefine-sym             | --redefine-sym             |
--redefine-syms            | *None available*           |
--srec-len                 | *None available*           |
--srec-forceS3             | *None available*           |
--strip-symbols            | *None available*           |
--strip-unneeded-symbols   | *None available*           |
--keep-symbols             | *None available*           |
--localize-symbols         | *None available*           |
--globalize-symbols        | *None available*           |
--keep-global-symbols      | --keep-global-symbols      |
--weaken-symbols           | *None available*           |
--alt-machine-code         | *None available*           |
--writable-text            | *None available*           |
--readonly-text            | *None available*           |
--pure                     | *None available*           |
--impure                   | *None available*           |
--prefix-symbols           | --prefix-symbols           |
--prefix-sections          | *None available*           |
--prefix-alloc-sections    | *None available*           |
--file-alignment           | *None available*           |
--heap                     | *None available*           |
--image-base               | *None available*           |
--section-alignment        | *None available*           |
--stack                    | *None available*           |
--subsystem                | *None available*           |
--compress-debug-sections  | --compress-debug-sections  |
--decompress-debug-sections| --decompress-debug-sections|
--verbose                  | *None available*           |
objcopy @<file>            | *None available*           |


On Mon, 22 Oct 2018 at 11:00, James Henderson <[hidden email]> wrote:
Hi,

On Thursday of the recent developers meeting, we had a round-table
discussing llvm-objcopy. Below are some notes I took from that
meeting. The discussion was fairly free-flowing, so the notes are not
particularly in depth. If anybody has any other comments relating to
this meeting, feel free to add to this!

Feature request: converting from 32-bit ELF to 64-bit ELF:
-- Size in sections broken, needs updating to not just be a public
member variable.

Making llvm-objcopy into a library:
-- Errors need to be non-fatal (return llvm::Error).
-- Would be nice to provide this as a writable portion of libObject.

**Action**: James Henderson to provide results of feature comparison
versus GNU objcopy.

Multiple file formats:
-- Don't try to use a common intermediate representation for all
object file formats!
-- Separate backends for different file formats.
---- Would like to avoid people "forgetting" to implement some
switches when implementing a new backend, leading to silent ignoring
of switches (maybe use subclasses etc).
---- Shouldn't need to implement each option, beyond an "unsupported"
message or similar.

Output should be stable:
-- Currently not the case for section header table (is deterministic,
but might be unnecessarily different to input).
-- No need to go to heroic efforts, if not realistic, or a better
alternative is possible.

Discussion on being able to modify the program header table:
-- Jake reluctant to.
-- But if real use case presents itself, should be okay.
-- Some requirements to add segments post-link.
-- Embedded use-cases may well break the immutable program header
table requirement.

File bugs upstream for visibility:
-- **Action**: Jake Ehrlich to request himself, James Henderson,
Jordan Rupprecht, and Alexander Shaposhnikov (four current main
upstream developers/reviewers of llvm-objcopy) added as default-CC for
llvm-objcopy bugs.

Compatibility with GNU objcopy is a top concern:
-- Where diverged, believed that GNU behaviour doesn't make sense, but
open to alternative.
-- File bugs/propose changes if issues encountered.

Regards,

James

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

ObjcopyFeatureAnalysis.xlsx (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] llvm-objcopy round-table summary

韩玉 via llvm-dev
In reply to this post by 韩玉 via llvm-dev


Op ma 22 okt. 2018 om 12:01 schreef James Henderson via llvm-dev <[hidden email]>:
File bugs upstream for visibility:
-- **Action**: Jake Ehrlich to request himself, James Henderson,
Jordan Rupprecht, and Alexander Shaposhnikov (four current main
upstream developers/reviewers of llvm-objcopy) added as default-CC for
llvm-objcopy bugs.


I've now added all 4 names to the default-cc list for llvm-objcopy bugs. Let me know if anything still doesn't seem right.

Thanks,

Kristof 

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev