source: chapter06/binutils.xml@ a001133

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.0 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 a001133 was a001133, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

HEAD: Retaged the introductori packages sections in chapter0{6,7,8}

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

  • Property mode set to 100644
File size: 8.6 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, Texinfo</seg></seglistitem>
26</segmentedlist>
27</sect2>
28
29<sect2 role="installation">
30<title>Installation of Binutils</title>
31
32<para>Now is an appropriate time to verify that your pseudo terminals (PTYs) are
33working properly inside the chroot environment. We will again quickly check that
34everything is set up correctly by performing a simple test:</para>
35
36<screen><userinput>expect -c "spawn ls"</userinput></screen>
37
38<para>If you receive the message:</para>
39
40<blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>
41
42<para>Your chroot environment is not set up for proper PTY operation. In this
43case there is no point in running the test suites for Binutils and GCC until you
44are able to resolve the issue.</para>
45
46<para>This package is known to behave badly when you have changed its
47default optimization flags (including the -march and -mcpu options).
48Therefore, if you have defined any environment variables that override
49default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
50or modifying them when building Binutils.</para>
51
52<para>The Binutils documentation recommends building Binutils outside of the
53source directory in a dedicated build directory:</para>
54
55<screen><userinput>mkdir ../binutils-build
56cd ../binutils-build</userinput></screen>
57
58<para>Now prepare Binutils for compilation:</para>
59
60<screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
61
62<para>Compile the package:</para>
63
64<screen><userinput>make tooldir=/usr</userinput></screen>
65
66<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
67executables end up) is set to $(exec_prefix)/$(target_alias), which expands
68into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
69build for our own system, we don't need this target specific directory in
70<filename>/usr</filename>. That setup would be used if the system was used to
71cross-compile (for example compiling a package on an Intel machine that
72generates code that can be executed on PowerPC machines).</para>
73
74<important><para>The test suite for Binutils in this section is considered
75<emphasis>critical</emphasis>. Our advice is to not skip it under any
76circumstances.</para></important>
77
78<para>Test the results:</para>
79
80<screen><userinput>make -k check</userinput></screen>
81
82<para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
83very much appropriate here. Be sure to refer back there should you have any
84doubts.</para>
85
86<para>Install the package:</para>
87
88<screen><userinput>make tooldir=/usr install</userinput></screen>
89
90<para>Install the <emphasis>libiberty</emphasis> 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"><title>Contents of Binutils</title>
99
100<para><emphasis>Installed programs</emphasis>: addr2line, ar, as, c++filt,
101gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and
102strip</para>
103
104<para><emphasis>Installed libraries</emphasis>: libiberty.a, libbfd.[a,so] and
105libopcodes.[a,so]</para>
106
107</sect2>
108
109
110<sect2><title>Short descriptions</title>
111
112<indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
113<para id="addr2line"><command>addr2line</command> translates program addresses to file
114names and line numbers. Given an address and the name of an executable, it
115uses the debugging information in the executable to figure out which source
116file and line number are associated with the address.</para>
117
118<indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
119<para id="ar"><command>ar</command> creates, modifies, and extracts from archives. An archive
120is a single file holding a collection of other files in a structure that makes
121it possible to retrieve the original individual files (called members of
122the archive).</para>
123
124<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
125<para id="as"><command>as</command> is an assembler. It assembles the output of
126gcc into object files.</para>
127
128<indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
129<para id="c-filt"><command>c++filt</command> is used by the linker to de-mangle C++ and
130Java symbols, to keep overloaded functions from clashing.</para>
131
132<indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
133<para id="gprof"><command>gprof</command> displays call graph profile data.</para>
134
135<indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
136<para id="ld"><command>ld</command> is a linker. It combines a number of object
137and archive files into a single file, relocating their data and tying up symbol
138references.</para>
139
140<indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
141<para id="nm"><command>nm</command> lists the symbols occurring in a given object file.</para>
142
143<indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
144<para id="objcopy"><command>objcopy</command> is used to translate one type of object
145file into another.</para>
146
147<indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
148<para id="objdump"><command>objdump</command> displays information about the given
149object file, with options controlling what particular information to display.
150The information shown is mostly only useful to programmers who are working on
151the compilation tools.</para>
152
153<indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
154<para id="ranlib"><command>ranlib</command> generates an index of the contents of an
155archive, and stores it in the archive. The index lists all the symbols defined
156by archive members that are relocatable object files.</para>
157
158<indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
159<para id="readelf"><command>readelf</command> displays information about elf type binaries.</para>
160
161<indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
162<para id="size"><command>size</command> lists the section sizes -- and the grand
163total -- for the given object files.</para>
164
165<indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
166<para id="strings"><command>strings</command> outputs, for each given file, the sequences
167of printable characters that are of at least the specified length (defaulting to 4).
168For object files it prints, by default, only the strings from the initializing
169and loading sections. For other types of files it scans the whole file.</para>
170
171<indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
172<para id="strip"><command>strip</command> discards symbols from object files.</para>
173
174<indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
175<para id="libiberty"><command>libiberty</command> contains routines used by various GNU
176programs, including getopt, obstack, strerror, strtol and strtoul.</para>
177
178<indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
179<para id="libbfd"><command>libbfd</command> is the Binary File Descriptor library.</para>
180
181<indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
182<para id="libopcodes"><command>libopcodes</command> is a library for dealing with opcodes.
183It is used for building utilities like objdump. Opcodes are the <quote>readable
184text</quote> versions of instructions for the processor.</para>
185
186</sect2>
187
188
189
190</sect1>
Note: See TracBrowser for help on using the repository browser.