[uClibc 0000867]: Undefined references to _dl_app_fini_array and _dl_app_init_array when trying to link statically with uclibc

bugs at busybox.net bugs at busybox.net
Fri May 5 10:59:58 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=867 
====================================================================== 
Reported By:                blurgk
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   867
Category:                   Architecture Specific
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             05-05-2006 02:15 PDT
Last Modified:              05-05-2006 03:59 PDT
====================================================================== 
Summary:                    Undefined references to _dl_app_fini_array and
_dl_app_init_array when trying to link statically with uclibc
Description: 
I get undefined references when I try to link a program statically to
uclibc:

$ cat test.c 
#include <stdio.h>

int main (void)
{
        printf ("Hello\n");
        return 0;
}

$ arm-linux-gcc test.c -o test -static
/usr/src/buildroot-20060308/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.5/../../../../arm-linux-uclibc/lib/libc.a(__uClibc_main.os):
In function `__GI___uClibc_fini':
__uClibc_main.c:(.text+0x13c): undefined reference to
`_dl_app_fini_array'
/usr/src/buildroot-20060308/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.5/../../../../arm-linux-uclibc/lib/libc.a(__uClibc_main.os):
In function `__uClibc_main':
__uClibc_main.c:(.text+0x2e0): undefined reference to
`_dl_app_init_array'
collect2: ld returned 1 exit status

====================================================================== 

---------------------------------------------------------------------- 
 psm - 05-05-06 03:59  
---------------------------------------------------------------------- 
run gcc w/ -v and provide that output, your toolchain seems to work
incorrectly
_dl_app_*_array does not have to be in libc.a (only in libc.so) and
shouldn't
be used for static linking. readelf -s libc.a | more, search for
__uClibc_main
and see if _dl_app_*_array appear there (and see if __uClibc_main.os or
.oS was
added to the archive) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-05-06 02:15  blurgk         New Issue                                    
05-05-06 02:15  blurgk         Status                   new => assigned     
05-05-06 02:15  blurgk         Assigned To               => uClibc          
05-05-06 03:59  psm            Note Added: 0001346                          
======================================================================




More information about the uClibc-cvs mailing list