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
|
---|
44 | cd ../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
|
---|
110 | make</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 | <para os="l">Copy the <filename class="headerfile">libiberty.h</filename> file to
|
---|
130 | <filename class="directory">${CLFS}/usr/include</filename> directory:</para>
|
---|
131 |
|
---|
132 | <screen os="m"><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h ${CLFS}/cross-tools/include</userinput></screen>
|
---|
133 |
|
---|
134 | </sect2>
|
---|
135 |
|
---|
136 | <sect2 id="contents-binutils" role="content">
|
---|
137 | <title>Contents of Binutils</title>
|
---|
138 |
|
---|
139 | <segmentedlist>
|
---|
140 | <segtitle>Installed programs</segtitle>
|
---|
141 | <segtitle>Installed libraries</segtitle>
|
---|
142 |
|
---|
143 | <seglistitem>
|
---|
144 | <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, nm, objcopy,
|
---|
145 | objdump, ranlib, readelf, size, strings, and strip</seg>
|
---|
146 | <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
|
---|
147 | </seglistitem>
|
---|
148 | </segmentedlist>
|
---|
149 |
|
---|
150 | <variablelist>
|
---|
151 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
152 | <?dbfo list-presentation="list"?>
|
---|
153 | <?dbhtml list-presentation="table"?>
|
---|
154 |
|
---|
155 | <varlistentry id="addr2line">
|
---|
156 | <term><command>addr2line</command></term>
|
---|
157 | <listitem>
|
---|
158 | <para>Translates program addresses to file names and line numbers;
|
---|
159 | given an address and the name of an executable, it uses the debugging
|
---|
160 | information in the executable to determine which source file and line
|
---|
161 | number are associated with the address</para>
|
---|
162 | <indexterm zone="ch-cross-tools-binutils addr2line">
|
---|
163 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
164 | </indexterm>
|
---|
165 | </listitem>
|
---|
166 | </varlistentry>
|
---|
167 |
|
---|
168 | <varlistentry id="ar">
|
---|
169 | <term><command>ar</command></term>
|
---|
170 | <listitem>
|
---|
171 | <para>Creates, modifies, and extracts from archives</para>
|
---|
172 | <indexterm zone="ch-cross-tools-binutils ar">
|
---|
173 | <primary sortas="b-ar">ar</primary>
|
---|
174 | </indexterm>
|
---|
175 | </listitem>
|
---|
176 | </varlistentry>
|
---|
177 |
|
---|
178 | <varlistentry id="as">
|
---|
179 | <term><command>as</command></term>
|
---|
180 | <listitem>
|
---|
181 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
182 | into object files</para>
|
---|
183 | <indexterm zone="ch-cross-tools-binutils as">
|
---|
184 | <primary sortas="b-as">as</primary>
|
---|
185 | </indexterm>
|
---|
186 | </listitem>
|
---|
187 | </varlistentry>
|
---|
188 |
|
---|
189 | <varlistentry id="c-filt">
|
---|
190 | <term><command>c++filt</command></term>
|
---|
191 | <listitem>
|
---|
192 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
193 | overloaded functions from clashing</para>
|
---|
194 | <indexterm zone="ch-cross-tools-binutils c-filt">
|
---|
195 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
196 | </indexterm>
|
---|
197 | </listitem>
|
---|
198 | </varlistentry>
|
---|
199 |
|
---|
200 | <varlistentry id="elfedit">
|
---|
201 | <term><command>elfedit</command></term>
|
---|
202 | <listitem>
|
---|
203 | <para>Examine and modify ELF metadata within an ELF object</para>
|
---|
204 | <indexterm zone="ch-cross-tools-binutils elfedit">
|
---|
205 | <primary sortas="b-elfedit">elfedit</primary>
|
---|
206 | </indexterm>
|
---|
207 | </listitem>
|
---|
208 | </varlistentry>
|
---|
209 |
|
---|
210 | <varlistentry id="gprof">
|
---|
211 | <term><command>gprof</command></term>
|
---|
212 | <listitem>
|
---|
213 | <para>Displays call graph profile data</para>
|
---|
214 | <indexterm zone="ch-cross-tools-binutils gprof">
|
---|
215 | <primary sortas="b-gprof">gprof</primary>
|
---|
216 | </indexterm>
|
---|
217 | </listitem>
|
---|
218 | </varlistentry>
|
---|
219 |
|
---|
220 | <varlistentry id="ld">
|
---|
221 | <term><command>ld</command></term>
|
---|
222 | <listitem>
|
---|
223 | <para>A linker that combines a number of object and archive files
|
---|
224 | into a single file, relocating their data and tying up symbol
|
---|
225 | references</para>
|
---|
226 | <indexterm zone="ch-cross-tools-binutils ld">
|
---|
227 | <primary sortas="b-ld">ld</primary>
|
---|
228 | </indexterm>
|
---|
229 | </listitem>
|
---|
230 | </varlistentry>
|
---|
231 |
|
---|
232 | <varlistentry id="nm">
|
---|
233 | <term><command>nm</command></term>
|
---|
234 | <listitem>
|
---|
235 | <para>Lists the symbols occurring in a given object file</para>
|
---|
236 | <indexterm zone="ch-cross-tools-binutils nm">
|
---|
237 | <primary sortas="b-nm">nm</primary>
|
---|
238 | </indexterm>
|
---|
239 | </listitem>
|
---|
240 | </varlistentry>
|
---|
241 |
|
---|
242 | <varlistentry id="objcopy">
|
---|
243 | <term><command>objcopy</command></term>
|
---|
244 | <listitem>
|
---|
245 | <para>Copy the contents of one object file to another</para>
|
---|
246 | <indexterm zone="ch-cross-tools-binutils objcopy">
|
---|
247 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
248 | </indexterm>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="objdump">
|
---|
253 | <term><command>objdump</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>Displays information about the given object file, with options
|
---|
256 | controlling the particular information to display; the information
|
---|
257 | shown is useful to programmers who are working on the compilation
|
---|
258 | tools</para>
|
---|
259 | <indexterm zone="ch-cross-tools-binutils objdump">
|
---|
260 | <primary sortas="b-objdump">objdump</primary>
|
---|
261 | </indexterm>
|
---|
262 | </listitem>
|
---|
263 | </varlistentry>
|
---|
264 |
|
---|
265 | <varlistentry id="ranlib">
|
---|
266 | <term><command>ranlib</command></term>
|
---|
267 | <listitem>
|
---|
268 | <para>Generates an index of the contents of an archive and stores it
|
---|
269 | in the archive; the index lists all of the symbols defined by archive
|
---|
270 | members that are relocatable object files</para>
|
---|
271 | <indexterm zone="ch-cross-tools-binutils ranlib">
|
---|
272 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
273 | </indexterm>
|
---|
274 | </listitem>
|
---|
275 | </varlistentry>
|
---|
276 |
|
---|
277 | <varlistentry id="readelf">
|
---|
278 | <term><command>readelf</command></term>
|
---|
279 | <listitem>
|
---|
280 | <para>Displays information about ELF type binaries</para>
|
---|
281 | <indexterm zone="ch-cross-tools-binutils readelf">
|
---|
282 | <primary sortas="b-readelf">readelf</primary>
|
---|
283 | </indexterm>
|
---|
284 | </listitem>
|
---|
285 | </varlistentry>
|
---|
286 |
|
---|
287 | <varlistentry id="size">
|
---|
288 | <term><command>size</command></term>
|
---|
289 | <listitem>
|
---|
290 | <para>Lists the section sizes and the total size for the given
|
---|
291 | object files</para>
|
---|
292 | <indexterm zone="ch-cross-tools-binutils size">
|
---|
293 | <primary sortas="b-size">size</primary>
|
---|
294 | </indexterm>
|
---|
295 | </listitem>
|
---|
296 | </varlistentry>
|
---|
297 |
|
---|
298 | <varlistentry id="strings">
|
---|
299 | <term><command>strings</command></term>
|
---|
300 | <listitem>
|
---|
301 | <para>Outputs, for each given file, the sequences of printable
|
---|
302 | characters that are of at least the specified length (defaulting to
|
---|
303 | four); for object files, it prints, by default, only the strings from
|
---|
304 | the initializing and loading sections while for other types of files,
|
---|
305 | it scans the entire file</para>
|
---|
306 | <indexterm zone="ch-cross-tools-binutils strings">
|
---|
307 | <primary sortas="b-strings">strings</primary>
|
---|
308 | </indexterm>
|
---|
309 | </listitem>
|
---|
310 | </varlistentry>
|
---|
311 |
|
---|
312 | <varlistentry id="strip">
|
---|
313 | <term><command>strip</command></term>
|
---|
314 | <listitem>
|
---|
315 | <para>Discards symbols from object files</para>
|
---|
316 | <indexterm zone="ch-cross-tools-binutils strip">
|
---|
317 | <primary sortas="b-strip">strip</primary>
|
---|
318 | </indexterm>
|
---|
319 | </listitem>
|
---|
320 | </varlistentry>
|
---|
321 |
|
---|
322 | <varlistentry id="libiberty">
|
---|
323 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
324 | <listitem>
|
---|
325 | <para>Contains routines used by various GNU programs, including
|
---|
326 | <command>getopt</command>, <command>obstack</command>,
|
---|
327 | <command>strerror</command>, <command>strtol</command>, and
|
---|
328 | <command>strtoul</command></para>
|
---|
329 | <indexterm zone="ch-cross-tools-binutils libiberty">
|
---|
330 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
331 | </indexterm>
|
---|
332 | </listitem>
|
---|
333 | </varlistentry>
|
---|
334 |
|
---|
335 | <varlistentry id="libbfd">
|
---|
336 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
337 | <listitem>
|
---|
338 | <para>The Binary File Descriptor library</para>
|
---|
339 | <indexterm zone="ch-cross-tools-binutils libbfd">
|
---|
340 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
341 | </indexterm>
|
---|
342 | </listitem>
|
---|
343 | </varlistentry>
|
---|
344 |
|
---|
345 | <varlistentry id="libopcodes">
|
---|
346 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
347 | <listitem>
|
---|
348 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
349 | text</quote> versions of instructions for the processor;
|
---|
350 | it is used for building utilities like
|
---|
351 | <command>objdump</command>.</para>
|
---|
352 | <indexterm zone="ch-cross-tools-binutils libopcodes">
|
---|
353 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
354 | </indexterm>
|
---|
355 | </listitem>
|
---|
356 | </varlistentry>
|
---|
357 |
|
---|
358 | </variablelist>
|
---|
359 |
|
---|
360 | </sect2>
|
---|
361 |
|
---|
362 | </sect1>
|
---|