source: chapter06/binutils.xml@ 845846e0

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 845846e0 was 845846e0, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Removed PDF specifics tags.

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

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