Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 11 Jan 2014 11:40:32 -0600
From: Rob Landley <>
To: Rich Felker <>
Subject: Re: libgcc --disable-shared test case

On 10/17/2013 01:09:13 AM, Rich Felker wrote:
> On i386 or any arch where libgcc functions are needed for 64-bit
> division, the following should reproduce the failure if libgcc was
> built with --disable-shared (which disables visibility):
> gcc -O2 -shared -o lib_v1.c
> gcc -O2 main.c ./
> ./a.out # ok
> gcc -O2 -shared -o lib_v2.c
> ./a.out # fails with symbol errors
> Rich

   long long foo(long long x) { return x/10; }

   long long foo(long long x) { return x/16; }

   #include <stdio.h>
   extern long long foo(long long);
   int main() { printf("%lld\n", foo(100)/10); }

Ok, I just tested this again. With lib_v1.c, the one built with my  
simple-cross-compiler toolchain printed 1, and the lib_v2.c printed 0.  
(I believe you said the error was a link failure?)

I had to copy the resulting a.out and into  
simple-root-filesystem (which was built with the simple cross compiler  
and doesn't contain a native compiler) to run it in a chroot because  
the host hasn't got uClibc libraries installed in it, hence no for the dynamic link...

Looks like my toolchain doesn't exhibit this behavior? (Not after I  
hacked the hell out of the libgcc.a build, anyway...)

(I'm sure I tested this before, but didn't write the result down.  
There's a reason I blog to myself so much when I'm not buried by  


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.