source: chapter08/binutils.xml@ b6ff6a8

xry111/arm64 xry111/arm64-12.0
Last change on this file since b6ff6a8 was 64e8131, checked in by Xi Ruoyao <xry111@…>, 11 months ago

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

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