source: chapter08/binutils.xml@ 0ca76f9

multilib-10.1
Last change on this file since 0ca76f9 was 0ca76f9, checked in by Thomas Trepl <thomas@…>, 4 years ago

Merge changes from trunk to multilib

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