source: chapter06/binutils.xml@ 427a460

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 427a460 was e123025, checked in by DJ Lucas <dj@…>, 7 years ago

Add gold linker to ch6 binutils build, restore chapter 5 bison.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11178 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 12.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-binutils" role="wrap">
9 <?dbhtml filename="binutils.html"?>
10
11 <sect1info condition="script">
12 <productname>binutils</productname>
13 <productnumber>&binutils-version;</productnumber>
14 <address>&binutils-url;</address>
15 </sect1info>
16
17 <title>Binutils-&binutils-version;</title>
18
19 <indexterm zone="ch-system-binutils">
20 <primary sortas="a-Binutils">Binutils</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Binutils package contains a linker, an assembler, and other
27 tools for handling object files.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&binutils-ch6-sbu;</seg>
35 <seg>&binutils-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of Binutils</title>
43
44 <para>Verify that the PTYs are working properly inside the chroot
45 environment by performing a simple test:</para>
46
47<screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
48
49 <para>This command should output the following:</para>
50
51<screen><computeroutput>spawn ls</computeroutput></screen>
52
53 <para>If, instead, the output includes the message below, then the environment
54 is not set up for proper PTY operation. This issue needs to be resolved before
55 running the test suites for Binutils and GCC:</para>
56
57<screen><computeroutput>The system has no more ptys.
58Ask your system administrator to create more.</computeroutput></screen>
59
60 <para>The Binutils documentation recommends building Binutils
61 in a dedicated build directory:</para>
62
63<screen><userinput remap="pre">mkdir -v build
64cd build</userinput></screen>
65
66 <para>Prepare Binutils for compilation:</para>
67
68<screen><userinput remap="configure">../configure --prefix=/usr \
69 --enable-gold \
70 --enable-ld=default \
71 --enable-plugins \
72 --enable-shared \
73 --disable-werror \
74 --with-system-zlib</userinput></screen>
75 <variablelist>
76 <title>The meaning of the configure parameters:</title>
77
78 <varlistentry>
79 <term><parameter>--enable-gold</parameter></term>
80 <listitem>
81 <para>Build the gold linker and install it as ld.gold (along side the
82 default linker).</para>
83 </listitem>
84 </varlistentry>
85
86 <varlistentry>
87 <term><parameter>--enable-ld=default</parameter></term>
88 <listitem>
89 <para>Build the original bdf linker and install it as both ld (the
90 default linker) and ld.bfd.</para>
91 </listitem>
92 </varlistentry>
93
94 <varlistentry>
95 <term><parameter>--enable-plugins</parameter></term>
96 <listitem>
97 <para>Enables plugin support for the linker.</para>
98 </listitem>
99 </varlistentry>
100
101 <varlistentry>
102 <term><parameter>--with-system-zlib</parameter></term>
103 <listitem>
104 <para>Use the installed zlib library rather than building the
105 included version.</para>
106 </listitem>
107 </varlistentry>
108
109 </variablelist>
110
111 <para>Compile the package:</para>
112
113<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
114
115 <variablelist>
116 <title>The meaning of the make parameter:</title>
117
118 <varlistentry>
119 <term><parameter>tooldir=/usr</parameter></term>
120 <listitem>
121 <para>Normally, the tooldir (the directory where the executables will
122 ultimately be located) is set to <filename
123 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
124 example, x86_64 machines would expand that to <filename
125 class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
126 a custom system, this target-specific directory in <filename
127 class="directory">/usr</filename> is not required. <filename
128 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
129 used if the system was used to cross-compile (for example, compiling a
130 package on an Intel machine that generates code that can be executed
131 on PowerPC machines).</para>
132 </listitem>
133 </varlistentry>
134
135 </variablelist>
136
137 <important>
138 <para>The test suite for Binutils in this section is considered critical.
139 Do not skip it under any circumstances.</para>
140 </important>
141
142 <para>Test the results:</para>
143
144<screen><userinput remap="test">make -k check</userinput></screen>
145
146 <para>Install the package:</para>
147
148<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
149
150 </sect2>
151
152 <sect2 id="contents-binutils" role="content">
153 <title>Contents of Binutils</title>
154
155 <segmentedlist>
156 <segtitle>Installed programs</segtitle>
157 <segtitle>Installed libraries</segtitle>
158 <segtitle>Installed directory</segtitle>
159
160 <seglistitem>
161 <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
162 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
163 <seg>libbfd.{a,so} and libopcodes.{a,so}</seg>
164 <seg>/usr/lib/ldscripts</seg>
165 </seglistitem>
166 </segmentedlist>
167
168 <variablelist>
169 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
170 <?dbfo list-presentation="list"?>
171 <?dbhtml list-presentation="table"?>
172
173 <varlistentry id="addr2line">
174 <term><command>addr2line</command></term>
175 <listitem>
176 <para>Translates program addresses to file names and line numbers;
177 given an address and the name of an executable, it uses the debugging
178 information in the executable to determine which source file and line
179 number are associated with the address</para>
180 <indexterm zone="ch-system-binutils addr2line">
181 <primary sortas="b-addr2line">addr2line</primary>
182 </indexterm>
183 </listitem>
184 </varlistentry>
185
186 <varlistentry id="ar">
187 <term><command>ar</command></term>
188 <listitem>
189 <para>Creates, modifies, and extracts from archives</para>
190 <indexterm zone="ch-system-binutils ar">
191 <primary sortas="b-ar">ar</primary>
192 </indexterm>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry id="as">
197 <term><command>as</command></term>
198 <listitem>
199 <para>An assembler that assembles the output of <command>gcc</command>
200 into object files</para>
201 <indexterm zone="ch-system-binutils as">
202 <primary sortas="b-as">as</primary>
203 </indexterm>
204 </listitem>
205 </varlistentry>
206
207 <varlistentry id="c-filt">
208 <term><command>c++filt</command></term>
209 <listitem>
210 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
211 overloaded functions from clashing</para>
212 <indexterm zone="ch-system-binutils c-filt">
213 <primary sortas="b-c++filt">c++filt</primary>
214 </indexterm>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry id="elfedit">
219 <term><command>elfedit</command></term>
220 <listitem>
221 <para>Updates the ELF header of ELF files</para>
222 <indexterm zone="ch-system-binutils elfedit">
223 <primary sortas="b-elfedit">elfedit</primary>
224 </indexterm>
225 </listitem>
226 </varlistentry>
227
228 <varlistentry id="gprof">
229 <term><command>gprof</command></term>
230 <listitem>
231 <para>Displays call graph profile data</para>
232 <indexterm zone="ch-system-binutils gprof">
233 <primary sortas="b-gprof">gprof</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="ld">
239 <term><command>ld</command></term>
240 <listitem>
241 <para>A linker that combines a number of object and archive files
242 into a single file, relocating their data and tying up symbol
243 references</para>
244 <indexterm zone="ch-system-binutils ld">
245 <primary sortas="b-ld">ld</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="ld.bfd">
251 <term><command>ld.bfd</command></term>
252 <listitem>
253 <para>Hard link to <command>ld</command></para>
254 <indexterm zone="ch-system-binutils ld.bfd">
255 <primary sortas="b-ld.bfd">ld.bfd</primary>
256 </indexterm>
257 </listitem>
258 </varlistentry>
259
260 <varlistentry id="nm">
261 <term><command>nm</command></term>
262 <listitem>
263 <para>Lists the symbols occurring in a given object file</para>
264 <indexterm zone="ch-system-binutils nm">
265 <primary sortas="b-nm">nm</primary>
266 </indexterm>
267 </listitem>
268 </varlistentry>
269
270 <varlistentry id="objcopy">
271 <term><command>objcopy</command></term>
272 <listitem>
273 <para>Translates one type of object file into another</para>
274 <indexterm zone="ch-system-binutils objcopy">
275 <primary sortas="b-objcopy">objcopy</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
280 <varlistentry id="objdump">
281 <term><command>objdump</command></term>
282 <listitem>
283 <para>Displays information about the given object file, with options
284 controlling the particular information to display; the information
285 shown is useful to programmers who are working on the compilation
286 tools</para>
287 <indexterm zone="ch-system-binutils objdump">
288 <primary sortas="b-objdump">objdump</primary>
289 </indexterm>
290 </listitem>
291 </varlistentry>
292
293 <varlistentry id="ranlib">
294 <term><command>ranlib</command></term>
295 <listitem>
296 <para>Generates an index of the contents of an archive and stores it
297 in the archive; the index lists all of the symbols defined by archive
298 members that are relocatable object files</para>
299 <indexterm zone="ch-system-binutils ranlib">
300 <primary sortas="b-ranlib">ranlib</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="readelf">
306 <term><command>readelf</command></term>
307 <listitem>
308 <para>Displays information about ELF type binaries</para>
309 <indexterm zone="ch-system-binutils readelf">
310 <primary sortas="b-readelf">readelf</primary>
311 </indexterm>
312 </listitem>
313 </varlistentry>
314
315 <varlistentry id="size">
316 <term><command>size</command></term>
317 <listitem>
318 <para>Lists the section sizes and the total size for the given
319 object files</para>
320 <indexterm zone="ch-system-binutils size">
321 <primary sortas="b-size">size</primary>
322 </indexterm>
323 </listitem>
324 </varlistentry>
325
326 <varlistentry id="strings">
327 <term><command>strings</command></term>
328 <listitem>
329 <para>Outputs, for each given file, the sequences of printable
330 characters that are of at least the specified length (defaulting to
331 four); for object files, it prints, by default, only the strings from
332 the initializing and loading sections while for other types of files, it
333 scans the entire file</para>
334 <indexterm zone="ch-system-binutils strings">
335 <primary sortas="b-strings">strings</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry id="strip">
341 <term><command>strip</command></term>
342 <listitem>
343 <para>Discards symbols from object files</para>
344 <indexterm zone="ch-system-binutils strip">
345 <primary sortas="b-strip">strip</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="libbfd">
351 <term><filename class="libraryfile">libbfd</filename></term>
352 <listitem>
353 <para>The Binary File Descriptor library</para>
354 <indexterm zone="ch-system-binutils libbfd">
355 <primary sortas="c-libbfd">libbfd</primary>
356 </indexterm>
357 </listitem>
358 </varlistentry>
359
360 <varlistentry id="libopcodes">
361 <term><filename class="libraryfile">libopcodes</filename></term>
362 <listitem>
363 <para>A library for dealing with opcodes&mdash;the <quote>readable
364 text</quote> versions of instructions for the processor;
365 it is used for building utilities like
366 <command>objdump</command></para>
367 <indexterm zone="ch-system-binutils libopcodes">
368 <primary sortas="c-libopcodes">libopcodes</primary>
369 </indexterm>
370 </listitem>
371 </varlistentry>
372
373 </variablelist>
374
375 </sect2>
376
377</sect1>
Note: See TracBrowser for help on using the repository browser.