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,

On 10/01/2019 12:13, Nick Clifton wrote:
Is this a bug or a feature?
Well I would have to say "bug", although I think that it is really a case
of expecting too much of a feature that was really only intended to catch
ordinary function calls.

I have no idea how to fix it however, so maybe the best that we can is to
update the documentation....

from the documentation

"Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to __wrap_symbol. Any undefined reference to __real_symbol will be resolved to symbol. "

it is absolutely not clear that function pointer references are anything special and are not covered by this mapping. I am not sure what is expected to work. There are not that many tests in the test suite. Maybe this:

"Use a wrapper function for all direct calls to symbol. Any direct function call to symbol will be resolved to __wrap_symbol. Any direct function call to __real_symbol will be resolved to symbol. Indirect function calls will not be replaced for example."

Would it be difficult to catch also indirect function calls?

--
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.


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