bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22831] ld causes massive thrashing if object files are not fully


From: giovanni.lostumbo at gmail dot com
Subject: [Bug ld/22831] ld causes massive thrashing if object files are not fully memory-resident: new algorithm needed
Date: Mon, 19 Sep 2022 10:10:08 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22831

--- Comment #38 from Giovanni Lostumbo <giovanni.lostumbo at gmail dot com> ---
I contacted Dr.(h.c) Richard Stallman the other day to inquire which of
original GNU ld versions he wrote.

He replied (spelling errors included and annotated with "[sic]" by me),  

"The original GNU ld was written ny[sic] me.  I designed it to minimize
total memory usage by reading all the object files and libraries twice
in the right oder[sic].

Others wrote a different ld program in the early 1990s.
I think that was to support additional features and output formats.
However, machines' memory sizes were bigger and they did not preserve
what I had done to reduce the total memory requirement."

Upon checking the ld.c file in Binutils 1.9, Stallman wrote the first version
of ld. "/* Written by Richard Stallman with some help from Eric Albert."  He
also wrote the 1988 and 1988 binutils files, which appear to be betas.

The ld file(s) in Binutils 1.94-beta were written by Steve Chamberlain, and
Binutils 2.1 is a completely different version onwards.

Thus it appears that the only official version of binutils that contains the
memory minimizing technique is 1.9. I have attached ld.c here along with the
source (171KB). Link:
http://www.mirrorservice.org/sites/sources.redhat.com/pub/binutils/old-releases/binutils-1.9.tar.bz2

What are the additional features? From an old GNU ld manual, "ld version 2
January 1994": 

"This version of ld uses the general purpose BFD libraries to operate on object
files. This allows ld to read, combine, and write object files in many
different formats--for example, COFF or a.out. Different formats may be linked
together to produce any available kind of object file. See section BFD, for
more information. 

Aside from its flexibility, the GNU linker is more helpful than other linkers
in providing diagnostic information. Many linkers abandon execution immediately
upon encountering an error; whenever possible, ld continues executing, allowing
you to identify other errors (or, in some cases, to get an output file in spite
of the error)." Source:
https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_1.html#SEC1

Could the original version be adapted to retain memory minimizing techniques
while supporting additional output formats? I don't know. It seems like most,
if not all the new features result in additional memory usage (size of ld 1.9
is 171 KB uncompressed; size of ld folder in 2.1 is 696 KB-multiple ld files).
Whether the original techniques were even tested to work with the new features
is something worth exploring.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

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