binutils.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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-fin-sbu;</seg>
  27. <seg>&binutils-fin-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>Now remove one test that prevents the tests from running
  44. to completion, and fix other tests in the gold test suite, which
  45. need to be adjusted for GCC 10:</para>
  46. <screen><userinput remap="pre">sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in
  47. patch -Np1 -i ../binutils-&binutils-version;-gcc10_gold_test_fix-1.patch</userinput></screen>
  48. <para>The Binutils documentation recommends building Binutils
  49. in a dedicated build directory:</para>
  50. <screen><userinput remap="pre">mkdir -v build
  51. cd build</userinput></screen>
  52. <para>Prepare Binutils for compilation:</para>
  53. <screen><userinput remap="configure">../configure --prefix=/usr \
  54. --enable-gold \
  55. --enable-ld=default \
  56. --enable-plugins \
  57. --enable-shared \
  58. --disable-werror \
  59. --enable-64-bit-bfd \
  60. --with-system-zlib</userinput></screen>
  61. <variablelist>
  62. <title>The meaning of the configure parameters:</title>
  63. <varlistentry>
  64. <term><parameter>--enable-gold</parameter></term>
  65. <listitem>
  66. <para>Build the gold linker and install it as ld.gold (along side the
  67. default linker).</para>
  68. </listitem>
  69. </varlistentry>
  70. <varlistentry>
  71. <term><parameter>--enable-ld=default</parameter></term>
  72. <listitem>
  73. <para>Build the original bfd linker and install it as both ld (the
  74. default linker) and ld.bfd.</para>
  75. </listitem>
  76. </varlistentry>
  77. <varlistentry>
  78. <term><parameter>--enable-plugins</parameter></term>
  79. <listitem>
  80. <para>Enables plugin support for the linker.</para>
  81. </listitem>
  82. </varlistentry>
  83. <varlistentry>
  84. <term><parameter>--enable-64-bit-bfd</parameter></term>
  85. <listitem>
  86. <para>Enables 64-bit support (on hosts with narrower word sizes).
  87. May not be needed on 64-bit systems, but does no harm.</para>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry>
  91. <term><parameter>--with-system-zlib</parameter></term>
  92. <listitem>
  93. <para>Use the installed zlib library rather than building the
  94. included version.</para>
  95. </listitem>
  96. </varlistentry>
  97. </variablelist>
  98. <para>Compile the package:</para>
  99. <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
  100. <variablelist>
  101. <title>The meaning of the make parameter:</title>
  102. <varlistentry>
  103. <term><parameter>tooldir=/usr</parameter></term>
  104. <listitem>
  105. <para>Normally, the tooldir (the directory where the executables will
  106. ultimately be located) is set to <filename
  107. class="directory">$(exec_prefix)/$(target_alias)</filename>. For
  108. example, x86_64 machines would expand that to <filename
  109. class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
  110. a custom system, this target-specific directory in <filename
  111. class="directory">/usr</filename> is not required. <filename
  112. class="directory">$(exec_prefix)/$(target_alias)</filename> would be
  113. used if the system was used to cross-compile (for example, compiling a
  114. package on an Intel machine that generates code that can be executed
  115. on PowerPC machines).</para>
  116. </listitem>
  117. </varlistentry>
  118. </variablelist>
  119. <important>
  120. <para>The test suite for Binutils in this section is considered critical.
  121. Do not skip it under any circumstances.</para>
  122. </important>
  123. <para>Test the results:</para>
  124. <screen><userinput remap="test">make -k check</userinput></screen>
  125. <!-- <para>The ver_test_pr16504.sh test is known to fail.</para>-->
  126. <para>Install the package:</para>
  127. <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
  128. </sect2>
  129. <sect2 id="contents-binutils" role="content">
  130. <title>Contents of Binutils</title>
  131. <segmentedlist>
  132. <segtitle>Installed programs</segtitle>
  133. <segtitle>Installed libraries</segtitle>
  134. <segtitle>Installed directory</segtitle>
  135. <seglistitem>
  136. <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
  137. objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
  138. <seg>libbfd.{a,so} and libopcodes.{a,so}</seg>
  139. <seg>/usr/lib/ldscripts</seg>
  140. </seglistitem>
  141. </segmentedlist>
  142. <variablelist>
  143. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  144. <?dbfo list-presentation="list"?>
  145. <?dbhtml list-presentation="table"?>
  146. <varlistentry id="addr2line">
  147. <term><command>addr2line</command></term>
  148. <listitem>
  149. <para>Translates program addresses to file names and line numbers;
  150. given an address and the name of an executable, it uses the debugging
  151. information in the executable to determine which source file and line
  152. number are associated with the address</para>
  153. <indexterm zone="ch-system-binutils addr2line">
  154. <primary sortas="b-addr2line">addr2line</primary>
  155. </indexterm>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry id="ar">
  159. <term><command>ar</command></term>
  160. <listitem>
  161. <para>Creates, modifies, and extracts from archives</para>
  162. <indexterm zone="ch-system-binutils ar">
  163. <primary sortas="b-ar">ar</primary>
  164. </indexterm>
  165. </listitem>
  166. </varlistentry>
  167. <varlistentry id="as">
  168. <term><command>as</command></term>
  169. <listitem>
  170. <para>An assembler that assembles the output of <command>gcc</command>
  171. into object files</para>
  172. <indexterm zone="ch-system-binutils as">
  173. <primary sortas="b-as">as</primary>
  174. </indexterm>
  175. </listitem>
  176. </varlistentry>
  177. <varlistentry id="c-filt">
  178. <term><command>c++filt</command></term>
  179. <listitem>
  180. <para>Used by the linker to de-mangle C++ and Java symbols and to keep
  181. overloaded functions from clashing</para>
  182. <indexterm zone="ch-system-binutils c-filt">
  183. <primary sortas="b-c++filt">c++filt</primary>
  184. </indexterm>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry id="dwp">
  188. <term><command>dwp</command></term>
  189. <listitem>
  190. <para>The DWARF packaging utility</para>
  191. <indexterm zone="ch-system-binutils dwp">
  192. <primary sortas="dwp">dwp</primary>
  193. </indexterm>
  194. </listitem>
  195. </varlistentry>
  196. <varlistentry id="elfedit">
  197. <term><command>elfedit</command></term>
  198. <listitem>
  199. <para>Updates the ELF header of ELF files</para>
  200. <indexterm zone="ch-system-binutils elfedit">
  201. <primary sortas="b-elfedit">elfedit</primary>
  202. </indexterm>
  203. </listitem>
  204. </varlistentry>
  205. <varlistentry id="gprof">
  206. <term><command>gprof</command></term>
  207. <listitem>
  208. <para>Displays call graph profile data</para>
  209. <indexterm zone="ch-system-binutils gprof">
  210. <primary sortas="b-gprof">gprof</primary>
  211. </indexterm>
  212. </listitem>
  213. </varlistentry>
  214. <varlistentry id="ld">
  215. <term><command>ld</command></term>
  216. <listitem>
  217. <para>A linker that combines a number of object and archive files
  218. into a single file, relocating their data and tying up symbol
  219. references</para>
  220. <indexterm zone="ch-system-binutils ld">
  221. <primary sortas="b-ld">ld</primary>
  222. </indexterm>
  223. </listitem>
  224. </varlistentry>
  225. <varlistentry id="ld.gold">
  226. <term><command>ld.gold</command></term>
  227. <listitem>
  228. <para>A cut down version of ld that only supports the
  229. elf object file format</para>
  230. <indexterm zone="ch-system-binutils ld.gold">
  231. <primary sortas="b-ld.gold">ld.gold</primary>
  232. </indexterm>
  233. </listitem>
  234. </varlistentry>
  235. <varlistentry id="ld.bfd">
  236. <term><command>ld.bfd</command></term>
  237. <listitem>
  238. <para>Hard link to <command>ld</command></para>
  239. <indexterm zone="ch-system-binutils ld.bfd">
  240. <primary sortas="b-ld.bfd">ld.bfd</primary>
  241. </indexterm>
  242. </listitem>
  243. </varlistentry>
  244. <varlistentry id="nm">
  245. <term><command>nm</command></term>
  246. <listitem>
  247. <para>Lists the symbols occurring in a given object file</para>
  248. <indexterm zone="ch-system-binutils nm">
  249. <primary sortas="b-nm">nm</primary>
  250. </indexterm>
  251. </listitem>
  252. </varlistentry>
  253. <varlistentry id="objcopy">
  254. <term><command>objcopy</command></term>
  255. <listitem>
  256. <para>Translates one type of object file into another</para>
  257. <indexterm zone="ch-system-binutils objcopy">
  258. <primary sortas="b-objcopy">objcopy</primary>
  259. </indexterm>
  260. </listitem>
  261. </varlistentry>
  262. <varlistentry id="objdump">
  263. <term><command>objdump</command></term>
  264. <listitem>
  265. <para>Displays information about the given object file, with options
  266. controlling the particular information to display; the information
  267. shown is useful to programmers who are working on the compilation
  268. tools</para>
  269. <indexterm zone="ch-system-binutils objdump">
  270. <primary sortas="b-objdump">objdump</primary>
  271. </indexterm>
  272. </listitem>
  273. </varlistentry>
  274. <varlistentry id="ranlib">
  275. <term><command>ranlib</command></term>
  276. <listitem>
  277. <para>Generates an index of the contents of an archive and stores it
  278. in the archive; the index lists all of the symbols defined by archive
  279. members that are relocatable object files</para>
  280. <indexterm zone="ch-system-binutils ranlib">
  281. <primary sortas="b-ranlib">ranlib</primary>
  282. </indexterm>
  283. </listitem>
  284. </varlistentry>
  285. <varlistentry id="readelf">
  286. <term><command>readelf</command></term>
  287. <listitem>
  288. <para>Displays information about ELF type binaries</para>
  289. <indexterm zone="ch-system-binutils readelf">
  290. <primary sortas="b-readelf">readelf</primary>
  291. </indexterm>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry id="size">
  295. <term><command>size</command></term>
  296. <listitem>
  297. <para>Lists the section sizes and the total size for the given
  298. object files</para>
  299. <indexterm zone="ch-system-binutils size">
  300. <primary sortas="b-size">size</primary>
  301. </indexterm>
  302. </listitem>
  303. </varlistentry>
  304. <varlistentry id="strings">
  305. <term><command>strings</command></term>
  306. <listitem>
  307. <para>Outputs, for each given file, the sequences of printable
  308. characters that are of at least the specified length (defaulting to
  309. four); for object files, it prints, by default, only the strings from
  310. the initializing and loading sections while for other types of files, it
  311. scans the entire file</para>
  312. <indexterm zone="ch-system-binutils strings">
  313. <primary sortas="b-strings">strings</primary>
  314. </indexterm>
  315. </listitem>
  316. </varlistentry>
  317. <varlistentry id="strip">
  318. <term><command>strip</command></term>
  319. <listitem>
  320. <para>Discards symbols from object files</para>
  321. <indexterm zone="ch-system-binutils strip">
  322. <primary sortas="b-strip">strip</primary>
  323. </indexterm>
  324. </listitem>
  325. </varlistentry>
  326. <varlistentry id="libbfd">
  327. <term><filename class="libraryfile">libbfd</filename></term>
  328. <listitem>
  329. <para>The Binary File Descriptor library</para>
  330. <indexterm zone="ch-system-binutils libbfd">
  331. <primary sortas="c-libbfd">libbfd</primary>
  332. </indexterm>
  333. </listitem>
  334. </varlistentry>
  335. <varlistentry id="libctf">
  336. <term><filename class="libraryfile">libctf</filename></term>
  337. <listitem>
  338. <para>The Compat ANSI-C Type Format debugging support library</para>
  339. <indexterm zone="ch-system-binutils libctf">
  340. <primary sortas="c-libctf">libctf</primary>
  341. </indexterm>
  342. </listitem>
  343. </varlistentry>
  344. <varlistentry id="libctf-nobfd">
  345. <term><filename class="libraryfile">libctf-nobfd</filename></term>
  346. <listitem>
  347. <para>A libctf variant which does not use libbfd functionality</para>
  348. <indexterm zone="ch-system-binutils libctf-nobfd">
  349. <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
  350. </indexterm>
  351. </listitem>
  352. </varlistentry>
  353. <varlistentry id="libopcodes">
  354. <term><filename class="libraryfile">libopcodes</filename></term>
  355. <listitem>
  356. <para>A library for dealing with opcodes&mdash;the <quote>readable
  357. text</quote> versions of instructions for the processor;
  358. it is used for building utilities like
  359. <command>objdump</command></para>
  360. <indexterm zone="ch-system-binutils libopcodes">
  361. <primary sortas="c-libopcodes">libopcodes</primary>
  362. </indexterm>
  363. </listitem>
  364. </varlistentry>
  365. </variablelist>
  366. </sect2>
  367. </sect1>