Does the LD --wrap feature work for library internal references?

Sebastian Huber sebastian.huber@embedded-brains.de
Fri Jan 18 09:04:00 GMT 2019


On 18/01/2019 01:24, Alan Modra wrote:
> On Mon, Jan 14, 2019 at 10:40:56AM +0100, Sebastian Huber wrote:
>> On 10/01/2019 20:04, Joel Sherrill wrote:
>>>
>>> On Thu, Jan 10, 2019, 8:05 AM Alan Modra <amodra@gmail.com
>>> <mailto:amodra@gmail.com> wrote:
>>>
>>>      On Thu, Jan 10, 2019 at 02:48:16PM +0100, Sebastian Huber wrote:
>>>      > So this wrapping works only across object files and not
>>>      > for references inside an object file.
>>>
>>>      Yes.  If a reference is to a function defined in the same file you
>>>      don't have an undefined symbol for the given function in that file.
>>>
>>>
>>> And per function section compilation and linking have no impact on that?
> 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.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Binutils mailing list