source: chapter06/binutils.xml@ 69993f4

6.0
Last change on this file since 69993f4 was 69993f4, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Second round of edits for final release

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4066 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 9.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-binutils" xreflabel="Binutils" role="wrap">
7<title>Binutils-&binutils-version;</title>
8<?dbhtml filename="binutils.html"?>
9
10<indexterm zone="ch-system-binutils"><primary sortas="a-Binutils">Binutils</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Binutils package contains a linker, an assembler, and other tools for
14handling object files.</para>
15
16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>1.4 SBU</seg><seg>167 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>Binutils installation depends on</segtitle>
24<seglistitem><seg>Bash, Coreutils, Diffutils, GCC, Gettext,
25Glibc, Grep, Make, Perl, Sed, and Texinfo</seg></seglistitem>
26</segmentedlist>
27</sect2>
28
29<sect2 role="installation">
30<title>Installation of Binutils</title>
31
32<para>This package is known to have issues when its default
33optimization flags (including the <parameter>-march</parameter> and
34<parameter>-mcpu</parameter> options) are changed. If any environment
35variables that override default optimizations have been defined, such
36as <emphasis>CFLAGS</emphasis> and <emphasis>CXXFLAGS</emphasis>,
37unset them when building Binutils.</para>
38
39<para>Verify that the PTYs are working properly inside the chroot
40environment. Check that everything is set up correctly by performing a
41simple test:</para>
42
43<screen><userinput>expect -c "spawn ls"</userinput></screen>
44
45<para>If the following message shows up, the chroot environment is not
46set up for proper PTY operation:</para>
47
48<screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
49
50<para>This issue needs to be resolved before running the test suites
51for Binutils and GCC.</para>
52
53<para>The Binutils documentation recommends building Binutils outside of the
54source directory in a dedicated build directory:</para>
55
56<screen><userinput>mkdir ../binutils-build
57cd ../binutils-build</userinput></screen>
58
59<para>Prepare Binutils for compilation:</para>
60
61<screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
62
63<para>Compile the package:</para>
64
65<screen><userinput>make tooldir=/usr</userinput></screen>
66
67<para>Normally, the tooldir (the directory where the executables will
68ultimately be located) is set to <filename
69class="directory">$(exec_prefix)/$(target_alias)</filename>, which
70expands into <filename
71class="directory">/usr/i686-pc-linux-gnu</filename>. Because this is a
72custom system, this target-specific directory in <filename
73class="directory">/usr</filename> is not required. This setup would be
74used if the system was used to cross-compile (for example, compiling a
75package on an Intel machine that generates code that can be executed
76on PowerPC machines).</para>
77
78<important><para>The test suite for Binutils in this section is
79considered critical. Do not skip it under any
80circumstances.</para></important>
81
82<para>Test the results:</para>
83
84<screen><userinput>make check</userinput></screen>
85
86<para>Install the package:</para>
87
88<screen><userinput>make tooldir=/usr install</userinput></screen>
89
90<para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
91some packages:</para>
92
93<screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
94
95</sect2>
96
97
98<sect2 id="contents-binutils" role="content"><title>Contents of Binutils</title>
99
100<segmentedlist>
101<segtitle>Installed programs</segtitle>
102<segtitle>Installed libraries</segtitle>
103<seglistitem><seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
104ranlib, readelf, size, strings, and strip</seg>
105<seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg></seglistitem>
106</segmentedlist>
107
108<variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
109<?dbfo list-presentation="list"?>
110
111<varlistentry id="addr2line">
112<term><command>addr2line</command></term>
113<listitem>
114<para>translates program addresses to file names and line numbers.
115Given an address and the name of an executable, it uses the debugging
116information in the executable to determine which source file and line
117number are associated with the address.</para>
118<indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
119</listitem>
120</varlistentry>
121
122<varlistentry id="ar">
123<term><command>ar</command></term>
124<listitem>
125<para>creates, modifies, and extracts from archives. An archive is a
126single file holding a collection of other files in a structure that
127makes it possible to retrieve the original individual files (called
128members of the archive).</para>
129<indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
130</listitem>
131</varlistentry>
132
133<varlistentry id="as">
134<term><command>as</command></term>
135<listitem>
136<para>an assembler that assembles the output of gcc into object
137files.</para>
138<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
139</listitem>
140</varlistentry>
141
142<varlistentry id="c-filt">
143<term><command>c++filt</command></term>
144<listitem>
145<para>used by the linker to de-mangle C++ and Java symbols and to keep
146overloaded functions from clashing.</para>
147<indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
148</listitem>
149</varlistentry>
150
151<varlistentry id="gprof">
152<term><command>gprof</command></term>
153<listitem>
154<para>displays call graph profile data.</para>
155<indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
156</listitem>
157</varlistentry>
158
159<varlistentry id="ld">
160<term><command>ld</command></term>
161<listitem>
162<para>a linker that combines a number of object and archive files into a single file,
163relocating their data and tying up symbol references.</para>
164<indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
165</listitem>
166</varlistentry>
167
168<varlistentry id="nm">
169<term><command>nm</command></term>
170<listitem>
171<para>lists the symbols occurring in a given object file.</para>
172<indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
173</listitem>
174</varlistentry>
175
176<varlistentry id="objcopy">
177<term><command>objcopy</command></term>
178<listitem>
179<para>translates one type of object file into another.</para>
180<indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
181</listitem>
182</varlistentry>
183
184<varlistentry id="objdump">
185<term><command>objdump</command></term>
186<listitem>
187<para>displays information about the given object file, with options
188controlling the particular information to display. The information
189shown is useful to programmers who are working on the compilation
190tools.</para>
191<indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
192</listitem>
193</varlistentry>
194
195<varlistentry id="ranlib">
196<term><command>ranlib</command></term>
197<listitem>
198<para>generates an index of the contents of an archive and stores it
199in the archive. The index lists all of the symbols defined by archive
200members that are relocatable object files.</para>
201<indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
202</listitem>
203</varlistentry>
204
205<varlistentry id="readelf">
206<term><command>readelf</command></term>
207<listitem>
208<para>displays information about ELF type binaries.</para>
209<indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
210</listitem>
211</varlistentry>
212
213<varlistentry id="size">
214<term><command>size</command></term>
215<listitem>
216<para>lists the section sizes and the total size for the given object files.</para>
217<indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
218</listitem>
219</varlistentry>
220
221<varlistentry id="strings">
222<term><command>strings</command></term>
223<listitem>
224<para>outputs, for each given file, the sequences of printable
225characters that are of at least the specified length (defaulting to
226four). For object files, it prints, by default, only the strings from
227the initializing and loading sections. For other types of files, it
228scans the entire file.</para>
229<indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
230</listitem>
231</varlistentry>
232
233<varlistentry id="strip">
234<term><command>strip</command></term>
235<listitem>
236<para>discards symbols from object files.</para>
237<indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
238</listitem>
239</varlistentry>
240
241<varlistentry id="libiberty">
242<term><filename class="libraryfile">libiberty</filename></term>
243<listitem>
244<para>contains routines used by various GNU programs, including
245<command>getopt</command>, <command>obstack</command>,
246<command>strerror</command>, <command>strtol</command>, and
247<command>strtoul</command>.</para>
248<indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
249</listitem>
250</varlistentry>
251
252<varlistentry id="libbfd">
253<term><filename class="libraryfile">libbfd</filename></term>
254<listitem>
255<para>the Binary File Descriptor library.</para>
256<indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
257</listitem>
258</varlistentry>
259
260<varlistentry id="libopcodes">
261<term><filename class="libraryfile">libopcodes</filename></term>
262<listitem>
263<para>a library for dealing with opcodes.
264It is used for building utilities like <command>objdump</command>. Opcodes are the <quote>readable
265text</quote> versions of instructions for the processor.</para>
266<indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
267</listitem>
268</varlistentry>
269</variablelist>
270
271</sect2>
272
273</sect1>
274
Note: See TracBrowser for help on using the repository browser.