Re: where in gcc sources is foobar.o written?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
To: Mark Galeck <mark_galeck@xxxxxxxxxxx>; "gcc-help@xxxxxxxxxxx" <gcc-help@xxxxxxxxxxx>
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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux