문제

as defaults to ELF. I have some PIC code I would like to assemble to just that - only the raw instructions, no sections, etc. I believe using nasm you could achieve this by assembling with no options, and start your code with the BITS 32 directive (for a 32 bit architecture).

How to with as?

System:
- Ubuntu 12.04.
- as 2.2.
- x86 32b

도움이 되었습니까?

해결책

as can only generate ELF output, but you can convert an ELF binary to another format using objcopy:

objcopy -O binary mybinary.elf mybinary.bin

It supports a number of other formats as well as "binary". In particular, it supports "ihex" to produce .hex files, which some microcontroller programming tools may require.

다른 팁

-c compile will produce an object file from source

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top