tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Basesystem programs redefine routine symbols from libc



David Young <dyoung%pobox.com@localhost> wrote:
> On Mon, Dec 18, 2017 at 07:08:52PM +0000, David Holland wrote:
>> In netbsd everything in libc with a name that isn't from Standard C
>> (and thus not reusable by application code) is marked weak and aliased
>> to a version of the name with a _ in front; also internal uses by libc
>> are routed to those names so application use of conflicting symbols
>> doesn't break libc. This is what libc's namespace.h is for, and
>> somewhere there's actual documentation about it.
>> 
>> The sanitizer libraries should be doing the same things, and
>> apparently they aren't.
> 
> They are on Linux (#else case, below) but not on FreeBSD.  It sounds
> like FreeBSD's dynamic linker has a (grave?) bug: see the comment on the
> FreeBSD case.  I hope we don't have the same bug in NetBSD!
> 
> #elif defined(__FreeBSD__)                                                   
[...]
> // FreeBSD's dynamic linker (incompliantly) gives non-weak symbols higher
> // priority than weak ones so weak aliases won't work for indirect calls
> // in position-independent (-fPIC / -fPIE) mode.
[...]

Is there a test-case / PR for that?

-uwe



Home | Main Index | Thread Index | Old Index