This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Problem using --wrap flag with stat/lstat functions


Daniel Sumers Myers <dmyers@umiacs.umd.edu> writes:

>         I'm having a problem using the --wrap flag of ld to provide a wrapper for the
> GNU libc's stat and lstat functions. In C, everything works nicely, but in optimized
> C++ code, the compiler inlines stat and lstat, and my wrappers no longer get called.
> Short of providing wrappers for the functions called by the inlined stat and lstat,
> is there a way around this problem?

No, not really.  Once the compiler has decided to inline stat, there
isn't anything there that the linker can latch onto.  I suppose you
could try using the -fno-inline option when compiling, but that would
certainly hurt the performance of your C++ code.

Ian


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