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

Last change on this file since d451637 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
RevLine 
[a9e389d]1<?xml version="1.0" encoding="ISO-8859-1"?>
[bd48e48]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[a9e389d]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
[e666df1]29 <para os="a">It is important that Binutils be the first package compiled
[9de8668]30 because both the C library and GCC perform various tests on the available
[a9e389d]31 linker and assembler to determine which of their own features to
32 enable.</para>
33
[e554d7b]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
[e666df1]40 <para os="b">The Binutils documentation recommends building Binutils outside of the
[a9e389d]41 source directory in a dedicated build directory:</para>
42
[e666df1]43<screen os="c"><userinput>mkdir -v ../binutils-build
[a9e389d]44cd ../binutils-build</userinput></screen>
45
[e666df1]46 <para os="d">Prepare Binutils for compilation:</para>
[a9e389d]47
[b8ac103]48<screen os="e"><userinput>../binutils-&binutils-version;/configure \
49 --prefix=${CLFS}/cross-tools \
50 --target=${CLFS_TARGET} \
[a2798d9]51 --with-sysroot=${CLFS}/cross-tools/sysroot \
[b8ac103]52 --disable-nls \
[62fdf1a]53 --disable-multilib</userinput></screen>
[a9e389d]54
[e666df1]55 <variablelist os="f">
[a9e389d]56 <title>The meaning of the configure options:</title>
57
[e666df1]58 <varlistentry os="f1">
[a9e389d]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
[e666df1]67 <varlistentry os="f3">
[a9e389d]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
[9dc5852]72 the host system.</para>
[a9e389d]73 </listitem>
74 </varlistentry>
75
[e666df1]76 <varlistentry os="f4">
[a2798d9]77 <term><parameter>--with-sysroot=${CLFS}/cross-tools/sysroot</parameter></term>
[a9e389d]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
[e666df1]85 <varlistentry os="f5">
[a9e389d]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
[e666df1]93 <varlistentry os="f7">
[a9e389d]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
[e666df1]103 <para os="g">Compile the package:</para>
[a9e389d]104
[e666df1]105<screen os="h"><userinput>make configure-host
[a9e389d]106make</userinput></screen>
107
[e666df1]108 <variablelist os="i">
[a9e389d]109 <title>The meaning of the make options:</title>
110
[e666df1]111 <varlistentry os="i1">
[a9e389d]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
[e666df1]121 <para os="j">Install the package:</para>
[a9e389d]122
[e666df1]123<screen os="k"><userinput>make install</userinput></screen>
[a9e389d]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>
[3c24b73]135 <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, nm, objcopy,
136 objdump, ranlib, readelf, size, strings, and strip</seg>
[a9e389d]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>
[6561a0f]153 <indexterm zone="ch-cross-tools-binutils addr2line">
[a9e389d]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>
[6561a0f]163 <indexterm zone="ch-cross-tools-binutils ar">
[a9e389d]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>
[6561a0f]174 <indexterm zone="ch-cross-tools-binutils as">
[a9e389d]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>
[6561a0f]185 <indexterm zone="ch-cross-tools-binutils c-filt">
[a9e389d]186 <primary sortas="b-c++filt">c++filt</primary>
187 </indexterm>
188 </listitem>
189 </varlistentry>
190
[3c24b73]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
[a9e389d]201 <varlistentry id="gprof">
202 <term><command>gprof</command></term>
203 <listitem>
204 <para>Displays call graph profile data</para>
[6561a0f]205 <indexterm zone="ch-cross-tools-binutils gprof">
[a9e389d]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>
[6561a0f]217 <indexterm zone="ch-cross-tools-binutils ld">
[a9e389d]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>
[6561a0f]227 <indexterm zone="ch-cross-tools-binutils nm">
[a9e389d]228 <primary sortas="b-nm">nm</primary>
229 </indexterm>
230 </listitem>
231 </varlistentry>
232
[3c24b73]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
[a9e389d]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>
[6561a0f]250 <indexterm zone="ch-cross-tools-binutils objdump">
[a9e389d]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>
[6561a0f]262 <indexterm zone="ch-cross-tools-binutils ranlib">
[a9e389d]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>
[6561a0f]272 <indexterm zone="ch-cross-tools-binutils readelf">
[a9e389d]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>
[6561a0f]283 <indexterm zone="ch-cross-tools-binutils size">
[a9e389d]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>
[6561a0f]297 <indexterm zone="ch-cross-tools-binutils strings">
[a9e389d]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>
[6561a0f]307 <indexterm zone="ch-cross-tools-binutils strip">
[a9e389d]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>
[6561a0f]320 <indexterm zone="ch-cross-tools-binutils libiberty">
[a9e389d]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>
[6561a0f]330 <indexterm zone="ch-cross-tools-binutils libbfd">
[a9e389d]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>
[6561a0f]343 <indexterm zone="ch-cross-tools-binutils libopcodes">
[a9e389d]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.