binutils.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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>Apply a patch to prevent a build failure when using compiler optimizations:</para>
  49. <screen><userinput remap="pre">patch -Np1 -i ../&binutils-build-patch;</userinput></screen>
  50. <para>The Binutils documentation recommends building Binutils outside of the
  51. source directory in a dedicated build directory:</para>
  52. <screen><userinput remap="pre">mkdir -v ../binutils-build
  53. cd ../binutils-build</userinput></screen>
  54. <para>Prepare Binutils for compilation:</para>
  55. <screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
  56. <para>Compile the package:</para>
  57. <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
  58. <variablelist>
  59. <title>The meaning of the make parameter:</title>
  60. <varlistentry>
  61. <term><parameter>tooldir=/usr</parameter></term>
  62. <listitem>
  63. <para>Normally, the tooldir (the directory where the executables will
  64. ultimately be located) is set to <filename
  65. class="directory">$(exec_prefix)/$(target_alias)</filename>. For
  66. example, x86_64 machines would expand that to <filename
  67. class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
  68. a custom system, this target-specific directory in <filename
  69. class="directory">/usr</filename> is not required. <filename
  70. class="directory">$(exec_prefix)/$(target_alias)</filename> would be
  71. used if the system was used to cross-compile (for example, compiling a
  72. package on an Intel machine that generates code that can be executed
  73. on PowerPC machines).</para>
  74. </listitem>
  75. </varlistentry>
  76. </variablelist>
  77. <important>
  78. <para>The test suite for Binutils in this section is considered critical.
  79. Do not skip it under any circumstances.</para>
  80. </important>
  81. <para>Test the results:</para>
  82. <screen><userinput remap="test">make -k check</userinput></screen>
  83. <para>Install the package:</para>
  84. <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
  85. <para>Install the <filename class="headerfile">libiberty</filename> header
  86. file that is needed by some packages:</para>
  87. <!-- <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> -->
  88. <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
  89. </sect2>
  90. <sect2 id="contents-binutils" role="content">
  91. <title>Contents of Binutils</title>
  92. <segmentedlist>
  93. <segtitle>Installed programs</segtitle>
  94. <segtitle>Installed libraries</segtitle>
  95. <segtitle>Installed directory</segtitle>
  96. <seglistitem>
  97. <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
  98. objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
  99. <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
  100. <seg>/usr/lib/ldscripts</seg>
  101. </seglistitem>
  102. </segmentedlist>
  103. <variablelist>
  104. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  105. <?dbfo list-presentation="list"?>
  106. <?dbhtml list-presentation="table"?>
  107. <varlistentry id="addr2line">
  108. <term><command>addr2line</command></term>
  109. <listitem>
  110. <para>Translates program addresses to file names and line numbers;
  111. given an address and the name of an executable, it uses the debugging
  112. information in the executable to determine which source file and line
  113. number are associated with the address</para>
  114. <indexterm zone="ch-system-binutils addr2line">
  115. <primary sortas="b-addr2line">addr2line</primary>
  116. </indexterm>
  117. </listitem>
  118. </varlistentry>
  119. <varlistentry id="ar">
  120. <term><command>ar</command></term>
  121. <listitem>
  122. <para>Creates, modifies, and extracts from archives</para>
  123. <indexterm zone="ch-system-binutils ar">
  124. <primary sortas="b-ar">ar</primary>
  125. </indexterm>
  126. </listitem>
  127. </varlistentry>
  128. <varlistentry id="as">
  129. <term><command>as</command></term>
  130. <listitem>
  131. <para>An assembler that assembles the output of <command>gcc</command>
  132. into object files</para>
  133. <indexterm zone="ch-system-binutils as">
  134. <primary sortas="b-as">as</primary>
  135. </indexterm>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry id="c-filt">
  139. <term><command>c++filt</command></term>
  140. <listitem>
  141. <para>Used by the linker to de-mangle C++ and Java symbols and to keep
  142. overloaded functions from clashing</para>
  143. <indexterm zone="ch-system-binutils c-filt">
  144. <primary sortas="b-c++filt">c++filt</primary>
  145. </indexterm>
  146. </listitem>
  147. </varlistentry>
  148. <varlistentry id="elfedit">
  149. <term><command>elfedit</command></term>
  150. <listitem>
  151. <para>Updates the ELF header of ELF files</para>
  152. <indexterm zone="ch-system-binutils elfedit">
  153. <primary sortas="b-elfedit">elfedit</primary>
  154. </indexterm>
  155. </listitem>
  156. </varlistentry>
  157. <varlistentry id="gprof">
  158. <term><command>gprof</command></term>
  159. <listitem>
  160. <para>Displays call graph profile data</para>
  161. <indexterm zone="ch-system-binutils gprof">
  162. <primary sortas="b-gprof">gprof</primary>
  163. </indexterm>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="ld">
  167. <term><command>ld</command></term>
  168. <listitem>
  169. <para>A linker that combines a number of object and archive files
  170. into a single file, relocating their data and tying up symbol
  171. references</para>
  172. <indexterm zone="ch-system-binutils ld">
  173. <primary sortas="b-ld">ld</primary>
  174. </indexterm>
  175. </listitem>
  176. </varlistentry>
  177. <varlistentry id="ld.bfd">
  178. <term><command>ld.bfd</command></term>
  179. <listitem>
  180. <para>Hard link to <command>ld</command></para>
  181. <indexterm zone="ch-system-binutils ld.bfd">
  182. <primary sortas="b-ld.bfd">ld.bfd</primary>
  183. </indexterm>
  184. </listitem>
  185. </varlistentry>
  186. <varlistentry id="nm">
  187. <term><command>nm</command></term>
  188. <listitem>
  189. <para>Lists the symbols occurring in a given object file</para>
  190. <indexterm zone="ch-system-binutils nm">
  191. <primary sortas="b-nm">nm</primary>
  192. </indexterm>
  193. </listitem>
  194. </varlistentry>
  195. <varlistentry id="objcopy">
  196. <term><command>objcopy</command></term>
  197. <listitem>
  198. <para>Translates one type of object file into another</para>
  199. <indexterm zone="ch-system-binutils objcopy">
  200. <primary sortas="b-objcopy">objcopy</primary>
  201. </indexterm>
  202. </listitem>
  203. </varlistentry>
  204. <varlistentry id="objdump">
  205. <term><command>objdump</command></term>
  206. <listitem>
  207. <para>Displays information about the given object file, with options
  208. controlling the particular information to display; the information
  209. shown is useful to programmers who are working on the compilation
  210. tools</para>
  211. <indexterm zone="ch-system-binutils objdump">
  212. <primary sortas="b-objdump">objdump</primary>
  213. </indexterm>
  214. </listitem>
  215. </varlistentry>
  216. <varlistentry id="ranlib">
  217. <term><command>ranlib</command></term>
  218. <listitem>
  219. <para>Generates an index of the contents of an archive and stores it
  220. in the archive; the index lists all of the symbols defined by archive
  221. members that are relocatable object files</para>
  222. <indexterm zone="ch-system-binutils ranlib">
  223. <primary sortas="b-ranlib">ranlib</primary>
  224. </indexterm>
  225. </listitem>
  226. </varlistentry>
  227. <varlistentry id="readelf">
  228. <term><command>readelf</command></term>
  229. <listitem>
  230. <para>Displays information about ELF type binaries</para>
  231. <indexterm zone="ch-system-binutils readelf">
  232. <primary sortas="b-readelf">readelf</primary>
  233. </indexterm>
  234. </listitem>
  235. </varlistentry>
  236. <varlistentry id="size">
  237. <term><command>size</command></term>
  238. <listitem>
  239. <para>Lists the section sizes and the total size for the given
  240. object files</para>
  241. <indexterm zone="ch-system-binutils size">
  242. <primary sortas="b-size">size</primary>
  243. </indexterm>
  244. </listitem>
  245. </varlistentry>
  246. <varlistentry id="strings">
  247. <term><command>strings</command></term>
  248. <listitem>
  249. <para>Outputs, for each given file, the sequences of printable
  250. characters that are of at least the specified length (defaulting to
  251. four); for object files, it prints, by default, only the strings from
  252. the initializing and loading sections while for other types of files, it
  253. scans the entire file</para>
  254. <indexterm zone="ch-system-binutils strings">
  255. <primary sortas="b-strings">strings</primary>
  256. </indexterm>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry id="strip">
  260. <term><command>strip</command></term>
  261. <listitem>
  262. <para>Discards symbols from object files</para>
  263. <indexterm zone="ch-system-binutils strip">
  264. <primary sortas="b-strip">strip</primary>
  265. </indexterm>
  266. </listitem>
  267. </varlistentry>
  268. <varlistentry id="libiberty">
  269. <term><filename class="libraryfile">libiberty</filename></term>
  270. <listitem>
  271. <para>Contains routines used by various GNU programs, including
  272. <command>getopt</command>, <command>obstack</command>,
  273. <command>strerror</command>, <command>strtol</command>, and
  274. <command>strtoul</command></para>
  275. <indexterm zone="ch-system-binutils libiberty">
  276. <primary sortas="c-libiberty">libiberty</primary>
  277. </indexterm>
  278. </listitem>
  279. </varlistentry>
  280. <varlistentry id="libbfd">
  281. <term><filename class="libraryfile">libbfd</filename></term>
  282. <listitem>
  283. <para>The Binary File Descriptor library</para>
  284. <indexterm zone="ch-system-binutils libbfd">
  285. <primary sortas="c-libbfd">libbfd</primary>
  286. </indexterm>
  287. </listitem>
  288. </varlistentry>
  289. <varlistentry id="libopcodes">
  290. <term><filename class="libraryfile">libopcodes</filename></term>
  291. <listitem>
  292. <para>A library for dealing with opcodes&mdash;the <quote>readable
  293. text</quote> versions of instructions for the processor;
  294. it is used for building utilities like
  295. <command>objdump</command>.</para>
  296. <indexterm zone="ch-system-binutils libopcodes">
  297. <primary sortas="c-libopcodes">libopcodes</primary>
  298. </indexterm>
  299. </listitem>
  300. </varlistentry>
  301. </variablelist>
  302. </sect2>
  303. </sect1>