source: chapter08/binutils.xml@ 131799a

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