]>
Commit | Line | Data |
---|---|---|
bae7f79e | 1 | gold is an ELF linker. It is intended to have complete support for |
874c5b28 ILT |
2 | ELF and to run as fast as possible on modern systems. For normal use |
3 | it is a drop-in replacement for the older GNU linker. | |
bae7f79e | 4 | |
874c5b28 ILT |
5 | gold is part of the GNU binutils. See ../binutils/README for more |
6 | general notes, including where to send bug reports. | |
7 | ||
8 | gold was originally developed at Google, and was contributed to the | |
9 | Free Software Foundation in March 2008. At Google it was designed by | |
10 | Ian Lance Taylor, with major contributions by Cary Coutant, Craig | |
11 | Silverstein, and Andrew Chatham. | |
12 | ||
13 | The existing GNU linker manual is intended to be accurate | |
14 | documentation for features which gold supports. gold supports most of | |
15 | the features of the GNU linker for ELF targets. Notable | |
16 | omissions--features of the GNU linker not currently supported in | |
17 | gold--are: | |
18 | * MEMORY regions in linker scripts | |
19 | * MRI compatible linker scripts | |
20 | * linker map files (-M, -Map) | |
21 | * cross-reference reports (--cref) | |
22 | * linker garbage collection (--gc-sections) | |
23 | * position independent executables (-pie) | |
24 | * various other minor options | |
25 | ||
26 | ||
27 | Notes on the code | |
28 | ================= | |
29 | ||
30 | These are some notes which may be helpful to people working on the | |
31 | source code of gold itself. | |
32 | ||
33 | gold is written in C++. It is a GNU program, and therefore follows | |
34 | the GNU formatting standards as modified for C++. Source documents in | |
35 | order of decreasing precedence: | |
bae7f79e ILT |
36 | http://www.gnu.org/prep/standards/ |
37 | http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE | |
38 | http://www.zembu.com/eng/procs/c++style.html | |
39 | ||
40 | The linker is intended to have complete support for cross-compilation, | |
874c5b28 ILT |
41 | while still supporting the normal case of native linking as fast as |
42 | possible. In order to do this, many classes are actually templates | |
43 | whose parameter is the ELF file class (e.g., 32 bits or 64 bits). The | |
44 | C++ code is the same, but we don't pay the execution time cost of | |
45 | always using 64-bit integers if the target is 32 bits. Many of these | |
46 | class templates also have an endianness parameter: true for | |
47 | big-endian, false for little-endian. | |
bae7f79e | 48 | |
874c5b28 ILT |
49 | The linker is multi-threaded. The Task class represents a single unit |
50 | of work. Task objects are stored on a single Workqueue object. Tasks | |
51 | communicate via Task_token objects. Task_token objects are only | |
52 | manipulated while holding the master Workqueue lock. Relatively few | |
53 | mutexes are used. |