Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using Zig's objcopy subcommand #7

Open
alexrp opened this issue Jan 9, 2024 · 1 comment
Open

Consider using Zig's objcopy subcommand #7

alexrp opened this issue Jan 9, 2024 · 1 comment

Comments

@alexrp
Copy link

alexrp commented Jan 9, 2024

At least since 0.11.0, Zig has an objcopy subcommand, which would eliminate the need for LLVM's llvm-objcopy.

$ zig --help|grep objcopy
  objcopy          Use Zig as a drop-in objcopy
$ zig objcopy --help
Usage: zig objcopy [options] input output

Options:
  -h, --help                  Print this help and exit
  --output-target=<value>     Format of the output file
  -O <value>                  Alias for --output-target
  --only-section=<section>    Remove all but <section>
  -j <value>                  Alias for --only-section
  --pad-to <addr>             Pad the last section up to address <addr>
  --strip-debug, -g           Remove all debug sections from the output.
  --strip-all, -S             Remove all debug sections and symbol table from the output.
  --only-keep-debug           Strip a file, removing contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact.
  --add-gnu-debuglink=<file>  Creates a .gnu_debuglink section which contains a reference to <file> and adds it to the output file.
  --extract-to <file>         Extract the removed sections into <file>, and add a .gnu-debuglink section.
  --compress-debug-sections   Compress DWARF debug sections with zlib

Not sure if it has all the functionality that NativeAOT needs, though.

@MichalStrehovsky
Copy link
Owner

Neat, that might work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants