* mark.urs@gmail.com
@ 2006-05-25 13:53 Mark U
2006-05-25 14:40 ` mark.urs@gmail.com Kai Ruottu
0 siblings, 1 reply; 2+ messages in thread
From: Mark U @ 2006-05-25 13:53 UTC (permalink / raw)
To: gcc-help
Hi,
I'm just curious to know whether there is any option in GNU GCC to get
the C code and the corresponding asembly.
like if we give '-S' option for GCC it gives the assembly of the program
#gcc -S test.c
gives test.S
I want to know the option for getting something like
--------------------------
printf()
<ASSEMBLY of printf>
fn();
<ASSEMBLY FOR JUMPING TO FN>
--------------------------
for a program
----------------
printf()
fn();
----------------
Thanks and regards,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mark.urs@gmail.com
2006-05-25 13:53 mark.urs@gmail.com Mark U
@ 2006-05-25 14:40 ` Kai Ruottu
0 siblings, 0 replies; 2+ messages in thread
From: Kai Ruottu @ 2006-05-25 14:40 UTC (permalink / raw)
To: Mark U; +Cc: gcc-help
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....
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-25 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-25 13:53 mark.urs@gmail.com Mark U
2006-05-25 14:40 ` mark.urs@gmail.com Kai Ruottu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).