This is the mail archive of the binutils@sourceware.org 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: Does the LD --wrap feature work for library internal references?


Hi Sebastian,

> For another it doesn't work:
> 
> /build/rtems/5/bin/powerpc-rtems5-gcc -Wl,--wrap=_bsd_ether_output -qrtems -B/build/rtems/5/powerpc-

> It links, I would have expected an undefined reference to __wrap__bsd_ether_output. In the executable I find this:
> 
> nm media01.exe | grep ether_output
> 0001b640 T _bsd_ether_output
> 
> It is not clear to me why it works with one function and not with another.

Is it possible that the _bsd_ether_output function has been inlined into
all the places where it is used ?

The wrap feature of the linker works by replacing symbols, but this is
only effective if there are undefined references to the symbols being
replaced.  If all of the references have already been resolved (or just
don't exist, eg because of inlining) then wrapping will have no effect.

Cheers
  Nick



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