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?


Hello Nick,

----- Am 4. Jan 2019 um 15:27 schrieb Nick Clifton nickc@redhat.com:

> Hi Sebastian,
> 
>> I don't use link-time optimization. I am sure the functions ether_input() and
>> ether_output() are present in the executable.
> 
> OK, but my guess is that the compiler has already done something clever
> so that those symbols are never referenced, and hence wrapping the symbols
> has no effect.  (You could look in the object file and see if the symbols
> are used in one or more relocations...)
> 
> Alternatively maybe there really is a bug in the linker's wrapping code.
> But I have no idea what it might be, or why this particular situation is
> causing problems.  If you do think that it is a linker bug though, please
> could you put together a small test case to demonstrate the problem ?
> Ideally using assembler source files rather than C/C++ sources, so that
> we do not have to worry about compiler optimizations.

attached is a self-contained example with Makefile and C code. It seems the reference via function pointers is the problem.

Attachment: ld-wrap.tar.gz
Description: application/compressed-tar


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