This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem with glibc-2.1.3 and gcc-2.95.2 -ffunction-sections


Dear libc gurus,

I've just run into some grief cross-compiling a simple hello world program
statically linking against glibc-2.1.3 cross-compiled using gcc-2.95.2 with
-ffunction-sections & -fdata-sections and the binutils-000330 snapshot
configured for a powerpc-linux target.

My glibc was configured like this:

    CFLAGS="-msoft-float -Os -DNDEBUG=1 -ffunction-sections -fdata-sections"
    export CFLAGS
    CC=powerpc-linux-gcc
    export CC
    AR=powerpc-linux-ar
    export AR
    RANLIB=powerpc-linux-ranlib
    export RANLIB
    configure --host=powerpc-linux --with-headers=/usr/src/linux/include \
    --enable-add-ons=linuxthreads --with-gnu-as --with-gnu-ld \
    --disable-sanity-checks --without-fp

And my binary was built with:
% powerpc-linux-gcc -static hello.c -o hello

The resulting binary dies on startup with:
    Program received signal SIGSEGV, Segmentation fault.
    0x10003884 in __libc_start_main ()
    (gdb) where
    #0  0x10003884 in __libc_start_main ()
    #1  0x10003824 in _fini ()
    #2  0x10003824 in _fini ()
    #3  0x1000392c in __libc_start_main ()
    #4  <signal handler called>

Rebuilding glibc with the same configuration sans "-ffunction-sections
-fdata-sections" works fine. Can anyone suggest what might be going wrong
here, before I dive in on a multi-hour bughunt?

Thanks,
Graham

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]