source: chapter08/binutils.xml@ 00e8b532

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

Merge upstream changes

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