This is https://bugs.llvm.org/show_bug.cgi?id=40005,
Patch teaches llvm-objcopy to preserve OS/ABI and ABIVersion fields of ELF header.
(Currently, it drops them to zero).
Paths
| Differential D55886
[llvm-objcopy] - Do not drop the OS/ABI and ABIVersion fields of ELF header ClosedPublic Authored by grimar on Dec 19 2018, 5:46 AM.
Details Summary This is https://bugs.llvm.org/show_bug.cgi?id=40005, Patch teaches llvm-objcopy to preserve OS/ABI and ABIVersion fields of ELF header.
Diff Detail Event Timelinegrimar added a parent revision: D55884: [yaml2obj/obj2yaml] - Support dumping/parsing ABI version..Dec 19 2018, 5:48 AM This revision is now accepted and ready to land.Dec 19 2018, 12:47 PM Comment Actions LGTM, I'd like James's approval and my only comment is about a feature we can add after this if its needed. James is also out on leave so go ahead and land this.
Comment Actions LGTM. I recently tried to use llvm-objcopy for building CheriBSD (a fork of FreeBSD for the CHERI CPU) and ran into asserts due to missing ELFOSABI_FREEBSD. Closed by commit rL349738: [llvm-objcopy] - Do not drop the OS/ABI and ABIVersion fields of ELF header (authored by grimar). · Explain WhyDec 20 2018, 2:54 AM This revision was automatically updated to reflect the committed changes. Comment Actions
@jakehehrlich - At the moment, no we don't have a use case for that. If we ever do, I'll either file a bug or create a review. @grimar - thanks for the fix!
Revision Contents
Diff 178867 include/llvm/ObjectYAML/ELFYAML.h
lib/ObjectYAML/ELFYAML.cpp
test/tools/llvm-objcopy/ELF/copy-osabi.test
test/tools/yaml2obj/elf-abiversion.yaml
tools/llvm-objcopy/ELF/Object.h
tools/llvm-objcopy/ELF/Object.cpp
tools/obj2yaml/elf2yaml.cpp
tools/yaml2obj/yaml2elf.cpp
|
I'd like @jhenderson to comment if their use case might ever require them to specify what the OSABI and/or ABIVersion might need to be set via a flag for the BianryELFBuilder case.