source: chapter08/binutils.xml@ ceebda5

ml-11.0 multilib
Last change on this file since ceebda5 was ceebda5, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

Merge changes from trunk to multilib

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@12176 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 15.7 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-fin-sbu;</seg>
35 <seg>&binutils-fin-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>Now remove one test that prevents the tests from running
61 to completion:</para>
62
63<screen><userinput remap="pre">sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in</userinput></screen>
64
65 <para>The Binutils documentation recommends building Binutils
66 in a dedicated build directory:</para>
67
68<screen><userinput remap="pre">mkdir -v build
69cd build</userinput></screen>
70
71 <para>Prepare Binutils for compilation:</para>
72
73<screen arch="default"><userinput remap="configure">../configure --prefix=/usr \
74 --enable-gold \
75 --enable-ld=default \
76 --enable-plugins \
77 --enable-shared \
78 --disable-werror \
79 --enable-64-bit-bfd \
80 --with-system-zlib</userinput></screen>
81<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr \
82 --enable-gold \
83 --enable-ld=default \
84 --enable-plugins \
85 --enable-shared \
86 --disable-werror \
87 --enable-64-bit-bfd \
88 --with-system-zlib \
89 --enable-multilib</userinput></screen>
90
91 <variablelist>
92 <title>The meaning of the configure parameters:</title>
93
94 <varlistentry>
95 <term><parameter>--enable-gold</parameter></term>
96 <listitem>
97 <para>Build the gold linker and install it as ld.gold (along side the
98 default linker).</para>
99 </listitem>
100 </varlistentry>
101
102 <varlistentry>
103 <term><parameter>--enable-ld=default</parameter></term>
104 <listitem>
105 <para>Build the original bfd linker and install it as both ld (the
106 default linker) and ld.bfd.</para>
107 </listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><parameter>--enable-plugins</parameter></term>
112 <listitem>
113 <para>Enables plugin support for the linker.</para>
114 </listitem>
115 </varlistentry>
116
117 <varlistentry>
118 <term><parameter>--enable-64-bit-bfd</parameter></term>
119 <listitem>
120 <para>Enables 64-bit support (on hosts with narrower word sizes).
121 May not be needed on 64-bit systems, but does no harm.</para>
122 </listitem>
123 </varlistentry>
124
125 <varlistentry arch="ml_32,ml_x32,ml_all">
126 <term><parameter>--enable-multilib</parameter></term>
127 <listitem>
128 <para>Enables multilib support in bintutils.</para>
129 </listitem>
130 </varlistentry>
131
132 <varlistentry>
133 <term><parameter>--with-system-zlib</parameter></term>
134 <listitem>
135 <para>Use the installed zlib library rather than building the
136 included version.</para>
137 </listitem>
138 </varlistentry>
139
140 </variablelist>
141
142 <para>Compile the package:</para>
143
144<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
145
146 <variablelist>
147 <title>The meaning of the make parameter:</title>
148
149 <varlistentry>
150 <term><parameter>tooldir=/usr</parameter></term>
151 <listitem>
152 <para>Normally, the tooldir (the directory where the executables will
153 ultimately be located) is set to <filename
154 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
155 example, x86_64 machines would expand that to <filename
156 class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
157 a custom system, this target-specific directory in <filename
158 class="directory">/usr</filename> is not required. <filename
159 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
160 used if the system was used to cross-compile (for example, compiling a
161 package on an Intel machine that generates code that can be executed
162 on PowerPC machines).</para>
163 </listitem>
164 </varlistentry>
165
166 </variablelist>
167
168 <important>
169 <para>The test suite for Binutils in this section is considered critical.
170 Do not skip it under any circumstances.</para>
171 </important>
172
173 <para>Test the results:</para>
174
175<screen><userinput remap="test">make -k check</userinput></screen>
176
177 <para>Four tests named <quote>Run property ...</quote> are known to
178 fail.</para>
179
180 <para>Install the package:</para>
181
182<screen><userinput remap="install">make tooldir=/usr install -j1</userinput></screen>
183
184 <para>Remove useless static libraries:</para>
185
186<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a</userinput></screen>
187
188 </sect2>
189
190 <sect2 id="contents-binutils" role="content">
191 <title>Contents of Binutils</title>
192
193 <segmentedlist>
194 <segtitle>Installed programs</segtitle>
195 <segtitle>Installed libraries</segtitle>
196 <segtitle>Installed directory</segtitle>
197
198 <seglistitem>
199 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
200 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
201 <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
202 <seg>/usr/lib/ldscripts</seg>
203 </seglistitem>
204 </segmentedlist>
205
206 <variablelist>
207 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
208 <?dbfo list-presentation="list"?>
209 <?dbhtml list-presentation="table"?>
210
211 <varlistentry id="addr2line">
212 <term><command>addr2line</command></term>
213 <listitem>
214 <para>Translates program addresses to file names and line numbers;
215 given an address and the name of an executable, it uses the debugging
216 information in the executable to determine which source file and line
217 number are associated with the address</para>
218 <indexterm zone="ch-system-binutils addr2line">
219 <primary sortas="b-addr2line">addr2line</primary>
220 </indexterm>
221 </listitem>
222 </varlistentry>
223
224 <varlistentry id="ar">
225 <term><command>ar</command></term>
226 <listitem>
227 <para>Creates, modifies, and extracts from archives</para>
228 <indexterm zone="ch-system-binutils ar">
229 <primary sortas="b-ar">ar</primary>
230 </indexterm>
231 </listitem>
232 </varlistentry>
233
234 <varlistentry id="as">
235 <term><command>as</command></term>
236 <listitem>
237 <para>An assembler that assembles the output of <command>gcc</command>
238 into object files</para>
239 <indexterm zone="ch-system-binutils as">
240 <primary sortas="b-as">as</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="c-filt">
246 <term><command>c++filt</command></term>
247 <listitem>
248 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
249 overloaded functions from clashing</para>
250 <indexterm zone="ch-system-binutils c-filt">
251 <primary sortas="b-c++filt">c++filt</primary>
252 </indexterm>
253 </listitem>
254 </varlistentry>
255
256 <varlistentry id="dwp">
257 <term><command>dwp</command></term>
258 <listitem>
259 <para>The DWARF packaging utility</para>
260 <indexterm zone="ch-system-binutils dwp">
261 <primary sortas="dwp">dwp</primary>
262 </indexterm>
263 </listitem>
264 </varlistentry>
265
266 <varlistentry id="elfedit">
267 <term><command>elfedit</command></term>
268 <listitem>
269 <para>Updates the ELF header of ELF files</para>
270 <indexterm zone="ch-system-binutils elfedit">
271 <primary sortas="b-elfedit">elfedit</primary>
272 </indexterm>
273 </listitem>
274 </varlistentry>
275
276 <varlistentry id="gprof">
277 <term><command>gprof</command></term>
278 <listitem>
279 <para>Displays call graph profile data</para>
280 <indexterm zone="ch-system-binutils gprof">
281 <primary sortas="b-gprof">gprof</primary>
282 </indexterm>
283 </listitem>
284 </varlistentry>
285
286 <varlistentry id="ld">
287 <term><command>ld</command></term>
288 <listitem>
289 <para>A linker that combines a number of object and archive files
290 into a single file, relocating their data and tying up symbol
291 references</para>
292 <indexterm zone="ch-system-binutils ld">
293 <primary sortas="b-ld">ld</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297
298 <varlistentry id="ld.gold">
299 <term><command>ld.gold</command></term>
300 <listitem>
301 <para>A cut down version of ld that only supports the
302 elf object file format</para>
303 <indexterm zone="ch-system-binutils ld.gold">
304 <primary sortas="b-ld.gold">ld.gold</primary>
305 </indexterm>
306 </listitem>
307 </varlistentry>
308
309 <varlistentry id="ld.bfd">
310 <term><command>ld.bfd</command></term>
311 <listitem>
312 <para>Hard link to <command>ld</command></para>
313 <indexterm zone="ch-system-binutils ld.bfd">
314 <primary sortas="b-ld.bfd">ld.bfd</primary>
315 </indexterm>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry id="nm">
320 <term><command>nm</command></term>
321 <listitem>
322 <para>Lists the symbols occurring in a given object file</para>
323 <indexterm zone="ch-system-binutils nm">
324 <primary sortas="b-nm">nm</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="objcopy">
330 <term><command>objcopy</command></term>
331 <listitem>
332 <para>Translates one type of object file into another</para>
333 <indexterm zone="ch-system-binutils objcopy">
334 <primary sortas="b-objcopy">objcopy</primary>
335 </indexterm>
336 </listitem>
337 </varlistentry>
338
339 <varlistentry id="objdump">
340 <term><command>objdump</command></term>
341 <listitem>
342 <para>Displays information about the given object file, with options
343 controlling the particular information to display; the information
344 shown is useful to programmers who are working on the compilation
345 tools</para>
346 <indexterm zone="ch-system-binutils objdump">
347 <primary sortas="b-objdump">objdump</primary>
348 </indexterm>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry id="ranlib">
353 <term><command>ranlib</command></term>
354 <listitem>
355 <para>Generates an index of the contents of an archive and stores it
356 in the archive; the index lists all of the symbols defined by archive
357 members that are relocatable object files</para>
358 <indexterm zone="ch-system-binutils ranlib">
359 <primary sortas="b-ranlib">ranlib</primary>
360 </indexterm>
361 </listitem>
362 </varlistentry>
363
364 <varlistentry id="readelf">
365 <term><command>readelf</command></term>
366 <listitem>
367 <para>Displays information about ELF type binaries</para>
368 <indexterm zone="ch-system-binutils readelf">
369 <primary sortas="b-readelf">readelf</primary>
370 </indexterm>
371 </listitem>
372 </varlistentry>
373
374 <varlistentry id="size">
375 <term><command>size</command></term>
376 <listitem>
377 <para>Lists the section sizes and the total size for the given
378 object files</para>
379 <indexterm zone="ch-system-binutils size">
380 <primary sortas="b-size">size</primary>
381 </indexterm>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry id="strings">
386 <term><command>strings</command></term>
387 <listitem>
388 <para>Outputs, for each given file, the sequences of printable
389 characters that are of at least the specified length (defaulting to
390 four); for object files, it prints, by default, only the strings from
391 the initializing and loading sections while for other types of files, it
392 scans the entire file</para>
393 <indexterm zone="ch-system-binutils strings">
394 <primary sortas="b-strings">strings</primary>
395 </indexterm>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry id="strip">
400 <term><command>strip</command></term>
401 <listitem>
402 <para>Discards symbols from object files</para>
403 <indexterm zone="ch-system-binutils strip">
404 <primary sortas="b-strip">strip</primary>
405 </indexterm>
406 </listitem>
407 </varlistentry>
408
409 <varlistentry id="libbfd">
410 <term><filename class="libraryfile">libbfd</filename></term>
411 <listitem>
412 <para>The Binary File Descriptor library</para>
413 <indexterm zone="ch-system-binutils libbfd">
414 <primary sortas="c-libbfd">libbfd</primary>
415 </indexterm>
416 </listitem>
417 </varlistentry>
418
419 <varlistentry id="libctf">
420 <term><filename class="libraryfile">libctf</filename></term>
421 <listitem>
422 <para>The Compat ANSI-C Type Format debugging support library</para>
423 <indexterm zone="ch-system-binutils libctf">
424 <primary sortas="c-libctf">libctf</primary>
425 </indexterm>
426 </listitem>
427 </varlistentry>
428
429 <varlistentry id="libctf-nobfd">
430 <term><filename class="libraryfile">libctf-nobfd</filename></term>
431 <listitem>
432 <para>A libctf variant which does not use libbfd functionality</para>
433 <indexterm zone="ch-system-binutils libctf-nobfd">
434 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
435 </indexterm>
436 </listitem>
437 </varlistentry>
438
439 <varlistentry id="libopcodes">
440 <term><filename class="libraryfile">libopcodes</filename></term>
441 <listitem>
442 <para>A library for dealing with opcodes&mdash;the <quote>readable
443 text</quote> versions of instructions for the processor;
444 it is used for building utilities like
445 <command>objdump</command></para>
446 <indexterm zone="ch-system-binutils libopcodes">
447 <primary sortas="c-libopcodes">libopcodes</primary>
448 </indexterm>
449 </listitem>
450 </varlistentry>
451
452 </variablelist>
453
454 </sect2>
455
456</sect1>
Note: See TracBrowser for help on using the repository browser.