How to generate a nasm compilable assembly code from c source code on Linux?

后端 未结 3 960

Test platform is 32 bit Linux.

Basically, I know gcc can be used to generate both Intel and At&T style assembly code, but it seems that you can not<

3条回答
  •  被撕碎了的回忆
    2020-12-04 10:37

    Heres a way to do it without objconv

    ndisasm -u <(objdump -j .text -d main.o | cut -d: -f2 | cut -d$'\t' -f 2 | perl -ne 'next if /file/; s/\s+//g; print' | xxd -r -p)
    

提交回复
热议问题