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?


On Fri, Jan 18, 2019 at 10:04:36AM +0100, Sebastian Huber wrote:
> On 18/01/2019 01:24, Alan Modra wrote:
> > No, -ffunction-sections will make no difference.  Really, --wrap was
> > intended for wrapping system functions, which I guess is why the
> > feature was implemented only for undefined symbols.  I don't see a
> > fundamental reason why --wrap couldn't be made to work with defined
> > symbols, provided the compiler and assembler don't optimise references
> > to local functions.
> 
> In case it is acceptable to extend --wrap to work also for defined symbol
> references, then I would have a look at this and try to implement it. If you
> already have an idea which functions needs to be touched for this new
> feature, then this would be helpful for me.

It might just be a matter of calling bfd_wrapped_link_hash_lookup in
more places where we currently call bfd_link_hash_lookup and its
derivatives like elf_link_hash_lookup.  Knowing which places to change
is the difficult part.  Anything involved with relocation processing
for a start.

-- 
Alan Modra
Australia Development Lab, IBM


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