binutils.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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 by performing a simple test:</para>
  35. <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
  36. <para>This command should output the following:</para>
  37. <screen><computeroutput>spawn ls</computeroutput></screen>
  38. <para>If, instead, the output includes the message below, then the environment
  39. is not set up for proper PTY operation. This issue needs to be resolved before
  40. running the test suites for Binutils and GCC:</para>
  41. <screen><computeroutput>The system has no more ptys.
  42. Ask your system administrator to create more.</computeroutput></screen>
  43. <para>Suppress the installation of an outdated
  44. <filename>standards.info</filename> file as a newer one is installed later
  45. on in the Autoconf instructions:</para>
  46. <screen><userinput remap="pre">rm -fv etc/standards.info
  47. sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in</userinput></screen>
  48. <para>Fix a couple of syntax errors that prevent the documentation from
  49. building with Texinfo-&texinfo-version;:</para>
  50. <screen><userinput remap="pre">sed -i -e 's/@colophon/@@colophon/' \
  51. -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo</userinput></screen>
  52. <para>The Binutils documentation recommends building Binutils outside of the
  53. source directory in a dedicated build directory:</para>
  54. <screen><userinput remap="pre">mkdir -v ../binutils-build
  55. cd ../binutils-build</userinput></screen>
  56. <para>Prepare Binutils for compilation:</para>
  57. <screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
  58. <para>Compile the package:</para>
  59. <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
  60. <variablelist>
  61. <title>The meaning of the make parameter:</title>
  62. <varlistentry>
  63. <term><parameter>tooldir=/usr</parameter></term>
  64. <listitem>
  65. <para>Normally, the tooldir (the directory where the executables will
  66. ultimately be located) is set to <filename
  67. class="directory">$(exec_prefix)/$(target_alias)</filename>. For
  68. example, x86_64 machines would expand that to <filename
  69. class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
  70. a custom system, this target-specific directory in <filename
  71. class="directory">/usr</filename> is not required. <filename
  72. class="directory">$(exec_prefix)/$(target_alias)</filename> would be
  73. used if the system was used to cross-compile (for example, compiling a
  74. package on an Intel machine that generates code that can be executed
  75. on PowerPC machines).</para>
  76. </listitem>
  77. </varlistentry>
  78. </variablelist>
  79. <important>
  80. <para>The test suite for Binutils in this section is considered critical.
  81. Do not skip it under any circumstances.</para>
  82. </important>
  83. <para>Test the results:</para>
  84. <screen><userinput remap="test">make check</userinput></screen>
  85. <para>Install the package:</para>
  86. <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
  87. <para>Install the <filename class="headerfile">libiberty</filename> header
  88. file that is needed by some packages:</para>
  89. <!-- <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> -->
  90. <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
  91. </sect2>
  92. <sect2 id="contents-binutils" role="content">
  93. <title>Contents of Binutils</title>
  94. <segmentedlist>
  95. <segtitle>Installed programs</segtitle>
  96. <segtitle>Installed libraries</segtitle>
  97. <segtitle>Installed directory</segtitle>
  98. <seglistitem>
  99. <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
  100. objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
  101. <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
  102. <seg>/usr/lib/ldscripts</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="elfedit">
  151. <term><command>elfedit</command></term>
  152. <listitem>
  153. <para>Updates the ELF header of ELF files</para>
  154. <indexterm zone="ch-system-binutils elfedit">
  155. <primary sortas="b-elfedit">elfedit</primary>
  156. </indexterm>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry id="gprof">
  160. <term><command>gprof</command></term>
  161. <listitem>
  162. <para>Displays call graph profile data</para>
  163. <indexterm zone="ch-system-binutils gprof">
  164. <primary sortas="b-gprof">gprof</primary>
  165. </indexterm>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry id="ld">
  169. <term><command>ld</command></term>
  170. <listitem>
  171. <para>A linker that combines a number of object and archive files
  172. into a single file, relocating their data and tying up symbol
  173. references</para>
  174. <indexterm zone="ch-system-binutils ld">
  175. <primary sortas="b-ld">ld</primary>
  176. </indexterm>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="ld.bfd">
  180. <term><command>ld.bfd</command></term>
  181. <listitem>
  182. <para>Hard link to <command>ld</command></para>
  183. <indexterm zone="ch-system-binutils ld.bfd">
  184. <primary sortas="b-ld.bfd">ld.bfd</primary>
  185. </indexterm>
  186. </listitem>
  187. </varlistentry>
  188. <varlistentry id="nm">
  189. <term><command>nm</command></term>
  190. <listitem>
  191. <para>Lists the symbols occurring in a given object file</para>
  192. <indexterm zone="ch-system-binutils nm">
  193. <primary sortas="b-nm">nm</primary>
  194. </indexterm>
  195. </listitem>
  196. </varlistentry>
  197. <varlistentry id="objcopy">
  198. <term><command>objcopy</command></term>
  199. <listitem>
  200. <para>Translates one type of object file into another</para>
  201. <indexterm zone="ch-system-binutils objcopy">
  202. <primary sortas="b-objcopy">objcopy</primary>
  203. </indexterm>
  204. </listitem>
  205. </varlistentry>
  206. <varlistentry id="objdump">
  207. <term><command>objdump</command></term>
  208. <listitem>
  209. <para>Displays information about the given object file, with options
  210. controlling the particular information to display; the information
  211. shown is useful to programmers who are working on the compilation
  212. tools</para>
  213. <indexterm zone="ch-system-binutils objdump">
  214. <primary sortas="b-objdump">objdump</primary>
  215. </indexterm>
  216. </listitem>
  217. </varlistentry>
  218. <varlistentry id="ranlib">
  219. <term><command>ranlib</command></term>
  220. <listitem>
  221. <para>Generates an index of the contents of an archive and stores it
  222. in the archive; the index lists all of the symbols defined by archive
  223. members that are relocatable object files</para>
  224. <indexterm zone="ch-system-binutils ranlib">
  225. <primary sortas="b-ranlib">ranlib</primary>
  226. </indexterm>
  227. </listitem>
  228. </varlistentry>
  229. <varlistentry id="readelf">
  230. <term><command>readelf</command></term>
  231. <listitem>
  232. <para>Displays information about ELF type binaries</para>
  233. <indexterm zone="ch-system-binutils readelf">
  234. <primary sortas="b-readelf">readelf</primary>
  235. </indexterm>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry id="size">
  239. <term><command>size</command></term>
  240. <listitem>
  241. <para>Lists the section sizes and the total size for the given
  242. object files</para>
  243. <indexterm zone="ch-system-binutils size">
  244. <primary sortas="b-size">size</primary>
  245. </indexterm>
  246. </listitem>
  247. </varlistentry>
  248. <varlistentry id="strings">
  249. <term><command>strings</command></term>
  250. <listitem>
  251. <para>Outputs, for each given file, the sequences of printable
  252. characters that are of at least the specified length (defaulting to
  253. four); for object files, it prints, by default, only the strings from
  254. the initializing and loading sections while for other types of files, it
  255. scans the entire file</para>
  256. <indexterm zone="ch-system-binutils strings">
  257. <primary sortas="b-strings">strings</primary>
  258. </indexterm>
  259. </listitem>
  260. </varlistentry>
  261. <varlistentry id="strip">
  262. <term><command>strip</command></term>
  263. <listitem>
  264. <para>Discards symbols from object files</para>
  265. <indexterm zone="ch-system-binutils strip">
  266. <primary sortas="b-strip">strip</primary>
  267. </indexterm>
  268. </listitem>
  269. </varlistentry>
  270. <varlistentry id="libiberty">
  271. <term><filename class="libraryfile">libiberty</filename></term>
  272. <listitem>
  273. <para>Contains routines used by various GNU programs, including
  274. <command>getopt</command>, <command>obstack</command>,
  275. <command>strerror</command>, <command>strtol</command>, and
  276. <command>strtoul</command></para>
  277. <indexterm zone="ch-system-binutils libiberty">
  278. <primary sortas="c-libiberty">libiberty</primary>
  279. </indexterm>
  280. </listitem>
  281. </varlistentry>
  282. <varlistentry id="libbfd">
  283. <term><filename class="libraryfile">libbfd</filename></term>
  284. <listitem>
  285. <para>The Binary File Descriptor library</para>
  286. <indexterm zone="ch-system-binutils libbfd">
  287. <primary sortas="c-libbfd">libbfd</primary>
  288. </indexterm>
  289. </listitem>
  290. </varlistentry>
  291. <varlistentry id="libopcodes">
  292. <term><filename class="libraryfile">libopcodes</filename></term>
  293. <listitem>
  294. <para>A library for dealing with opcodes&mdash;the <quote>readable
  295. text</quote> versions of instructions for the processor;
  296. it is used for building utilities like
  297. <command>objdump</command>.</para>
  298. <indexterm zone="ch-system-binutils libopcodes">
  299. <primary sortas="c-libopcodes">libopcodes</primary>
  300. </indexterm>
  301. </listitem>
  302. </varlistentry>
  303. </variablelist>
  304. </sect2>
  305. </sect1>