LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-09-2010, 05:03 AM   #1
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Rep: Reputation: 1
undefined reference to `__libc_csu_fini'


Hello,

I am getting the bellow linker error with GCC 4.4 and GLIBC 2.12.

1. /usr/lib/../lib64/crt1.o: In function `_start': (.text+0x12): undefined reference to `__libc_csu_fini'
2. /usr/lib/../lib64/crt1.o: In function `_start': (.text+0x19): undefined reference to `__libc_csu_init'

Any help on what is wrong here? Did I miss some package?

Best Regards,
Ananth
 
Old 12-09-2010, 06:23 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 671

Rep: Reputation: 94
Miscompiled glibc
Too much striped glibc
Wrong LDFLAGS

That's what coming to my mind right way.

My system's crt1.o is not striped at all (SLackware64 13.1 Multilib) by the way.
 
Old 12-09-2010, 07:14 AM   #3
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Original Poster
Rep: Reputation: 1
Can you please elaborate on miscompiled glibc and too much striped glibc and what should I do for right glibc?
I have installed GLIBC 2.12 version and all libraries from there are taken.

Best Regards,
Ananth
 
Old 12-09-2010, 11:03 AM   #4
ozanbaba
Member
 
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 671

Rep: Reputation: 94
Looking my system crt1.o with objdump and __libc_csu_fini and __libc_csu_init are there.

Check out the crt1.o yourself with objdump and see if it's there.
If it's there, Check your LDFLAGS. IT might be the problem.
 
Old 12-09-2010, 10:46 PM   #5
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Original Poster
Rep: Reputation: 1
Thanks for your support,

Here is my objdump of crt1.o (for simplicity i am pasting only the problematic area)

0000000000000000 *UND* 0000000000000000 __libc_csu_fini
0000000000000000 g F .text 0000000000000000 _start
0000000000000000 *UND* 0000000000000000 __libc_csu_init
0000000000000000 *UND* 0000000000000000 main
0000000000000000 w .data 0000000000000000 data_start
0000000000000000 g O .rodata.cst4 0000000000000004 _IO_stdin_used
0000000000000000 *UND* 0000000000000000 __libc_start_main
0000000000000000 g .data 0000000000000000 __data_start

Symbols (__libc_csu_fini and __libc_start_main) with which I am facing issue are marked as UND (undefined), does this mean that my crt1.0 is wrong?
If so my GLIBC is installation is wrong? I am new to Linux and trying to debug these system errors for first time.

Best Regards,
Anant
 
Old 12-10-2010, 01:02 AM   #6
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 666

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by akonchada View Post
Hello,

I am getting the bellow linker error with GCC 4.4 and GLIBC 2.12.

1. /usr/lib/../lib64/crt1.o: In function `_start': (.text+0x12): undefined reference to `__libc_csu_fini'
2. /usr/lib/../lib64/crt1.o: In function `_start': (.text+0x19): undefined reference to `__libc_csu_init'

Any help on what is wrong here? Did I miss some package?

Best Regards,
Ananth
What command do you use for link?
 
Old 12-10-2010, 01:34 AM   #7
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Original Poster
Rep: Reputation: 1
Hello,

I am using g++ as bellow,

g++ -o XXX -lstdc++ -rdynamic -mt -L/usr/lib/x86_64-redhat-linux5E/lib64 -L/usr/lib64 -L-m64 -lpthread -lrt -lssl -lcrypto -lappllib -lnsl -lpthread -lresolv -lrt -lm -ldl -lmp

it is from gcc 4.4 version and i am getting bellow linker errors.

/usr/lib/../lib64/crt1.o: In function `_start': (.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/../lib64/crt1.o: In function `_start': (.text+0x19): undefined reference to `__libc_csu_init'

Best Regards,
Ananth
 
Old 12-10-2010, 09:47 AM   #8
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Original Poster
Rep: Reputation: 1
Hello,

My problem is solved, I missed /lib64 path in my linker LD_LIBRARY_PATH and that is the reason why these symbols are not visible.
Another issue is libc.so and libpthread.so for lib64 are not binary files instead they are ASCII file. There is a pointer in thes files
to pick the binary file ffom /lib64 where I have different content than expected.

Solution is, as I don't have /lib64 in my system (I have separate tool set where I place all lib64 libraries) I gave right file path in both ASCII file (libc.so and libpthread.so).

Best Regards,
Ananth

Last edited by akonchada; 12-10-2010 at 11:58 PM.
 
Old 01-18-2012, 12:58 PM   #9
DGPickett
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
I got burnt when I was moving libraries around, as the missing objects are in libc_nonshared.a, linked in by this cute bit, a text *.so:

Code:
$ cat /usr/lib64/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a  AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
Undefined reference to: ashlesha Programming 5 11-08-2006 01:07 PM
undefined reference? Sharky01252 Programming 3 11-07-2006 11:36 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM


All times are GMT -5. The time now is 10:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration