source: clfs-embedded/BOOK/cross-tools/common/binutils.xml@ a58af15

Last change on this file since a58af15 was 6561a0f, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Fixed validation issues.

  • Property mode set to 100644
File size: 12.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-cross-tools-binutils" role="wrap">
9 <?dbhtml filename="binutils.html"?>
10
11 <title>Cross Binutils-&binutils-version;</title>
12
13 <indexterm zone="ch-cross-tools-binutils">
14 <primary sortas="a-Binutils">Binutils</primary>
15 <secondary>cross tools</secondary>
16 </indexterm>
17
18 <sect2 role="package">
19 <title/>
20
21 <para>The Binutils package contains a linker, an assembler, and other
22 tools for handling object files.</para>
23
24 </sect2>
25
26 <sect2 role="installation">
27 <title>Installation of Cross Binutils</title>
28
29 <para os="da">It is important that Binutils be the first package compiled
30 because both Glibc and GCC perform various tests on the available
31 linker and assembler to determine which of their own features to
32 enable.</para>
33
34
35 <para os="p1">To make sure that the proper syntax is used for a couple of
36 tools, apply the following patch:</para>
37
38<screen os="p2"><userinput>patch -Np1 -i ../&binutils-posix-patch;</userinput></screen>
39
40 <para os="a">The Binutils documentation recommends building Binutils outside of the
41 source directory in a dedicated build directory:</para>
42
43<screen os="b"><userinput>mkdir -v ../binutils-build
44cd ../binutils-build</userinput></screen>
45
46 <para os="c">Prepare Binutils for compilation:</para>
47
48<screen os="bc"><userinput>../binutils-&binutils-version;/configure --prefix=${CLFS}/cross-tools \
49 --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-sysroot=${CLFS} \
50 --disable-nls --enable-shared --disable-multilib</userinput></screen>
51
52 <variablelist os="bd">
53 <title>The meaning of the configure options:</title>
54
55 <varlistentry os="bd1">
56 <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
57 <listitem>
58 <para>This tells the configure script to prepare to install the
59 package in the <filename class="directory">${CLFS}/cross-tools</filename>
60 directory.</para>
61 </listitem>
62 </varlistentry>
63
64 <varlistentry os="bd2">
65 <term><parameter>--host=${CLFS_HOST}</parameter></term>
66 <listitem>
67 <para>When used with --target, this creates a cross-architecture
68 executable that creates files for ${CLFS_TARGET} but runs on
69 ${CLFS_HOST}.</para>
70 </listitem>
71 </varlistentry>
72
73 <varlistentry os="bd3">
74 <term><parameter>--target=${CLFS_TARGET}</parameter></term>
75 <listitem>
76 <para>When used with --host, this creates a cross-architecture
77 executable that creates files for ${CLFS_TARGET} but runs on
78 ${CLFS_HOST}.</para>
79 </listitem>
80 </varlistentry>
81
82 <varlistentry os="bd4">
83 <term><parameter>--with-sysroot=${CLFS}</parameter></term>
84 <listitem>
85 <para>This tells configure that ${CLFS} is going to be the root
86 of our system. It will now use the specified sysroot, ${CLFS}, as
87 a prefix of the default search paths.</para>
88 </listitem>
89 </varlistentry>
90
91 <varlistentry os="bd5">
92 <term><parameter>--disable-nls</parameter></term>
93 <listitem>
94 <para>This disables internationalization as i18n is not needed for the
95 cross-compile tools.</para>
96 </listitem>
97 </varlistentry>
98
99 <varlistentry os="bd6">
100 <term><parameter>--enable-shared</parameter></term>
101 <listitem>
102 <para>Enable the creation of the shared libraries.</para>
103 </listitem>
104 </varlistentry>
105
106 <varlistentry os="bd7">
107 <term><parameter>--disable-multilib</parameter></term>
108 <listitem>
109 <para>This option disables the building of a multilib
110 capable binutils.</para>
111 </listitem>
112 </varlistentry>
113
114 </variablelist>
115
116 <para os="be">Compile the package:</para>
117
118<screen os="bf"><userinput>make configure-host
119make</userinput></screen>
120
121 <variablelist os="bg">
122 <title>The meaning of the make options:</title>
123
124 <varlistentry os="bg1">
125 <term><parameter>configure-host</parameter></term>
126 <listitem>
127 <para>This checks the host environment and makes sure all the
128 necessary tools are available to compile Binutils.</para>
129 </listitem>
130 </varlistentry>
131
132 </variablelist>
133
134 <para os="bh">Install the package:</para>
135
136<screen os="bi"><userinput>make install</userinput></screen>
137
138 <para os="bj">Copy the <filename class="headerfile">libiberty.h</filename> file to
139 <filename class="directory">${CLFS}/usr/include</filename> directory:</para>
140
141<screen os="bk"><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h ${CLFS}/usr/include</userinput></screen>
142
143 </sect2>
144
145 <sect2 id="contents-binutils" role="content">
146 <title>Contents of Binutils</title>
147
148 <segmentedlist>
149 <segtitle>Installed programs</segtitle>
150 <segtitle>Installed libraries</segtitle>
151
152 <seglistitem>
153 <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
154 ranlib, readelf, size, strings, and strip</seg>
155 <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
156 </seglistitem>
157 </segmentedlist>
158
159 <variablelist>
160 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
161 <?dbfo list-presentation="list"?>
162 <?dbhtml list-presentation="table"?>
163
164 <varlistentry id="addr2line">
165 <term><command>addr2line</command></term>
166 <listitem>
167 <para>Translates program addresses to file names and line numbers;
168 given an address and the name of an executable, it uses the debugging
169 information in the executable to determine which source file and line
170 number are associated with the address</para>
171 <indexterm zone="ch-cross-tools-binutils addr2line">
172 <primary sortas="b-addr2line">addr2line</primary>
173 </indexterm>
174 </listitem>
175 </varlistentry>
176
177 <varlistentry id="ar">
178 <term><command>ar</command></term>
179 <listitem>
180 <para>Creates, modifies, and extracts from archives</para>
181 <indexterm zone="ch-cross-tools-binutils ar">
182 <primary sortas="b-ar">ar</primary>
183 </indexterm>
184 </listitem>
185 </varlistentry>
186
187 <varlistentry id="as">
188 <term><command>as</command></term>
189 <listitem>
190 <para>An assembler that assembles the output of <command>gcc</command>
191 into object files</para>
192 <indexterm zone="ch-cross-tools-binutils as">
193 <primary sortas="b-as">as</primary>
194 </indexterm>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry id="c-filt">
199 <term><command>c++filt</command></term>
200 <listitem>
201 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
202 overloaded functions from clashing</para>
203 <indexterm zone="ch-cross-tools-binutils c-filt">
204 <primary sortas="b-c++filt">c++filt</primary>
205 </indexterm>
206 </listitem>
207 </varlistentry>
208
209 <varlistentry id="gprof">
210 <term><command>gprof</command></term>
211 <listitem>
212 <para>Displays call graph profile data</para>
213 <indexterm zone="ch-cross-tools-binutils gprof">
214 <primary sortas="b-gprof">gprof</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
219 <varlistentry id="ld">
220 <term><command>ld</command></term>
221 <listitem>
222 <para>A linker that combines a number of object and archive files
223 into a single file, relocating their data and tying up symbol
224 references</para>
225 <indexterm zone="ch-cross-tools-binutils ld">
226 <primary sortas="b-ld">ld</primary>
227 </indexterm>
228 </listitem>
229 </varlistentry>
230
231 <varlistentry id="nm">
232 <term><command>nm</command></term>
233 <listitem>
234 <para>Lists the symbols occurring in a given object file</para>
235 <indexterm zone="ch-cross-tools-binutils nm">
236 <primary sortas="b-nm">nm</primary>
237 </indexterm>
238 </listitem>
239 </varlistentry>
240
241 <varlistentry id="objdump">
242 <term><command>objdump</command></term>
243 <listitem>
244 <para>Displays information about the given object file, with options
245 controlling the particular information to display; the information
246 shown is useful to programmers who are working on the compilation
247 tools</para>
248 <indexterm zone="ch-cross-tools-binutils objdump">
249 <primary sortas="b-objdump">objdump</primary>
250 </indexterm>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry id="ranlib">
255 <term><command>ranlib</command></term>
256 <listitem>
257 <para>Generates an index of the contents of an archive and stores it
258 in the archive; the index lists all of the symbols defined by archive
259 members that are relocatable object files</para>
260 <indexterm zone="ch-cross-tools-binutils ranlib">
261 <primary sortas="b-ranlib">ranlib</primary>
262 </indexterm>
263 </listitem>
264 </varlistentry>
265
266 <varlistentry id="readelf">
267 <term><command>readelf</command></term>
268 <listitem>
269 <para>Displays information about ELF type binaries</para>
270 <indexterm zone="ch-cross-tools-binutils readelf">
271 <primary sortas="b-readelf">readelf</primary>
272 </indexterm>
273 </listitem>
274 </varlistentry>
275
276 <varlistentry id="size">
277 <term><command>size</command></term>
278 <listitem>
279 <para>Lists the section sizes and the total size for the given
280 object files</para>
281 <indexterm zone="ch-cross-tools-binutils size">
282 <primary sortas="b-size">size</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="strings">
288 <term><command>strings</command></term>
289 <listitem>
290 <para>Outputs, for each given file, the sequences of printable
291 characters that are of at least the specified length (defaulting to
292 four); for object files, it prints, by default, only the strings from
293 the initializing and loading sections while for other types of files,
294 it scans the entire file</para>
295 <indexterm zone="ch-cross-tools-binutils strings">
296 <primary sortas="b-strings">strings</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="strip">
302 <term><command>strip</command></term>
303 <listitem>
304 <para>Discards symbols from object files</para>
305 <indexterm zone="ch-cross-tools-binutils strip">
306 <primary sortas="b-strip">strip</primary>
307 </indexterm>
308 </listitem>
309 </varlistentry>
310
311 <varlistentry id="libiberty">
312 <term><filename class="libraryfile">libiberty</filename></term>
313 <listitem>
314 <para>Contains routines used by various GNU programs, including
315 <command>getopt</command>, <command>obstack</command>,
316 <command>strerror</command>, <command>strtol</command>, and
317 <command>strtoul</command></para>
318 <indexterm zone="ch-cross-tools-binutils libiberty">
319 <primary sortas="c-libiberty">libiberty</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
324 <varlistentry id="libbfd">
325 <term><filename class="libraryfile">libbfd</filename></term>
326 <listitem>
327 <para>The Binary File Descriptor library</para>
328 <indexterm zone="ch-cross-tools-binutils libbfd">
329 <primary sortas="c-libbfd">libbfd</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="libopcodes">
335 <term><filename class="libraryfile">libopcodes</filename></term>
336 <listitem>
337 <para>A library for dealing with opcodes&mdash;the <quote>readable
338 text</quote> versions of instructions for the processor;
339 it is used for building utilities like
340 <command>objdump</command>.</para>
341 <indexterm zone="ch-cross-tools-binutils libopcodes">
342 <primary sortas="c-libopcodes">libopcodes</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346
347 </variablelist>
348
349 </sect2>
350
351</sect1>
Note: See TracBrowser for help on using the repository browser.