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

Last change on this file since 173cc96 was 7e8a7d8, checked in by Andrew Bradford <andrew@…>, 10 years ago

Update binutils to 2.24

Now supports musl without patching of binutils.

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