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

objdump -M no-aliases doesn't work with --macho #61019

Closed
verhovsky opened this issue Feb 27, 2023 · 2 comments · Fixed by #113795
Closed

objdump -M no-aliases doesn't work with --macho #61019

verhovsky opened this issue Feb 27, 2023 · 2 comments · Fixed by #113795

Comments

@verhovsky
Copy link

verhovsky commented Feb 27, 2023

Compile this trivial AArch64 program

.global _main
.align 2

_main:	MOV	W1, W2

like this

as main.s -o main.o
ld -o main -lSystem -syslibroot `xcrun -sdk macosx --show-sdk-path` main.o

then run objdump on it:

$ objdump -d main

main:	file format mach-o arm64

Disassembly of section __TEXT,__text:

0000000100003fb4 <_main>:
100003fb4: e1 03 02 2a 	mov	w1, w2
$ objdump -d --macho main
main:
(__TEXT,__text) section
_main:
100003fb4:	e1 03 02 2a	mov	w1, w2
$ objdump -d -M no-aliases main

main:	file format mach-o arm64

Disassembly of section __TEXT,__text:

0000000100003fb4 <_main>:
100003fb4: e1 03 02 2a 	orr	w1, wzr, w2
$ objdump -d --macho -M no-aliases main
main:
(__TEXT,__text) section
_main:
100003fb4:	e1 03 02 2a	mov	w1, w2

The last command (objdump -d --macho -M no-aliases main) outputs mov instead of orr.

I'm on an M1 Macbook Air, macOS 13.2.1, Xcode version 14.1 (14B47b)

$ as --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ objdump --version
Apple LLVM version 14.0.0 (clang-1400.0.29.202)
  Optimized build.
  Default target: arm64-apple-darwin22.3.0
  Host CPU: apple-a12
[...]

See below/HelloSilicon#43 for details.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 27, 2023

@llvm/issue-subscribers-tools-llvm-objdump

@MaskRay
Copy link
Member

MaskRay commented Oct 27, 2024

myllvm-mc -filetype=obj -triple=arm64-apple-darwin a.s -o a.o && myllvm-objdump -d -M no-aliases a.o

works without --macho.

@MaskRay MaskRay closed this as completed Oct 27, 2024
@MaskRay MaskRay reopened this Oct 27, 2024
MaskRay added a commit to MaskRay/llvm-project that referenced this issue Oct 27, 2024
--macho -d uses the `parseInputMachO` code path, which does not handle
-M. Add -M handling for --macho as well.

Close llvm#61019
MaskRay added a commit that referenced this issue Oct 28, 2024
--macho -d uses the `parseInputMachO` code path, which does not handle
-M. Add -M handling for --macho as well.

Close #61019

Pull Request: #113795
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this issue Nov 4, 2024
--macho -d uses the `parseInputMachO` code path, which does not handle
-M. Add -M handling for --macho as well.

Close llvm#61019

Pull Request: llvm#113795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants