binutils.xml 12 KB

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