source: chapter08/binutils.xml@ a151e09

multilib
Last change on this file since a151e09 was a151e09, checked in by Thomas Trepl (Moody) <thomas@…>, 21 months ago

Automatic merge of trunk into multilib

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