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

Last change on this file since 288ef52 was aeb76e6, checked in by Andrew Bradford <andrew@…>, 11 years ago

binutils: Don't copy libiberty.h

GCC will "do the right thing" later in the build thus this step is not
needed.

  • Property mode set to 100644
File size: 12.5 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-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="a">It is important that Binutils be the first package compiled
30 because both uClibc 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 <para os="ab">Fix a couple of syntax errors that prevent the documentation
35 from building with some versions of Texinfo:</para>
36
37<screen os="ac"><userinput>sed -i -e 's/@colophon/@@colophon/' \
38 -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo</userinput></screen>
39
40 <para os="b">The Binutils documentation recommends building Binutils outside of the
41 source directory in a dedicated build directory:</para>
42
43<screen os="c"><userinput>mkdir -v ../binutils-build
44cd ../binutils-build</userinput></screen>
45
46 <para os="d">Prepare Binutils for compilation:</para>
47
48<screen os="e"><userinput>../binutils-&binutils-version;/configure --prefix=${CLFS}/cross-tools \
49 --target=${CLFS_TARGET} --with-sysroot=${CLFS} --disable-nls \
50 --enable-shared --disable-multilib</userinput></screen>
51
52 <variablelist os="f">
53 <title>The meaning of the configure options:</title>
54
55 <varlistentry os="f1">
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="f3">
65 <term><parameter>--target=${CLFS_TARGET}</parameter></term>
66 <listitem>
67 <para>When used with --host, this creates a cross-architecture
68 executable that creates files for ${CLFS_TARGET} but runs on
69 the host system.</para>
70 </listitem>
71 </varlistentry>
72
73 <varlistentry os="f4">
74 <term><parameter>--with-sysroot=${CLFS}</parameter></term>
75 <listitem>
76 <para>This tells configure that ${CLFS} is going to be the root
77 of our system. It will now use the specified sysroot, ${CLFS}, as
78 a prefix of the default search paths.</para>
79 </listitem>
80 </varlistentry>
81
82 <varlistentry os="f5">
83 <term><parameter>--disable-nls</parameter></term>
84 <listitem>
85 <para>This disables internationalization as i18n is not needed for the
86 cross-compile tools.</para>
87 </listitem>
88 </varlistentry>
89
90 <varlistentry os="f6">
91 <term><parameter>--enable-shared</parameter></term>
92 <listitem>
93 <para>Enable the creation of the shared libraries.</para>
94 </listitem>
95 </varlistentry>
96
97 <varlistentry os="f7">
98 <term><parameter>--disable-multilib</parameter></term>
99 <listitem>
100 <para>This option disables the building of a multilib
101 capable binutils.</para>
102 </listitem>
103 </varlistentry>
104
105 </variablelist>
106
107 <para os="g">Compile the package:</para>
108
109<screen os="h"><userinput>make configure-host
110make</userinput></screen>
111
112 <variablelist os="i">
113 <title>The meaning of the make options:</title>
114
115 <varlistentry os="i1">
116 <term><parameter>configure-host</parameter></term>
117 <listitem>
118 <para>This checks the host environment and makes sure all the
119 necessary tools are available to compile Binutils.</para>
120 </listitem>
121 </varlistentry>
122
123 </variablelist>
124
125 <para os="j">Install the package:</para>
126
127<screen os="k"><userinput>make install</userinput></screen>
128
129 </sect2>
130
131 <sect2 id="contents-binutils" role="content">
132 <title>Contents of Binutils</title>
133
134 <segmentedlist>
135 <segtitle>Installed programs</segtitle>
136 <segtitle>Installed libraries</segtitle>
137
138 <seglistitem>
139 <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, nm, objcopy,
140 objdump, ranlib, readelf, size, strings, and strip</seg>
141 <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
142 </seglistitem>
143 </segmentedlist>
144
145 <variablelist>
146 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
147 <?dbfo list-presentation="list"?>
148 <?dbhtml list-presentation="table"?>
149
150 <varlistentry id="addr2line">
151 <term><command>addr2line</command></term>
152 <listitem>
153 <para>Translates program addresses to file names and line numbers;
154 given an address and the name of an executable, it uses the debugging
155 information in the executable to determine which source file and line
156 number are associated with the address</para>
157 <indexterm zone="ch-cross-tools-binutils addr2line">
158 <primary sortas="b-addr2line">addr2line</primary>
159 </indexterm>
160 </listitem>
161 </varlistentry>
162
163 <varlistentry id="ar">
164 <term><command>ar</command></term>
165 <listitem>
166 <para>Creates, modifies, and extracts from archives</para>
167 <indexterm zone="ch-cross-tools-binutils ar">
168 <primary sortas="b-ar">ar</primary>
169 </indexterm>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry id="as">
174 <term><command>as</command></term>
175 <listitem>
176 <para>An assembler that assembles the output of <command>gcc</command>
177 into object files</para>
178 <indexterm zone="ch-cross-tools-binutils as">
179 <primary sortas="b-as">as</primary>
180 </indexterm>
181 </listitem>
182 </varlistentry>
183
184 <varlistentry id="c-filt">
185 <term><command>c++filt</command></term>
186 <listitem>
187 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
188 overloaded functions from clashing</para>
189 <indexterm zone="ch-cross-tools-binutils c-filt">
190 <primary sortas="b-c++filt">c++filt</primary>
191 </indexterm>
192 </listitem>
193 </varlistentry>
194
195 <varlistentry id="elfedit">
196 <term><command>elfedit</command></term>
197 <listitem>
198 <para>Examine and modify ELF metadata within an ELF object</para>
199 <indexterm zone="ch-cross-tools-binutils elfedit">
200 <primary sortas="b-elfedit">elfedit</primary>
201 </indexterm>
202 </listitem>
203 </varlistentry>
204
205 <varlistentry id="gprof">
206 <term><command>gprof</command></term>
207 <listitem>
208 <para>Displays call graph profile data</para>
209 <indexterm zone="ch-cross-tools-binutils gprof">
210 <primary sortas="b-gprof">gprof</primary>
211 </indexterm>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry id="ld">
216 <term><command>ld</command></term>
217 <listitem>
218 <para>A linker that combines a number of object and archive files
219 into a single file, relocating their data and tying up symbol
220 references</para>
221 <indexterm zone="ch-cross-tools-binutils ld">
222 <primary sortas="b-ld">ld</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry id="nm">
228 <term><command>nm</command></term>
229 <listitem>
230 <para>Lists the symbols occurring in a given object file</para>
231 <indexterm zone="ch-cross-tools-binutils nm">
232 <primary sortas="b-nm">nm</primary>
233 </indexterm>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry id="objcopy">
238 <term><command>objcopy</command></term>
239 <listitem>
240 <para>Copy the contents of one object file to another</para>
241 <indexterm zone="ch-cross-tools-binutils objcopy">
242 <primary sortas="b-objcopy">objcopy</primary>
243 </indexterm>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry id="objdump">
248 <term><command>objdump</command></term>
249 <listitem>
250 <para>Displays information about the given object file, with options
251 controlling the particular information to display; the information
252 shown is useful to programmers who are working on the compilation
253 tools</para>
254 <indexterm zone="ch-cross-tools-binutils objdump">
255 <primary sortas="b-objdump">objdump</primary>
256 </indexterm>
257 </listitem>
258 </varlistentry>
259
260 <varlistentry id="ranlib">
261 <term><command>ranlib</command></term>
262 <listitem>
263 <para>Generates an index of the contents of an archive and stores it
264 in the archive; the index lists all of the symbols defined by archive
265 members that are relocatable object files</para>
266 <indexterm zone="ch-cross-tools-binutils ranlib">
267 <primary sortas="b-ranlib">ranlib</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="readelf">
273 <term><command>readelf</command></term>
274 <listitem>
275 <para>Displays information about ELF type binaries</para>
276 <indexterm zone="ch-cross-tools-binutils readelf">
277 <primary sortas="b-readelf">readelf</primary>
278 </indexterm>
279 </listitem>
280 </varlistentry>
281
282 <varlistentry id="size">
283 <term><command>size</command></term>
284 <listitem>
285 <para>Lists the section sizes and the total size for the given
286 object files</para>
287 <indexterm zone="ch-cross-tools-binutils size">
288 <primary sortas="b-size">size</primary>
289 </indexterm>
290 </listitem>
291 </varlistentry>
292
293 <varlistentry id="strings">
294 <term><command>strings</command></term>
295 <listitem>
296 <para>Outputs, for each given file, the sequences of printable
297 characters that are of at least the specified length (defaulting to
298 four); for object files, it prints, by default, only the strings from
299 the initializing and loading sections while for other types of files,
300 it scans the entire file</para>
301 <indexterm zone="ch-cross-tools-binutils strings">
302 <primary sortas="b-strings">strings</primary>
303 </indexterm>
304 </listitem>
305 </varlistentry>
306
307 <varlistentry id="strip">
308 <term><command>strip</command></term>
309 <listitem>
310 <para>Discards symbols from object files</para>
311 <indexterm zone="ch-cross-tools-binutils strip">
312 <primary sortas="b-strip">strip</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="libiberty">
318 <term><filename class="libraryfile">libiberty</filename></term>
319 <listitem>
320 <para>Contains routines used by various GNU programs, including
321 <command>getopt</command>, <command>obstack</command>,
322 <command>strerror</command>, <command>strtol</command>, and
323 <command>strtoul</command></para>
324 <indexterm zone="ch-cross-tools-binutils libiberty">
325 <primary sortas="c-libiberty">libiberty</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="libbfd">
331 <term><filename class="libraryfile">libbfd</filename></term>
332 <listitem>
333 <para>The Binary File Descriptor library</para>
334 <indexterm zone="ch-cross-tools-binutils libbfd">
335 <primary sortas="c-libbfd">libbfd</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry id="libopcodes">
341 <term><filename class="libraryfile">libopcodes</filename></term>
342 <listitem>
343 <para>A library for dealing with opcodes&mdash;the <quote>readable
344 text</quote> versions of instructions for the processor;
345 it is used for building utilities like
346 <command>objdump</command>.</para>
347 <indexterm zone="ch-cross-tools-binutils libopcodes">
348 <primary sortas="c-libopcodes">libopcodes</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 </variablelist>
354
355 </sect2>
356
357</sect1>
Note: See TracBrowser for help on using the repository browser.