where in gcc sources is foobar.o written?

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

 



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

>gcc -c foobar.c -o foobar.o


The reason why I am asking, if you care to know, is that the LD_PRELOAD trick for the above command, does intercept the open() syscall for (reading) foobar.c, but does not intercept the open() call for (writing) foobar.o .

I know some version of open() is called for writing foobar.o because that is what 

>strace -fF gcc -c foobar.c -o foobar.o

says.


If the library containing open() were linked statically, then both would not show up.  I also tried to intercept __open(), fopen(), creat(), and their 64-bit variants.  Nothing.  

So I am stumped and I need to look at the sources to understand.  Or perhaps if someone knows the answer, you can explain this to me.

Thank you very much,

Mark



[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