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: where in gcc sources is foobar.o written?


Thank you for your help!

Yes with your pointer I found out that cc1 writes a .s file in the /tmp directory, and then

the assembler /usr/bin/as opens that for reading using fopen() and outputs foobar.o (without any renaming).  

Still I don't know what the assembler is using to open foobar.o for writing (strace says open() but I intercept that and any variants and none of them are used, maybe the assembler is built with syscalls linked statically).


So I guess I need to understand the assembler source and/or how it links the system calls.  

I can see that the assembler is not part of gcc so I guess that is where this thread ends.  

Thank you for your help and if you have anything more to teach me, please do, thank you




----- Original Message -----
From: Manuel LÃpez-IbÃÃez <lopezibanez@gmail.com>
To: Mark Galeck <mark_galeck@pacbell.net>; "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Sent: Saturday, March 5, 2016 3:52 AM
Subject: Re: where in gcc sources is foobar.o written?

On 05/03/16 11:23, Mark Galeck wrote:

> Hello,
>
>
> as you know, the source of gcc is quite complex, especially for someone who managed to go through their MS in Computer Science without taking a compiler class :)
>
> Where in the sources is the file foobar.o opened for writing in

The foobar.o in your command-line is created by the assembler. Append '-###' to 
see all programs invoked by the gcc driver. See 
https://gcc.gnu.org/wiki/DebuggingGCC

It is possible that the assembler creates the .o file in some /tmp/ directory, 
then renames/moves it to the target directory.

There is a lot of useful info in https://gcc.gnu.org/wiki/GettingStarted 
Unfortunately, it is badly organized. Any help in organizing it would be 
appreciated.

Cheers,

    Manuel.


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