binutils.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. <blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>
  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 -march and -mcpu 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 Binutils documentation recommends building Binutils outside of the
  41. source directory in a dedicated build directory:</para>
  42. <screen><userinput>mkdir ../binutils-build
  43. cd ../binutils-build</userinput></screen>
  44. <para>Now prepare Binutils for compilation:</para>
  45. <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
  46. <para>Compile the package:</para>
  47. <screen><userinput>make tooldir=/usr</userinput></screen>
  48. <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
  49. executables end up) is set to $(exec_prefix)/$(target_alias), which expands
  50. into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
  51. build for our own system, we don't need this target specific directory in
  52. <filename>/usr</filename>. That setup would be used if the system was used to
  53. cross-compile (for example compiling a package on an Intel machine that
  54. generates code that can be executed on PowerPC machines).</para>
  55. <important><para>The test suite for Binutils in this section is considered
  56. <emphasis>critical</emphasis>. Our advice is to not skip it under any
  57. circumstances.</para></important>
  58. <para>Test the results:</para>
  59. <screen><userinput>make -k check</userinput></screen>
  60. <para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
  61. very much appropriate here. Be sure to refer back there should you have any
  62. doubts.</para>
  63. <para>Install the package:</para>
  64. <screen><userinput>make tooldir=/usr install</userinput></screen>
  65. <para>Install the <emphasis>libiberty</emphasis> header file that is needed by
  66. some packages:</para>
  67. <screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
  68. </sect2>
  69. <sect2 id="contents-binutils" role="content"><title>Contents of Binutils</title>
  70. <segmentedlist>
  71. <segtitle>Installed programs</segtitle>
  72. <segtitle>Installed libraries</segtitle>
  73. <seglistitem><seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
  74. ranlib, readelf, size, strings and strip</seg>
  75. <seg>libiberty.a, libbfd.[a,so] and libopcodes.[a,so]</seg></seglistitem>
  76. </segmentedlist>
  77. <variablelist><title>Short descriptions</title>
  78. <varlistentry>
  79. <term id="addr2line"><command>addr2line</command></term>
  80. <listitem>
  81. <indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
  82. <para>translates program addresses to file
  83. names and line numbers. Given an address and the name of an executable, it
  84. uses the debugging information in the executable to figure out which source
  85. file and line number are associated with the address.</para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry>
  89. <term id="ar"><command>ar</command></term>
  90. <listitem>
  91. <indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
  92. <para>creates, modifies, and extracts from archives. An archive
  93. is a single file holding a collection of other files in a structure that makes
  94. it possible to retrieve the original individual files (called members of
  95. the archive).</para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term id="as"><command>as</command></term>
  100. <listitem>
  101. <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
  102. <para>is an assembler. It assembles the output of gcc into object files.</para>
  103. </listitem>
  104. </varlistentry>
  105. <varlistentry>
  106. <term id="c-filt"><command>c++filt</command></term>
  107. <listitem>
  108. <indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
  109. <para>is used by the linker to de-mangle C++ and
  110. Java symbols, to keep overloaded functions from clashing.</para>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term id="gprof"><command>gprof</command></term>
  115. <listitem>
  116. <indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
  117. <para>displays call graph profile data.</para>
  118. </listitem>
  119. </varlistentry>
  120. <varlistentry>
  121. <term id="ld"><command>ld</command></term>
  122. <listitem>
  123. <indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
  124. <para>is a linker. It combines a number of object and archive files into a single file,
  125. relocating their data and tying up symbol references.</para>
  126. </listitem>
  127. </varlistentry>
  128. <varlistentry>
  129. <term id="nm"><command>nm</command></term>
  130. <listitem>
  131. <indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
  132. <para>lists the symbols occurring in a given object file.</para>
  133. </listitem>
  134. </varlistentry>
  135. <varlistentry>
  136. <term id="objcopy"><command>objcopy</command></term>
  137. <listitem>
  138. <indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
  139. <para>is used to translate one type of object file into another.</para>
  140. </listitem>
  141. </varlistentry>
  142. <varlistentry>
  143. <term id="objdump"><command>objdump</command></term>
  144. <listitem>
  145. <indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
  146. <para>displays information about the given object file, with options controlling what
  147. particular information to display. The information shown is mostly only useful to
  148. programmers who are working on the compilation tools.</para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry>
  152. <term id="ranlib"><command>ranlib</command></term>
  153. <listitem>
  154. <indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
  155. <para>generates an index of the contents of an
  156. archive, and stores it in the archive. The index lists all the symbols defined
  157. by archive members that are relocatable object files.</para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term id="readelf"><command>readelf</command></term>
  162. <listitem>
  163. <indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
  164. <para>displays information about elf type binaries.</para>
  165. </listitem>
  166. </varlistentry>
  167. <varlistentry>
  168. <term id="size"><command>size</command></term>
  169. <listitem>
  170. <indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
  171. <para>lists the section sizes -- and the grand total -- for the given object files.</para>
  172. </listitem>
  173. </varlistentry>
  174. <varlistentry>
  175. <term id="strings"><command>strings</command></term>
  176. <listitem>
  177. <indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
  178. <para>outputs, for each given file, the sequences
  179. of printable characters that are of at least the specified length (defaulting to 4).
  180. For object files it prints, by default, only the strings from the initializing
  181. and loading sections. For other types of files it scans the whole file.</para>
  182. </listitem>
  183. </varlistentry>
  184. <varlistentry>
  185. <term id="strip"><command>strip</command></term>
  186. <listitem>
  187. <indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
  188. <para>discards symbols from object files.</para>
  189. </listitem>
  190. </varlistentry>
  191. <varlistentry>
  192. <term id="libiberty"><command>libiberty</command></term>
  193. <listitem>
  194. <indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
  195. <para>contains routines used by various GNU
  196. programs, including getopt, obstack, strerror, strtol and strtoul.</para>
  197. </listitem>
  198. </varlistentry>
  199. <varlistentry>
  200. <term id="libbfd"><command>libbfd</command></term>
  201. <listitem>
  202. <indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
  203. <para>is the Binary File Descriptor library.</para>
  204. </listitem>
  205. </varlistentry>
  206. <varlistentry>
  207. <term id="libopcodes"><command>libopcodes</command></term>
  208. <listitem>
  209. <indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
  210. <para>is a library for dealing with opcodes.
  211. It is used for building utilities like objdump. Opcodes are the <quote>readable
  212. text</quote> versions of instructions for the processor.</para>
  213. </listitem>
  214. </varlistentry>
  215. </variablelist>
  216. </sect2>
  217. </sect1>