binutils.xml 12 KB

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