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 <[EMAIL PROTECTED]> 
2008-11-18 00:21

收件人
[EMAIL PROTECTED]
抄送
bug-binutils@gnu.org
主题
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.

Cheers
   Nick



_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to