source: chapter08/binutils.xml@ b35ab48b

11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since b35ab48b was 9c4ff70, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Package updates.
Update to bc-5.2.2.
Update to linux-5.16.8.
Update to binutils-2.38. Requires adding zlib to Chapter 6.

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