source: chapter08/binutils.xml@ 5365c7a

xry111/mips64el
Last change on this file since 5365c7a was 5365c7a, checked in by Xi Ruoyao <xry111@…>, 2 weeks ago

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

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