source: chapter08/binutils.xml@ 942172e

multilib xry111/multilib
Last change on this file since 942172e was ac1639c, checked in by Thomas Trepl <thomas@…>, 8 months ago

Automatic merge of trunk into multilib

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