This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Force specified function to be linked to a specified lib whencompiling/linking
- From: Nick Clifton <nickc at redhat dot com>
- To: Yubin Ruan <ablacktshirt at gmail dot com>, Carlos O'Donell <carlos at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 21 Jul 2017 13:17:56 +0100
- Subject: Re: Force specified function to be linked to a specified lib whencompiling/linking
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E0A6E46210
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0A6E46210
- References: <CAJYFCiMnf+vLhBq9s-B2RXY7Xx8r5Wd5k5Fr959ZbKUuFwZRvA@mail.gmail.com> <aea4e63c-9396-3e3d-bbbc-ebfbe85aaee8@redhat.com> <20170721134932.GB28075@HP>
Hi Yubin,
> What I want to do here is to have the internal standard malloc linked to the
> right place, not the one we created:
> as you see, I want the `__real_malloc' to be linked to the standard malloc
> implementation. And in this situation, user don't know any internal changes.
> They just use it as usual.
I do not think that this is a good idea. Changing a system or library function
without the user's awareness is a bad thing, and could lead to all kinds of abuse.
If you want an application to use an augmented function then the programmer should
be told how to do this, and allowed the choice of whether or not to follow through.
Cheers
Nick