source: chapter08/binutils.xml@ ba1a9cf

multilib trunk xry111/arm64 xry111/loongarch
Last change on this file since ba1a9cf was cdf280e, checked in by Bruce Dubbs <bdubbs@…>, 4 months ago

Package updates.
Update to openssl-3.2.1.
Update to zlib-1.3.1.
Update to xz-5.4.6.
Update to linux-6.7.2.
Update to iana-etc-20240125.
Update to binutils-2.42.
Update to acl-2.3.2.
Update upstream fixes for readline-8.2.
Apply upstream fix for bash-5.2.21.

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