Mac executable creation issue
2024-8-25 23:33:10 Author: www.reddit.com(查看原文) 阅读量:8 收藏

Hello peeps,

I'm trying to create binary from x86 code [.S extension] on Apple Mac [2.3 GHz Dual-Core Intel Core i5 processor]. Im getting .o file without any errors. But I couldn't generate binary file from object file.

command used and error received:

$ clang -o example example.o ld: Undefined symbols: _main, referenced from: <initial-undefines> clang: error: linker command failed with exit code 1 (use -v to see invocation)

Piece of code I used to create .o file:

.intel_syntax noprefix

_main: xor rax, rax
xor rcx, rcx
test rdi, rdi

Any suggestions please.. PS: I have tried using ld as well, it gives me same error.


文章来源: https://www.reddit.com/r/ReverseEngineering/comments/1f0z2yi/mac_executable_creation_issue/
如有侵权请联系:admin#unsafe.sh