public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Incremental linking
@ 1998-04-09 19:56 Dave Taylor
  1998-04-10  0:39 ` Jeffrey A Law
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dave Taylor @ 1998-04-09 19:56 UTC (permalink / raw)
  To: egcs

I've been noticing the "-r" command in ld for some time now, and as our
project is almost at 1000 files and takes a solid 30 seconds to link with
debugging symbols, I've been lusting to figure out how incremental linking
works.

I grok that -r generates an output file which in turn can be used to link
with, and I've gotten that to work. 

However, the desired use for this relinkable file is to be able to say
something like:

gcc relinkable.o module1.o module2.o ... -o my_proggy

Where module1.o and module2.o may already be in the relinkable.o file, but
because they've been specified on the command line, the symbols in those
module*.o files override the symbols in the relinkable.o file.  Is there a
way to get ld to behave this way?  Or was that half of the incremental
linking feature never implemented?  Because when I try that, it complains
that there are duplicate symbols and is clearly not trying to override the
old symbols. 

I'm interested in any alternatives you know of to shorten the link time.

A big problem seems to be that the output file is a whopping 12Mb, and the
*.o files take up a healthy 50Mb themselves.  This stuff is partially
bloated because of the size of the debugging info added by -g.  We've
noticed that MSVC puts the debugging symbols in a seperate file.  Perhaps
they did this to speed up linking? 

We're using Linux, and we've already tried using RAM drives and getting
lots of RAM.  Unfortunately, we don't entirely grok how to allocate a
certain amt of RAM to the ramdrive.  The technique shown to us was to
mke2fs on /dev/ram1, specifying how many blocks, and then mounting the
/dev/ram1 file.  Doing this made my system unstable, and interestingly, I
couldn't umount it.

We've also tried creating shared libraries which I guess basically defers
the link until each module is needed at execution time.  This speeds
things up rather a lot, but we noticed that gdb doesn't debug shared
libraries very well for us.  If you step into a function that's in a
shared library, instead of popping in, it gets confused about what line
number you're on, or it'll start stepping through what looks like
hash-table glue code.  Not being able to debug hurts.

We're using egcs 1.0.2, and we make extensive use of C++.  I've heard
rumors that libg++ isn't terribly well-tested for interoperability with
other libs.. ?

Thanks for any comments or suggestions.  My e-mail is ddt@crack.com.

	=-ddt->

---------
Dave Taylor, Owner
Crack dot Com, Inc.  http://crack.com


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Incremental Linking
@ 2000-03-10 13:36 Mike Ludwig
  2000-03-10 15:10 ` Martin v. Loewis
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Ludwig @ 2000-03-10 13:36 UTC (permalink / raw)
  To: gcc; +Cc: mludwig

Does GCC support incremental linking and if so what options do I have to 
use?

I checked the mailing list archives and someone asked a similiar
question and the answer was to use shared libraries.  Shared libraries
are not the answer that I am looking for.  What I want to do is link a 
number of objects to gether to create an executable and then relink  in one 
of the (modified) objects again.
Something like:
gcc -o myexe a.o b.o c.o
Make some changes to b.c and recompile:
gcc -c b.c
I then want to relink b.o directly into myexe. Something like
gcc -o myexe myexe b.o

Can I do this somehow?  When I try I get a bunch of errors about duplicate 
symbols.

Thanks,
Mike.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-03-10 15:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-09 19:56 Incremental linking Dave Taylor
1998-04-10  0:39 ` Jeffrey A Law
1998-04-10 12:35   ` Ian Lance Taylor
1998-04-10 17:12     ` Andi Kleen
1998-04-11 11:54       ` Samuel Tardieu
1998-04-10  7:27 ` Richard Henderson
1998-04-10  7:50 ` H.J. Lu
1998-04-10 12:35   ` Ian Lance Taylor
2000-03-10 13:36 Incremental Linking Mike Ludwig
2000-03-10 15:10 ` Martin v. Loewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).