source: chapter08/binutils.xml@ 738a4c1

multilib
Last change on this file since 738a4c1 was 738a4c1, checked in by Thomas Trepl (Moody) <thomas@…>, 2 years ago

Automatic merge of trunk into multilib

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