source: chapter08/binutils.xml@ adcaa44d

multilib
Last change on this file since adcaa44d was ce49ad6, checked in by Thomas Trepl <thomas@…>, 16 months ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 16.0 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>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 --with-system-zlib</userinput></screen>
61<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr \
62 --sysconfdir=/etc \
63 --enable-gold \
64 --enable-ld=default \
65 --enable-plugins \
66 --enable-shared \
67 --disable-werror \
68 --enable-64-bit-bfd \
69 --with-system-zlib \
70 --enable-multilib</userinput></screen>
71
72 <variablelist>
73 <title>The meaning of the configure parameters:</title>
74
75 <varlistentry>
76 <term><parameter>--enable-gold</parameter></term>
77 <listitem>
78 <para>Build the gold linker and install it as ld.gold (alongside the
79 default linker).</para>
80 </listitem>
81 </varlistentry>
82
83 <varlistentry>
84 <term><parameter>--enable-ld=default</parameter></term>
85 <listitem>
86 <para>Build the original bfd linker and install it as both ld (the
87 default linker) and ld.bfd.</para>
88 </listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><parameter>--enable-plugins</parameter></term>
93 <listitem>
94 <para>Enables plugin support for the linker.</para>
95 </listitem>
96 </varlistentry>
97
98 <varlistentry>
99 <term><parameter>--enable-64-bit-bfd</parameter></term>
100 <listitem>
101 <para>Enables 64-bit support (on hosts with narrower word sizes).
102 May not be needed on 64-bit systems, but does no harm.</para>
103 </listitem>
104 </varlistentry>
105
106 <varlistentry arch="ml_32,ml_x32,ml_all">
107 <term><parameter>--enable-multilib</parameter></term>
108 <listitem>
109 <para>Enables multilib support in bintutils.</para>
110 </listitem>
111 </varlistentry>
112
113 <varlistentry>
114 <term><parameter>--with-system-zlib</parameter></term>
115 <listitem>
116 <para>Use the installed zlib library instead of building the
117 included version.</para>
118 </listitem>
119 </varlistentry>
120
121 </variablelist>
122
123 <para>Compile the package:</para>
124
125<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
126
127 <variablelist>
128 <title>The meaning of the make parameter:</title>
129
130 <varlistentry>
131 <term><parameter>tooldir=/usr</parameter></term>
132 <listitem>
133 <para>Normally, the tooldir (the directory where the executables will
134 ultimately be located) is set to <filename
135 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
136 example, x86_64 machines would expand that to <filename
137 class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
138 a custom system, this target-specific directory in <filename
139 class="directory">/usr</filename> is not required. <filename
140 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
141 used if the system were used to cross-compile (for example, compiling a
142 package on an Intel machine that generates code that can be executed
143 on PowerPC machines).</para>
144 </listitem>
145 </varlistentry>
146
147 </variablelist>
148
149 <important>
150 <para>The test suite for Binutils in this section is considered critical.
151 Do not skip it under any circumstances.</para>
152 </important>
153
154 <para>Test the results:</para>
155
156<screen><userinput remap="test">make -k check</userinput></screen>
157
158 <para>For a list of failed tests, run:</para>
159
160<screen><userinput remap="test">grep '^FAIL:' $(find -name '*.log')</userinput></screen>
161
162 <para>Twelve tests fail in the gold test suite when the
163 <option>--enable-default-pie</option> and
164 <option>--enable-default-ssp</option> options are passed to GCC.</para>
165
166 <para>Install the package:</para>
167
168<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
169
170 <para>Remove useless static libraries and an empty man page:</para>
171
172<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a
173rm -fv /usr/share/man/man1/{gprofng,gp-*}.1</userinput></screen>
174
175 </sect2>
176
177 <sect2 id="contents-binutils" role="content">
178 <title>Contents of Binutils</title>
179
180 <segmentedlist>
181 <segtitle>Installed programs</segtitle>
182 <segtitle>Installed libraries</segtitle>
183 <segtitle>Installed directory</segtitle>
184
185 <seglistitem>
186 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
187 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
188 <seg>libbfd.so, libctf.so, libctf-nobfd.so, libopcodes.so, and libsframe.so</seg>
189 <seg>/usr/lib/ldscripts</seg>
190 </seglistitem>
191 </segmentedlist>
192
193 <variablelist>
194 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
195 <?dbfo list-presentation="list"?>
196 <?dbhtml list-presentation="table"?>
197
198 <varlistentry id="addr2line">
199 <term><command>addr2line</command></term>
200 <listitem>
201 <para>Translates program addresses to file names and line numbers;
202 given an address and the name of an executable, it uses the debugging
203 information in the executable to determine which source file and line
204 number are associated with the address</para>
205 <indexterm zone="ch-system-binutils addr2line">
206 <primary sortas="b-addr2line">addr2line</primary>
207 </indexterm>
208 </listitem>
209 </varlistentry>
210
211 <varlistentry id="ar">
212 <term><command>ar</command></term>
213 <listitem>
214 <para>Creates, modifies, and extracts from archives</para>
215 <indexterm zone="ch-system-binutils ar">
216 <primary sortas="b-ar">ar</primary>
217 </indexterm>
218 </listitem>
219 </varlistentry>
220
221 <varlistentry id="as">
222 <term><command>as</command></term>
223 <listitem>
224 <para>An assembler that assembles the output of <command>gcc</command>
225 into object files</para>
226 <indexterm zone="ch-system-binutils as">
227 <primary sortas="b-as">as</primary>
228 </indexterm>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry id="c-filt">
233 <term><command>c++filt</command></term>
234 <listitem>
235 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
236 overloaded functions from clashing</para>
237 <indexterm zone="ch-system-binutils c-filt">
238 <primary sortas="b-c++filt">c++filt</primary>
239 </indexterm>
240 </listitem>
241 </varlistentry>
242
243 <varlistentry id="dwp">
244 <term><command>dwp</command></term>
245 <listitem>
246 <para>The DWARF packaging utility</para>
247 <indexterm zone="ch-system-binutils dwp">
248 <primary sortas="dwp">dwp</primary>
249 </indexterm>
250 </listitem>
251 </varlistentry>
252
253 <varlistentry id="elfedit">
254 <term><command>elfedit</command></term>
255 <listitem>
256 <para>Updates the ELF headers of ELF files</para>
257 <indexterm zone="ch-system-binutils elfedit">
258 <primary sortas="b-elfedit">elfedit</primary>
259 </indexterm>
260 </listitem>
261 </varlistentry>
262
263 <varlistentry id="gprof">
264 <term><command>gprof</command></term>
265 <listitem>
266 <para>Displays call graph profile data</para>
267 <indexterm zone="ch-system-binutils gprof">
268 <primary sortas="b-gprof">gprof</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry id="gprofng">
274 <term><command>gprofng</command></term>
275 <listitem>
276 <para>Gathers and analyzes performance data</para>
277 <indexterm zone="ch-system-binutils gprofng">
278 <primary sortas="b-gprofng">gprofng</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>A 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 <varlistentry id="libsframe">
450 <term><filename class="libraryfile">libsframe</filename></term>
451 <listitem>
452 <para>A library to support online backtracing using a
453 simple unwinder</para>
454 <indexterm zone="ch-system-binutils libsframe">
455 <primary sortas="c-libsframe">libsframe</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 </variablelist>
461
462 </sect2>
463
464</sect1>
Note: See TracBrowser for help on using the repository browser.