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
|
---|
14 | handling 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,
|
---|
25 | Glibc, Grep, Make, Perl, Sed, Texinfo</seg></seglistitem>
|
---|
26 | </segmentedlist>
|
---|
27 | </sect2>
|
---|
28 |
|
---|
29 | <sect2 role="installation">
|
---|
30 | <title>Installation of Binutils</title>
|
---|
31 |
|
---|
32 | <para>Verify that your the terminals (PTYs) are working properly
|
---|
33 | inside the chroot environment. Check that everything is set up
|
---|
34 | correctly by performing a simple test:</para>
|
---|
35 |
|
---|
36 | <screen><userinput>expect -c "spawn ls"</userinput></screen>
|
---|
37 |
|
---|
38 | <para>If the following message shows up, the chroot environment is not
|
---|
39 | set up for proper PTY operation:</para>
|
---|
40 |
|
---|
41 | <screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
|
---|
42 |
|
---|
43 | <para>The issue needs to be resolved before running the test suites
|
---|
44 | for Binutils and GCC.</para>
|
---|
45 |
|
---|
46 | <para>This package is known to have issues when its default
|
---|
47 | optimization flags (including the <parameter>-march</parameter> and
|
---|
48 | <parameter>-mcpu</parameter> options) are changed. If any environment
|
---|
49 | variables that override default optimizations have been defined, such
|
---|
50 | as <emphasis>CFLAGS</emphasis> and <emphasis>CXXFLAGS</emphasis>,
|
---|
51 | unset or modifying them when building Binutils.</para>
|
---|
52 |
|
---|
53 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
54 | source directory in a dedicated build directory:</para>
|
---|
55 |
|
---|
56 | <screen><userinput>mkdir ../binutils-build
|
---|
57 | cd ../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
|
---|
68 | ultimately be located) is set to <filename
|
---|
69 | class="directory">$(exec_prefix)/$(target_alias)</filename>, which
|
---|
70 | expands into <filename
|
---|
71 | class="directory">/usr/i686-pc-linux-gnu</filename>. Because this is a
|
---|
72 | custom system, this target-specific directory in <filename
|
---|
73 | class="directory">/usr</filename> is not required. This setup would be
|
---|
74 | used if the system was used to cross-compile (for example, compiling a
|
---|
75 | package on an Intel machine that generates code that can be executed
|
---|
76 | on PowerPC machines).</para>
|
---|
77 |
|
---|
78 | <important><para>The test suite for Binutils in this section is
|
---|
79 | considered critical. Do not skip it under any
|
---|
80 | circumstances.</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
|
---|
91 | some 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,
|
---|
104 | ranlib, readelf, size, strings and strip</seg>
|
---|
105 | <seg>libiberty.a, libbfd.[a,so] and libopcodes.[a,so]</seg></seglistitem>
|
---|
106 | </segmentedlist>
|
---|
107 |
|
---|
108 | <variablelist><title>Short descriptions</title>
|
---|
109 |
|
---|
110 | <varlistentry id="addr2line">
|
---|
111 | <term><command>addr2line</command></term>
|
---|
112 | <listitem>
|
---|
113 | <indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
|
---|
114 | <para>translates program addresses to file names and line numbers.
|
---|
115 | Given an address and the name of an executable, it uses the debugging
|
---|
116 | information in the executable to determine which source file and line
|
---|
117 | number are associated with the address.</para>
|
---|
118 | </listitem>
|
---|
119 | </varlistentry>
|
---|
120 |
|
---|
121 | <varlistentry id="ar">
|
---|
122 | <term><command>ar</command></term>
|
---|
123 | <listitem>
|
---|
124 | <indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
|
---|
125 | <para>creates, modifies, and extracts from archives. An archive is a
|
---|
126 | single file holding a collection of other files in a structure that
|
---|
127 | makes it possible to retrieve the original individual files (called
|
---|
128 | members of the archive).</para>
|
---|
129 | </listitem>
|
---|
130 | </varlistentry>
|
---|
131 |
|
---|
132 | <varlistentry id="as">
|
---|
133 | <term><command>as</command></term>
|
---|
134 | <listitem>
|
---|
135 | <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
|
---|
136 | <para>an assembler. It assembles the output of gcc into object
|
---|
137 | files.</para>
|
---|
138 | </listitem>
|
---|
139 | </varlistentry>
|
---|
140 |
|
---|
141 | <varlistentry id="c-filt">
|
---|
142 | <term><command>c++filt</command></term>
|
---|
143 | <listitem>
|
---|
144 | <indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
|
---|
145 | <para>used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
146 | overloaded functions from clashing.</para>
|
---|
147 | </listitem>
|
---|
148 | </varlistentry>
|
---|
149 |
|
---|
150 | <varlistentry id="gprof">
|
---|
151 | <term><command>gprof</command></term>
|
---|
152 | <listitem>
|
---|
153 | <indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
|
---|
154 | <para>displays call graph profile data.</para>
|
---|
155 | </listitem>
|
---|
156 | </varlistentry>
|
---|
157 |
|
---|
158 | <varlistentry id="ld">
|
---|
159 | <term><command>ld</command></term>
|
---|
160 | <listitem>
|
---|
161 | <indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
|
---|
162 | <para>a linker. It combines a number of object and archive files into a single file,
|
---|
163 | relocating their data and tying up symbol references.</para>
|
---|
164 | </listitem>
|
---|
165 | </varlistentry>
|
---|
166 |
|
---|
167 | <varlistentry id="nm">
|
---|
168 | <term><command>nm</command></term>
|
---|
169 | <listitem>
|
---|
170 | <indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
|
---|
171 | <para>lists the symbols occurring in a given object file.</para>
|
---|
172 | </listitem>
|
---|
173 | </varlistentry>
|
---|
174 |
|
---|
175 | <varlistentry id="objcopy">
|
---|
176 | <term><command>objcopy</command></term>
|
---|
177 | <listitem>
|
---|
178 | <indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
|
---|
179 | <para>used to translate one type of object file into another.</para>
|
---|
180 | </listitem>
|
---|
181 | </varlistentry>
|
---|
182 |
|
---|
183 | <varlistentry id="objdump">
|
---|
184 | <term><command>objdump</command></term>
|
---|
185 | <listitem>
|
---|
186 | <indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
|
---|
187 | <para>displays information about the given object file, with options
|
---|
188 | controlling the particular information to display. The information
|
---|
189 | shown is useful to programmers who are working on the compilation
|
---|
190 | tools.</para>
|
---|
191 | </listitem>
|
---|
192 | </varlistentry>
|
---|
193 |
|
---|
194 | <varlistentry id="ranlib">
|
---|
195 | <term><command>ranlib</command></term>
|
---|
196 | <listitem>
|
---|
197 | <indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
|
---|
198 | <para>generates an index of the contents of an archive and stores it
|
---|
199 | in the archive. The index lists all of the symbols defined by archive
|
---|
200 | members that are relocatable object files.</para>
|
---|
201 | </listitem>
|
---|
202 | </varlistentry>
|
---|
203 |
|
---|
204 | <varlistentry id="readelf">
|
---|
205 | <term><command>readelf</command></term>
|
---|
206 | <listitem>
|
---|
207 | <indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
|
---|
208 | <para>displays information about ELF type binaries.</para>
|
---|
209 | </listitem>
|
---|
210 | </varlistentry>
|
---|
211 |
|
---|
212 | <varlistentry id="size">
|
---|
213 | <term><command>size</command></term>
|
---|
214 | <listitem>
|
---|
215 | <indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
|
---|
216 | <para>lists the section sizes and the total size for the given object files.</para>
|
---|
217 | </listitem>
|
---|
218 | </varlistentry>
|
---|
219 |
|
---|
220 | <varlistentry id="strings">
|
---|
221 | <term><command>strings</command></term>
|
---|
222 | <listitem>
|
---|
223 | <indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
|
---|
224 | <para>outputs, for each given file, the sequences of printable
|
---|
225 | characters that are of at least the specified length (defaulting to
|
---|
226 | four). For object files, it prints, by default, only the strings from
|
---|
227 | the initializing and loading sections. For other types of files, it
|
---|
228 | scans the whole file.</para>
|
---|
229 | </listitem>
|
---|
230 | </varlistentry>
|
---|
231 |
|
---|
232 | <varlistentry id="strip">
|
---|
233 | <term><command>strip</command></term>
|
---|
234 | <listitem>
|
---|
235 | <indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
|
---|
236 | <para>discards symbols from object files.</para>
|
---|
237 | </listitem>
|
---|
238 | </varlistentry>
|
---|
239 |
|
---|
240 | <varlistentry id="libiberty">
|
---|
241 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
242 | <listitem>
|
---|
243 | <indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
|
---|
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 | </listitem>
|
---|
249 | </varlistentry>
|
---|
250 |
|
---|
251 | <varlistentry id="libbfd">
|
---|
252 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
253 | <listitem>
|
---|
254 | <indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
|
---|
255 | <para>the Binary File Descriptor library.</para>
|
---|
256 | </listitem>
|
---|
257 | </varlistentry>
|
---|
258 |
|
---|
259 | <varlistentry id="libopcodes">
|
---|
260 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
261 | <listitem>
|
---|
262 | <indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
|
---|
263 | <para>a library for dealing with opcodes.
|
---|
264 | It is used for building utilities like <command>objdump</command>. Opcodes are the <quote>readable
|
---|
265 | text</quote> versions of instructions for the processor.</para>
|
---|
266 | </listitem>
|
---|
267 | </varlistentry>
|
---|
268 | </variablelist>
|
---|
269 |
|
---|
270 | </sect2>
|
---|
271 |
|
---|
272 | </sect1>
|
---|
273 |
|
---|