The assembler and disassembler together can be used to modify the assembly and do some testing.
e.g. :
clang a.c -S -O2 -o a.s
do some modifications to the a.s
clang a.s -o a.out (here clang implicitly invoke the assembler to generate exe)
You can also do (equivalent to the above):
assemble:
/usr/bin/as a.s -o a.o
clang a.o -o a.out
To look at the assembly of .o or exe
disassemble:
objdump modified.o-d > modified.out.disassembly
objdump modified.out -d > modified.out.disassembly
No comments:
Post a Comment