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