Reputation: 1207
When writing assembly codes manually on macOS, .section .text
will lead to "unexpected token in '.section' directive" error, and to fix is to remove .section
token.
But when I generate assembly codes via clang like clang xxxx.cpp -S
, it turns out something like
.section __TEXT,__text,regular,pure_instructions
What is the difference between these two ways?
Upvotes: 2
Views: 2095
Reputation: 1207
I finally figure out. According to apple's doc OS X Assembler Reference, directive .text
is section (__TEXT,__text)
Upvotes: 2