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>Verify that the PTYs are working properly inside the chroot
|
---|
45 | environment by performing a simple test:</para>
|
---|
46 |
|
---|
47 | <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
|
---|
48 |
|
---|
49 | <para>This command should output the following:</para>
|
---|
50 |
|
---|
51 | <screen><computeroutput>spawn ls</computeroutput></screen>
|
---|
52 |
|
---|
53 | <para>If, instead, the output includes the message below, then the environment
|
---|
54 | is not set up for proper PTY operation. This issue needs to be resolved before
|
---|
55 | running the test suites for Binutils and GCC:</para>
|
---|
56 |
|
---|
57 | <screen><computeroutput>The system has no more ptys.
|
---|
58 | Ask your system administrator to create more.</computeroutput></screen>
|
---|
59 | <!-- Fixed in binutils-2.39
|
---|
60 | <para>
|
---|
61 | Now make a fix identified upstream that affects building some packages:
|
---|
62 | </para>
|
---|
63 |
|
---|
64 | <screen><userinput remap="pre">sed -e '/R_386_TLS_LE /i \ || (TYPE) == R_386_TLS_IE \\' \
|
---|
65 | -i ./bfd/elfxx-x86.h</userinput></screen>
|
---|
66 | -->
|
---|
67 | <para>The Binutils documentation recommends building Binutils
|
---|
68 | in a dedicated build directory:</para>
|
---|
69 |
|
---|
70 | <screen><userinput remap="pre">mkdir -v build
|
---|
71 | cd build</userinput></screen>
|
---|
72 |
|
---|
73 | <para>Prepare Binutils for compilation:</para>
|
---|
74 |
|
---|
75 | <screen><userinput remap="configure">../configure --prefix=/usr \
|
---|
76 | --sysconfdir=/etc \
|
---|
77 | --enable-gold \
|
---|
78 | --enable-ld=default \
|
---|
79 | --enable-plugins \
|
---|
80 | --enable-shared \
|
---|
81 | --disable-werror \
|
---|
82 | --enable-64-bit-bfd \
|
---|
83 | --with-system-zlib</userinput></screen>
|
---|
84 | <variablelist>
|
---|
85 | <title>The meaning of the configure parameters:</title>
|
---|
86 |
|
---|
87 | <varlistentry>
|
---|
88 | <term><parameter>--enable-gold</parameter></term>
|
---|
89 | <listitem>
|
---|
90 | <para>Build the gold linker and install it as ld.gold (along side the
|
---|
91 | default linker).</para>
|
---|
92 | </listitem>
|
---|
93 | </varlistentry>
|
---|
94 |
|
---|
95 | <varlistentry>
|
---|
96 | <term><parameter>--enable-ld=default</parameter></term>
|
---|
97 | <listitem>
|
---|
98 | <para>Build the original bfd linker and install it as both ld (the
|
---|
99 | default linker) and ld.bfd.</para>
|
---|
100 | </listitem>
|
---|
101 | </varlistentry>
|
---|
102 |
|
---|
103 | <varlistentry>
|
---|
104 | <term><parameter>--enable-plugins</parameter></term>
|
---|
105 | <listitem>
|
---|
106 | <para>Enables plugin support for the linker.</para>
|
---|
107 | </listitem>
|
---|
108 | </varlistentry>
|
---|
109 |
|
---|
110 | <varlistentry>
|
---|
111 | <term><parameter>--enable-64-bit-bfd</parameter></term>
|
---|
112 | <listitem>
|
---|
113 | <para>Enables 64-bit support (on hosts with narrower word sizes).
|
---|
114 | May not be needed on 64-bit systems, but does no harm.</para>
|
---|
115 | </listitem>
|
---|
116 | </varlistentry>
|
---|
117 |
|
---|
118 | <varlistentry>
|
---|
119 | <term><parameter>--with-system-zlib</parameter></term>
|
---|
120 | <listitem>
|
---|
121 | <para>Use the installed zlib library rather than building the
|
---|
122 | included version.</para>
|
---|
123 | </listitem>
|
---|
124 | </varlistentry>
|
---|
125 |
|
---|
126 | </variablelist>
|
---|
127 |
|
---|
128 | <para>Compile the package:</para>
|
---|
129 |
|
---|
130 | <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
|
---|
131 |
|
---|
132 | <variablelist>
|
---|
133 | <title>The meaning of the make parameter:</title>
|
---|
134 |
|
---|
135 | <varlistentry>
|
---|
136 | <term><parameter>tooldir=/usr</parameter></term>
|
---|
137 | <listitem>
|
---|
138 | <para>Normally, the tooldir (the directory where the executables will
|
---|
139 | ultimately be located) is set to <filename
|
---|
140 | class="directory">$(exec_prefix)/$(target_alias)</filename>. For
|
---|
141 | example, x86_64 machines would expand that to <filename
|
---|
142 | class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
|
---|
143 | a custom system, this target-specific directory in <filename
|
---|
144 | class="directory">/usr</filename> is not required. <filename
|
---|
145 | class="directory">$(exec_prefix)/$(target_alias)</filename> would be
|
---|
146 | used if the system was used to cross-compile (for example, compiling a
|
---|
147 | package on an Intel machine that generates code that can be executed
|
---|
148 | on PowerPC machines).</para>
|
---|
149 | </listitem>
|
---|
150 | </varlistentry>
|
---|
151 |
|
---|
152 | </variablelist>
|
---|
153 |
|
---|
154 | <important>
|
---|
155 | <para>The test suite for Binutils in this section is considered critical.
|
---|
156 | Do not skip it under any circumstances.</para>
|
---|
157 | </important>
|
---|
158 |
|
---|
159 | <para>Test the results:</para>
|
---|
160 |
|
---|
161 | <screen><userinput remap="test">make -k check</userinput></screen>
|
---|
162 |
|
---|
163 | <para>Twelve tests fail in the <command>gold</command> testsuite when the
|
---|
164 | <option>--enable-default-pie</option> and
|
---|
165 | <option>--enable-default-ssp</option> options are passed to GCC. There
|
---|
166 | is also a known failure in the <command>as</command> tests.</para>
|
---|
167 | <!-- Fixed in 2.39
|
---|
168 | https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=01ae03b
|
---|
169 | <para>One gold test, <filename>pr17704a_test</filename>, is known to
|
---|
170 | fail if <parameter>CONFIG_IA32_EMULATION</parameter> is disabled in the
|
---|
171 | kernel configuration of the host system.</para>
|
---|
172 | -->
|
---|
173 | <para>Install the package:</para>
|
---|
174 |
|
---|
175 | <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
|
---|
176 |
|
---|
177 | <para>Remove useless static libraries and an empty man page:</para>
|
---|
178 |
|
---|
179 | <screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a
|
---|
180 | rm -fv /usr/share/man/man1/gprofng.1</userinput></screen>
|
---|
181 |
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 id="contents-binutils" role="content">
|
---|
185 | <title>Contents of Binutils</title>
|
---|
186 |
|
---|
187 | <segmentedlist>
|
---|
188 | <segtitle>Installed programs</segtitle>
|
---|
189 | <segtitle>Installed libraries</segtitle>
|
---|
190 | <segtitle>Installed directory</segtitle>
|
---|
191 |
|
---|
192 | <seglistitem>
|
---|
193 | <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
|
---|
194 | objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
|
---|
195 | <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
|
---|
196 | <seg>/usr/lib/ldscripts</seg>
|
---|
197 | </seglistitem>
|
---|
198 | </segmentedlist>
|
---|
199 |
|
---|
200 | <variablelist>
|
---|
201 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
202 | <?dbfo list-presentation="list"?>
|
---|
203 | <?dbhtml list-presentation="table"?>
|
---|
204 |
|
---|
205 | <varlistentry id="addr2line">
|
---|
206 | <term><command>addr2line</command></term>
|
---|
207 | <listitem>
|
---|
208 | <para>Translates program addresses to file names and line numbers;
|
---|
209 | given an address and the name of an executable, it uses the debugging
|
---|
210 | information in the executable to determine which source file and line
|
---|
211 | number are associated with the address</para>
|
---|
212 | <indexterm zone="ch-system-binutils addr2line">
|
---|
213 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
214 | </indexterm>
|
---|
215 | </listitem>
|
---|
216 | </varlistentry>
|
---|
217 |
|
---|
218 | <varlistentry id="ar">
|
---|
219 | <term><command>ar</command></term>
|
---|
220 | <listitem>
|
---|
221 | <para>Creates, modifies, and extracts from archives</para>
|
---|
222 | <indexterm zone="ch-system-binutils ar">
|
---|
223 | <primary sortas="b-ar">ar</primary>
|
---|
224 | </indexterm>
|
---|
225 | </listitem>
|
---|
226 | </varlistentry>
|
---|
227 |
|
---|
228 | <varlistentry id="as">
|
---|
229 | <term><command>as</command></term>
|
---|
230 | <listitem>
|
---|
231 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
232 | into object files</para>
|
---|
233 | <indexterm zone="ch-system-binutils as">
|
---|
234 | <primary sortas="b-as">as</primary>
|
---|
235 | </indexterm>
|
---|
236 | </listitem>
|
---|
237 | </varlistentry>
|
---|
238 |
|
---|
239 | <varlistentry id="c-filt">
|
---|
240 | <term><command>c++filt</command></term>
|
---|
241 | <listitem>
|
---|
242 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
243 | overloaded functions from clashing</para>
|
---|
244 | <indexterm zone="ch-system-binutils c-filt">
|
---|
245 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
246 | </indexterm>
|
---|
247 | </listitem>
|
---|
248 | </varlistentry>
|
---|
249 |
|
---|
250 | <varlistentry id="dwp">
|
---|
251 | <term><command>dwp</command></term>
|
---|
252 | <listitem>
|
---|
253 | <para>The DWARF packaging utility</para>
|
---|
254 | <indexterm zone="ch-system-binutils dwp">
|
---|
255 | <primary sortas="dwp">dwp</primary>
|
---|
256 | </indexterm>
|
---|
257 | </listitem>
|
---|
258 | </varlistentry>
|
---|
259 |
|
---|
260 | <varlistentry id="elfedit">
|
---|
261 | <term><command>elfedit</command></term>
|
---|
262 | <listitem>
|
---|
263 | <para>Updates the ELF header of ELF files</para>
|
---|
264 | <indexterm zone="ch-system-binutils elfedit">
|
---|
265 | <primary sortas="b-elfedit">elfedit</primary>
|
---|
266 | </indexterm>
|
---|
267 | </listitem>
|
---|
268 | </varlistentry>
|
---|
269 |
|
---|
270 | <varlistentry id="gprof">
|
---|
271 | <term><command>gprof</command></term>
|
---|
272 | <listitem>
|
---|
273 | <para>Displays call graph profile data</para>
|
---|
274 | <indexterm zone="ch-system-binutils gprof">
|
---|
275 | <primary sortas="b-gprof">gprof</primary>
|
---|
276 | </indexterm>
|
---|
277 | </listitem>
|
---|
278 | </varlistentry>
|
---|
279 |
|
---|
280 | <varlistentry id="gprofng">
|
---|
281 | <term><command>gprofng</command></term>
|
---|
282 | <listitem>
|
---|
283 | <para>Gather and analyze performance data</para>
|
---|
284 | <indexterm zone="ch-system-binutils gprofng">
|
---|
285 | <primary sortas="b-gprofng">gprofng</primary>
|
---|
286 | </indexterm>
|
---|
287 | </listitem>
|
---|
288 | </varlistentry>
|
---|
289 |
|
---|
290 | <varlistentry id="ld">
|
---|
291 | <term><command>ld</command></term>
|
---|
292 | <listitem>
|
---|
293 | <para>A linker that combines a number of object and archive files
|
---|
294 | into a single file, relocating their data and tying up symbol
|
---|
295 | references</para>
|
---|
296 | <indexterm zone="ch-system-binutils ld">
|
---|
297 | <primary sortas="b-ld">ld</primary>
|
---|
298 | </indexterm>
|
---|
299 | </listitem>
|
---|
300 | </varlistentry>
|
---|
301 |
|
---|
302 | <varlistentry id="ld.gold">
|
---|
303 | <term><command>ld.gold</command></term>
|
---|
304 | <listitem>
|
---|
305 | <para>A cut down version of ld that only supports the
|
---|
306 | elf object file format</para>
|
---|
307 | <indexterm zone="ch-system-binutils ld.gold">
|
---|
308 | <primary sortas="b-ld.gold">ld.gold</primary>
|
---|
309 | </indexterm>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry id="ld.bfd">
|
---|
314 | <term><command>ld.bfd</command></term>
|
---|
315 | <listitem>
|
---|
316 | <para>Hard link to <command>ld</command></para>
|
---|
317 | <indexterm zone="ch-system-binutils ld.bfd">
|
---|
318 | <primary sortas="b-ld.bfd">ld.bfd</primary>
|
---|
319 | </indexterm>
|
---|
320 | </listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | <varlistentry id="nm">
|
---|
324 | <term><command>nm</command></term>
|
---|
325 | <listitem>
|
---|
326 | <para>Lists the symbols occurring in a given object file</para>
|
---|
327 | <indexterm zone="ch-system-binutils nm">
|
---|
328 | <primary sortas="b-nm">nm</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
332 |
|
---|
333 | <varlistentry id="objcopy">
|
---|
334 | <term><command>objcopy</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>Translates one type of object file into another</para>
|
---|
337 | <indexterm zone="ch-system-binutils objcopy">
|
---|
338 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
339 | </indexterm>
|
---|
340 | </listitem>
|
---|
341 | </varlistentry>
|
---|
342 |
|
---|
343 | <varlistentry id="objdump">
|
---|
344 | <term><command>objdump</command></term>
|
---|
345 | <listitem>
|
---|
346 | <para>Displays information about the given object file, with options
|
---|
347 | controlling the particular information to display; the information
|
---|
348 | shown is useful to programmers who are working on the compilation
|
---|
349 | tools</para>
|
---|
350 | <indexterm zone="ch-system-binutils objdump">
|
---|
351 | <primary sortas="b-objdump">objdump</primary>
|
---|
352 | </indexterm>
|
---|
353 | </listitem>
|
---|
354 | </varlistentry>
|
---|
355 |
|
---|
356 | <varlistentry id="ranlib">
|
---|
357 | <term><command>ranlib</command></term>
|
---|
358 | <listitem>
|
---|
359 | <para>Generates an index of the contents of an archive and stores it
|
---|
360 | in the archive; the index lists all of the symbols defined by archive
|
---|
361 | members that are relocatable object files</para>
|
---|
362 | <indexterm zone="ch-system-binutils ranlib">
|
---|
363 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
364 | </indexterm>
|
---|
365 | </listitem>
|
---|
366 | </varlistentry>
|
---|
367 |
|
---|
368 | <varlistentry id="readelf">
|
---|
369 | <term><command>readelf</command></term>
|
---|
370 | <listitem>
|
---|
371 | <para>Displays information about ELF type binaries</para>
|
---|
372 | <indexterm zone="ch-system-binutils readelf">
|
---|
373 | <primary sortas="b-readelf">readelf</primary>
|
---|
374 | </indexterm>
|
---|
375 | </listitem>
|
---|
376 | </varlistentry>
|
---|
377 |
|
---|
378 | <varlistentry id="size">
|
---|
379 | <term><command>size</command></term>
|
---|
380 | <listitem>
|
---|
381 | <para>Lists the section sizes and the total size for the given
|
---|
382 | object files</para>
|
---|
383 | <indexterm zone="ch-system-binutils size">
|
---|
384 | <primary sortas="b-size">size</primary>
|
---|
385 | </indexterm>
|
---|
386 | </listitem>
|
---|
387 | </varlistentry>
|
---|
388 |
|
---|
389 | <varlistentry id="strings">
|
---|
390 | <term><command>strings</command></term>
|
---|
391 | <listitem>
|
---|
392 | <para>Outputs, for each given file, the sequences of printable
|
---|
393 | characters that are of at least the specified length (defaulting to
|
---|
394 | four); for object files, it prints, by default, only the strings from
|
---|
395 | the initializing and loading sections while for other types of files, it
|
---|
396 | scans the entire file</para>
|
---|
397 | <indexterm zone="ch-system-binutils strings">
|
---|
398 | <primary sortas="b-strings">strings</primary>
|
---|
399 | </indexterm>
|
---|
400 | </listitem>
|
---|
401 | </varlistentry>
|
---|
402 |
|
---|
403 | <varlistentry id="strip">
|
---|
404 | <term><command>strip</command></term>
|
---|
405 | <listitem>
|
---|
406 | <para>Discards symbols from object files</para>
|
---|
407 | <indexterm zone="ch-system-binutils strip">
|
---|
408 | <primary sortas="b-strip">strip</primary>
|
---|
409 | </indexterm>
|
---|
410 | </listitem>
|
---|
411 | </varlistentry>
|
---|
412 |
|
---|
413 | <varlistentry id="libbfd">
|
---|
414 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
415 | <listitem>
|
---|
416 | <para>The Binary File Descriptor library</para>
|
---|
417 | <indexterm zone="ch-system-binutils libbfd">
|
---|
418 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
419 | </indexterm>
|
---|
420 | </listitem>
|
---|
421 | </varlistentry>
|
---|
422 |
|
---|
423 | <varlistentry id="libctf">
|
---|
424 | <term><filename class="libraryfile">libctf</filename></term>
|
---|
425 | <listitem>
|
---|
426 | <para>The Compat ANSI-C Type Format debugging support library</para>
|
---|
427 | <indexterm zone="ch-system-binutils libctf">
|
---|
428 | <primary sortas="c-libctf">libctf</primary>
|
---|
429 | </indexterm>
|
---|
430 | </listitem>
|
---|
431 | </varlistentry>
|
---|
432 |
|
---|
433 | <varlistentry id="libctf-nobfd">
|
---|
434 | <term><filename class="libraryfile">libctf-nobfd</filename></term>
|
---|
435 | <listitem>
|
---|
436 | <para>A libctf variant which does not use libbfd functionality</para>
|
---|
437 | <indexterm zone="ch-system-binutils libctf-nobfd">
|
---|
438 | <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
|
---|
439 | </indexterm>
|
---|
440 | </listitem>
|
---|
441 | </varlistentry>
|
---|
442 |
|
---|
443 | <varlistentry id="libopcodes">
|
---|
444 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
445 | <listitem>
|
---|
446 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
447 | text</quote> versions of instructions for the processor;
|
---|
448 | it is used for building utilities like
|
---|
449 | <command>objdump</command></para>
|
---|
450 | <indexterm zone="ch-system-binutils libopcodes">
|
---|
451 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
452 | </indexterm>
|
---|
453 | </listitem>
|
---|
454 | </varlistentry>
|
---|
455 |
|
---|
456 | </variablelist>
|
---|
457 |
|
---|
458 | </sect2>
|
---|
459 |
|
---|
460 | </sect1>
|
---|