public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: Olivier Desenfans <olivier.desenfans@hipperos.com>,
	newlib@sourceware.org
Subject: Re: Externally provided __getreent
Date: Mon, 22 May 2017 05:36:00 -0000	[thread overview]
Message-ID: <592278E1.7080709@embedded-brains.de> (raw)
In-Reply-To: <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.

      reply	other threads:[~2017-05-22  5:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 14:44 Olivier Desenfans
2017-05-22  5:36 ` Sebastian Huber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=592278E1.7080709@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=newlib@sourceware.org \
    --cc=olivier.desenfans@hipperos.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).