[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

答复: Re: ´ð¸´: Re: How large fil e can be processed by the linker "ld"?

From: shihhuangti
Subject: 答复: Re: ´ð¸´: Re: How large fil e can be processed by the linker "ld"?
Date: Tue, 18 Nov 2008 00:49:40 +0800

Hi, Nick,

thanks for your suggestion, I'll try it tomorrow.

from your reply about my using option  "-X -s", I think it is necessary to detail the prcess of my operation:

Step first, I use option "-r" to link all the objs together(without option "-X -s"), and it succeed; the output obj file has size of 2G bytes above;

Step second, I use option  "-X -s" with option "-r", but ld failed.

it is diffcult to me to explain why this happens, for the memory required by the second step should be smaller the the first step(because the ld can drop some section within every obj file); and the first functions, why the second doesn't? additionly, the ld doesn't generated any message like "memory exhausted" which it does when I want to generate a exe-file (have hot reloc info), So I think the error happens during at second step may due to some other cause but not about the available memory amount.

Nick Clifton <address@hidden>

2008-11-18 00:21

Re: ´ð¸´: Re: How large file can be processed by the linker "ld"?

Hi shihhuangti,

> I want to know why the linker use such amount memory to put the objs
> together? it is possible to be optimized?

Yes, but it would be a lot of work.  (Essentially it would mean
rewriting the linker with minimizing memory usage as the main aim).  But
... this does suggest an alternative - have you tried using a different
linker ?  There are two that I know of that might work for you - the
"gold" linker which is currently under development in the binutils
project and the linker which comes with the elfutils project.  (I am not
really involved in the elfutils project so I cannot tell you any more
about their linker).  The gold linker can be built from the current
binutils sources by specifying --enable-gold on the configure command
line.  Give it a try and see if it helps.

> if I doesn't use option  "-X -s" when invoking the linker ld, and with
> option "-r" the relocated obj file can be generated which has size of 2g
> bytes above.
> I think this is a bug, am I right?

I don't think so.  The problem is that you are dealing with a very big
program and you are attempting to link it on a machine with only a
limited amount of memory.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]