linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gcc -S option
@ 2003-03-14 18:40 Shanks
  2003-03-14 18:56 ` Elias Athanasopoulos
  0 siblings, 1 reply; 2+ messages in thread
From: Shanks @ 2003-03-14 18:40 UTC (permalink / raw)
  To: linux-c-programming

Hi,

Assume hypothetical C code below
int
main()
{
        int t;

        t += 1;
        return 0;
}

When i compile this code using -S option on a *solaris* box using
the *solaris* compiler, i get following .s file
! File a.c:
!    1  int
!    2  main()
!    3  {
!    4          int t;
!    5
!    6          t += 1;

        add     %i5,1,%i5

!    7          return 0;

        mov     %g0,%i0
        jmp     %i7+8
        restore

As you can see above, the .s file generated is of following
format:
- C code block
- Corresponding Assembly code

However when i do the same thing using gcc i get *only* the
assembly code and not the corresponding C code also.

Can someone tell me if i need to pass some extra options
while compiling using gcc to get the desired data.

Right now i am generating .s as follows
$ gcc -S a.c

Thanks in advance,
Shanks

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcc -S option
  2003-03-14 18:40 gcc -S option Shanks
@ 2003-03-14 18:56 ` Elias Athanasopoulos
  0 siblings, 0 replies; 2+ messages in thread
From: Elias Athanasopoulos @ 2003-03-14 18:56 UTC (permalink / raw)
  To: Shanks; +Cc: linux-c-programming

On Fri, Mar 14, 2003 at 10:40:46AM -0800, Shanks wrote:
> Can someone tell me if i need to pass some extra options
> while compiling using gcc to get the desired data.

I think you can't. You can use objdump with '-dS' to dump a mixture
of asm and C code, when that is possible.

Elias

-- 
University of Athens			I bet the human brain 
Physics Department				is a kludge --Marvin Minsky 

	

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-14 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-14 18:40 gcc -S option Shanks
2003-03-14 18:56 ` Elias Athanasopoulos

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 NNTP newsgroup(s).