binutils.xml 10 KB

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