How to control the gcc's output format?

Ian Lance Taylor
Wed Apr 26 17:07:00 GMT 2006

"Zhu, Will" <> writes:

>     I meet a problem when developing a project.
>     My GCC's output format is ELF obj file. But I want to get an a.out
> format obj file. The objcopy failed because the output ELF obj file
> contains some sections ( .rodata / .comment) that objcopy can not deal
> with.
>     So I want to know if I can control the GCC's output format and get
> the a.out format obj file directly from the GCC's output? 
>     I searched the GCC manual but did not find my desired answer.
>     If I can only get an ELF format obj file
>         1. Can I get rid of .rodata/.comment sections from my ELF obj
> file?
>         2. I know objcopy could remove the .comment section from the elf
> obj file.         
>          But I want to know is there any option control the compile
> procedure 
>          that can remove the .comment/.rodata section?

Configure and build gcc for a different target, e.g., i386-aout.


More information about the Gcc-help mailing list