source: chapter08/binutils.xml@ b1169eb

multilib xry111/multilib
Last change on this file since b1169eb was b1169eb, checked in by Thomas Trepl <thomas@…>, 2 months ago

Automatic merge of trunk into multilib

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