[PATCH] D66407: [llvm-objcopy][MachO] Implement -Ibinary
Seiya Nuta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 01:34:17 PDT 2019
seiya marked 2 inline comments as done.
seiya added inline comments.
================
Comment at: llvm/test/tools/llvm-objcopy/MachO/binary-input.test:19
+X86-64-NEXT: Arch: x86_64
+ARM64: Format: Mach-O arm64
+ARM64-NEXT: Arch: aarch64
----------------
Note that GNU objcopy sets MH_MAGIC instead of MH_MAGIC64 for aarch64:
```
$ gobjcopy -I binary -B aarch64 -O mach-o-arm64 foo.txt binary.arm64.o
$ llvm-readobj binary.arm64.o
File: binary.arm64.o
Format: Mach-O 32-bit unknown <- should be "Mach-O arm64"!
Arch: aarch64
AddressSize: 32bit
$ otool -h binary.arm64.o
Mach header
magic cputype cpusubtype caps filetype ncmds ...
0xfeedface 16777228 0 0x00 1 3 ...
```
I have no experience with aarch64 MachO objects, but AFAIK the magic should be MH_MAGIC64 ([[ https://github.com/llvm/llvm-project/blob/c52c74efdf43f35c7d1b9dcda309218b50573677/llvm/test/MC/MachO/AArch64/data-in-code.s#L18 | example ]]). I believe it's a bug in GNU objcopy...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66407/new/
https://reviews.llvm.org/D66407
More information about the llvm-commits
mailing list