binutils.xml 12 KB

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