From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100993 invoked by alias); 22 May 2017 05:36:56 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 100768 invoked by uid 89); 22 May 2017 05:36:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL,BAYES_00,FOREIGN_BODY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.2 spammy=sebastian, Sebastian, interestingly, achieving X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 May 2017 05:36:34 +0000 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dCg1D-0008Pa-51; Mon, 22 May 2017 07:36:35 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dCg1C-00019g-UV; Mon, 22 May 2017 07:36:35 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id B69462A0929; Mon, 22 May 2017 07:37:14 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NB-Vqjzu0dLx; Mon, 22 May 2017 07:37:14 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 66BF02A092A; Mon, 22 May 2017 07:37:14 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LTLyo5clKRTr; Mon, 22 May 2017 07:37:14 +0200 (CEST) Received: from [192.168.96.129] (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 443362A0929; Mon, 22 May 2017 07:37:14 +0200 (CEST) Subject: Re: Externally provided __getreent To: Olivier Desenfans , newlib@sourceware.org References: From: Sebastian Huber Message-ID: <592278E1.7080709@embedded-brains.de> Date: Mon, 22 May 2017 05:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00338.txt.bz2 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=20 for your __getreent() function (e.g. because it found the weak version=20 first and nothing else pulled in the module containing your=20 implementation), then it will not end up in the executable. --=20 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=C3=A4ftliche Mitteilung im Sinne des EHUG.