`Hiding' libc symbols

Harti Brandt brandt at fokus.fraunhofer.de
Tue May 6 09:12:18 PDT 2003


On Tue, 6 May 2003, Jacques A. Vidrine wrote:

JAV>On Tue, May 06, 2003 at 09:42:04AM -0600, Ben Mesander wrote:
JAV>> In addition to ports which override libc functions like printf() for
JAV>> ease of porting, there are important ports, such as the Boehm garbage
JAV>> collector for C/C++ or electric fence, which _depend_ upon the ability
JAV>> to override libc functions such as malloc() and free().
JAV>>
JAV>> Whatever decision is eventually made must allow such ports to
JAV>> function.
JAV>>
JAV>> This has been brought up once before, but I do not see how any of the
JAV>> advocates for change have addressed it.
JAV>
JAV>Probably because there is not much to address.  I think it is
JAV>universally agreed that the allocator is likely to need to be
JAV>overridden.  There are at least two solutions:
JAV>
JAV>  (a) Treat malloc & company as an exception: always call them by
JAV>      their un-adorned name from within libc.
JAV>
JAV>  (b) Let these specialized applications override the adorned names
JAV>      instead.  There is probably already code within these ports to
JAV>      deal with underscore-prefixed names.
JAV>
JAV>I don't really have a preference for either solution.

If you absolutely need to, use b). Treating all functions uniform reduces
the number of surprises one will encounter by 1.

harti
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-arch mailing list