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

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

binutils: Use new sysroot dir

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