[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,
|
---|
| 25 | Glibc, Grep, Make, Perl, Sed, Texinfo</seg></seglistitem>
|
---|
| 26 | </segmentedlist>
|
---|
| 27 | </sect2>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="installation">
|
---|
| 30 | <title>Installation of Binutils</title>
|
---|
[73aedd1d] | 31 |
|
---|
[ef13657] | 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>
|
---|
[73aedd1d] | 35 |
|
---|
| 36 | <screen><userinput>expect -c "spawn ls"</userinput></screen>
|
---|
| 37 |
|
---|
[ef13657] | 38 | <para>If the following message shows up, the chroot environment is not
|
---|
| 39 | set up for proper PTY operation:</para>
|
---|
[73aedd1d] | 40 |
|
---|
[3c928f1] | 41 | <screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
|
---|
[73aedd1d] | 42 |
|
---|
[ef13657] | 43 | <para>The issue needs to be resolved before running the test suites
|
---|
| 44 | for Binutils and GCC.</para>
|
---|
[73aedd1d] | 45 |
|
---|
[ef13657] | 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>
|
---|
[73aedd1d] | 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 |
|
---|
[ef13657] | 59 | <para>Prepare Binutils for compilation:</para>
|
---|
[73aedd1d] | 60 |
|
---|
[673b0d8] | 61 | <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 62 |
|
---|
| 63 | <para>Compile the package:</para>
|
---|
| 64 |
|
---|
| 65 | <screen><userinput>make tooldir=/usr</userinput></screen>
|
---|
| 66 |
|
---|
[ef13657] | 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
|
---|
[90afe40d] | 80 | circumstances.</para></important>
|
---|
| 81 |
|
---|
[73aedd1d] | 82 | <para>Test the results:</para>
|
---|
| 83 |
|
---|
[ef13657] | 84 | <screen><userinput>make check</userinput></screen>
|
---|
[73aedd1d] | 85 |
|
---|
| 86 | <para>Install the package:</para>
|
---|
| 87 |
|
---|
| 88 | <screen><userinput>make tooldir=/usr install</userinput></screen>
|
---|
| 89 |
|
---|
[3c928f1] | 90 | <para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
|
---|
[73aedd1d] | 91 | some packages:</para>
|
---|
| 92 |
|
---|
[673b0d8] | 93 | <screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
[73aedd1d] | 94 |
|
---|
| 95 | </sect2>
|
---|
[6370fa6] | 96 |
|
---|
[5888299] | 97 |
|
---|
[c6cb3aa] | 98 | <sect2 id="contents-binutils" role="content"><title>Contents of Binutils</title>
|
---|
[673b0d8] | 99 |
|
---|
[c6cb3aa] | 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>
|
---|
[673b0d8] | 107 |
|
---|
[3ed279f] | 108 | <variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
|
---|
| 109 | <?dbfo list-presentation="list"?>
|
---|
[673b0d8] | 110 |
|
---|
[b8a819f] | 111 | <varlistentry id="addr2line">
|
---|
| 112 | <term><command>addr2line</command></term>
|
---|
[c6cb3aa] | 113 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 118 | <indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
|
---|
[c6cb3aa] | 119 | </listitem>
|
---|
| 120 | </varlistentry>
|
---|
[673b0d8] | 121 |
|
---|
[b8a819f] | 122 | <varlistentry id="ar">
|
---|
| 123 | <term><command>ar</command></term>
|
---|
[c6cb3aa] | 124 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 129 | <indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
|
---|
[c6cb3aa] | 130 | </listitem>
|
---|
| 131 | </varlistentry>
|
---|
[673b0d8] | 132 |
|
---|
[b8a819f] | 133 | <varlistentry id="as">
|
---|
| 134 | <term><command>as</command></term>
|
---|
[c6cb3aa] | 135 | <listitem>
|
---|
[ef13657] | 136 | <para>an assembler. It assembles the output of gcc into object
|
---|
| 137 | files.</para>
|
---|
[3ed279f] | 138 | <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
|
---|
[c6cb3aa] | 139 | </listitem>
|
---|
| 140 | </varlistentry>
|
---|
[673b0d8] | 141 |
|
---|
[b8a819f] | 142 | <varlistentry id="c-filt">
|
---|
| 143 | <term><command>c++filt</command></term>
|
---|
[c6cb3aa] | 144 | <listitem>
|
---|
[ef13657] | 145 | <para>used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
| 146 | overloaded functions from clashing.</para>
|
---|
[3ed279f] | 147 | <indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
|
---|
[c6cb3aa] | 148 | </listitem>
|
---|
| 149 | </varlistentry>
|
---|
[673b0d8] | 150 |
|
---|
[b8a819f] | 151 | <varlistentry id="gprof">
|
---|
| 152 | <term><command>gprof</command></term>
|
---|
[c6cb3aa] | 153 | <listitem>
|
---|
| 154 | <para>displays call graph profile data.</para>
|
---|
[3ed279f] | 155 | <indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
|
---|
[c6cb3aa] | 156 | </listitem>
|
---|
| 157 | </varlistentry>
|
---|
[673b0d8] | 158 |
|
---|
[b8a819f] | 159 | <varlistentry id="ld">
|
---|
| 160 | <term><command>ld</command></term>
|
---|
[c6cb3aa] | 161 | <listitem>
|
---|
[ef13657] | 162 | <para>a linker. It combines a number of object and archive files into a single file,
|
---|
[c6cb3aa] | 163 | relocating their data and tying up symbol references.</para>
|
---|
[3ed279f] | 164 | <indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
|
---|
[c6cb3aa] | 165 | </listitem>
|
---|
| 166 | </varlistentry>
|
---|
| 167 |
|
---|
[b8a819f] | 168 | <varlistentry id="nm">
|
---|
| 169 | <term><command>nm</command></term>
|
---|
[c6cb3aa] | 170 | <listitem>
|
---|
| 171 | <para>lists the symbols occurring in a given object file.</para>
|
---|
[3ed279f] | 172 | <indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
|
---|
[c6cb3aa] | 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
[73aedd1d] | 175 |
|
---|
[b8a819f] | 176 | <varlistentry id="objcopy">
|
---|
| 177 | <term><command>objcopy</command></term>
|
---|
[c6cb3aa] | 178 | <listitem>
|
---|
[ef13657] | 179 | <para>used to translate one type of object file into another.</para>
|
---|
[3ed279f] | 180 | <indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
|
---|
[c6cb3aa] | 181 | </listitem>
|
---|
| 182 | </varlistentry>
|
---|
[673b0d8] | 183 |
|
---|
[b8a819f] | 184 | <varlistentry id="objdump">
|
---|
| 185 | <term><command>objdump</command></term>
|
---|
[c6cb3aa] | 186 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 191 | <indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
|
---|
[c6cb3aa] | 192 | </listitem>
|
---|
| 193 | </varlistentry>
|
---|
| 194 |
|
---|
[b8a819f] | 195 | <varlistentry id="ranlib">
|
---|
| 196 | <term><command>ranlib</command></term>
|
---|
[c6cb3aa] | 197 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 201 | <indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
|
---|
[c6cb3aa] | 202 | </listitem>
|
---|
| 203 | </varlistentry>
|
---|
[673b0d8] | 204 |
|
---|
[b8a819f] | 205 | <varlistentry id="readelf">
|
---|
| 206 | <term><command>readelf</command></term>
|
---|
[c6cb3aa] | 207 | <listitem>
|
---|
[ef13657] | 208 | <para>displays information about ELF type binaries.</para>
|
---|
[3ed279f] | 209 | <indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
|
---|
[c6cb3aa] | 210 | </listitem>
|
---|
| 211 | </varlistentry>
|
---|
[673b0d8] | 212 |
|
---|
[b8a819f] | 213 | <varlistentry id="size">
|
---|
| 214 | <term><command>size</command></term>
|
---|
[c6cb3aa] | 215 | <listitem>
|
---|
[ef13657] | 216 | <para>lists the section sizes and the total size for the given object files.</para>
|
---|
[3ed279f] | 217 | <indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
|
---|
[c6cb3aa] | 218 | </listitem>
|
---|
| 219 | </varlistentry>
|
---|
[673b0d8] | 220 |
|
---|
[b8a819f] | 221 | <varlistentry id="strings">
|
---|
| 222 | <term><command>strings</command></term>
|
---|
[c6cb3aa] | 223 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 229 | <indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
|
---|
[c6cb3aa] | 230 | </listitem>
|
---|
| 231 | </varlistentry>
|
---|
[673b0d8] | 232 |
|
---|
[b8a819f] | 233 | <varlistentry id="strip">
|
---|
| 234 | <term><command>strip</command></term>
|
---|
[c6cb3aa] | 235 | <listitem>
|
---|
| 236 | <para>discards symbols from object files.</para>
|
---|
[3ed279f] | 237 | <indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
|
---|
[c6cb3aa] | 238 | </listitem>
|
---|
| 239 | </varlistentry>
|
---|
[673b0d8] | 240 |
|
---|
[b8a819f] | 241 | <varlistentry id="libiberty">
|
---|
[e63529b] | 242 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
[c6cb3aa] | 243 | <listitem>
|
---|
[ef13657] | 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>
|
---|
[3ed279f] | 248 | <indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
|
---|
[c6cb3aa] | 249 | </listitem>
|
---|
| 250 | </varlistentry>
|
---|
[673b0d8] | 251 |
|
---|
[b8a819f] | 252 | <varlistentry id="libbfd">
|
---|
[e63529b] | 253 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
[c6cb3aa] | 254 | <listitem>
|
---|
[ef13657] | 255 | <para>the Binary File Descriptor library.</para>
|
---|
[3ed279f] | 256 | <indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
|
---|
[c6cb3aa] | 257 | </listitem>
|
---|
| 258 | </varlistentry>
|
---|
[673b0d8] | 259 |
|
---|
[b8a819f] | 260 | <varlistentry id="libopcodes">
|
---|
[e63529b] | 261 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
[c6cb3aa] | 262 | <listitem>
|
---|
[ef13657] | 263 | <para>a library for dealing with opcodes.
|
---|
| 264 | It is used for building utilities like <command>objdump</command>. Opcodes are the <quote>readable
|
---|
[673b0d8] | 265 | text</quote> versions of instructions for the processor.</para>
|
---|
[3ed279f] | 266 | <indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
|
---|
[c6cb3aa] | 267 | </listitem>
|
---|
| 268 | </varlistentry>
|
---|
| 269 | </variablelist>
|
---|
[673b0d8] | 270 |
|
---|
| 271 | </sect2>
|
---|
| 272 |
|
---|
| 273 | </sect1>
|
---|
[ef13657] | 274 |
|
---|