The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hp-ux linker option -c roopa_v HP-UX 0 05-12-2009 10:04 AM
G++ Linker Error ASRRAJ Linux 1 06-15-2008 12:41 AM
CPP Linker Error ASRRAJ Software Releases - RSS News 0 06-09-2008 04:05 AM
linker problem suman_jakkula AIX 0 08-29-2006 07:38 AM
Linker (ld) rajashekaran UNIX for Dummies Questions & Answers 1 02-14-2003 02:07 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-28-2009
Shompis Shompis is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 8
GCC: Choose my own linker

Hi,

I do not use the default linker, and instead us another one and pass this argument -Wl,--dynamic-linker=<path to linker> to gcc when compiling. However, what happens if the linker is not under /lib and /lib64 and I am not able to create a symlink to the linker in /lib or /lib64 due to no access to sudo rights. So instead I pass this -Wl,--dynamic-linker=/home/myhome/ld-custom.so

Will the linker be properly found when running the program on say some other computer where the linker is not located where it was in link-time? It will be located under /lib64 on target.
  #2 (permalink)  
Old 10-28-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,937
I don't see any reason why the linker should not be found.
  #3 (permalink)  
Old 10-29-2009
Shompis Shompis is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 8
Ok. I was just thinking that the path will be hardcoded in the executable binary because of I do not understand how the executable binary will figure out which linker to use in runtime otherwise. Maybe just the name and not the path will be hardcoded? But I have not tested. So I am speculating.

---------- Post updated 10-29-09 at 03:20 AM ---------- Previous update was 10-28-09 at 09:42 PM ----------

You are right. Didn't think about that the linker does not really need to be available during compilation.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0