source: chapter08/binutils.xml@ 1b61cd1

xry111/arm64 xry111/arm64-12.0
Last change on this file since 1b61cd1 was 7160772, checked in by Xi Ruoyao <xry111@…>, 15 months ago

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

  • Property mode set to 100644
File size: 15.2 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>Install the package:</para>
145
146<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
147
148 <para>Remove useless static libraries and an empty man page:</para>
149
150<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a
151rm -fv /usr/share/man/man1/{gprofng,gp-*}.1</userinput></screen>
152
153 </sect2>
154
155 <sect2 id="contents-binutils" role="content">
156 <title>Contents of Binutils</title>
157
158 <segmentedlist>
159 <segtitle>Installed programs</segtitle>
160 <segtitle>Installed libraries</segtitle>
161 <segtitle>Installed directory</segtitle>
162
163 <seglistitem>
164 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
165 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
166 <seg>libbfd.so, libctf.so, libctf-nobfd.so, 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="libopcodes">
415 <term><filename class="libraryfile">libopcodes</filename></term>
416 <listitem>
417 <para>A library for dealing with opcodes&mdash;the <quote>readable
418 text</quote> versions of instructions for the processor;
419 it is used for building utilities like
420 <command>objdump</command></para>
421 <indexterm zone="ch-system-binutils libopcodes">
422 <primary sortas="c-libopcodes">libopcodes</primary>
423 </indexterm>
424 </listitem>
425 </varlistentry>
426
427 <varlistentry id="libsframe">
428 <term><filename class="libraryfile">libsframe</filename></term>
429 <listitem>
430 <para>A library to support online backtracing using a
431 simple unwinder</para>
432 <indexterm zone="ch-system-binutils libsframe">
433 <primary sortas="c-libsframe">libsframe</primary>
434 </indexterm>
435 </listitem>
436 </varlistentry>
437
438 </variablelist>
439
440 </sect2>
441
442</sect1>
Note: See TracBrowser for help on using the repository browser.