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