bug-bash
[Top][All Lists]
Advanced

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

Re: conflict between gcc and bash malloc lib with static link


From: Chet Ramey
Subject: Re: conflict between gcc and bash malloc lib with static link
Date: Thu, 09 Apr 2015 11:28:39 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 4/8/15 12:32 PM, Mike Frysinger wrote:
> On 08 Apr 2015 09:40, Chet Ramey wrote:
>> I suspect the problem with malloc is that there are one or more addition
al
>> symbols in the file (malloc.o) that glibc uses to satisfy some internal
>> reference, which causes the rest of the symbols from malloc.o to be
>> loaded, which causes conflicts with the already-loaded bash malloc libra
ry.
> 
> glibc tries pretty hard to avoid symbol conflicts even when static linkin
g.
> if you're aware of such conflicts, please let us know.  there should be n
o
> leaking of plain symbols like "foo" or "xmalloc" even w/static libs.
> -mike

It's not `plain' symbols, or even weak symbols, that usually cause the
problem.  Say something in the C library or another library uses
`posix_memalign'.  The bash malloc doesn't implement that function, but
glibc does, and glibc provides its implementation in the same source file
as the rest of the malloc functions.  The static link will pull in that
entire file, resulting in symbol conflicts.

Chet
- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlUmmhAACgkQu1hp8GTqdKs5MgCfQ/19Qtgrc+Q4i+d/iuRWC8Fh
0joAoJcZCL3iJHZ+y13kJMoT7ud9AKSw
=DbvA
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]