ld a memory hog on Ubuntu 10/11?

Peter Teuben teuben at astro.umd.edu
Mon Jun 27 17:43:26 UTC 2011


On 06/27/2011 12:58 PM, Peter Teuben wrote:
> Recently I noted that the loaded (ld) allocates memory that I've 
> declared in large static arrays in fortran programs.
> I wrote a simple short C program that exhibits the same problem (or 
> perhaps it's a new feature):
>
>      gcc -o ldhog  ldhog.c
>
> will (depending how much memory you have, and how big N is) sit there 
> for quite some time.This version uses a little over 500MB.
> In previous versions of ld, this was not a problem, but somehow now it 
> is.  Perhaps this is a bug fixed in Ubuntu 11 ?
> I am running this on 10.10.
> AFAIK, the array is uninitilized data, and indeed, the size command 
> shows up with 500+ MB in the .bss section of the executable.
> So it's beyond me why ld should allocate that space and do something 
> with it.
>
> Anybody have an idea what's going on here?
>


one reply to my post. The compile (link) option

       -fuse=gold

appears to be doing the job.   I also confirmed that Ubuntu 11.04 still 
has the same "issue", thogh a newer version
of binutils.





More information about the ubuntu-users mailing list