source: chapter08/binutils.xml@ 8ada78d

12.0 12.0-rc1 12.1 12.1-rc1 multilib trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/update-glibc
Last change on this file since 8ada78d was 8ada78d, checked in by Xi Ruoyao <xry111@…>, 11 months ago

binutils: gprofng man pages are OK now

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