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

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1487226 was 206bb97, checked in by Joe Ciccone <jciccone@…>, 15 years ago

Updated Binutils to 2.20.

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