LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2008, 09:29 PM   #1
surfer41
Member
 
Registered: Oct 2005
Distribution: Debian Etch
Posts: 44

Rep: Reputation: 15
how to choose dynamic linker for a.out file?


How can i tell gcc to use a different dynamic-linker while linking
a.out file? I mean i've installed new gcc in a separate folder.
The newly installed gcc uses /lib/ld-linux.so.2 which i don't want.
Is there anyway to choose another linker for a.out without chroot?
 
Old 07-01-2008, 10:17 AM   #2
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
any reason you want to use something other than ld?
 
Old 07-01-2008, 01:18 PM   #3
surfer41
Member
 
Registered: Oct 2005
Distribution: Debian Etch
Posts: 44

Original Poster
Rep: Reputation: 15
> any reason you want to use something other than ld?

I am trying to install gnome-2.22. i installed gcc,binutils,glib etc.
on a separate folder. when i invoke gcc it uses the default(old)
dynamic linker. So i was wondering how can i make the new gcc use
new dynamic linker by default?
 
Old 07-01-2008, 06:20 PM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
why not just install the new gcc etc. as default?
it should be backward compatible.
 
Old 07-03-2008, 02:32 PM   #5
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
You should be able to modify such conditions (at least temporarily) using a specs file. For example,
Code:
$ gcc -dumpspecs | sed -e 's#/lib/ld-linux.so.2#/path/to/other/loader#g' > specfile
$ gcc -specs=specfile -o test test.c
$ readelf -l test | grep "Requesting program interpreter"
      [Requesting program interpreter: /path/to/other/loader]
$ CC="gcc -specs=specfile" ./configure
$ make
…
A more permanent solution would be to pass the correct configure options when building your toolchain in the first place.
 
  


Reply



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
Bash - choose a random line from a file ericcarlson Linux - Software 27 11-12-2013 01:25 AM
emacs/auctex: choose pdftex with file variables otoomet Linux - Software 0 02-04-2007 06:48 AM
Linux dynamic linker thedevilsjester Programming 4 09-20-2005 07:11 PM
Linker problem: can't find a file, but the file exists atlep Programming 5 08-16-2004 06:15 AM
can't load dynamic linker '/lib/ld.so qanopus Linux - General 4 01-06-2003 06:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration