This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mark.urs@gmail.com


Mark U kirjoitti:
Hi,

I'm just curious to know whether there is any option in GNU GCC to get
the C code  and the corresponding asembly.
The problem with this issue is that it is explained in the GNU assembler manual,
not in the GCC manual :-( The expectation however seems to be that it is explained
in the GCC manual ! Anyhow the 'as' manual tells in the Chapter 2 :


"If you are invoking as via the gnu C compiler, you can use the `-Wa' option to pass
arguments through to the assembler. The assembler arguments must be separated
from each other (and the `-Wa') by commas. For example:
gcc -c -g -O -Wa,-alh,-L file.c
This passes two options to the assembler: `-alh' (emit a listing to standard output with
high-level and assembly source) and `-L' (retain local symbols in the symbol table)."


The debug option '-g' causes the row number and source info being added into the
output for 'as'. The listing comes to the standard output so a redirection into a file can
be a better solution....



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]