This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Externally provided __getreent
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: Olivier Desenfans <olivier dot desenfans at hipperos dot com>, newlib at sourceware dot org
- Date: Mon, 22 May 2017 07:36:33 +0200
- Subject: Re: Externally provided __getreent
- Authentication-results: sourceware.org; auth=none
- References: <CAE2L740FW-chs4dVvQhpS9LXCXNgHF+xLWaEJP0gcpFFEsw02A@mail.gmail.com>
On 19/05/17 16:44, Olivier Desenfans wrote:
newlib apparently does not let me do that; you can override the
default implementation (in sys/reent/getreent.c) by implementing your
own version (in sys/myos/getreent.c). I tried to declare that custom
version as a weak symbol so that the linker would replace it with the
version in our custom API but to no avail. Interestingly the linker
does not throw a duplicate symbol error. There seems to be some magic
trickery in the build system that prevents me from achieving this.
This is not how weak symbols work. If the linker has no reason to look
for your __getreent() function (e.g. because it found the weak version
first and nothing else pulled in the module containing your
implementation), then it will not end up in the executable.
--
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.