[BUG] error in global variables strong aliasing

Peter S. Mazinger ps.m at gmx.net
Mon Mar 27 10:34:26 UTC 2006


On Fri, 24 Mar 2006, Amir Shalem wrote:

> I have attached below a test-case for the effect of strong aliasing for 
> variables.
> when you run `make` it will compile two programs with the same code
> first test.c is loaded dynamically, and then test.c is compiled 
> statically within the program
> as you can see the output of the program shows that for strong alias 
> variable
> the base address and the aliases variable address are different.
> 
> here's sample output on freebsd amd64 6.1, debian x86 sarge, and latest 
> buildroot + latest uClibc + gcc 4.1.0 + binutils 2.16.1:
> (the only difference are the addresses)
> 
> Running dynamic program:
> LD_LIBRARY_PATH="." ./prog-dynamic
> strong alias    : 0x500be4 (base) != 0x500be8 (alias)
> weak alias    : 0x500be0 (base) == 0x500be0 (alias)
> ---
> Running static program:
> ./prog-static
> strong alias    : 0x500b10 (base) == 0x500b10 (alias)
> weak alias    : 0x500b14 (base) == 0x500b14 (alias)
> 
> now,
> there's strong aliases between __environ and environ in uClibc code
> uClibc uses __environ, and busybox ash shell uses environ
> but __environ and environ when busybox program is running (when 
> dynamically linked against uClibc)
> have different addresses which invalidates the environ variable.
> 
> amir.
> 

Your test case works on x86 (native uClibc, gentoo-embedded). Could this 
be a cross-compiled/buildroot issue?

I don't have yet uClibc-svn working on arm/ppc/mipsel natively to test it 
there, could someone test this natively on some non-x86 arch?
(The test apps should be compiled/linked natively on uClibc please)

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list