source: chapter08/binutils.xml@ 3a4f80c

multilib
Last change on this file since 3a4f80c was 3a4f80c, checked in by Thomas Trepl <thomas@…>, 11 months ago

Merge branch '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>Three tests in the gprofng suite are also known to fail.</para>
167
168 <para>Install the package:</para>
169
170<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
171
172 <para>Remove useless static libraries:</para>
173
174<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a</userinput></screen>
175
176 </sect2>
177
178 <sect2 id="contents-binutils" role="content">
179 <title>Contents of Binutils</title>
180
181 <segmentedlist>
182 <segtitle>Installed programs</segtitle>
183 <segtitle>Installed libraries</segtitle>
184 <segtitle>Installed directory</segtitle>
185
186 <seglistitem>
187 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
188 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
189 <seg>libbfd.so, libctf.so, libctf-nobfd.so, libopcodes.so, and libsframe.so</seg>
190 <seg>/usr/lib/ldscripts</seg>
191 </seglistitem>
192 </segmentedlist>
193
194 <variablelist>
195 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
196 <?dbfo list-presentation="list"?>
197 <?dbhtml list-presentation="table"?>
198
199 <varlistentry id="addr2line">
200 <term><command>addr2line</command></term>
201 <listitem>
202 <para>Translates program addresses to file names and line numbers;
203 given an address and the name of an executable, it uses the debugging
204 information in the executable to determine which source file and line
205 number are associated with the address</para>
206 <indexterm zone="ch-system-binutils addr2line">
207 <primary sortas="b-addr2line">addr2line</primary>
208 </indexterm>
209 </listitem>
210 </varlistentry>
211
212 <varlistentry id="ar">
213 <term><command>ar</command></term>
214 <listitem>
215 <para>Creates, modifies, and extracts from archives</para>
216 <indexterm zone="ch-system-binutils ar">
217 <primary sortas="b-ar">ar</primary>
218 </indexterm>
219 </listitem>
220 </varlistentry>
221
222 <varlistentry id="as">
223 <term><command>as</command></term>
224 <listitem>
225 <para>An assembler that assembles the output of <command>gcc</command>
226 into object files</para>
227 <indexterm zone="ch-system-binutils as">
228 <primary sortas="b-as">as</primary>
229 </indexterm>
230 </listitem>
231 </varlistentry>
232
233 <varlistentry id="c-filt">
234 <term><command>c++filt</command></term>
235 <listitem>
236 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
237 overloaded functions from clashing</para>
238 <indexterm zone="ch-system-binutils c-filt">
239 <primary sortas="b-c++filt">c++filt</primary>
240 </indexterm>
241 </listitem>
242 </varlistentry>
243
244 <varlistentry id="dwp">
245 <term><command>dwp</command></term>
246 <listitem>
247 <para>The DWARF packaging utility</para>
248 <indexterm zone="ch-system-binutils dwp">
249 <primary sortas="dwp">dwp</primary>
250 </indexterm>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry id="elfedit">
255 <term><command>elfedit</command></term>
256 <listitem>
257 <para>Updates the ELF headers of ELF files</para>
258 <indexterm zone="ch-system-binutils elfedit">
259 <primary sortas="b-elfedit">elfedit</primary>
260 </indexterm>
261 </listitem>
262 </varlistentry>
263
264 <varlistentry id="gprof">
265 <term><command>gprof</command></term>
266 <listitem>
267 <para>Displays call graph profile data</para>
268 <indexterm zone="ch-system-binutils gprof">
269 <primary sortas="b-gprof">gprof</primary>
270 </indexterm>
271 </listitem>
272 </varlistentry>
273
274 <varlistentry id="gprofng">
275 <term><command>gprofng</command></term>
276 <listitem>
277 <para>Gathers and analyzes performance data</para>
278 <indexterm zone="ch-system-binutils gprofng">
279 <primary sortas="b-gprofng">gprofng</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283
284 <varlistentry id="ld">
285 <term><command>ld</command></term>
286 <listitem>
287 <para>A linker that combines a number of object and archive files
288 into a single file, relocating their data and tying up symbol
289 references</para>
290 <indexterm zone="ch-system-binutils ld">
291 <primary sortas="b-ld">ld</primary>
292 </indexterm>
293 </listitem>
294 </varlistentry>
295
296 <varlistentry id="ld.gold">
297 <term><command>ld.gold</command></term>
298 <listitem>
299 <para>A cut down version of ld that only supports the
300 elf object file format</para>
301 <indexterm zone="ch-system-binutils ld.gold">
302 <primary sortas="b-ld.gold">ld.gold</primary>
303 </indexterm>
304 </listitem>
305 </varlistentry>
306
307 <varlistentry id="ld.bfd">
308 <term><command>ld.bfd</command></term>
309 <listitem>
310 <para>A hard link to <command>ld</command></para>
311 <indexterm zone="ch-system-binutils ld.bfd">
312 <primary sortas="b-ld.bfd">ld.bfd</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="nm">
318 <term><command>nm</command></term>
319 <listitem>
320 <para>Lists the symbols occurring in a given object file</para>
321 <indexterm zone="ch-system-binutils nm">
322 <primary sortas="b-nm">nm</primary>
323 </indexterm>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry id="objcopy">
328 <term><command>objcopy</command></term>
329 <listitem>
330 <para>Translates one type of object file into another</para>
331 <indexterm zone="ch-system-binutils objcopy">
332 <primary sortas="b-objcopy">objcopy</primary>
333 </indexterm>
334 </listitem>
335 </varlistentry>
336
337 <varlistentry id="objdump">
338 <term><command>objdump</command></term>
339 <listitem>
340 <para>Displays information about the given object file, with options
341 controlling the particular information to display; the information
342 shown is useful to programmers who are working on the compilation
343 tools</para>
344 <indexterm zone="ch-system-binutils objdump">
345 <primary sortas="b-objdump">objdump</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="ranlib">
351 <term><command>ranlib</command></term>
352 <listitem>
353 <para>Generates an index of the contents of an archive and stores it
354 in the archive; the index lists all of the symbols defined by archive
355 members that are relocatable object files</para>
356 <indexterm zone="ch-system-binutils ranlib">
357 <primary sortas="b-ranlib">ranlib</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="readelf">
363 <term><command>readelf</command></term>
364 <listitem>
365 <para>Displays information about ELF type binaries</para>
366 <indexterm zone="ch-system-binutils readelf">
367 <primary sortas="b-readelf">readelf</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="size">
373 <term><command>size</command></term>
374 <listitem>
375 <para>Lists the section sizes and the total size for the given
376 object files</para>
377 <indexterm zone="ch-system-binutils size">
378 <primary sortas="b-size">size</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
383 <varlistentry id="strings">
384 <term><command>strings</command></term>
385 <listitem>
386 <para>Outputs, for each given file, the sequences of printable
387 characters that are of at least the specified length (defaulting to
388 four); for object files, it prints, by default, only the strings from
389 the initializing and loading sections while for other types of files, it
390 scans the entire file</para>
391 <indexterm zone="ch-system-binutils strings">
392 <primary sortas="b-strings">strings</primary>
393 </indexterm>
394 </listitem>
395 </varlistentry>
396
397 <varlistentry id="strip">
398 <term><command>strip</command></term>
399 <listitem>
400 <para>Discards symbols from object files</para>
401 <indexterm zone="ch-system-binutils strip">
402 <primary sortas="b-strip">strip</primary>
403 </indexterm>
404 </listitem>
405 </varlistentry>
406
407 <varlistentry id="libbfd">
408 <term><filename class="libraryfile">libbfd</filename></term>
409 <listitem>
410 <para>The Binary File Descriptor library</para>
411 <indexterm zone="ch-system-binutils libbfd">
412 <primary sortas="c-libbfd">libbfd</primary>
413 </indexterm>
414 </listitem>
415 </varlistentry>
416
417 <varlistentry id="libctf">
418 <term><filename class="libraryfile">libctf</filename></term>
419 <listitem>
420 <para>The Compat ANSI-C Type Format debugging support library</para>
421 <indexterm zone="ch-system-binutils libctf">
422 <primary sortas="c-libctf">libctf</primary>
423 </indexterm>
424 </listitem>
425 </varlistentry>
426
427 <varlistentry id="libctf-nobfd">
428 <term><filename class="libraryfile">libctf-nobfd</filename></term>
429 <listitem>
430 <para>A libctf variant which does not use libbfd functionality</para>
431 <indexterm zone="ch-system-binutils libctf-nobfd">
432 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
433 </indexterm>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry id="libopcodes">
438 <term><filename class="libraryfile">libopcodes</filename></term>
439 <listitem>
440 <para>A library for dealing with opcodes&mdash;the <quote>readable
441 text</quote> versions of instructions for the processor;
442 it is used for building utilities like
443 <command>objdump</command></para>
444 <indexterm zone="ch-system-binutils libopcodes">
445 <primary sortas="c-libopcodes">libopcodes</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="libsframe">
451 <term><filename class="libraryfile">libsframe</filename></term>
452 <listitem>
453 <para>A library to support online backtracing using a
454 simple unwinder</para>
455 <indexterm zone="ch-system-binutils libsframe">
456 <primary sortas="c-libsframe">libsframe</primary>
457 </indexterm>
458 </listitem>
459 </varlistentry>
460
461 </variablelist>
462
463 </sect2>
464
465</sect1>
Note: See TracBrowser for help on using the repository browser.