LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 02-04-2008, 04:13 AM   #1
bkpope
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
Relinking with new version of static library?


I have an application that was linked with a static library. I would like to relink that executable with a new version of the static library, but without respecifying everything else that went into the application. I have tried placing the new library both before & after the exec name, but the generated map shows that "ld" used the libbrary from prog_old.

> ld -o prog_new libnew.a prog_old -M --cref

> ld -o prog_new prog_old libnew.a -M --cref

I've read the "ld" MAN pages and browsed through the "ld" info, but cannot find anything on how to do that. I also browsed around on the web, and though I found quite a number of "how-to" documents on linking applications, most of them are more geared to shared libraries, than to static libraries.

Is this possible with the Linux "ld" command?

Thanks,
Bev in TX
 
Old 02-04-2008, 09:25 PM   #2
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
If prog_old is a statically linked executable, so with all symbols resolved, why would the linker even bother to look at the new library? Do prog_new and prog_old differ at all?
 
Old 02-05-2008, 06:56 AM   #3
bkpope
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Relinking with new version of static library?

Since libnew.a differs from the original static library, yes, prog_old and prog_new do differ.

I used to be able to do this a long time ago on IBM's AIX OS, so I thought it might be possible on Linux. From what you said, it sounds like we cannot do that on Linux.

Thanks,
Bev in TX
 
Old 02-05-2008, 08:00 AM   #4
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Quote:
Originally Posted by bkpope View Post
From what you said, it sounds like we cannot do that on Linux.
I wouldn't take it as the word of authority on this You could try asking in the programming section where they might have some more hardcore knowledge.
 
Old 02-05-2008, 02:39 PM   #5
bkpope
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Relinking with new version of static library?

I'm new to these forums (I've had an ID for a while, but never used it). I don't see one that is explicitly called "Programming". To exactly which forum are you referring?

Thanks,
Bev in TX
 
Old 02-05-2008, 03:59 PM   #6
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
http://www.linuxquestions.org/questions/programming-9/

(but I see now it's not Linux specific). What you are asking for sounds like something that might be useful in a commercial closed-source environment. I just never heard of it in a linux context.
 
Old 02-11-2008, 09:09 AM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I'm going to close down this thread.

Please continue this conversation here.

For future reference, if you want to move a thread please report it to a moderator and we will happily move it for you.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
shared library containing static library serbet Programming 0 01-04-2008 03:17 AM
creating static library that includes another static library kskkumar Programming 2 10-22-2007 10:51 AM
Making a static library from a given shared library vro Programming 1 07-27-2007 04:07 PM
LINUX - linking archive (static library) with shared (dynamic) library gurkama Programming 5 03-04-2007 11:11 PM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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