gdb/
[deliverable/binutils-gdb.git] / gold / README
CommitLineData
bae7f79e 1gold is an ELF linker. It is intended to have complete support for
874c5b28
ILT
2ELF and to run as fast as possible on modern systems. For normal use
3it is a drop-in replacement for the older GNU linker.
bae7f79e 4
874c5b28
ILT
5gold is part of the GNU binutils. See ../binutils/README for more
6general notes, including where to send bug reports.
7
8gold was originally developed at Google, and was contributed to the
9Free Software Foundation in March 2008. At Google it was designed by
10Ian Lance Taylor, with major contributions by Cary Coutant, Craig
11Silverstein, and Andrew Chatham.
12
13The existing GNU linker manual is intended to be accurate
14documentation for features which gold supports. gold supports most of
15the features of the GNU linker for ELF targets. Notable
16omissions--features of the GNU linker not currently supported in
17gold--are:
18 * MEMORY regions in linker scripts
19 * MRI compatible linker scripts
874c5b28 20 * cross-reference reports (--cref)
874c5b28
ILT
21 * various other minor options
22
23
24Notes on the code
25=================
26
27These are some notes which may be helpful to people working on the
28source code of gold itself.
29
30gold is written in C++. It is a GNU program, and therefore follows
31the GNU formatting standards as modified for C++. Source documents in
32order of decreasing precedence:
bae7f79e
ILT
33 http://www.gnu.org/prep/standards/
34 http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE
35 http://www.zembu.com/eng/procs/c++style.html
36
37The linker is intended to have complete support for cross-compilation,
874c5b28
ILT
38while still supporting the normal case of native linking as fast as
39possible. In order to do this, many classes are actually templates
40whose parameter is the ELF file class (e.g., 32 bits or 64 bits). The
41C++ code is the same, but we don't pay the execution time cost of
42always using 64-bit integers if the target is 32 bits. Many of these
43class templates also have an endianness parameter: true for
44big-endian, false for little-endian.
bae7f79e 45
874c5b28
ILT
46The linker is multi-threaded. The Task class represents a single unit
47of work. Task objects are stored on a single Workqueue object. Tasks
48communicate via Task_token objects. Task_token objects are only
49manipulated while holding the master Workqueue lock. Relatively few
50mutexes are used.
14359ca0
ILT
51
52
53Build requirements
54==================
55
56The gold source code uses templates heavily. Building it requires a
57recent version of g++. g++ 4.0.3 is known to work. g++ 3.2 and g++
583.4.3 are known to fail.
59
60The linker script parser uses features which are only in newer
61versions of bison. bison 2.3 is known to work. bison 1.26 is known
62to fail. If you are building gold from an official binutils release,
63the bison output should already be included.
This page took 0.212906 seconds and 4 git commands to generate.