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