source: chapter06/binutils.xml@ 1fa2099

multilib-10.1
Last change on this file since 1fa2099 was 1fa2099, checked in by Thomas Trepl <thomas@…>, 5 years ago

Initial creation of multilib branch

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11565 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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