source: chapter08/binutils.xml@ c5750ecf

ml-11.0 multilib
Last change on this file since c5750ecf was c5750ecf, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Automatic merge of trunk into multilib

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