source: chapter08/binutils.xml@ e05a52a

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