source: BOOK/final-system/common/binutils.xml@ 8199be3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 8199be3 was 4fd157b, checked in by Joe Ciccone <jciccone@…>, 14 years ago

Updated Binutils to 2.20.1.

  • Property mode set to 100644
File size: 11.9 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
[aa18ac0]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[3f8be484]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-binutils" role="wrap">
9 <?dbhtml filename="binutils.html"?>
10
11 <title>Binutils-&binutils-version;</title>
12
13 <indexterm zone="ch-system-binutils">
14 <primary sortas="a-Binutils">Binutils</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Binutils package contains a linker, an assembler, and other
21 tools for handling object files.</para>
22
23 </sect2>
24
25 <sect2 role="installation">
26 <title>Installation of Binutils</title>
27
28 <para os="b">Verify that the PTYs are working properly inside the build
29 environment. Check that everything is set up correctly by performing a
30 simple test:</para>
31
[0f3854e]32<screen os="c" role="nodump"><userinput>expect -c "spawn ls"</userinput></screen>
[3f8be484]33
[9ecbe5a]34 <para os="d">This command should give the following output:</para>
[3f8be484]35
[9ecbe5a]36<screen os="e"><computeroutput>spawn ls</computeroutput></screen>
[3f8be484]37
[9ecbe5a]38 <para os="f">If, instead, it gives a message saying to create more ptys,
39 then the environment is not set up for proper PTY operation. This issue
40 needs to be resolved before running the test suites for Binutils and GCC.</para>
[3f8be484]41
42 <para os="g">The Binutils documentation recommends building Binutils outside of the
43 source directory in a dedicated build directory:</para>
44
[94e6142]45<screen os="h"><userinput>mkdir -v ../binutils-build
[3f8be484]46cd ../binutils-build</userinput></screen>
47
48 <para os="i">Prepare Binutils for compilation:</para>
49
[4173cd9]50<screen os="ca"><userinput>CC="gcc -isystem /usr/include" \
51 LDFLAGS="-Wl,-rpath-link,/lib" \
[cef9831]52 ../binutils-&binutils-version;/configure --prefix=/usr \
[3f8be484]53 --enable-shared</userinput></screen>
54
55 <para os="j">Compile the package:</para>
56
57<screen os="k"><userinput>make configure-host</userinput></screen>
58
59 <important os="l">
60 <para>During <command>make configure-host</command> you may receive the
61 following error message. It is safe to ignore.</para>
62
63<screen><computeroutput>WARNING: `flex' is missing on your system. You should only
64need it if you modified a `.l' file. You may need the `Flex'
65package in order for those modifications to take effect. You
66can get `Flex' from any GNU archive site.</computeroutput></screen>
67 </important>
68
69<screen os="m"><userinput>make tooldir=/usr</userinput></screen>
70
[44d357b]71 <variablelist os="n">
72 <title>The meaning of the make parameter:</title>
73
74 <varlistentry>
75 <term><parameter>tooldir=/usr</parameter></term>
76 <listitem>
77 <para>Normally, the tooldir (the directory where the executables
78 will ultimately be located) is set to <filename
79 class="directory">$(exec_prefix)/$(target_alias)</filename>. Because this
80 is a custom system, this target-specific directory in <filename
81 class="directory">/usr</filename> is not required.</para>
82 </listitem>
83 </varlistentry>
84 </variablelist>
[3f8be484]85
86 <important os="o">
[121c48a]87 <para>The test suite for Binutils is considered critical.
88 Do not skip it under any circumstance.</para>
[3f8be484]89 </important>
90
[936dcb48]91 <para os="ts1">In order to run the testsuite correctly, due to a change in
92 Glibc we need to run the following command to prevent an error:</para>
[3f8be484]93
[936dcb48]94<screen os="ts2"><userinput>sed -i 's/getline/_getline/' ../binutils-&binutils-version;/libiberty/testsuite/test-demangle.c</userinput></screen>
[3f8be484]95
[936dcb48]96 <para os="p">Test the results:</para>
[f54319a]97
[936dcb48]98<screen os="q"><userinput>make check</userinput></screen>
[f54319a]99
[3f8be484]100 <para os="r">Install the package:</para>
101
102<screen os="s"><userinput>make tooldir=/usr install</userinput></screen>
103
104 <para os="t">Install the <filename class="headerfile">libiberty</filename> header
105 file that is needed by some packages:</para>
106
[94e6142]107<screen os="u"><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
[3f8be484]108
109 </sect2>
110
111 <sect2 id="contents-binutils" role="content">
112 <title>Contents of Binutils</title>
113
114 <segmentedlist>
115 <segtitle>Installed programs</segtitle>
116 <segtitle>Installed libraries</segtitle>
[61ad0b7f]117 <segtitle>Installed directory</segtitle>
[3f8be484]118
119 <seglistitem>
120 <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
121 ranlib, readelf, size, strings, and strip</seg>
122 <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
[61ad0b7f]123 <seg>/usr/lib/ldscripts</seg>
[3f8be484]124 </seglistitem>
125 </segmentedlist>
126
127 <variablelist>
128 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
129 <?dbfo list-presentation="list"?>
130 <?dbhtml list-presentation="table"?>
131
132 <varlistentry id="addr2line">
133 <term><command>addr2line</command></term>
134 <listitem>
135 <para>Translates program addresses to file names and line numbers;
136 given an address and the name of an executable, it uses the debugging
137 information in the executable to determine which source file and line
138 number are associated with the address</para>
139 <indexterm zone="ch-system-binutils addr2line">
140 <primary sortas="b-addr2line">addr2line</primary>
141 </indexterm>
142 </listitem>
143 </varlistentry>
144
145 <varlistentry id="ar">
146 <term><command>ar</command></term>
147 <listitem>
148 <para>Creates, modifies, and extracts from archives</para>
149 <indexterm zone="ch-system-binutils ar">
150 <primary sortas="b-ar">ar</primary>
151 </indexterm>
152 </listitem>
153 </varlistentry>
154
155 <varlistentry id="as">
156 <term><command>as</command></term>
157 <listitem>
158 <para>An assembler that assembles the output of <command>gcc</command>
159 into object files</para>
160 <indexterm zone="ch-system-binutils as">
161 <primary sortas="b-as">as</primary>
162 </indexterm>
163 </listitem>
164 </varlistentry>
165
166 <varlistentry id="c-filt">
167 <term><command>c++filt</command></term>
168 <listitem>
169 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
170 overloaded functions from clashing</para>
171 <indexterm zone="ch-system-binutils c-filt">
172 <primary sortas="b-c++filt">c++filt</primary>
173 </indexterm>
174 </listitem>
175 </varlistentry>
176
177 <varlistentry id="gprof">
178 <term><command>gprof</command></term>
179 <listitem>
180 <para>Displays call graph profile data</para>
181 <indexterm zone="ch-system-binutils gprof">
182 <primary sortas="b-gprof">gprof</primary>
183 </indexterm>
184 </listitem>
185 </varlistentry>
186
187 <varlistentry id="ld">
188 <term><command>ld</command></term>
189 <listitem>
190 <para>A linker that combines a number of object and archive files
191 into a single file, relocating their data and tying up symbol
192 references</para>
193 <indexterm zone="ch-system-binutils ld">
194 <primary sortas="b-ld">ld</primary>
195 </indexterm>
196 </listitem>
197 </varlistentry>
198
199 <varlistentry id="nm">
200 <term><command>nm</command></term>
201 <listitem>
202 <para>Lists the symbols occurring in a given object file</para>
203 <indexterm zone="ch-system-binutils nm">
204 <primary sortas="b-nm">nm</primary>
205 </indexterm>
206 </listitem>
207 </varlistentry>
208
209 <varlistentry id="objcopy">
210 <term><command>objcopy</command></term>
211 <listitem>
212 <para>Translates one type of object file into another</para>
213 <indexterm zone="ch-system-binutils objcopy">
214 <primary sortas="b-objcopy">objcopy</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
219 <varlistentry id="objdump">
220 <term><command>objdump</command></term>
221 <listitem>
222 <para>Displays information about the given object file, with options
223 controlling the particular information to display; the information
224 shown is useful to programmers who are working on the compilation
225 tools</para>
226 <indexterm zone="ch-system-binutils objdump">
227 <primary sortas="b-objdump">objdump</primary>
228 </indexterm>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry id="ranlib">
233 <term><command>ranlib</command></term>
234 <listitem>
235 <para>Generates an index of the contents of an archive and stores it
236 in the archive; the index lists all of the symbols defined by archive
237 members that are relocatable object files</para>
238 <indexterm zone="ch-system-binutils ranlib">
239 <primary sortas="b-ranlib">ranlib</primary>
240 </indexterm>
241 </listitem>
242 </varlistentry>
243
244 <varlistentry id="readelf">
245 <term><command>readelf</command></term>
246 <listitem>
247 <para>Displays information about ELF type binaries</para>
248 <indexterm zone="ch-system-binutils readelf">
249 <primary sortas="b-readelf">readelf</primary>
250 </indexterm>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry id="size">
255 <term><command>size</command></term>
256 <listitem>
257 <para>Lists the section sizes and the total size for the given
258 object files</para>
259 <indexterm zone="ch-system-binutils size">
260 <primary sortas="b-size">size</primary>
261 </indexterm>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry id="strings">
266 <term><command>strings</command></term>
267 <listitem>
268 <para>Outputs, for each given file, the sequences of printable
269 characters that are of at least the specified length (defaulting to
270 four); for object files, it prints, by default, only the strings from
271 the initializing and loading sections while for other types of files,
272 it scans the entire file</para>
273 <indexterm zone="ch-system-binutils strings">
274 <primary sortas="b-strings">strings</primary>
275 </indexterm>
276 </listitem>
277 </varlistentry>
278
279 <varlistentry id="strip">
280 <term><command>strip</command></term>
281 <listitem>
282 <para>Discards symbols from object files</para>
283 <indexterm zone="ch-system-binutils strip">
284 <primary sortas="b-strip">strip</primary>
285 </indexterm>
286 </listitem>
287 </varlistentry>
288
289 <varlistentry id="libiberty">
290 <term><filename class="libraryfile">libiberty</filename></term>
291 <listitem>
292 <para>Contains routines used by various GNU programs, including
293 <command>getopt</command>, <command>obstack</command>,
294 <command>strerror</command>, <command>strtol</command>, and
295 <command>strtoul</command></para>
296 <indexterm zone="ch-system-binutils libiberty">
297 <primary sortas="c-libiberty">libiberty</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry id="libbfd">
303 <term><filename class="libraryfile">libbfd</filename></term>
304 <listitem>
305 <para>The Binary File Descriptor library</para>
306 <indexterm zone="ch-system-binutils libbfd">
307 <primary sortas="c-libbfd">libbfd</primary>
308 </indexterm>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry id="libopcodes">
313 <term><filename class="libraryfile">libopcodes</filename></term>
314 <listitem>
315 <para>A library for dealing with opcodes&mdash;the <quote>readable
316 text</quote> versions of instructions for the processor;
317 it is used for building utilities like
318 <command>objdump</command>.</para>
319 <indexterm zone="ch-system-binutils libopcodes">
320 <primary sortas="c-libopcodes">libopcodes</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
324
325 </variablelist>
326
327 </sect2>
328
329</sect1>
Note: See TracBrowser for help on using the repository browser.