source: BOOK/final-system/common/binutils.xml@ 2919d9a

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 2919d9a was 9ecbe5a, checked in by Chris Staub <chris@…>, 16 years ago

Text clarification to explain the correct output for expect test command

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