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]

where in gcc sources is foobar.o written?


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]