LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-25-2013, 05:36 AM   #1
salathia
LQ Newbie
 
Registered: Jun 2013
Posts: 7

Rep: Reputation: Disabled
collect2: ld returned 1 exit status


I am working on the toolchain from the scratch...

While installing gcc with the following commands:
echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
../../Source/glibc-2.9/configure \
--build=$BUILDMACH \
--host=$TARGETMACH \
--prefix=/usr \
--with-headers=$SYSROOTDIR/usr/include \
--config-cache \
--enable-add-ons=glibc-ports-2.9,nptl \
--enable-kernel=2.6.0

It worked fine and
make -k install-headers cross_compiling=yes install_root=$SYSROOTDIR

It also worked fine but after configuring I am facing the error for this command

make

/home/phytectoolchain/Build/glibc-build/elf/librtld.os: In function `_dl_start_final':
/home/phytectoolchain/Source/glibc-2.9/elf/rtld.c:348: undefined reference to `_begin'
/home/phytectoolchain/Install/lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: /home/phytectoolchain/Build/glibc-build/elf/ld.so: hidden symbol `_begin' isn't defined
/home/phytectoolchain/Install/lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [/home/phytectoolchain/Build/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory `/home/phytectoolchain/Source/glibc-2.9/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/phytectoolchain/Source/glibc-2.9'
make: *** [all] Error 2

Last edited by salathia; 06-25-2013 at 05:43 AM.
 
Old 06-27-2013, 11:04 AM   #2
adelabarra
Member
 
Registered: May 2008
Location: Argentina
Distribution: Debian, Slackware
Posts: 49

Rep: Reputation: 3
Wink

Dear salathia:
I've got a method that is a pain in the ass, but sometimes works.
First, I do a grep so that I can send all the file names that have the unreferenced symbol/function to a file.

For example: grep -rl "_dl_start_final" $PWD > afiletosaveallnames

Then you open "afiletosaveallnames" (doesn't need to be so long) and see whereelse is the unreferenced symbol. Sometimes the function is declared but not [I]defined[/].
Sometimes is easy, if you find where the function is defined you can add the file to the headers if you find it.
The most of the times the file exists but is misplaced.
If you can't find where the function is defined, then some library is missing.
You 've got to find it somewhere ... and fall in an endless updating..https://lqo-thequestionsnetw.netdna-..._lq/icon12.gif

Last edited by adelabarra; 06-27-2013 at 11:05 AM.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A different collect2: ld returned 1 exit status old_as_a_fossil Linux - General 0 01-28-2010 09:57 AM
collect2: ld returned 1 exit status makphy Linux - Newbie 0 12-14-2009 02:05 AM
collect2: ld returned 1 exit status kvijaik Linux - Software 2 10-07-2009 09:17 PM
collect2: ld returned 1 exit status Ritendra Linux - Newbie 2 07-30-2009 07:39 AM
collect2: ld returned 1 exit status abirami Linux - Software 0 03-02-2005 01:07 AM


All times are GMT -5. The time now is 10:10 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