source: chapter08/binutils.xml@ 8a687fa

11.2 11.2-rc1 multilib trunk xry111/arm64 xry111/clfs-ng xry111/pip3 xry111/queue-11.3 xry111/rust-wip-20221008
Last change on this file since 8a687fa was 8a687fa, checked in by Xi Ruoyao <xry111@…>, 4 months ago

binutils: add desc for gprofng

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