[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
|
---|
[4d86da9] | 45 | environment by performing a simple test:</para>
|
---|
[73aedd1d] | 46 |
|
---|
[0445a3d] | 47 | <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
|
---|
[73aedd1d] | 48 |
|
---|
[4d86da9] | 49 | <para>This command should output the following:</para>
|
---|
| 50 |
|
---|
| 51 | <screen><computeroutput>spawn ls</computeroutput></screen>
|
---|
| 52 |
|
---|
| 53 | <para>If, instead, the output includes the message below, then the environment
|
---|
| 54 | is not set up for proper PTY operation. This issue needs to be resolved before
|
---|
| 55 | running the test suites for Binutils and GCC:</para>
|
---|
[81fd230] | 56 |
|
---|
[92474b45] | 57 | <screen><computeroutput>The system has no more ptys.
|
---|
[81fd230] | 58 | Ask your system administrator to create more.</computeroutput></screen>
|
---|
| 59 |
|
---|
[3e0c6919] | 60 | <para>Suppress the installation of an outdated
|
---|
| 61 | <filename>standards.info</filename> file as a newer one is installed later
|
---|
| 62 | on in the Autoconf instructions:</para>
|
---|
| 63 |
|
---|
| 64 | <screen><userinput remap="pre">rm -fv etc/standards.info
|
---|
| 65 | sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in</userinput></screen>
|
---|
| 66 |
|
---|
[0f344dd] | 67 | <para>Fix some test suite scripts so all tests pass:</para>
|
---|
| 68 |
|
---|
| 69 | <screen><userinput remap="pre">patch -Np1 -i ../&binutils-testsuite-fixes-patch;</userinput></screen>
|
---|
| 70 |
|
---|
[92474b45] | 71 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
| 72 | source directory in a dedicated build directory:</para>
|
---|
[73aedd1d] | 73 |
|
---|
[0445a3d] | 74 | <screen><userinput remap="pre">mkdir -v ../binutils-build
|
---|
[73aedd1d] | 75 | cd ../binutils-build</userinput></screen>
|
---|
| 76 |
|
---|
[92474b45] | 77 | <para>Prepare Binutils for compilation:</para>
|
---|
[73aedd1d] | 78 |
|
---|
[ac62f17] | 79 | <screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 80 |
|
---|
[e0901b3] | 81 | <note><para>There is an optional argument to <command>configure</command>,
|
---|
| 82 | <option>--enable-lto</option>, that can be used to allow the
|
---|
| 83 | <command>ar</command>, <command>nm</command>, and <command>ranlib</command>
|
---|
| 84 | commands to accept a <option>--plugin</option> parameter. This is used to
|
---|
| 85 | allow <command>gcc</command> to do "link time optimization" if specified.
|
---|
| 86 | No packages in LFS or BLFS currently use this capability.</para></note>
|
---|
| 87 |
|
---|
[92474b45] | 88 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 89 |
|
---|
[0445a3d] | 90 | <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
|
---|
[73aedd1d] | 91 |
|
---|
[92474b45] | 92 | <variablelist>
|
---|
| 93 | <title>The meaning of the make parameter:</title>
|
---|
| 94 |
|
---|
| 95 | <varlistentry>
|
---|
| 96 | <term><parameter>tooldir=/usr</parameter></term>
|
---|
| 97 | <listitem>
|
---|
| 98 | <para>Normally, the tooldir (the directory where the executables will
|
---|
| 99 | ultimately be located) is set to <filename
|
---|
| 100 | class="directory">$(exec_prefix)/$(target_alias)</filename>. For
|
---|
[6e88633] | 101 | example, x86_64 machines would expand that to <filename
|
---|
| 102 | class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
|
---|
[92474b45] | 103 | a custom system, this target-specific directory in <filename
|
---|
| 104 | class="directory">/usr</filename> is not required. <filename
|
---|
| 105 | class="directory">$(exec_prefix)/$(target_alias)</filename> would be
|
---|
| 106 | used if the system was used to cross-compile (for example, compiling a
|
---|
| 107 | package on an Intel machine that generates code that can be executed
|
---|
| 108 | on PowerPC machines).</para>
|
---|
| 109 | </listitem>
|
---|
| 110 | </varlistentry>
|
---|
| 111 |
|
---|
| 112 | </variablelist>
|
---|
| 113 |
|
---|
| 114 | <important>
|
---|
| 115 | <para>The test suite for Binutils in this section is considered critical.
|
---|
| 116 | Do not skip it under any circumstances.</para>
|
---|
| 117 | </important>
|
---|
| 118 |
|
---|
| 119 | <para>Test the results:</para>
|
---|
[81fd230] | 120 |
|
---|
[0f344dd] | 121 | <screen><userinput remap="test">make check</userinput></screen>
|
---|
[73aedd1d] | 122 |
|
---|
[92474b45] | 123 | <para>Install the package:</para>
|
---|
[73aedd1d] | 124 |
|
---|
[0445a3d] | 125 | <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
|
---|
[73aedd1d] | 126 |
|
---|
[92474b45] | 127 | <para>Install the <filename class="headerfile">libiberty</filename> header
|
---|
| 128 | file that is needed by some packages:</para>
|
---|
[73aedd1d] | 129 |
|
---|
[64adff3] | 130 | <!-- <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> -->
|
---|
[ac62f17] | 131 | <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
[73aedd1d] | 132 |
|
---|
[92474b45] | 133 | </sect2>
|
---|
| 134 |
|
---|
| 135 |
|
---|
| 136 | <sect2 id="contents-binutils" role="content">
|
---|
| 137 | <title>Contents of Binutils</title>
|
---|
| 138 |
|
---|
| 139 | <segmentedlist>
|
---|
| 140 | <segtitle>Installed programs</segtitle>
|
---|
| 141 | <segtitle>Installed libraries</segtitle>
|
---|
[fe05b08] | 142 | <segtitle>Installed directory</segtitle>
|
---|
[92474b45] | 143 |
|
---|
| 144 | <seglistitem>
|
---|
[3119ddc] | 145 | <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
|
---|
| 146 | objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
|
---|
[0090db5] | 147 | <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
|
---|
[fe05b08] | 148 | <seg>/usr/lib/ldscripts</seg>
|
---|
[92474b45] | 149 | </seglistitem>
|
---|
| 150 | </segmentedlist>
|
---|
| 151 |
|
---|
| 152 | <variablelist>
|
---|
| 153 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 154 | <?dbfo list-presentation="list"?>
|
---|
| 155 | <?dbhtml list-presentation="table"?>
|
---|
| 156 |
|
---|
| 157 | <varlistentry id="addr2line">
|
---|
| 158 | <term><command>addr2line</command></term>
|
---|
| 159 | <listitem>
|
---|
| 160 | <para>Translates program addresses to file names and line numbers;
|
---|
| 161 | given an address and the name of an executable, it uses the debugging
|
---|
| 162 | information in the executable to determine which source file and line
|
---|
| 163 | number are associated with the address</para>
|
---|
| 164 | <indexterm zone="ch-system-binutils addr2line">
|
---|
| 165 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
| 166 | </indexterm>
|
---|
| 167 | </listitem>
|
---|
| 168 | </varlistentry>
|
---|
| 169 |
|
---|
| 170 | <varlistentry id="ar">
|
---|
| 171 | <term><command>ar</command></term>
|
---|
| 172 | <listitem>
|
---|
| 173 | <para>Creates, modifies, and extracts from archives</para>
|
---|
| 174 | <indexterm zone="ch-system-binutils ar">
|
---|
| 175 | <primary sortas="b-ar">ar</primary>
|
---|
| 176 | </indexterm>
|
---|
| 177 | </listitem>
|
---|
| 178 | </varlistentry>
|
---|
| 179 |
|
---|
| 180 | <varlistentry id="as">
|
---|
| 181 | <term><command>as</command></term>
|
---|
| 182 | <listitem>
|
---|
| 183 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
| 184 | into object files</para>
|
---|
| 185 | <indexterm zone="ch-system-binutils as">
|
---|
| 186 | <primary sortas="b-as">as</primary>
|
---|
| 187 | </indexterm>
|
---|
| 188 | </listitem>
|
---|
| 189 | </varlistentry>
|
---|
| 190 |
|
---|
| 191 | <varlistentry id="c-filt">
|
---|
| 192 | <term><command>c++filt</command></term>
|
---|
| 193 | <listitem>
|
---|
| 194 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
| 195 | overloaded functions from clashing</para>
|
---|
| 196 | <indexterm zone="ch-system-binutils c-filt">
|
---|
| 197 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
| 198 | </indexterm>
|
---|
| 199 | </listitem>
|
---|
| 200 | </varlistentry>
|
---|
| 201 |
|
---|
[3119ddc] | 202 | <varlistentry id="elfedit">
|
---|
| 203 | <term><command>elfedit</command></term>
|
---|
| 204 | <listitem>
|
---|
| 205 | <para>Updates the ELF header of ELF files</para>
|
---|
| 206 | <indexterm zone="ch-system-binutils elfedit">
|
---|
| 207 | <primary sortas="b-elfedit">elfedit</primary>
|
---|
| 208 | </indexterm>
|
---|
| 209 | </listitem>
|
---|
| 210 | </varlistentry>
|
---|
| 211 |
|
---|
[92474b45] | 212 | <varlistentry id="gprof">
|
---|
| 213 | <term><command>gprof</command></term>
|
---|
| 214 | <listitem>
|
---|
| 215 | <para>Displays call graph profile data</para>
|
---|
| 216 | <indexterm zone="ch-system-binutils gprof">
|
---|
| 217 | <primary sortas="b-gprof">gprof</primary>
|
---|
| 218 | </indexterm>
|
---|
| 219 | </listitem>
|
---|
| 220 | </varlistentry>
|
---|
| 221 |
|
---|
| 222 | <varlistentry id="ld">
|
---|
| 223 | <term><command>ld</command></term>
|
---|
| 224 | <listitem>
|
---|
| 225 | <para>A linker that combines a number of object and archive files
|
---|
| 226 | into a single file, relocating their data and tying up symbol
|
---|
| 227 | references</para>
|
---|
| 228 | <indexterm zone="ch-system-binutils ld">
|
---|
| 229 | <primary sortas="b-ld">ld</primary>
|
---|
| 230 | </indexterm>
|
---|
| 231 | </listitem>
|
---|
| 232 | </varlistentry>
|
---|
| 233 |
|
---|
[3119ddc] | 234 | <varlistentry id="ld.bfd">
|
---|
| 235 | <term><command>ld.bfd</command></term>
|
---|
| 236 | <listitem>
|
---|
| 237 | <para>Hard link to <command>ld</command></para>
|
---|
| 238 | <indexterm zone="ch-system-binutils ld.bfd">
|
---|
| 239 | <primary sortas="b-ld.bfd">ld.bfd</primary>
|
---|
| 240 | </indexterm>
|
---|
| 241 | </listitem>
|
---|
| 242 | </varlistentry>
|
---|
| 243 |
|
---|
[92474b45] | 244 | <varlistentry id="nm">
|
---|
| 245 | <term><command>nm</command></term>
|
---|
| 246 | <listitem>
|
---|
| 247 | <para>Lists the symbols occurring in a given object file</para>
|
---|
| 248 | <indexterm zone="ch-system-binutils nm">
|
---|
| 249 | <primary sortas="b-nm">nm</primary>
|
---|
| 250 | </indexterm>
|
---|
| 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
| 253 |
|
---|
| 254 | <varlistentry id="objcopy">
|
---|
| 255 | <term><command>objcopy</command></term>
|
---|
| 256 | <listitem>
|
---|
| 257 | <para>Translates one type of object file into another</para>
|
---|
| 258 | <indexterm zone="ch-system-binutils objcopy">
|
---|
| 259 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
| 260 | </indexterm>
|
---|
| 261 | </listitem>
|
---|
| 262 | </varlistentry>
|
---|
| 263 |
|
---|
| 264 | <varlistentry id="objdump">
|
---|
| 265 | <term><command>objdump</command></term>
|
---|
| 266 | <listitem>
|
---|
| 267 | <para>Displays information about the given object file, with options
|
---|
| 268 | controlling the particular information to display; the information
|
---|
| 269 | shown is useful to programmers who are working on the compilation
|
---|
| 270 | tools</para>
|
---|
| 271 | <indexterm zone="ch-system-binutils objdump">
|
---|
| 272 | <primary sortas="b-objdump">objdump</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
| 277 | <varlistentry id="ranlib">
|
---|
| 278 | <term><command>ranlib</command></term>
|
---|
| 279 | <listitem>
|
---|
| 280 | <para>Generates an index of the contents of an archive and stores it
|
---|
| 281 | in the archive; the index lists all of the symbols defined by archive
|
---|
| 282 | members that are relocatable object files</para>
|
---|
| 283 | <indexterm zone="ch-system-binutils ranlib">
|
---|
| 284 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
| 285 | </indexterm>
|
---|
| 286 | </listitem>
|
---|
| 287 | </varlistentry>
|
---|
| 288 |
|
---|
| 289 | <varlistentry id="readelf">
|
---|
| 290 | <term><command>readelf</command></term>
|
---|
| 291 | <listitem>
|
---|
| 292 | <para>Displays information about ELF type binaries</para>
|
---|
| 293 | <indexterm zone="ch-system-binutils readelf">
|
---|
| 294 | <primary sortas="b-readelf">readelf</primary>
|
---|
| 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
| 298 |
|
---|
| 299 | <varlistentry id="size">
|
---|
| 300 | <term><command>size</command></term>
|
---|
| 301 | <listitem>
|
---|
| 302 | <para>Lists the section sizes and the total size for the given
|
---|
| 303 | object files</para>
|
---|
| 304 | <indexterm zone="ch-system-binutils size">
|
---|
| 305 | <primary sortas="b-size">size</primary>
|
---|
| 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
| 310 | <varlistentry id="strings">
|
---|
| 311 | <term><command>strings</command></term>
|
---|
| 312 | <listitem>
|
---|
| 313 | <para>Outputs, for each given file, the sequences of printable
|
---|
| 314 | characters that are of at least the specified length (defaulting to
|
---|
| 315 | four); for object files, it prints, by default, only the strings from
|
---|
| 316 | the initializing and loading sections while for other types of files, it
|
---|
| 317 | scans the entire file</para>
|
---|
| 318 | <indexterm zone="ch-system-binutils strings">
|
---|
| 319 | <primary sortas="b-strings">strings</primary>
|
---|
| 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
| 323 |
|
---|
| 324 | <varlistentry id="strip">
|
---|
| 325 | <term><command>strip</command></term>
|
---|
| 326 | <listitem>
|
---|
| 327 | <para>Discards symbols from object files</para>
|
---|
| 328 | <indexterm zone="ch-system-binutils strip">
|
---|
| 329 | <primary sortas="b-strip">strip</primary>
|
---|
| 330 | </indexterm>
|
---|
| 331 | </listitem>
|
---|
| 332 | </varlistentry>
|
---|
| 333 |
|
---|
| 334 | <varlistentry id="libiberty">
|
---|
| 335 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
| 336 | <listitem>
|
---|
| 337 | <para>Contains routines used by various GNU programs, including
|
---|
| 338 | <command>getopt</command>, <command>obstack</command>,
|
---|
| 339 | <command>strerror</command>, <command>strtol</command>, and
|
---|
| 340 | <command>strtoul</command></para>
|
---|
| 341 | <indexterm zone="ch-system-binutils libiberty">
|
---|
| 342 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
| 343 | </indexterm>
|
---|
| 344 | </listitem>
|
---|
| 345 | </varlistentry>
|
---|
| 346 |
|
---|
| 347 | <varlistentry id="libbfd">
|
---|
| 348 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
| 349 | <listitem>
|
---|
| 350 | <para>The Binary File Descriptor library</para>
|
---|
| 351 | <indexterm zone="ch-system-binutils libbfd">
|
---|
| 352 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
| 353 | </indexterm>
|
---|
| 354 | </listitem>
|
---|
| 355 | </varlistentry>
|
---|
| 356 |
|
---|
| 357 | <varlistentry id="libopcodes">
|
---|
| 358 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
| 359 | <listitem>
|
---|
| 360 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
| 361 | text</quote> versions of instructions for the processor;
|
---|
| 362 | it is used for building utilities like
|
---|
| 363 | <command>objdump</command>.</para>
|
---|
| 364 | <indexterm zone="ch-system-binutils libopcodes">
|
---|
| 365 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
| 366 | </indexterm>
|
---|
| 367 | </listitem>
|
---|
| 368 | </varlistentry>
|
---|
| 369 |
|
---|
| 370 | </variablelist>
|
---|
| 371 |
|
---|
| 372 | </sect2>
|
---|
[673b0d8] | 373 |
|
---|
| 374 | </sect1>
|
---|