binutils.xml 12 KB

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