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 | <segmentedlist>
|
---|
24 | <segtitle>&buildtime;</segtitle>
|
---|
25 | <segtitle>&diskspace;</segtitle>
|
---|
26 |
|
---|
27 | <seglistitem>
|
---|
28 | <seg>&binutils-ch6-sbu;</seg>
|
---|
29 | <seg>&binutils-ch6-du;</seg>
|
---|
30 | </seglistitem>
|
---|
31 | </segmentedlist>
|
---|
32 |
|
---|
33 | </sect2>
|
---|
34 |
|
---|
35 | <sect2 role="installation">
|
---|
36 | <title>Installation of Binutils</title>
|
---|
37 |
|
---|
38 | <para>Verify that the PTYs are working properly inside the chroot
|
---|
39 | environment. Check that everything is set up correctly by performing a
|
---|
40 | simple test:</para>
|
---|
41 |
|
---|
42 | <screen><userinput>expect -c "spawn ls"</userinput></screen>
|
---|
43 |
|
---|
44 | <para>If the following message shows up, the chroot environment is not
|
---|
45 | set up for proper PTY operation:</para>
|
---|
46 |
|
---|
47 | <screen><computeroutput>The system has no more ptys.
|
---|
48 | Ask your system administrator to create more.</computeroutput></screen>
|
---|
49 |
|
---|
50 | <para>This issue needs to be resolved before running the test suites
|
---|
51 | for Binutils and GCC.</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 -v ../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 \
|
---|
62 | --enable-shared --disable-multilib</userinput></screen>
|
---|
63 |
|
---|
64 | <para>Compile the package:</para>
|
---|
65 |
|
---|
66 | <screen><userinput>make tooldir=/usr</userinput></screen>
|
---|
67 |
|
---|
68 | <variablelist>
|
---|
69 | <title>The meaning of the make parameter:</title>
|
---|
70 |
|
---|
71 | <varlistentry>
|
---|
72 | <term><parameter>tooldir=/usr</parameter></term>
|
---|
73 | <listitem>
|
---|
74 | <para>Normally, the tooldir (the directory where the executables will
|
---|
75 | ultimately be located) is set to <filename
|
---|
76 | class="directory">$(exec_prefix)/$(target_alias)</filename>. For
|
---|
77 | example, x86_64 machines would expand that to <filename
|
---|
78 | class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
|
---|
79 | a custom system, this target-specific directory in <filename
|
---|
80 | class="directory">/usr</filename> is not required. <filename
|
---|
81 | class="directory">$(exec_prefix)/$(target_alias)</filename> would be
|
---|
82 | used if the system was used to cross-compile (for example, compiling a
|
---|
83 | package on an Intel machine that generates code that can be executed
|
---|
84 | on PowerPC machines).</para>
|
---|
85 | </listitem>
|
---|
86 | </varlistentry>
|
---|
87 |
|
---|
88 | </variablelist>
|
---|
89 |
|
---|
90 | <important>
|
---|
91 | <para>The test suite for Binutils in this section is considered critical.
|
---|
92 | Do not skip it under any circumstances.</para>
|
---|
93 | </important>
|
---|
94 |
|
---|
95 | <para>Test the results:</para>
|
---|
96 |
|
---|
97 | <screen><userinput>make check</userinput></screen>
|
---|
98 |
|
---|
99 | <para>Install the package:</para>
|
---|
100 |
|
---|
101 | <screen><userinput>make tooldir=/usr install</userinput></screen>
|
---|
102 |
|
---|
103 | <para>Install the <filename class="headerfile">libiberty</filename> header
|
---|
104 | file that is needed by some packages:</para>
|
---|
105 |
|
---|
106 | <screen><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
107 |
|
---|
108 | </sect2>
|
---|
109 |
|
---|
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>
|
---|
117 |
|
---|
118 | <seglistitem>
|
---|
119 | <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
|
---|
120 | ranlib, readelf, size, strings, and strip</seg>
|
---|
121 | <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
|
---|
122 | </seglistitem>
|
---|
123 | </segmentedlist>
|
---|
124 |
|
---|
125 | <variablelist>
|
---|
126 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
127 | <?dbfo list-presentation="list"?>
|
---|
128 | <?dbhtml list-presentation="table"?>
|
---|
129 |
|
---|
130 | <varlistentry id="addr2line">
|
---|
131 | <term><command>addr2line</command></term>
|
---|
132 | <listitem>
|
---|
133 | <para>Translates program addresses to file names and line numbers;
|
---|
134 | given an address and the name of an executable, it uses the debugging
|
---|
135 | information in the executable to determine which source file and line
|
---|
136 | number are associated with the address</para>
|
---|
137 | <indexterm zone="ch-system-binutils addr2line">
|
---|
138 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
139 | </indexterm>
|
---|
140 | </listitem>
|
---|
141 | </varlistentry>
|
---|
142 |
|
---|
143 | <varlistentry id="ar">
|
---|
144 | <term><command>ar</command></term>
|
---|
145 | <listitem>
|
---|
146 | <para>Creates, modifies, and extracts from archives</para>
|
---|
147 | <indexterm zone="ch-system-binutils ar">
|
---|
148 | <primary sortas="b-ar">ar</primary>
|
---|
149 | </indexterm>
|
---|
150 | </listitem>
|
---|
151 | </varlistentry>
|
---|
152 |
|
---|
153 | <varlistentry id="as">
|
---|
154 | <term><command>as</command></term>
|
---|
155 | <listitem>
|
---|
156 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
157 | into object files</para>
|
---|
158 | <indexterm zone="ch-system-binutils as">
|
---|
159 | <primary sortas="b-as">as</primary>
|
---|
160 | </indexterm>
|
---|
161 | </listitem>
|
---|
162 | </varlistentry>
|
---|
163 |
|
---|
164 | <varlistentry id="c-filt">
|
---|
165 | <term><command>c++filt</command></term>
|
---|
166 | <listitem>
|
---|
167 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
168 | overloaded functions from clashing</para>
|
---|
169 | <indexterm zone="ch-system-binutils c-filt">
|
---|
170 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
171 | </indexterm>
|
---|
172 | </listitem>
|
---|
173 | </varlistentry>
|
---|
174 |
|
---|
175 | <varlistentry id="gprof">
|
---|
176 | <term><command>gprof</command></term>
|
---|
177 | <listitem>
|
---|
178 | <para>Displays call graph profile data</para>
|
---|
179 | <indexterm zone="ch-system-binutils gprof">
|
---|
180 | <primary sortas="b-gprof">gprof</primary>
|
---|
181 | </indexterm>
|
---|
182 | </listitem>
|
---|
183 | </varlistentry>
|
---|
184 |
|
---|
185 | <varlistentry id="ld">
|
---|
186 | <term><command>ld</command></term>
|
---|
187 | <listitem>
|
---|
188 | <para>A linker that combines a number of object and archive files
|
---|
189 | into a single file, relocating their data and tying up symbol
|
---|
190 | references</para>
|
---|
191 | <indexterm zone="ch-system-binutils ld">
|
---|
192 | <primary sortas="b-ld">ld</primary>
|
---|
193 | </indexterm>
|
---|
194 | </listitem>
|
---|
195 | </varlistentry>
|
---|
196 |
|
---|
197 | <varlistentry id="nm">
|
---|
198 | <term><command>nm</command></term>
|
---|
199 | <listitem>
|
---|
200 | <para>Lists the symbols occurring in a given object file</para>
|
---|
201 | <indexterm zone="ch-system-binutils nm">
|
---|
202 | <primary sortas="b-nm">nm</primary>
|
---|
203 | </indexterm>
|
---|
204 | </listitem>
|
---|
205 | </varlistentry>
|
---|
206 |
|
---|
207 | <varlistentry id="objcopy">
|
---|
208 | <term><command>objcopy</command></term>
|
---|
209 | <listitem>
|
---|
210 | <para>Translates one type of object file into another</para>
|
---|
211 | <indexterm zone="ch-system-binutils objcopy">
|
---|
212 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
213 | </indexterm>
|
---|
214 | </listitem>
|
---|
215 | </varlistentry>
|
---|
216 |
|
---|
217 | <varlistentry id="objdump">
|
---|
218 | <term><command>objdump</command></term>
|
---|
219 | <listitem>
|
---|
220 | <para>Displays information about the given object file, with options
|
---|
221 | controlling the particular information to display; the information
|
---|
222 | shown is useful to programmers who are working on the compilation
|
---|
223 | tools</para>
|
---|
224 | <indexterm zone="ch-system-binutils objdump">
|
---|
225 | <primary sortas="b-objdump">objdump</primary>
|
---|
226 | </indexterm>
|
---|
227 | </listitem>
|
---|
228 | </varlistentry>
|
---|
229 |
|
---|
230 | <varlistentry id="ranlib">
|
---|
231 | <term><command>ranlib</command></term>
|
---|
232 | <listitem>
|
---|
233 | <para>Generates an index of the contents of an archive and stores it
|
---|
234 | in the archive; the index lists all of the symbols defined by archive
|
---|
235 | members that are relocatable object files</para>
|
---|
236 | <indexterm zone="ch-system-binutils ranlib">
|
---|
237 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
238 | </indexterm>
|
---|
239 | </listitem>
|
---|
240 | </varlistentry>
|
---|
241 |
|
---|
242 | <varlistentry id="readelf">
|
---|
243 | <term><command>readelf</command></term>
|
---|
244 | <listitem>
|
---|
245 | <para>Displays information about ELF type binaries</para>
|
---|
246 | <indexterm zone="ch-system-binutils readelf">
|
---|
247 | <primary sortas="b-readelf">readelf</primary>
|
---|
248 | </indexterm>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="size">
|
---|
253 | <term><command>size</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>Lists the section sizes and the total size for the given
|
---|
256 | object files</para>
|
---|
257 | <indexterm zone="ch-system-binutils size">
|
---|
258 | <primary sortas="b-size">size</primary>
|
---|
259 | </indexterm>
|
---|
260 | </listitem>
|
---|
261 | </varlistentry>
|
---|
262 |
|
---|
263 | <varlistentry id="strings">
|
---|
264 | <term><command>strings</command></term>
|
---|
265 | <listitem>
|
---|
266 | <para>Outputs, for each given file, the sequences of printable
|
---|
267 | characters that are of at least the specified length (defaulting to
|
---|
268 | four); for object files, it prints, by default, only the strings from
|
---|
269 | the initializing and loading sections while for other types of files, it
|
---|
270 | scans the entire file</para>
|
---|
271 | <indexterm zone="ch-system-binutils strings">
|
---|
272 | <primary sortas="b-strings">strings</primary>
|
---|
273 | </indexterm>
|
---|
274 | </listitem>
|
---|
275 | </varlistentry>
|
---|
276 |
|
---|
277 | <varlistentry id="strip">
|
---|
278 | <term><command>strip</command></term>
|
---|
279 | <listitem>
|
---|
280 | <para>Discards symbols from object files</para>
|
---|
281 | <indexterm zone="ch-system-binutils strip">
|
---|
282 | <primary sortas="b-strip">strip</primary>
|
---|
283 | </indexterm>
|
---|
284 | </listitem>
|
---|
285 | </varlistentry>
|
---|
286 |
|
---|
287 | <varlistentry id="libiberty">
|
---|
288 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
289 | <listitem>
|
---|
290 | <para>Contains routines used by various GNU programs, including
|
---|
291 | <command>getopt</command>, <command>obstack</command>,
|
---|
292 | <command>strerror</command>, <command>strtol</command>, and
|
---|
293 | <command>strtoul</command></para>
|
---|
294 | <indexterm zone="ch-system-binutils libiberty">
|
---|
295 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
296 | </indexterm>
|
---|
297 | </listitem>
|
---|
298 | </varlistentry>
|
---|
299 |
|
---|
300 | <varlistentry id="libbfd">
|
---|
301 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
302 | <listitem>
|
---|
303 | <para>The Binary File Descriptor library</para>
|
---|
304 | <indexterm zone="ch-system-binutils libbfd">
|
---|
305 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
306 | </indexterm>
|
---|
307 | </listitem>
|
---|
308 | </varlistentry>
|
---|
309 |
|
---|
310 | <varlistentry id="libopcodes">
|
---|
311 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
312 | <listitem>
|
---|
313 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
314 | text</quote> versions of instructions for the processor;
|
---|
315 | it is used for building utilities like
|
---|
316 | <command>objdump</command>.</para>
|
---|
317 | <indexterm zone="ch-system-binutils libopcodes">
|
---|
318 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
319 | </indexterm>
|
---|
320 | </listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | </variablelist>
|
---|
324 |
|
---|
325 | </sect2>
|
---|
326 |
|
---|
327 | </sect1>
|
---|