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