source: chapter08/binutils.xml@ 328eb6f

xry111/arm64
Last change on this file since 328eb6f was 328eb6f, checked in by Xi Ruoyao <xry111@…>, 6 months ago

Merge remote-tracking branch 'origin/trunk' into xry111/arm64

  • Property mode set to 100644
File size: 15.4 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, ARM64 machines would expand that to <filename
113 class="directory">/usr/aarch64-unknown-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>Three tests in the gprofng suite are also known to fail.</para>-->
139
140 <para>Install the package:</para>
141
142<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
143
144 <para>Remove useless static libraries:</para>
145
146<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a</userinput></screen>
147
148 </sect2>
149
150 <sect2 id="contents-binutils" role="content">
151 <title>Contents of Binutils</title>
152
153 <segmentedlist>
154 <segtitle>Installed programs</segtitle>
155 <segtitle>Installed libraries</segtitle>
156 <segtitle>Installed directory</segtitle>
157
158 <seglistitem>
159 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
160 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
161 <seg>libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so,
162 libopcodes.so, and libsframe.so</seg>
163 <seg>/usr/lib/ldscripts</seg>
164 </seglistitem>
165 </segmentedlist>
166
167 <variablelist>
168 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
169 <?dbfo list-presentation="list"?>
170 <?dbhtml list-presentation="table"?>
171
172 <varlistentry id="addr2line">
173 <term><command>addr2line</command></term>
174 <listitem>
175 <para>Translates program addresses to file names and line numbers;
176 given an address and the name of an executable, it uses the debugging
177 information in the executable to determine which source file and line
178 number are associated with the address</para>
179 <indexterm zone="ch-system-binutils addr2line">
180 <primary sortas="b-addr2line">addr2line</primary>
181 </indexterm>
182 </listitem>
183 </varlistentry>
184
185 <varlistentry id="ar">
186 <term><command>ar</command></term>
187 <listitem>
188 <para>Creates, modifies, and extracts from archives</para>
189 <indexterm zone="ch-system-binutils ar">
190 <primary sortas="b-ar">ar</primary>
191 </indexterm>
192 </listitem>
193 </varlistentry>
194
195 <varlistentry id="as">
196 <term><command>as</command></term>
197 <listitem>
198 <para>An assembler that assembles the output of <command>gcc</command>
199 into object files</para>
200 <indexterm zone="ch-system-binutils as">
201 <primary sortas="b-as">as</primary>
202 </indexterm>
203 </listitem>
204 </varlistentry>
205
206 <varlistentry id="c-filt">
207 <term><command>c++filt</command></term>
208 <listitem>
209 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
210 overloaded functions from clashing</para>
211 <indexterm zone="ch-system-binutils c-filt">
212 <primary sortas="b-c++filt">c++filt</primary>
213 </indexterm>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry id="dwp">
218 <term><command>dwp</command></term>
219 <listitem>
220 <para>The DWARF packaging utility</para>
221 <indexterm zone="ch-system-binutils dwp">
222 <primary sortas="dwp">dwp</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry id="elfedit">
228 <term><command>elfedit</command></term>
229 <listitem>
230 <para>Updates the ELF headers of ELF files</para>
231 <indexterm zone="ch-system-binutils elfedit">
232 <primary sortas="b-elfedit">elfedit</primary>
233 </indexterm>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry id="gprof">
238 <term><command>gprof</command></term>
239 <listitem>
240 <para>Displays call graph profile data</para>
241 <indexterm zone="ch-system-binutils gprof">
242 <primary sortas="b-gprof">gprof</primary>
243 </indexterm>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry id="gprofng">
248 <term><command>gprofng</command></term>
249 <listitem>
250 <para>Gathers and analyzes performance data</para>
251 <indexterm zone="ch-system-binutils gprofng">
252 <primary sortas="b-gprofng">gprofng</primary>
253 </indexterm>
254 </listitem>
255 </varlistentry>
256
257 <varlistentry id="ld">
258 <term><command>ld</command></term>
259 <listitem>
260 <para>A linker that combines a number of object and archive files
261 into a single file, relocating their data and tying up symbol
262 references</para>
263 <indexterm zone="ch-system-binutils ld">
264 <primary sortas="b-ld">ld</primary>
265 </indexterm>
266 </listitem>
267 </varlistentry>
268
269 <varlistentry id="ld.gold">
270 <term><command>ld.gold</command></term>
271 <listitem>
272 <para>A cut down version of ld that only supports the
273 elf object file format</para>
274 <indexterm zone="ch-system-binutils ld.gold">
275 <primary sortas="b-ld.gold">ld.gold</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
280 <varlistentry id="ld.bfd">
281 <term><command>ld.bfd</command></term>
282 <listitem>
283 <para>A hard link to <command>ld</command></para>
284 <indexterm zone="ch-system-binutils ld.bfd">
285 <primary sortas="b-ld.bfd">ld.bfd</primary>
286 </indexterm>
287 </listitem>
288 </varlistentry>
289
290 <varlistentry id="nm">
291 <term><command>nm</command></term>
292 <listitem>
293 <para>Lists the symbols occurring in a given object file</para>
294 <indexterm zone="ch-system-binutils nm">
295 <primary sortas="b-nm">nm</primary>
296 </indexterm>
297 </listitem>
298 </varlistentry>
299
300 <varlistentry id="objcopy">
301 <term><command>objcopy</command></term>
302 <listitem>
303 <para>Translates one type of object file into another</para>
304 <indexterm zone="ch-system-binutils objcopy">
305 <primary sortas="b-objcopy">objcopy</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 <varlistentry id="objdump">
311 <term><command>objdump</command></term>
312 <listitem>
313 <para>Displays information about the given object file, with options
314 controlling the particular information to display; the information
315 shown is useful to programmers who are working on the compilation
316 tools</para>
317 <indexterm zone="ch-system-binutils objdump">
318 <primary sortas="b-objdump">objdump</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="ranlib">
324 <term><command>ranlib</command></term>
325 <listitem>
326 <para>Generates an index of the contents of an archive and stores it
327 in the archive; the index lists all of the symbols defined by archive
328 members that are relocatable object files</para>
329 <indexterm zone="ch-system-binutils ranlib">
330 <primary sortas="b-ranlib">ranlib</primary>
331 </indexterm>
332 </listitem>
333 </varlistentry>
334
335 <varlistentry id="readelf">
336 <term><command>readelf</command></term>
337 <listitem>
338 <para>Displays information about ELF type binaries</para>
339 <indexterm zone="ch-system-binutils readelf">
340 <primary sortas="b-readelf">readelf</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="size">
346 <term><command>size</command></term>
347 <listitem>
348 <para>Lists the section sizes and the total size for the given
349 object files</para>
350 <indexterm zone="ch-system-binutils size">
351 <primary sortas="b-size">size</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
356 <varlistentry id="strings">
357 <term><command>strings</command></term>
358 <listitem>
359 <para>Outputs, for each given file, the sequences of printable
360 characters that are of at least the specified length (defaulting to
361 four); for object files, it prints, by default, only the strings from
362 the initializing and loading sections while for other types of files, it
363 scans the entire file</para>
364 <indexterm zone="ch-system-binutils strings">
365 <primary sortas="b-strings">strings</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369
370 <varlistentry id="strip">
371 <term><command>strip</command></term>
372 <listitem>
373 <para>Discards symbols from object files</para>
374 <indexterm zone="ch-system-binutils strip">
375 <primary sortas="b-strip">strip</primary>
376 </indexterm>
377 </listitem>
378 </varlistentry>
379
380 <varlistentry id="libbfd">
381 <term><filename class="libraryfile">libbfd</filename></term>
382 <listitem>
383 <para>The Binary File Descriptor library</para>
384 <indexterm zone="ch-system-binutils libbfd">
385 <primary sortas="c-libbfd">libbfd</primary>
386 </indexterm>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry id="libctf">
391 <term><filename class="libraryfile">libctf</filename></term>
392 <listitem>
393 <para>The Compat ANSI-C Type Format debugging support library</para>
394 <indexterm zone="ch-system-binutils libctf">
395 <primary sortas="c-libctf">libctf</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 <varlistentry id="libctf-nobfd">
401 <term><filename class="libraryfile">libctf-nobfd</filename></term>
402 <listitem>
403 <para>A libctf variant which does not use libbfd functionality</para>
404 <indexterm zone="ch-system-binutils libctf-nobfd">
405 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
406 </indexterm>
407 </listitem>
408 </varlistentry>
409
410 <varlistentry id="libgprofng">
411 <term><filename class="libraryfile">libgprofng</filename></term>
412 <listitem>
413 <para>A library containing most routines used by
414 <command>gprofng</command></para>
415 <indexterm zone="ch-system-binutils libgprofng">
416 <primary sortas="c-libgprofng">libgprofng</primary>
417 </indexterm>
418 </listitem>
419 </varlistentry>
420
421 <varlistentry id="libopcodes">
422 <term><filename class="libraryfile">libopcodes</filename></term>
423 <listitem>
424 <para>A library for dealing with opcodes&mdash;the <quote>readable
425 text</quote> versions of instructions for the processor;
426 it is used for building utilities like
427 <command>objdump</command></para>
428 <indexterm zone="ch-system-binutils libopcodes">
429 <primary sortas="c-libopcodes">libopcodes</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry id="libsframe">
435 <term><filename class="libraryfile">libsframe</filename></term>
436 <listitem>
437 <para>A library to support online backtracing using a
438 simple unwinder</para>
439 <indexterm zone="ch-system-binutils libsframe">
440 <primary sortas="c-libsframe">libsframe</primary>
441 </indexterm>
442 </listitem>
443 </varlistentry>
444
445 </variablelist>
446
447 </sect2>
448
449</sect1>
Note: See TracBrowser for help on using the repository browser.