Changeset 609 for branches/GNU/src/binutils/bfd/doc
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- Location:
- branches/GNU/src/binutils/bfd/doc
- Files:
-
- 33 edited
-
ChangeLog (modified) (28 diffs, 1 prop)
-
Makefile.am (modified) (9 diffs, 1 prop)
-
Makefile.in (modified) (13 diffs, 1 prop)
-
aoutx.texi (modified) (3 diffs, 1 prop)
-
archive.texi (modified) (1 diff, 1 prop)
-
archures.texi (modified) (17 diffs, 1 prop)
-
bfd.info (modified) (3 diffs, 1 prop)
-
bfd.info-1 (modified) (19 diffs, 1 prop)
-
bfd.info-2 (modified) (51 diffs, 1 prop)
-
bfd.info-3 (modified) (9 diffs, 1 prop)
-
bfd.info-4 (modified) (5 diffs, 1 prop)
-
bfd.info-5 (modified) (3 diffs, 1 prop)
-
bfd.info-6 (modified) (3 diffs, 1 prop)
-
bfd.info-7 (modified) (3 diffs, 1 prop)
-
bfd.texinfo (modified) (12 diffs, 1 prop)
-
bfdint.texi (modified) (9 diffs, 1 prop)
-
bfdsumm.texi (modified) (1 diff, 1 prop)
-
bfdt.texi (modified) (23 diffs, 1 prop)
-
cache.texi (modified) (3 diffs, 1 prop)
-
chew.c (modified) (36 diffs, 1 prop)
-
coffcode.texi (modified) (5 diffs, 1 prop)
-
core.texi (modified) (2 diffs, 1 prop)
-
elf.texi (modified) (1 diff, 1 prop)
-
format.texi (modified) (5 diffs, 1 prop)
-
hash.texi (modified) (5 diffs, 1 prop)
-
libbfd.texi (modified) (7 diffs, 1 prop)
-
linker.texi (modified) (2 diffs, 1 prop)
-
opncls.texi (modified) (14 diffs, 1 prop)
-
proto.str (modified) (1 diff, 1 prop)
-
reloc.texi (modified) (35 diffs, 1 prop)
-
section.texi (modified) (28 diffs, 1 prop)
-
syms.texi (modified) (19 diffs, 1 prop)
-
targets.texi (modified) (11 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/doc/ChangeLog
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 2001-06-11 Alan Modra <amodra@bigpond.net.au> 2 3 * bfdint.texi (BFD target vector miscellaneous): --oformat, not 4 -oformat. 1 2003-02-12 Bob Wilson <bob.wilson@acm.org> 2 3 * bfd.texinfo: Fix quotes for texinfo. Make section title 4 capitalization more consistent. Use @example instead of @lisp. 5 Replace FDL appendix with include of fdl.texi. 6 * fdl.texi: New file. 7 8 2002-11-18 Klee Dienes <kdienes@apple.com> 9 10 * Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi. 11 (PROTOS): Add bfdio.p, bfdwin.p. 12 (SRCDOC): Add bfdio.c, bfdwin.c. 13 (SRCPROT): Add bfdio.c, bfdwin.c. 14 (SRCIPROT): Add bfdio.c, bfdwin.c. 15 (LIBBFD_H_DEP): Add bfdio.c, bfdwin.c. 16 (BFD_H_DEP): Add bfdio.c, bfdwin.c. 17 Add rules for bfdio.texi, bfdwin.text. 18 * bfd.texinfo: Include bfdio.texi. 19 20 2002-10-14 Alan Modra <amodra@bigpond.net.au> 21 22 * Makefile.in: Regenerate. 23 24 2002-10-11 Daniel Jacobowitz <drow@mvista.com> 25 26 * Makefile.in: Regenerated. 27 28 2002-08-29 John David Anglin <dave@hiauly1.hia.nrc.ca> 29 30 * chew.c (paramstuff, outputdots, perform, bang and usage): Remove 31 void from function definitions. 32 33 2002-08-13 Alan Modra <amodra@bigpond.net.au> 34 35 * header.sed: Strip tabs. 36 37 2002-06-08 Alan Modra <amodra@bigpond.net.au> 38 39 * Makefile.am: Fix quote style in last change. 40 * Makefile.in: Regenerate. 41 42 2002-06-07 Alan Modra <amodra@bigpond.net.au> 43 44 * Makefile.am (libbfd.h): Don't use "echo -n". 45 (libcoff.h, bfd.h): Likewise. 46 * Makefile.in: Regenerate. 47 48 2002-06-06 Lars Brinkhoff <lars@nocrew.org> 49 50 * bfdint.texi: Change registry@sco.com to registry@caldera.com. 51 52 2002-06-05 Alan Modra <amodra@bigpond.net.au> 53 54 * Makefile.am (libbfd.h): Add "Extracted from.." comment. 55 (libcoff.h, bfd.h): Likewise. 56 * Makefile.in: Regenerate. 57 58 2002-05-25 Alan Modra <amodra@bigpond.net.au> 59 60 * chew.c: Use #include "" instead of <> for local header files. 61 62 2002-04-20 Alan Modra <amodra@bigpond.net.au> 63 64 * Makefile.in: Regenerate. 65 66 2002-02-11 Alan Modra <amodra@bigpond.net.au> 67 68 * Makefile.in: Regenerate. 69 70 2002-02-01 Alan Modra <amodra@bigpond.net.au> 71 72 * chew.c (WORD): Eliminate. 73 74 2002-01-31 Ivan Guzvinec <ivang@opencores.org> 75 76 * Makefile.in: Regenerate. 77 78 2002-01-31 Alan Modra <amodra@bigpond.net.au> 79 80 * chew.c (courierize): Don't modify @command params. 81 82 2002-01-30 Nick Clifton <nickc@cambridge.redhat.com> 83 84 * proto.str (ENUMDOC): Place two spaces between the end of 85 the text and the closing comment marker. 86 87 2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> 88 89 * bfdint.texi (BFD target vector miscellaneous): Add 90 bfd_target_mmo_flavour. 91 * bfd.texinfo (BFD back ends): Add entry for mmo. 92 * Makefile.am (DOCFILES): Add mmo.texi. 93 (SRCDOC): Add mmo.c. 94 (s-mmo, mmo.texi): New rules. 95 96 2001-10-29 Kazu Hirata <kazu@hxi.com> 97 98 * bfdsumm.texi: Fix a typo. 99 100 2001-10-26 Nick Clifton <nickc@cambridge.redhat.com> 101 102 * bfd.texinfo: Change footer to refer to FSF. Change subtitle 103 to refer to original creation date. 104 105 2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> 106 107 * Makefile.am (install): Depend on install-info. 108 * Makefile.in: Regenerate. 109 110 2001-10-03 Alan Modra <amodra@bigpond.net.au> 111 112 * Makefile.am (BFD_H_DEP): Add ../version.h. 113 * Makefile.in: Regenerate. 114 115 2001-10-02 Alan Modra <amodra@bigpond.net.au> 116 117 * Makefile.in: Regenerate. 118 119 2001-10-01 Alan Modra <amodra@bigpond.net.au> 120 121 * header.sed: New file, adds header to generated files. 122 * Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and 123 bfd.h, using above. Add missing elf.c dependecy for libbfd.h. 124 * Makefile.in: Regenerate. 125 126 2001-09-21 Alan Modra <amodra@bigpond.net.au> 127 128 * Makefile.in: Regenerate. 129 130 2001-09-18 Alan Modra <amodra@bigpond.net.au> 131 132 * bfdint.texi: Replace reference to bfd_read with bfd_bread. 133 Likewise for bfd_write. 134 135 2001-07-24 Alan Modra <amodra@bigpond.net.au> 136 137 * Makefile.in: Regenerate. 138 139 2001-06-21 Hans-Peter Nilsson <hp@axis.com> 140 141 * bfdint.texi (BFD relocation functions) <different formats>: 142 Mention that the GNU linker is aware of input-output format 143 restrictions when generating relocatable output. Make new 144 paragraph for final-link case. 145 (BFD target vector swap): Fix typo. 5 146 6 147 2001-01-25 Kazu Hirata <kazu@hxi.com> … … 39 180 * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. 40 181 41 Fri Apr 7 17:54:38 2000Andrew Cagney <cagney@b1.cygnus.com>182 2000-04-07 Andrew Cagney <cagney@b1.cygnus.com> 42 183 43 184 * Makefile.in: Rebuild with current autoconf/automake. 44 185 45 Thu Feb 4 23:21:36 1999Ian Lance Taylor <ian@cygnus.com>186 1999-02-04 Ian Lance Taylor <ian@cygnus.com> 46 187 47 188 * Makefile.in: Rebuild with current autoconf/automake. 48 189 49 Thu Jul 23 09:36:44 1998Nick Clifton <nickc@cygnus.com>190 1998-07-23 Nick Clifton <nickc@cygnus.com> 50 191 51 192 * bfdint.texi (BFD ELF processor required): Add paragraph 52 193 describing the necessity to create "include/elf/CPU.h". 53 194 54 Thu May 7 14:45:43 1998Ian Lance Taylor <ian@cygnus.com>195 1998-05-07 Ian Lance Taylor <ian@cygnus.com> 55 196 56 197 * Makefile.am (chew.o): Add -I options for intl srcdir and … … 58 199 * Makefile.in: Rebuild. 59 200 60 Mon Apr 27 20:19:24 1998Ian Lance Taylor <ian@cygnus.com>201 1998-04-27 Ian Lance Taylor <ian@cygnus.com> 61 202 62 203 * bfdint.texi: New file. … … 64 205 * Makefile.in: Rebuild. 65 206 66 Mon Apr 13 16:48:56 1998Ian Lance Taylor <ian@cygnus.com>67 68 * Makefile.in: Rebuild. 69 70 Mon Apr 6 14:06:55 1998Ian Lance Taylor <ian@cygnus.com>207 1998-04-13 Ian Lance Taylor <ian@cygnus.com> 208 209 * Makefile.in: Rebuild. 210 211 1998-04-06 Ian Lance Taylor <ian@cygnus.com> 71 212 72 213 * Makefile.am (STAGESTUFF): Remove variable. … … 75 216 * Makefile.in: Rebuild. 76 217 77 Fri Mar 27 16:25:25 1998Ian Lance Taylor <ian@cygnus.com>218 1998-03-27 Ian Lance Taylor <ian@cygnus.com> 78 219 79 220 * chew.c (skip_white_and_starts): Remove unused declaration. … … 90 231 (main): Call usage for an unrecognized option. 91 232 92 Fri Feb 13 14:37:14 1998Ian Lance Taylor <ian@cygnus.com>233 1998-02-13 Ian Lance Taylor <ian@cygnus.com> 93 234 94 235 * Makefile.am (AUTOMAKE_OPTIONS): Define. 95 236 * Makefile.in: Rebuild. 96 237 97 Mon Jan 26 15:38:36 1998Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>238 1998-01-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> 98 239 99 240 * doc.str (bodytext): Don't output @* at the end. … … 105 246 * Makefile.in: Rebuild. 106 247 107 Wed Oct 1 14:41:28 1997Ian Lance Taylor <ian@cygnus.com>248 1997-10-01 Ian Lance Taylor <ian@cygnus.com> 108 249 109 250 * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or … … 111 252 * Makefile.in: Rebuild. 112 253 113 Fri Aug 15 04:55:15 1997Doug Evans <dje@canuck.cygnus.com>254 1997-08-15 Doug Evans <dje@canuck.cygnus.com> 114 255 115 256 * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC). 116 257 * Makefile.in: Rebuild. 117 258 118 Fri Aug 1 12:59:58 1997Ian Lance Taylor <ian@cygnus.com>259 1997-08-01 Ian Lance Taylor <ian@cygnus.com> 119 260 120 261 * Makefile.am (CC_FOR_BUILD): Don't set explicitly. 121 262 * Makefile.in: Rebuild. 122 263 123 Thu Jul 31 20:00:12 1997Ian Lance Taylor <ian@cygnus.com>264 1997-07-31 Ian Lance Taylor <ian@cygnus.com> 124 265 125 266 * Makefile.am: New file, based on old Makefile.in. 126 267 * Makefile.in: Now built with automake. 127 268 128 Tue Jul 22 14:44:00 1997Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>269 1997-07-22 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE> 129 270 130 271 * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi 131 272 rather than bfd.texi. 132 (DOCFILES): Change bfd.texi to bfdt.texi.273 (DOCFILES): Change bfd.texi to bfdt.texi. 133 274 * bfd.texinfo: Include bfdt.texi, not bfd.texi. 134 275 135 Mon Jun 16 15:33:15 1997Ian Lance Taylor <ian@cygnus.com>276 1997-06-16 Ian Lance Taylor <ian@cygnus.com> 136 277 137 278 * Makefile.in (CC, CFLAGS): Substitute from configure script. 138 279 From Jeff Makey <jeff@cts.com>. 139 280 140 Tue Apr 15 12:37:41 1997Ian Lance Taylor <ian@cygnus.com>281 1997-04-15 Ian Lance Taylor <ian@cygnus.com> 141 282 142 283 * Makefile.in (install-info): Use mkinstalldirs to build 143 284 $(infodir). 144 285 145 Tue Apr 8 12:49:46 1997Ian Lance Taylor <ian@cygnus.com>286 1997-04-08 Ian Lance Taylor <ian@cygnus.com> 146 287 147 288 * Makefile.in (install-info): Permit info files to be in srcdir. … … 152 293 remove $(DOCFILES). 153 294 154 Mon Apr 7 15:23:26 1997 Ian Lance Taylor <ian@cygnus.com>295 1997-04-07 Ian Lance Taylor <ian@cygnus.com> 155 296 156 297 * Makefile.in (distclean): Don't remove *.info files. 157 298 158 Thu Feb 13 20:50:02 1997Klaus Kaempf (kkaempf@progis.de)299 1997-02-13 Klaus Kaempf (kkaempf@progis.de) 159 300 160 301 * makefile.vms: New file. 161 302 162 Tue Jun 18 18:32:28 1996Ian Lance Taylor <ian@cygnus.com>303 1996-06-18 Ian Lance Taylor <ian@cygnus.com> 163 304 164 305 * chew.c (kill_bogus_lines): Reset sl when not at the start of a 165 306 line. From Uwe Ohse <uwe@tirka.gun.de>. 166 307 167 Tue Jan 30 14:10:46 1996Ian Lance Taylor <ian@cygnus.com>308 1996-01-30 Ian Lance Taylor <ian@cygnus.com> 168 309 169 310 From Ronald F. Guilmette <rfg@monkeys.com>: … … 171 312 (libcoff.h, bfd.h): Likewise. 172 313 173 Fri Nov 3 14:46:48 1995Fred Fish <fnf@cygnus.com>174 175 * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, 314 1995-11-03 Fred Fish <fnf@cygnus.com> 315 316 * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, 176 317 renamed from core.c. 177 318 178 Wed Nov 1 14:28:23 1995Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>319 1995-11-01 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> 179 320 180 321 * chew.c: Include <ctype.h>. 181 322 182 Fri Oct 6 16:23:34 1995Ken Raeburn <raeburn@cygnus.com>323 1995-10-06 Ken Raeburn <raeburn@cygnus.com> 183 324 184 325 Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> … … 186 327 * Makefile.in (Makefile): Only remake this Makefile. 187 328 188 Wed Oct 4 15:51:05 1995Ken Raeburn <raeburn@cygnus.com>329 1995-10-04 Ken Raeburn <raeburn@cygnus.com> 189 330 190 331 * chew.c: Include <stdio.h>. 191 332 192 Tue Sep 12 18:14:50 1995Ian Lance Taylor <ian@cygnus.com>333 1995-09-12 Ian Lance Taylor <ian@cygnus.com> 193 334 194 335 * Makefile.in (maintainer-clean): New target. 195 336 196 Thu Aug 31 12:18:43 1995Ian Lance Taylor <ian@cygnus.com>337 1995-08-31 Ian Lance Taylor <ian@cygnus.com> 197 338 198 339 * Makefile.in (bfd.h): Add additional #endif at end of bfd.h if 199 340 __cplusplus is defined. 200 341 201 Tue Nov 29 16:13:34 1994Doug Evans <dje@canuck.cygnus.com>342 1994-11-29 Doug Evans <dje@canuck.cygnus.com> 202 343 203 344 * chew.c (write_buffer): New argument `f', all callers changed. … … 206 347 * doc.str (COMMENT): Likewise. 207 348 208 Mon Sep 12 11:44:17 1994Ian Lance Taylor (ian@sanguine.cygnus.com)349 1994-09-12 Ian Lance Taylor (ian@sanguine.cygnus.com) 209 350 210 351 * Makefile.in (DOCFILES): Remove ctor.texi. … … 216 357 * bfd.texinfo (Constructors): Remove section. 217 358 218 Fri Sep 2 13:33:44 1994Ken Raeburn (raeburn@cujo.cygnus.com)359 1994-09-02 Ken Raeburn (raeburn@cujo.cygnus.com) 219 360 220 361 * chew.c: Include assert.h. Added prototypes for most functions. … … 238 379 ENUMEQ, ENUMEQX, ENUMDOC. 239 380 240 Wed Jan 12 18:37:12 1994Ian Lance Taylor (ian@tweedledumb.cygnus.com)381 1994-01-12 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 241 382 242 383 * bfd.texinfo: Added Linker Functions node. 243 * doc/Makefile.in (DOCFILES): Added linker.texi.384 * Makefile.in (DOCFILES): Added linker.texi. 244 385 (SRCDOC): Added linker.c. 245 386 (linker.texi): New target. 246 387 247 Tue Jan 4 10:52:56 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)388 1994-01-04 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 248 389 249 390 * chew.c: Don't rely on a correct declaration of exit. … … 251 392 (main): Use it. 252 393 253 Mon Jan 3 11:40:40 1994Ian Lance Taylor (ian@tweedledumb.cygnus.com)394 1994-01-03 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 254 395 255 396 * bfd.texinfo: Added Hash Tables node. … … 258 399 (hash.texi): New target. 259 400 260 Thu Dec 30 16:57:04 1993Ken Raeburn (raeburn@cujo.cygnus.com)401 1993-12-30 Ken Raeburn (raeburn@cujo.cygnus.com) 261 402 262 403 * Makefile.in: Delete all references to seclet.c, since it's just … … 264 405 since they don't contain documentation yet (hint, hint!). 265 406 266 Fri Nov 5 10:58:53 1993David J. Mackenzie (djm@thepub.cygnus.com)407 1993-11-05 David J. Mackenzie (djm@thepub.cygnus.com) 267 408 268 409 * bfd.texinfo: Small cleanups. 269 410 270 Fri Nov 19 03:46:11 1993Ken Raeburn (raeburn@cambridge.cygnus.com)411 1993-11-19 Ken Raeburn (raeburn@cambridge.cygnus.com) 271 412 272 413 * Makefile.in (archures.texi): Depends on $(MKDOC). 273 414 274 Tue Aug 10 14:22:39 1993Ken Raeburn (raeburn@cambridge.cygnus.com)415 1993-08-10 Ken Raeburn (raeburn@cambridge.cygnus.com) 275 416 276 417 * bfd.texinfo (BFD back end): Don't include elfcode.texi, since 277 418 it's empty now and that triggers a makeinfo bug. 278 419 279 Mon Aug 9 16:27:30 1993Ken Raeburn (raeburn@cambridge.cygnus.com)420 1993-08-09 Ken Raeburn (raeburn@cambridge.cygnus.com) 280 421 281 422 * bfd.texinfo (BFD back end): New section on ELF, includes … … 285 426 (elf.texi, elfcode.texi): New intermediate targets. 286 427 287 Thu Jun 24 13:48:13 1993David J. Mackenzie (djm@thepub.cygnus.com)428 1993-06-24 David J. Mackenzie (djm@thepub.cygnus.com) 288 429 289 430 * Makefile.in (.c.o, chew.o): Put CFLAGS last. … … 291 432 with ld.texinfo. 292 433 293 Mon Jun 14 12:07:07 1993david d `zoo' zuhn (zoo at rtl.cygnus.com)294 295 * Makefile.in (install-info): remove parentdir cruft, 296 297 Wed Jun 9 16:00:32 1993Jim Kingdon (kingdon@cygnus.com)434 1993-06-14 david d `zoo' zuhn (zoo at rtl.cygnus.com) 435 436 * Makefile.in (install-info): remove parentdir cruft, 437 438 1993-06-09 Jim Kingdon (kingdon@cygnus.com) 298 439 299 440 * Makefile.in (mostlyclean): Remove chew.o. 300 441 301 Tue May 25 14:46:58 1993Ken Raeburn (raeburn@cambridge.cygnus.com)442 1993-05-25 Ken Raeburn (raeburn@cambridge.cygnus.com) 302 443 303 444 * Makefile.in (libbfd.h): Use elfcode.h, not elf32.c. 304 445 305 Mon May 24 15:50:07 1993Ken Raeburn (raeburn@cygnus.com)446 1993-05-24 Ken Raeburn (raeburn@cygnus.com) 306 447 307 448 * chew.c (compile): Add a couple of missing casts. 308 449 309 Wed May 12 14:45:14 1993Ian Lance Taylor (ian@cygnus.com)450 1993-05-12 Ian Lance Taylor (ian@cygnus.com) 310 451 311 452 * Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC). … … 313 454 it must run on the build machine. 314 455 315 Tue Apr 6 22:38:10 1993John Gilmore (gnu@cygnus.com)456 1993-04-07 John Gilmore (gnu@cygnus.com) 316 457 317 458 * Makefile.in (chew): Don't compile from .c to executable in a … … 320 461 chew.o, and link that, which makes identical executables every time. 321 462 322 Wed Mar 24 17:26:29 1993david d `zoo' zuhn (zoo at poseidon.cygnus.com)463 1993-03-24 david d `zoo' zuhn (zoo at poseidon.cygnus.com) 323 464 324 465 * Makefile.in: fix typo (bfd.texinfo not bfd.texino) 325 466 326 Fri Mar 19 01:13:00 1993Ken Raeburn (raeburn@kr-pc.cygnus.com)467 1993-03-19 Ken Raeburn (raeburn@kr-pc.cygnus.com) 327 468 328 469 * bfd.texinfo: Since BFD version number has been bumped, do same … … 330 471 fixed to extract real version number. 331 472 332 Tue Mar 16 12:15:13 1993Per Bothner (bothner@rtl.cygnus.com)473 1993-03-16 Per Bothner (bothner@rtl.cygnus.com) 333 474 334 475 * Makefile.in: Add *clean rules. 335 476 336 Mon Jan 11 18:43:56 1993Ian Lance Taylor (ian@tweedledumb.cygnus.com)477 1993-01-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com) 337 478 338 479 * Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c. … … 341 482 to build. 342 483 343 Thu Dec 17 19:35:43 1992david d `zoo' zuhn (zoo at cirdan.cygnus.com)484 1992-12-17 david d `zoo' zuhn (zoo at cirdan.cygnus.com) 344 485 345 486 * Makefile.in: added dvi target, define and use $(TEXI2DVI) 346 487 347 Thu Dec 3 17:42:48 1992Ken Raeburn (raeburn@cambridge.cygnus.com)488 1992-12-03 Ken Raeburn (raeburn@cambridge.cygnus.com) 348 489 349 490 * Makefile.in (TEXIDIR): New variable. … … 352 493 * bfd.texinfo: Minor doc fixes. 353 494 354 Thu Nov 5 03:13:55 1992John Gilmore (gnu@cygnus.com)495 1992-11-05 John Gilmore (gnu@cygnus.com) 355 496 356 497 Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. 357 498 358 * doc/chew.c (exfunstuff): Eliminate.499 * chew.c (exfunstuff): Eliminate. 359 500 (paramstuff): Replace exfunstuff with function to generate PARAMS. 360 * doc/proto.str: Use paramstuff rather than exfunstuff.361 362 Mon Aug 17 12:40:32 1992Steve Chamberlain (sac@thepub.cygnus.com)501 * proto.str: Use paramstuff rather than exfunstuff. 502 503 1992-08-17 Steve Chamberlain (sac@thepub.cygnus.com) 363 504 364 505 * chew.c: various patches provided by Howard Chu. 365 506 366 Fri Jun 19 18:59:54 1992John Gilmore (gnu at cygnus.com)507 1992-06-19 John Gilmore (gnu at cygnus.com) 367 508 368 509 * Makefile.in (libbfd.h): Add elf.c as a source of prototypes. 369 510 370 Mon May 11 18:55:59 1992John Gilmore (gnu at cygnus.com)511 1992-05-11 John Gilmore (gnu at cygnus.com) 371 512 372 513 * chew.c: exit() should be declared by config files, not by 373 portable source code. Its type could be int or void function. 374 375 Mon May 4 13:45:57 1992K. Richard Pixley (rich@rtl.cygnus.com)514 portable source code. Its type could be int or void function. 515 516 1992-05-04 K. Richard Pixley (rich@rtl.cygnus.com) 376 517 377 518 * Makefile.in: another CFLAGS correction. 378 519 379 Tue Apr 28 10:21:32 1992K. Richard Pixley (rich@rtl.cygnus.com)520 1992-04-28 K. Richard Pixley (rich@rtl.cygnus.com) 380 521 381 522 * Makefile.in: Do the CFLAGS thing. 382 523 383 Fri Apr 10 22:34:52 1992Fred Fish (fnf@cygnus.com)524 1992-04-11 Fred Fish (fnf@cygnus.com) 384 525 385 526 * Makefile.in (MINUS_G): Add macro and default to -g. 386 527 387 Fri Mar 6 18:53:18 1992Steve Chamberlain (sac@thepub.cygnus.com)528 1992-03-06 Steve Chamberlain (sac@thepub.cygnus.com) 388 529 389 530 * chew.c: now has -w switch turn on warnings 390 531 391 Wed Feb 26 18:04:40 1992K. Richard Pixley (rich@cygnus.com)532 1992-02-26 K. Richard Pixley (rich@cygnus.com) 392 533 393 534 * Makefile.in, configure.in: removed traces of namesubdir, … … 395 536 copyrights to '92, changed some from Cygnus to FSF. 396 537 397 Tue Dec 10 22:11:05 1991K. Richard Pixley (rich at rtl.cygnus.com)538 1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) 398 539 399 540 * Makefile.in: build chew into the current directory. Complete 400 541 the MKDOC macro transition. 401 542 402 Tue Dec 10 08:26:28 1991Steve Chamberlain (sac at rtl.cygnus.com)543 1991-12-10 Steve Chamberlain (sac at rtl.cygnus.com) 403 544 404 545 * chew.c: don't core dump when can't open file … … 406 547 odd directories 407 548 408 Tue Dec 10 04:07:25 1991K. Richard Pixley (rich at rtl.cygnus.com)549 1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) 409 550 410 551 * Makefile.in: infodir belongs in datadir. 411 552 412 Sat Dec 7 17:01:23 1991Steve Chamberlain (sac at rtl.cygnus.com)553 1991-12-07 Steve Chamberlain (sac at rtl.cygnus.com) 413 554 414 555 * chew.c: Much modified … … 417 558 418 559 419 Fri Dec 6 22:57:12 1991K. Richard Pixley (rich at rtl.cygnus.com)560 1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) 420 561 421 562 * Makefile.in: added standards.text support, host/site/target … … 423 564 don't echo on install. 424 565 425 Thu Dec 5 22:46:17 1991K. Richard Pixley (rich at rtl.cygnus.com)566 1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com) 426 567 427 568 * Makefile.in: idestdir and ddestdir go away. Added copyrights -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/Makefile.am
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 5 5 DOCFILES = aoutx.texi archive.texi archures.texi \ 6 6 bfdt.texi cache.texi coffcode.texi \ 7 core.texi elf.texi elfcode.texi format.texi libbfd.texi \ 7 core.texi elf.texi elfcode.texi format.texi \ 8 libbfd.texi bfdwin.texi bfdio.texi \ 8 9 opncls.texi reloc.texi section.texi \ 9 syms.texi targets.texi init.texi hash.texi linker.texi 10 syms.texi targets.texi init.texi hash.texi linker.texi \ 11 mmo.texi 10 12 11 13 PROTOS = archive.p archures.p bfd.p \ 12 14 core.p format.p \ 15 bfdio.p bfdwin.p \ 13 16 libbfd.p opncls.p reloc.p \ 14 17 section.p syms.p targets.p \ … … 22 25 SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ 23 26 $(srcdir)/../archures.c $(srcdir)/../bfd.c \ 27 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 24 28 $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ 25 29 $(srcdir)/../corefile.c $(srcdir)/../elf.c \ … … 28 32 $(srcdir)/../reloc.c $(srcdir)/../section.c \ 29 33 $(srcdir)/../syms.c $(srcdir)/../targets.c \ 30 $(srcdir)/../hash.c $(srcdir)/../linker.c 34 $(srcdir)/../hash.c $(srcdir)/../linker.c \ 35 $(srcdir)/../mmo.c 31 36 32 37 SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ 33 38 $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ 34 39 $(srcdir)/../format.c $(srcdir)/../libbfd.c \ 40 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 35 41 $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ 36 42 $(srcdir)/../section.c $(srcdir)/../syms.c \ … … 38 44 39 45 SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ 46 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 40 47 $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ 41 48 $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ … … 124 131 elfcode.texi: s-elfcode 125 132 133 s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str 134 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp 135 $(srcdir)/../../move-if-change mmo.tmp mmo.texi 136 touch s-mmo 137 mmo.texi: s-mmo 138 126 139 s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str 127 140 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp … … 136 149 libbfd.texi: s-libbfd 137 150 151 s-bfdio: $(MKDOC) $(srcdir)/../bfdio.c $(srcdir)/doc.str 152 ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp 153 $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi 154 touch s-bfdio 155 bfdio.texi: s-bfdio 156 157 s-bfdwin: $(MKDOC) $(srcdir)/../bfdwin.c $(srcdir)/doc.str 158 ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp 159 $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi 160 touch s-bfdwin 161 bfdwin.texi: s-bfdwin 162 138 163 s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str 139 164 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp … … 184 209 linker.texi: s-linker 185 210 186 libbfd.h: $(srcdir)/../libbfd-in.h \ 211 LIBBFD_H_DEP = \ 212 $(srcdir)/../libbfd-in.h \ 187 213 $(srcdir)/../init.c \ 188 214 $(srcdir)/../libbfd.c \ 215 $(srcdir)/../bfdio.c \ 216 $(srcdir)/../bfdwin.c \ 189 217 $(srcdir)/../cache.c \ 190 218 $(srcdir)/../reloc.c \ 191 219 $(srcdir)/../archures.c \ 220 $(srcdir)/../elf.c \ 221 $(srcdir)/header.sed \ 192 222 $(srcdir)/proto.str \ 193 223 $(MKDOC) 194 cat $(srcdir)/../libbfd-in.h >libbfd.h 195 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h 196 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h 197 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h 198 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h 199 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h 200 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h 201 202 libcoff.h: $(srcdir)/../libcoff-in.h \ 224 225 libbfd.h: $(LIBBFD_H_DEP) 226 echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 227 for file in $(LIBBFD_H_DEP); do \ 228 case $$file in \ 229 *-in.h) cat $$file >> $@ ;; \ 230 */header.sed) break ;; \ 231 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 232 -e 's,$$,. */,' >> $@ ; \ 233 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ 234 esac; \ 235 done 236 237 LIBCOFF_H_DEP = \ 238 $(srcdir)/../libcoff-in.h \ 203 239 $(srcdir)/../coffcode.h \ 240 $(srcdir)/header.sed \ 204 241 $(srcdir)/proto.str \ 205 242 $(MKDOC) 206 cat $(srcdir)/../libcoff-in.h >libcoff.h 207 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h 208 209 bfd.h: $(srcdir)/../bfd-in.h \ 243 244 libcoff.h: $(LIBCOFF_H_DEP) 245 echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 246 for file in $(LIBCOFF_H_DEP); do \ 247 case $$file in \ 248 *-in.h) cat $$file >> $@ ;; \ 249 */header.sed) break ;; \ 250 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 251 -e 's,$$,. */,' >> $@ ; \ 252 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ 253 esac; \ 254 done 255 256 BFD_H_DEP = \ 257 $(srcdir)/../bfd-in.h \ 210 258 $(srcdir)/../init.c \ 211 259 $(srcdir)/../opncls.c \ 212 260 $(srcdir)/../libbfd.c \ 261 $(srcdir)/../bfdio.c \ 262 $(srcdir)/../bfdwin.c \ 213 263 $(srcdir)/../section.c \ 214 264 $(srcdir)/../archures.c \ … … 220 270 $(srcdir)/../targets.c \ 221 271 $(srcdir)/../format.c \ 272 $(srcdir)/../linker.c \ 273 $(srcdir)/../simple.c \ 274 $(srcdir)/header.sed \ 222 275 $(srcdir)/proto.str \ 276 $(srcdir)/../version.h \ 223 277 $(MKDOC) 224 cat $(srcdir)/../bfd-in.h >bfd.h 225 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h 226 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h 227 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h 228 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h 229 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h 230 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h 231 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h 232 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h 233 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h 234 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h 235 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h 236 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h 237 echo "#ifdef __cplusplus" >>bfd.h 238 echo "}" >>bfd.h 239 echo "#endif" >>bfd.h 240 echo "#endif" >>bfd.h 278 279 bfd.h: $(BFD_H_DEP) 280 echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 281 for file in $(BFD_H_DEP); do \ 282 case $$file in \ 283 *-in.h) cat $$file >> $@ ;; \ 284 */header.sed) break ;; \ 285 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 286 -e 's,$$,. */,' >> $@ ; \ 287 ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ 288 esac; \ 289 done 290 echo "#ifdef __cplusplus" >> $@ 291 echo "}" >> $@ 292 echo "#endif" >> $@ 293 echo "#endif" >> $@ 241 294 242 295 noinst_TEXINFOS = bfdint.texi … … 249 302 250 303 MAINTAINERCLEANFILES = $(DOCFILES) 304 305 # We want install to imply install-info as per GNU standards, despite the 306 # cygnus option. 307 install: install-info -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/Makefile.in
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 # Makefile.in generated automatically by automake 1.4 from Makefile.am2 3 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.1 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am 2 3 # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. 4 4 # This Makefile.in is free software; the Free Software Foundation 5 5 # gives unlimited permission to copy and/or distribute it, … … 116 116 all_backends = @all_backends@ 117 117 bfd_backends = @bfd_backends@ 118 bfd_default_target_size = @bfd_default_target_size@ 119 bfd_libs = @bfd_libs@ 118 120 bfd_machines = @bfd_machines@ 121 bfd_version = @bfd_version@ 122 bfd_version_string = @bfd_version_string@ 123 bfdincludedir = @bfdincludedir@ 124 bfdlibdir = @bfdlibdir@ 119 125 l = @l@ 120 126 tdefaults = @tdefaults@ … … 125 131 DOCFILES = aoutx.texi archive.texi archures.texi \ 126 132 bfdt.texi cache.texi coffcode.texi \ 127 core.texi elf.texi elfcode.texi format.texi libbfd.texi \ 133 core.texi elf.texi elfcode.texi format.texi \ 134 libbfd.texi bfdwin.texi bfdio.texi \ 128 135 opncls.texi reloc.texi section.texi \ 129 syms.texi targets.texi init.texi hash.texi linker.texi 136 syms.texi targets.texi init.texi hash.texi linker.texi \ 137 mmo.texi 130 138 131 139 132 140 PROTOS = archive.p archures.p bfd.p \ 133 141 core.p format.p \ 142 bfdio.p bfdwin.p \ 134 143 libbfd.p opncls.p reloc.p \ 135 144 section.p syms.p targets.p \ … … 144 153 SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ 145 154 $(srcdir)/../archures.c $(srcdir)/../bfd.c \ 155 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 146 156 $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ 147 157 $(srcdir)/../corefile.c $(srcdir)/../elf.c \ … … 150 160 $(srcdir)/../reloc.c $(srcdir)/../section.c \ 151 161 $(srcdir)/../syms.c $(srcdir)/../targets.c \ 152 $(srcdir)/../hash.c $(srcdir)/../linker.c 162 $(srcdir)/../hash.c $(srcdir)/../linker.c \ 163 $(srcdir)/../mmo.c 153 164 154 165 … … 156 167 $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ 157 168 $(srcdir)/../format.c $(srcdir)/../libbfd.c \ 169 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 158 170 $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ 159 171 $(srcdir)/../section.c $(srcdir)/../syms.c \ … … 162 174 163 175 SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ 176 $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ 164 177 $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ 165 178 $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ … … 172 185 173 186 MKDOC = chew$(EXEEXT_FOR_BUILD) 187 188 LIBBFD_H_DEP = \ 189 $(srcdir)/../libbfd-in.h \ 190 $(srcdir)/../init.c \ 191 $(srcdir)/../libbfd.c \ 192 $(srcdir)/../bfdio.c \ 193 $(srcdir)/../bfdwin.c \ 194 $(srcdir)/../cache.c \ 195 $(srcdir)/../reloc.c \ 196 $(srcdir)/../archures.c \ 197 $(srcdir)/../elf.c \ 198 $(srcdir)/header.sed \ 199 $(srcdir)/proto.str \ 200 $(MKDOC) 201 202 203 LIBCOFF_H_DEP = \ 204 $(srcdir)/../libcoff-in.h \ 205 $(srcdir)/../coffcode.h \ 206 $(srcdir)/header.sed \ 207 $(srcdir)/proto.str \ 208 $(MKDOC) 209 210 211 BFD_H_DEP = \ 212 $(srcdir)/../bfd-in.h \ 213 $(srcdir)/../init.c \ 214 $(srcdir)/../opncls.c \ 215 $(srcdir)/../libbfd.c \ 216 $(srcdir)/../bfdio.c \ 217 $(srcdir)/../bfdwin.c \ 218 $(srcdir)/../section.c \ 219 $(srcdir)/../archures.c \ 220 $(srcdir)/../reloc.c \ 221 $(srcdir)/../syms.c \ 222 $(srcdir)/../bfd.c \ 223 $(srcdir)/../archive.c \ 224 $(srcdir)/../corefile.c \ 225 $(srcdir)/../targets.c \ 226 $(srcdir)/../format.c \ 227 $(srcdir)/../linker.c \ 228 $(srcdir)/../simple.c \ 229 $(srcdir)/header.sed \ 230 $(srcdir)/proto.str \ 231 $(srcdir)/../version.h \ 232 $(MKDOC) 233 174 234 175 235 noinst_TEXINFOS = bfdint.texi … … 195 255 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) 196 256 197 TAR = tar257 TAR = gtar 198 258 GZIP_ENV = --best 199 259 all: all-redirect … … 281 341 list='$(INFO_DEPS)'; \ 282 342 for file in $$list; do \ 283 test -z "$ ii" \343 test -z "$$ii" \ 284 344 || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ 285 345 done … … 485 545 elfcode.texi: s-elfcode 486 546 547 s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str 548 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp 549 $(srcdir)/../../move-if-change mmo.tmp mmo.texi 550 touch s-mmo 551 mmo.texi: s-mmo 552 487 553 s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str 488 554 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp … … 497 563 libbfd.texi: s-libbfd 498 564 565 s-bfdio: $(MKDOC) $(srcdir)/../bfdio.c $(srcdir)/doc.str 566 ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp 567 $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi 568 touch s-bfdio 569 bfdio.texi: s-bfdio 570 571 s-bfdwin: $(MKDOC) $(srcdir)/../bfdwin.c $(srcdir)/doc.str 572 ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp 573 $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi 574 touch s-bfdwin 575 bfdwin.texi: s-bfdwin 576 499 577 s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str 500 578 ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp … … 545 623 linker.texi: s-linker 546 624 547 libbfd.h: $(srcdir)/../libbfd-in.h \ 548 $(srcdir)/../init.c \ 549 $(srcdir)/../libbfd.c \ 550 $(srcdir)/../cache.c \ 551 $(srcdir)/../reloc.c \ 552 $(srcdir)/../archures.c \ 553 $(srcdir)/proto.str \ 554 $(MKDOC) 555 cat $(srcdir)/../libbfd-in.h >libbfd.h 556 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h 557 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h 558 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h 559 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h 560 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h 561 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h 562 563 libcoff.h: $(srcdir)/../libcoff-in.h \ 564 $(srcdir)/../coffcode.h \ 565 $(srcdir)/proto.str \ 566 $(MKDOC) 567 cat $(srcdir)/../libcoff-in.h >libcoff.h 568 ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h 569 570 bfd.h: $(srcdir)/../bfd-in.h \ 571 $(srcdir)/../init.c \ 572 $(srcdir)/../opncls.c \ 573 $(srcdir)/../libbfd.c \ 574 $(srcdir)/../section.c \ 575 $(srcdir)/../archures.c \ 576 $(srcdir)/../reloc.c \ 577 $(srcdir)/../syms.c \ 578 $(srcdir)/../bfd.c \ 579 $(srcdir)/../archive.c \ 580 $(srcdir)/../corefile.c \ 581 $(srcdir)/../targets.c \ 582 $(srcdir)/../format.c \ 583 $(srcdir)/proto.str \ 584 $(MKDOC) 585 cat $(srcdir)/../bfd-in.h >bfd.h 586 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h 587 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h 588 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h 589 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h 590 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h 591 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h 592 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h 593 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h 594 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h 595 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h 596 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h 597 ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h 598 echo "#ifdef __cplusplus" >>bfd.h 599 echo "}" >>bfd.h 600 echo "#endif" >>bfd.h 601 echo "#endif" >>bfd.h 625 libbfd.h: $(LIBBFD_H_DEP) 626 echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 627 for file in $(LIBBFD_H_DEP); do \ 628 case $$file in \ 629 *-in.h) cat $$file >> $@ ;; \ 630 */header.sed) break ;; \ 631 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 632 -e 's,$$,. */,' >> $@ ; \ 633 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ 634 esac; \ 635 done 636 637 libcoff.h: $(LIBCOFF_H_DEP) 638 echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 639 for file in $(LIBCOFF_H_DEP); do \ 640 case $$file in \ 641 *-in.h) cat $$file >> $@ ;; \ 642 */header.sed) break ;; \ 643 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 644 -e 's,$$,. */,' >> $@ ; \ 645 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ 646 esac; \ 647 done 648 649 bfd.h: $(BFD_H_DEP) 650 echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ 651 for file in $(BFD_H_DEP); do \ 652 case $$file in \ 653 *-in.h) cat $$file >> $@ ;; \ 654 */header.sed) break ;; \ 655 *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ 656 -e 's,$$,. */,' >> $@ ; \ 657 ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ 658 esac; \ 659 done 660 echo "#ifdef __cplusplus" >> $@ 661 echo "}" >> $@ 662 echo "#endif" >> $@ 663 echo "#endif" >> $@ 664 665 # We want install to imply install-info as per GNU standards, despite the 666 # cygnus option. 667 install: install-info 602 668 603 669 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/aoutx.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 162 162 @strong{Synopsis} 163 163 @example 164 b oolean aout_@var{size}_mkobject, (bfd *abfd);164 bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); 165 165 @end example 166 166 @strong{Description}@* … … 188 188 @strong{Synopsis} 189 189 @example 190 b oolean aout_@var{size}_set_arch_mach,190 bfd_boolean aout_@var{size}_set_arch_mach, 191 191 (bfd *, 192 192 enum bfd_architecture arch, … … 202 202 @strong{Synopsis} 203 203 @example 204 b oolean aout_@var{size}_new_section_hook,204 bfd_boolean aout_@var{size}_new_section_hook, 205 205 (bfd *abfd, 206 206 asection *newsect)); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/archive.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 74 74 @strong{Synopsis} 75 75 @example 76 b oolean bfd_set_archive_head(bfd *output, bfd *new_head);76 bfd_boolean bfd_set_archive_head(bfd *output, bfd *new_head); 77 77 @end example 78 78 @strong{Description}@* -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/archures.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 36 36 enum bfd_architecture 37 37 @{ 38 bfd_arch_unknown, /* File arch not known */39 bfd_arch_obscure, /* Arch known, not one of these */38 bfd_arch_unknown, /* File arch not known. */ 39 bfd_arch_obscure, /* Arch known, not one of these. */ 40 40 bfd_arch_m68k, /* Motorola 68xxx */ 41 41 #define bfd_mach_m68000 1 … … 59 59 The exception is the "ca", which is 60 60 incompatible with all other machines except 61 "core". */61 "core". */ 62 62 63 63 #define bfd_mach_i960_core 1 … … 70 70 #define bfd_mach_i960_hx 8 71 71 72 bfd_arch_or32, /* OpenRISC 32 */ 73 72 74 bfd_arch_a29k, /* AMD 29000 */ 73 75 bfd_arch_sparc, /* SPARC */ … … 77 79 #define bfd_mach_sparc_sparclite 3 78 80 #define bfd_mach_sparc_v8plus 4 79 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */81 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 80 82 #define bfd_mach_sparc_sparclite_le 6 81 83 #define bfd_mach_sparc_v9 7 82 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */83 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */84 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */84 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 85 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 86 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 85 87 /* Nonzero if MACH has the v9 instruction set. */ 86 88 #define bfd_mach_sparc_v9_p(mach) \ … … 94 96 #define bfd_mach_mips4100 4100 95 97 #define bfd_mach_mips4111 4111 98 #define bfd_mach_mips4120 4120 96 99 #define bfd_mach_mips4300 4300 97 100 #define bfd_mach_mips4400 4400 … … 99 102 #define bfd_mach_mips4650 4650 100 103 #define bfd_mach_mips5000 5000 104 #define bfd_mach_mips5400 5400 105 #define bfd_mach_mips5500 5500 101 106 #define bfd_mach_mips6000 6000 102 107 #define bfd_mach_mips8000 8000 … … 104 109 #define bfd_mach_mips12000 12000 105 110 #define bfd_mach_mips16 16 106 #define bfd_mach_mips32 32107 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */108 111 #define bfd_mach_mips5 5 109 #define bfd_mach_mips64 64110 112 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ 113 #define bfd_mach_mipsisa32 32 114 #define bfd_mach_mipsisa32r2 33 115 #define bfd_mach_mipsisa64 64 111 116 bfd_arch_i386, /* Intel 386 */ 112 #define bfd_mach_i386_i386 0113 #define bfd_mach_i386_i8086 1114 #define bfd_mach_i386_i386_intel_syntax 2115 #define bfd_mach_x86_64 3116 #define bfd_mach_x86_64_intel_syntax 4117 #define bfd_mach_i386_i386 1 118 #define bfd_mach_i386_i8086 2 119 #define bfd_mach_i386_i386_intel_syntax 3 120 #define bfd_mach_x86_64 64 121 #define bfd_mach_x86_64_intel_syntax 65 117 122 bfd_arch_we32k, /* AT&T WE32xxx */ 118 123 bfd_arch_tahoe, /* CCI/Harris Tahoe */ … … 123 128 bfd_arch_convex, /* Convex */ 124 129 bfd_arch_m88k, /* Motorola 88xxx */ 130 bfd_arch_m98k, /* Motorola 98xxx */ 125 131 bfd_arch_pyramid, /* Pyramid Technology */ 126 bfd_arch_h8300, /* Hitachi H8/300 */ 127 #define bfd_mach_h8300 1 128 #define bfd_mach_h8300h 2 129 #define bfd_mach_h8300s 3 132 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ 133 #define bfd_mach_h8300 1 134 #define bfd_mach_h8300h 2 135 #define bfd_mach_h8300s 3 136 #define bfd_mach_h8300hn 4 137 #define bfd_mach_h8300sn 5 138 bfd_arch_pdp11, /* DEC PDP-11 */ 130 139 bfd_arch_powerpc, /* PowerPC */ 131 #define bfd_mach_ppc 0 140 #define bfd_mach_ppc 32 141 #define bfd_mach_ppc64 64 132 142 #define bfd_mach_ppc_403 403 133 143 #define bfd_mach_ppc_403gc 4030 … … 146 156 #define bfd_mach_ppc_rs64iii 643 147 157 #define bfd_mach_ppc_7400 7400 158 #define bfd_mach_ppc_e500 500 148 159 bfd_arch_rs6000, /* IBM RS/6000 */ 149 #define bfd_mach_rs6k 0160 #define bfd_mach_rs6k 6000 150 161 #define bfd_mach_rs6k_rs1 6001 151 162 #define bfd_mach_rs6k_rsc 6003 … … 153 164 bfd_arch_hppa, /* HP PA RISC */ 154 165 bfd_arch_d10v, /* Mitsubishi D10V */ 155 #define bfd_mach_d10v 0166 #define bfd_mach_d10v 1 156 167 #define bfd_mach_d10v_ts2 2 157 168 #define bfd_mach_d10v_ts3 3 158 169 bfd_arch_d30v, /* Mitsubishi D30V */ 170 bfd_arch_dlx, /* DLX */ 159 171 bfd_arch_m68hc11, /* Motorola 68HC11 */ 160 172 bfd_arch_m68hc12, /* Motorola 68HC12 */ 173 #define bfd_mach_m6812_default 0 174 #define bfd_mach_m6812 1 175 #define bfd_mach_m6812s 2 161 176 bfd_arch_z8k, /* Zilog Z8000 */ 162 177 #define bfd_mach_z8001 1 163 178 #define bfd_mach_z8002 2 164 bfd_arch_h8500, /* Hitachi H8/500*/165 bfd_arch_sh, /* Hitachi SH*/166 #define bfd_mach_sh 0179 bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ 180 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ 181 #define bfd_mach_sh 1 167 182 #define bfd_mach_sh2 0x20 168 183 #define bfd_mach_sh_dsp 0x2d 184 #define bfd_mach_sh2e 0x2e 169 185 #define bfd_mach_sh3 0x30 170 186 #define bfd_mach_sh3_dsp 0x3d 171 187 #define bfd_mach_sh3e 0x3e 172 188 #define bfd_mach_sh4 0x40 189 #define bfd_mach_sh5 0x50 173 190 bfd_arch_alpha, /* Dec Alpha */ 174 191 #define bfd_mach_alpha_ev4 0x10 175 192 #define bfd_mach_alpha_ev5 0x20 176 193 #define bfd_mach_alpha_ev6 0x30 177 bfd_arch_arm, /* Advanced Risc Machines ARM */ 194 bfd_arch_arm, /* Advanced Risc Machines ARM. */ 195 #define bfd_mach_arm_unknown 0 178 196 #define bfd_mach_arm_2 1 179 197 #define bfd_mach_arm_2a 2 … … 186 204 #define bfd_mach_arm_5TE 9 187 205 #define bfd_mach_arm_XScale 10 206 #define bfd_mach_arm_ep9312 11 207 #define bfd_mach_arm_iWMMXt 12 188 208 bfd_arch_ns32k, /* National Semiconductors ns32000 */ 189 209 bfd_arch_w65, /* WDC 65816 */ 190 210 bfd_arch_tic30, /* Texas Instruments TMS320C30 */ 211 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ 212 #define bfd_mach_tic3x 30 213 #define bfd_mach_tic4x 40 191 214 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ 192 215 bfd_arch_tic80, /* TI TMS320c80 (MVP) */ 193 216 bfd_arch_v850, /* NEC V850 */ 194 #define bfd_mach_v850 0217 #define bfd_mach_v850 1 195 218 #define bfd_mach_v850e 'E' 196 #define bfd_mach_v850ea 'A'197 219 bfd_arch_arc, /* ARC Cores */ 198 #define bfd_mach_arc_5 0199 #define bfd_mach_arc_6 1200 #define bfd_mach_arc_7 2201 #define bfd_mach_arc_8 3202 bfd_arch_m32r, /* Mitsubishi M32R/D*/203 #define bfd_mach_m32r 0 /* backwards compatibility*/220 #define bfd_mach_arc_5 5 221 #define bfd_mach_arc_6 6 222 #define bfd_mach_arc_7 7 223 #define bfd_mach_arc_8 8 224 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ 225 #define bfd_mach_m32r 1 /* For backwards compatibility. */ 204 226 #define bfd_mach_m32rx 'x' 205 227 bfd_arch_mn10200, /* Matsushita MN10200 */ … … 209 231 bfd_arch_fr30, 210 232 #define bfd_mach_fr30 0x46523330 233 bfd_arch_frv, 234 #define bfd_mach_frv 1 235 #define bfd_mach_frvsimple 2 236 #define bfd_mach_fr300 300 237 #define bfd_mach_fr400 400 238 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ 239 #define bfd_mach_fr500 500 211 240 bfd_arch_mcore, 212 241 bfd_arch_ia64, /* HP/Intel ia64 */ 213 #define bfd_mach_ia64_elf64 0 214 #define bfd_mach_ia64_elf32 1 242 #define bfd_mach_ia64_elf64 64 243 #define bfd_mach_ia64_elf32 32 244 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 245 #define bfd_mach_ip2022 1 246 #define bfd_mach_ip2022ext 2 247 bfd_arch_iq2000, /* Vitesse IQ2000. */ 248 #define bfd_mach_iq2000 1 249 #define bfd_mach_iq10 2 215 250 bfd_arch_pj, 216 bfd_arch_avr, /* Atmel AVR microcontrollers */251 bfd_arch_avr, /* Atmel AVR microcontrollers. */ 217 252 #define bfd_mach_avr1 1 218 253 #define bfd_mach_avr2 2 … … 221 256 #define bfd_mach_avr5 5 222 257 bfd_arch_cris, /* Axis CRIS */ 258 bfd_arch_s390, /* IBM s390 */ 259 #define bfd_mach_s390_31 31 260 #define bfd_mach_s390_64 64 261 bfd_arch_openrisc, /* OpenRISC */ 262 bfd_arch_mmix, /* Donald Knuth's educational processor. */ 263 bfd_arch_xstormy16, 264 #define bfd_mach_xstormy16 1 265 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 266 #define bfd_mach_msp110 110 267 #define bfd_mach_msp11 11 268 #define bfd_mach_msp12 12 269 #define bfd_mach_msp13 13 270 #define bfd_mach_msp14 14 271 #define bfd_mach_msp41 41 272 #define bfd_mach_msp31 31 273 #define bfd_mach_msp32 32 274 #define bfd_mach_msp33 33 275 #define bfd_mach_msp43 43 276 #define bfd_mach_msp44 44 277 #define bfd_mach_msp15 15 278 #define bfd_mach_msp16 16 279 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 280 #define bfd_mach_xtensa 1 223 281 bfd_arch_last 224 282 @}; … … 243 301 const char *printable_name; 244 302 unsigned int section_align_power; 245 /* True if this is the default machine for the architecture. */ 246 boolean the_default; 303 /* TRUE if this is the default machine for the architecture. 304 The default arch should be the first entry for an arch so that 305 all the entries for that arch can be accessed via @code{next}. */ 306 bfd_boolean the_default; 247 307 const struct bfd_arch_info * (*compatible) 248 308 PARAMS ((const struct bfd_arch_info *a, 249 309 const struct bfd_arch_info *b)); 250 310 251 b oolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));311 bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); 252 312 253 313 const struct bfd_arch_info *next; 254 @} bfd_arch_info_type; 314 @} 315 bfd_arch_info_type; 316 255 317 @end example 256 318 … … 292 354 const bfd_arch_info_type *bfd_arch_get_compatible( 293 355 const bfd *abfd, 294 const bfd *bbfd); 295 @end example 296 @strong{Description}@* 297 Determine whether two BFDs' 298 architectures and machine types are compatible. Calculates 299 the lowest common denominator between the two architectures 300 and machine types implied by the BFDs and returns a pointer to 301 an @code{arch_info} structure describing the compatible machine. 356 const bfd *bbfd, 357 bfd_boolean accept_unknowns); 358 @end example 359 @strong{Description}@* 360 Determine whether two BFDs' architectures and machine types 361 are compatible. Calculates the lowest common denominator 362 between the two architectures and machine types implied by 363 the BFDs and returns a pointer to an @code{arch_info} structure 364 describing the compatible machine. 302 365 303 366 @findex bfd_default_arch_struct … … 326 389 @strong{Synopsis} 327 390 @example 328 b oolean bfd_default_set_arch_mach(bfd *abfd,391 bfd_boolean bfd_default_set_arch_mach(bfd *abfd, 329 392 enum bfd_architecture arch, 330 393 unsigned long mach); … … 391 454 @strong{Synopsis} 392 455 @example 393 b oolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);456 bfd_boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); 394 457 @end example 395 458 @strong{Description}@* -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 18 18 19 19 Indirect: 20 bfd.info-1: 680 21 bfd.info-2: 38513 22 bfd.info-3: 83193 23 bfd.info-4: 131325 24 bfd.info-5: 180785 25 bfd.info-6: 215030 26 bfd.info-7: 261441 20 bfd.info-1: 692 21 bfd.info-2: 41803 22 bfd.info-3: 90229 23 bfd.info-4: 106012 24 bfd.info-5: 155933 25 bfd.info-6: 200434 26 bfd.info-7: 244988 27 bfd.info-8: 284745 28 bfd.info-9: 304445 27 29 28 30 Tag Table: 29 31 (Indirect) 30 Node: Top680 31 Node: Overview1012 32 Node: History2062 33 Node: How It Works3003 34 Node: What BFD Version 2 Can Do4541 35 Node: BFD information loss5855 36 Node: Canonical format8378 37 Node: BFD front end12739 38 Node: Memory Usage32611 39 Node: Initialization33834 40 Node: Sections34211 41 Node: Section Input34689 42 Node: Section Output36045 43 Node: typedef asection38513 44 Node: section prototypes54385 45 Node: Symbols61070 46 Node: Reading Symbols62660 47 Node: Writing Symbols63834 48 Node: Mini Symbols65524 49 Node: typedef asymbol66489 50 Node: symbol handling functions71718 51 Node: Archives76045 52 Node: Formats79663 53 Node: Relocations82473 54 Node: typedef arelent83193 55 Node: howto manager99352 56 Node: Core Files130304 57 Node: Targets131325 58 Node: bfd_target133288 59 Node: Architectures152202 60 Node: Opening and Closing167609 61 Node: Internal172006 62 Node: File Caching178006 63 Node: Linker Functions180785 64 Node: Creating a Linker Hash Table182451 65 Node: Adding Symbols to the Hash Table184179 66 Node: Differing file formats185069 67 Node: Adding symbols from an object file186802 68 Node: Adding symbols from an archive188938 69 Node: Performing the Final Link191337 70 Node: Information provided by the linker192568 71 Node: Relocating the section contents193704 72 Node: Writing the symbol table195441 73 Node: Hash Tables198035 74 Node: Creating and Freeing a Hash Table199226 75 Node: Looking Up or Entering a String200383 76 Node: Traversing a Hash Table201625 77 Node: Deriving a New Hash Table Type202403 78 Node: Define the Derived Structures203458 79 Node: Write the Derived Creation Routine204524 80 Node: Write Other Derived Routines207223 81 Node: BFD back ends208523 82 Node: What to Put Where208767 83 Node: aout208905 84 Node: coff215030 85 Node: elf242186 86 Node: GNU Free Documentation License243019 87 Node: Index261441 32 Node: Top692 33 Node: Overview1024 34 Node: History2074 35 Node: How It Works3015 36 Node: What BFD Version 2 Can Do4555 37 Node: BFD information loss5865 38 Node: Canonical format8388 39 Node: BFD front end12749 40 Node: Memory Usage35901 41 Node: Initialization37124 42 Node: Sections37501 43 Node: Section Input37979 44 Node: Section Output39335 45 Node: typedef asection41803 46 Node: section prototypes60730 47 Node: Symbols67894 48 Node: Reading Symbols69484 49 Node: Writing Symbols70625 50 Node: Mini Symbols72354 51 Node: typedef asymbol73319 52 Node: symbol handling functions78360 53 Node: Archives83052 54 Node: Formats86674 55 Node: Relocations89509 56 Node: typedef arelent90229 57 Node: howto manager106012 58 Node: Core Files152945 59 Node: Targets153970 60 Node: bfd_target155933 61 Node: Architectures175846 62 Node: Opening and Closing193984 63 Node: Internal200434 64 Node: File Caching207918 65 Node: Linker Functions210705 66 Node: Creating a Linker Hash Table212371 67 Node: Adding Symbols to the Hash Table214099 68 Node: Differing file formats214989 69 Node: Adding symbols from an object file216722 70 Node: Adding symbols from an archive218858 71 Node: Performing the Final Link221257 72 Node: Information provided by the linker222488 73 Node: Relocating the section contents223624 74 Node: Writing the symbol table225361 75 Node: Hash Tables227959 76 Node: Creating and Freeing a Hash Table229150 77 Node: Looking Up or Entering a String230307 78 Node: Traversing a Hash Table231549 79 Node: Deriving a New Hash Table Type232327 80 Node: Define the Derived Structures233382 81 Node: Write the Derived Creation Routine234448 82 Node: Write Other Derived Routines237147 83 Node: BFD back ends238447 84 Node: What to Put Where238713 85 Node: aout238851 86 Node: coff244988 87 Node: elf269909 88 Node: mmo270746 89 Node: File layout271669 90 Node: Symbol-table277307 91 Node: mmo section mapping281102 92 Node: GNU Free Documentation License284745 93 Node: Index304445 88 94 89 95 End Tag Table -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-1
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 107 107 #include "bfd.h" 108 108 109 unsigned int number_of_sections (abfd)109 unsigned int number_of_sections (abfd) 110 110 bfd *abfd; 111 111 { 112 return bfd_count_sections (abfd);112 return bfd_count_sections (abfd); 113 113 } 114 114 … … 139 139 access elements of the object file's data structures. 140 140 141 As different information from the theobject files is required, BFD141 As different information from the object files is required, BFD 142 142 reads from different sections of the file and processes them. For 143 143 example, a very common operation for the linker is processing symbol … … 288 288 File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top 289 289 290 BFD front end290 BFD Front End 291 291 ************* 292 292 … … 302 302 303 303 304 struct _bfd304 struct bfd 305 305 { 306 /* The filename the application opened the BFD with. */ 307 CONST char *filename; 308 309 /* A pointer to the target jump table. */ 310 const struct bfd_target *xvec; 311 312 /* To avoid dragging too many header files into every file that 313 includes ``bfd.h'', IOSTREAM has been declared as a "char 314 *", and MTIME as a "long". Their correct types, to which they 315 are cast when used, are "FILE *" and "time_t". The iostream 316 is the result of an fopen on the filename. However, if the 317 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 318 to a bfd_in_memory struct. */ 319 PTR iostream; 320 321 /* Is the file descriptor being cached? That is, can it be closed as 322 needed, and re-opened when accessed later? */ 323 324 boolean cacheable; 325 326 /* Marks whether there was a default target specified when the 327 BFD was opened. This is used to select which matching algorithm 328 to use to choose the back end. */ 329 330 boolean target_defaulted; 331 332 /* The caching routines use these to maintain a 333 least-recently-used list of BFDs */ 334 335 struct _bfd *lru_prev, *lru_next; 336 337 /* When a file is closed by the caching routines, BFD retains 338 state information on the file here: */ 339 340 file_ptr where; 341 342 /* and here: (``once'' means at least once) */ 343 344 boolean opened_once; 345 346 /* Set if we have a locally maintained mtime value, rather than 347 getting it from the file each time: */ 348 349 boolean mtime_set; 350 351 /* File modified time, if mtime_set is true: */ 352 353 long mtime; 354 355 /* Reserved for an unimplemented file locking extension.*/ 356 357 int ifd; 358 359 /* The format which belongs to the BFD. (object, core, etc.) */ 360 361 bfd_format format; 362 363 /* The direction the BFD was opened with*/ 364 365 enum bfd_direction {no_direction = 0, 366 read_direction = 1, 367 write_direction = 2, 368 both_direction = 3} direction; 369 370 /* Format_specific flags*/ 371 372 flagword flags; 373 374 /* Currently my_archive is tested before adding origin to 375 anything. I believe that this can become always an add of 376 origin, with origin set to 0 for non archive files. */ 377 378 file_ptr origin; 379 380 /* Remember when output has begun, to stop strange things 381 from happening. */ 382 boolean output_has_begun; 383 384 /* Pointer to linked list of sections*/ 385 struct sec *sections; 386 387 /* The number of sections */ 388 unsigned int section_count; 389 390 /* Stuff only useful for object files: 391 The start address. */ 392 bfd_vma start_address; 393 394 /* Used for input and output*/ 395 unsigned int symcount; 396 397 /* Symbol table for output BFD (with symcount entries) */ 398 struct symbol_cache_entry **outsymbols; 399 400 /* Pointer to structure which contains architecture information*/ 401 const struct bfd_arch_info *arch_info; 402 403 /* Stuff only useful for archives:*/ 404 PTR arelt_data; 405 struct _bfd *my_archive; /* The containing archive BFD. */ 406 struct _bfd *next; /* The next BFD in the archive. */ 407 struct _bfd *archive_head; /* The first BFD in the archive. */ 408 boolean has_armap; 409 410 /* A chain of BFD structures involved in a link. */ 411 struct _bfd *link_next; 412 413 /* A field used by _bfd_generic_link_add_archive_symbols. This will 414 be used only for archive elements. */ 415 int archive_pass; 416 417 /* Used by the back end to hold private data. */ 418 419 union 420 { 306 /* A unique identifier of the BFD */ 307 unsigned int id; 308 309 /* The filename the application opened the BFD with. */ 310 const char *filename; 311 312 /* A pointer to the target jump table. */ 313 const struct bfd_target *xvec; 314 315 /* To avoid dragging too many header files into every file that 316 includes ``bfd.h'', IOSTREAM has been declared as a "char *", 317 and MTIME as a "long". Their correct types, to which they 318 are cast when used, are "FILE *" and "time_t". The iostream 319 is the result of an fopen on the filename. However, if the 320 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 321 to a bfd_in_memory struct. */ 322 PTR iostream; 323 324 /* Is the file descriptor being cached? That is, can it be closed as 325 needed, and re-opened when accessed later? */ 326 bfd_boolean cacheable; 327 328 /* Marks whether there was a default target specified when the 329 BFD was opened. This is used to select which matching algorithm 330 to use to choose the back end. */ 331 bfd_boolean target_defaulted; 332 333 /* The caching routines use these to maintain a 334 least-recently-used list of BFDs. */ 335 struct bfd *lru_prev, *lru_next; 336 337 /* When a file is closed by the caching routines, BFD retains 338 state information on the file here... */ 339 ufile_ptr where; 340 341 /* ... and here: (``once'' means at least once). */ 342 bfd_boolean opened_once; 343 344 /* Set if we have a locally maintained mtime value, rather than 345 getting it from the file each time. */ 346 bfd_boolean mtime_set; 347 348 /* File modified time, if mtime_set is TRUE. */ 349 long mtime; 350 351 /* Reserved for an unimplemented file locking extension. */ 352 int ifd; 353 354 /* The format which belongs to the BFD. (object, core, etc.) */ 355 bfd_format format; 356 357 /* The direction with which the BFD was opened. */ 358 enum bfd_direction 359 { 360 no_direction = 0, 361 read_direction = 1, 362 write_direction = 2, 363 both_direction = 3 364 } 365 direction; 366 367 /* Format_specific flags. */ 368 flagword flags; 369 370 /* Currently my_archive is tested before adding origin to 371 anything. I believe that this can become always an add of 372 origin, with origin set to 0 for non archive files. */ 373 ufile_ptr origin; 374 375 /* Remember when output has begun, to stop strange things 376 from happening. */ 377 bfd_boolean output_has_begun; 378 379 /* A hash table for section names. */ 380 struct bfd_hash_table section_htab; 381 382 /* Pointer to linked list of sections. */ 383 struct sec *sections; 384 385 /* The place where we add to the section list. */ 386 struct sec **section_tail; 387 388 /* The number of sections. */ 389 unsigned int section_count; 390 391 /* Stuff only useful for object files: 392 The start address. */ 393 bfd_vma start_address; 394 395 /* Used for input and output. */ 396 unsigned int symcount; 397 398 /* Symbol table for output BFD (with symcount entries). */ 399 struct symbol_cache_entry **outsymbols; 400 401 /* Used for slurped dynamic symbol tables. */ 402 unsigned int dynsymcount; 403 404 /* Pointer to structure which contains architecture information. */ 405 const struct bfd_arch_info *arch_info; 406 407 /* Stuff only useful for archives. */ 408 PTR arelt_data; 409 struct bfd *my_archive; /* The containing archive BFD. */ 410 struct bfd *next; /* The next BFD in the archive. */ 411 struct bfd *archive_head; /* The first BFD in the archive. */ 412 bfd_boolean has_armap; 413 414 /* A chain of BFD structures involved in a link. */ 415 struct bfd *link_next; 416 417 /* A field used by _bfd_generic_link_add_archive_symbols. This will 418 be used only for archive elements. */ 419 int archive_pass; 420 421 /* Used by the back end to hold private data. */ 422 union 423 { 421 424 struct aout_data_struct *aout_data; 422 425 struct artdata *aout_ar_data; … … 435 438 struct nlm_obj_tdata *nlm_obj_data; 436 439 struct bout_data_struct *bout_data; 440 struct mmo_data_struct *mmo_data; 437 441 struct sun_core_struct *sun_core_data; 438 442 struct sco5_core_struct *sco5_core_data; … … 447 451 struct versados_data_struct *versados_data; 448 452 struct netbsd_core_struct *netbsd_core_data; 453 struct mach_o_data_struct *mach_o_data; 454 struct mach_o_fat_data_struct *mach_o_fat_data; 455 struct bfd_pef_data_struct *pef_data; 456 struct bfd_pef_xlib_data_struct *pef_xlib_data; 457 struct bfd_sym_data_struct *sym_data; 449 458 PTR any; 450 } tdata; 451 452 /* Used by the application to hold private data*/ 453 PTR usrdata; 459 } 460 tdata; 461 462 /* Used by the application to hold private data. */ 463 PTR usrdata; 454 464 455 465 /* Where all the allocated stuff under this BFD goes. This is a 456 466 struct objalloc *, but we use PTR to avoid requiring the inclusion of 457 467 objalloc.h. */ 458 PTR memory;468 PTR memory; 459 469 }; 460 470 … … 484 494 bfd_error_invalid_target, 485 495 bfd_error_wrong_format, 496 bfd_error_wrong_object_format, 486 497 bfd_error_invalid_operation, 487 498 bfd_error_no_memory, … … 499 510 bfd_error_file_too_big, 500 511 bfd_error_invalid_error_code 501 } bfd_error_type; 512 } 513 bfd_error_type; 502 514 503 515 `bfd_get_error' … … 521 533 522 534 *Synopsis* 523 CONSTchar *bfd_errmsg (bfd_error_type error_tag);535 const char *bfd_errmsg (bfd_error_type error_tag); 524 536 *Description* 525 537 Return a string describing the error ERROR_TAG, or the system error if … … 530 542 531 543 *Synopsis* 532 void bfd_perror ( CONSTchar *message);544 void bfd_perror (const char *message); 533 545 *Description* 534 546 Print to the standard error stream a string describing the last BFD … … 576 588 Return the BFD error handler function. 577 589 590 `bfd_archive_filename' 591 ...................... 592 593 *Synopsis* 594 const char *bfd_archive_filename (bfd *); 595 *Description* 596 For a BFD that is a component of an archive, returns a string with both 597 the archive name and file name. For other BFDs, just returns the file 598 name. 599 578 600 Symbols 579 601 ======= … … 583 605 584 606 *Synopsis* 585 long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);607 long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); 586 608 *Description* 587 609 Return the number of bytes required to store the relocation information … … 612 634 *Synopsis* 613 635 void bfd_set_reloc 614 (bfd *abfd, asection *sec, arelent **rel, unsigned int count) 636 (bfd *abfd, asection *sec, arelent **rel, unsigned int count); 615 637 *Description* 616 638 Set the relocation pointer and count within section SEC to the values … … 621 643 622 644 *Synopsis* 623 b oolean bfd_set_file_flags(bfd *abfd, flagword flags);645 bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); 624 646 *Description* 625 647 Set the flag word in the BFD ABFD to the value FLAGS. … … 670 692 671 693 *Synopsis* 672 b oolean bfd_set_start_address(bfd *abfd, bfd_vma vma);694 bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); 673 695 *Description* 674 696 Make VMA the entry point of output BFD ABFD. 675 697 676 698 *Returns* 677 Returns `true' on success, `false' otherwise. 699 Returns `TRUE' on success, `FALSE' otherwise. 700 701 `bfd_get_gp_size' 702 ................. 703 704 *Synopsis* 705 unsigned int bfd_get_gp_size (bfd *abfd); 706 *Description* 707 Return the maximum size of objects to be optimized using the GP 708 register under MIPS ECOFF. This is typically set by the `-G' argument 709 to the compiler, assembler or linker. 710 711 `bfd_set_gp_size' 712 ................. 713 714 *Synopsis* 715 void bfd_set_gp_size (bfd *abfd, unsigned int i); 716 *Description* 717 Set the maximum size of objects to be optimized using the GP register 718 under ECOFF or MIPS ELF. This is typically set by the `-G' argument to 719 the compiler, assembler or linker. 720 721 `bfd_scan_vma' 722 .............. 723 724 *Synopsis* 725 bfd_vma bfd_scan_vma (const char *string, const char **end, int base); 726 *Description* 727 Convert, like `strtoul', a numerical expression STRING into a `bfd_vma' 728 integer, and return that integer. (Though without as many bells and 729 whistles as `strtoul'.) The expression is assumed to be unsigned 730 (i.e., positive). If given a BASE, it is used as the base for 731 conversion. A base of 0 causes the function to interpret the string in 732 hex if a leading "0x" or "0X" is found, otherwise in octal if a leading 733 zero is found, otherwise in decimal. 734 735 If the value would overflow, the maximum `bfd_vma' value is returned. 736 737 `bfd_copy_private_bfd_data' 738 ........................... 739 740 *Synopsis* 741 bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); 742 *Description* 743 Copy private BFD information from the BFD IBFD to the the BFD OBFD. 744 Return `TRUE' on success, `FALSE' on error. Possible error returns are: 745 746 * `bfd_error_no_memory' - Not enough memory exists to create private 747 data for OBFD. 748 749 #define bfd_copy_private_bfd_data(ibfd, obfd) \ 750 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ 751 (ibfd, obfd)) 752 753 `bfd_merge_private_bfd_data' 754 ............................ 755 756 *Synopsis* 757 bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); 758 *Description* 759 Merge private BFD information from the BFD IBFD to the the output file 760 BFD OBFD when linking. Return `TRUE' on success, `FALSE' on error. 761 Possible error returns are: 762 763 * `bfd_error_no_memory' - Not enough memory exists to create private 764 data for OBFD. 765 766 #define bfd_merge_private_bfd_data(ibfd, obfd) \ 767 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ 768 (ibfd, obfd)) 769 770 `bfd_set_private_flags' 771 ....................... 772 773 *Synopsis* 774 bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); 775 *Description* 776 Set private BFD flag information in the BFD ABFD. Return `TRUE' on 777 success, `FALSE' on error. Possible error returns are: 778 779 * `bfd_error_no_memory' - Not enough memory exists to create private 780 data for OBFD. 781 782 #define bfd_set_private_flags(abfd, flags) \ 783 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) 784 785 `Other functions' 786 ................. 787 788 *Description* 789 The following functions exist but have not yet been documented. 790 #define bfd_sizeof_headers(abfd, reloc) \ 791 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) 792 793 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ 794 BFD_SEND (abfd, _bfd_find_nearest_line, \ 795 (abfd, sec, syms, off, file, func, line)) 796 797 #define bfd_debug_info_start(abfd) \ 798 BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) 799 800 #define bfd_debug_info_end(abfd) \ 801 BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) 802 803 #define bfd_debug_info_accumulate(abfd, section) \ 804 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 805 806 #define bfd_stat_arch_elt(abfd, stat) \ 807 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) 808 809 #define bfd_update_armap_timestamp(abfd) \ 810 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) 811 812 #define bfd_set_arch_mach(abfd, arch, mach)\ 813 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) 814 815 #define bfd_relax_section(abfd, section, link_info, again) \ 816 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) 817 818 #define bfd_gc_sections(abfd, link_info) \ 819 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) 820 821 #define bfd_merge_sections(abfd, link_info) \ 822 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) 823 824 #define bfd_discard_group(abfd, sec) \ 825 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) 826 827 #define bfd_link_hash_table_create(abfd) \ 828 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) 829 830 #define bfd_link_hash_table_free(abfd, hash) \ 831 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) 832 833 #define bfd_link_add_symbols(abfd, info) \ 834 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) 835 836 #define bfd_link_just_syms(sec, info) \ 837 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) 838 839 #define bfd_final_link(abfd, info) \ 840 BFD_SEND (abfd, _bfd_final_link, (abfd, info)) 841 842 #define bfd_free_cached_info(abfd) \ 843 BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) 844 845 #define bfd_get_dynamic_symtab_upper_bound(abfd) \ 846 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) 847 848 #define bfd_print_private_bfd_data(abfd, file)\ 849 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) 850 851 #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ 852 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) 853 854 #define bfd_get_dynamic_reloc_upper_bound(abfd) \ 855 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) 856 857 #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ 858 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) 859 860 extern bfd_byte *bfd_get_relocated_section_contents 861 PARAMS ((bfd *, struct bfd_link_info *, 862 struct bfd_link_order *, bfd_byte *, 863 bfd_boolean, asymbol **)); 864 865 `bfd_alt_mach_code' 866 ................... 867 868 *Synopsis* 869 bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); 870 *Description* 871 When more than one machine code number is available for the same 872 machine type, this function can be used to switch between the preferred 873 one (alternative == 0) and any others. Currently, only ELF supports 874 this feature, with up to two alternate machine codes. 875 876 struct bfd_preserve 877 { 878 PTR marker; 879 PTR tdata; 880 flagword flags; 881 const struct bfd_arch_info *arch_info; 882 struct sec *sections; 883 struct sec **section_tail; 884 unsigned int section_count; 885 struct bfd_hash_table section_htab; 886 }; 887 888 `bfd_preserve_save' 889 ................... 890 891 *Synopsis* 892 bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); 893 *Description* 894 When testing an object for compatibility with a particular target 895 back-end, the back-end object_p function needs to set up certain fields 896 in the bfd on successfully recognizing the object. This typically 897 happens in a piecemeal fashion, with failures possible at many points. 898 On failure, the bfd is supposed to be restored to its initial state, 899 which is virtually impossible. However, restoring a subset of the bfd 900 state works in practice. This function stores the subset and 901 reinitializes the bfd. 902 903 `bfd_preserve_restore' 904 ...................... 905 906 *Synopsis* 907 void bfd_preserve_restore (bfd *, struct bfd_preserve *); 908 *Description* 909 This function restores bfd state saved by bfd_preserve_save. If MARKER 910 is non-NULL in struct bfd_preserve then that block and all subsequently 911 bfd_alloc'd memory is freed. 912 913 `bfd_preserve_finish' 914 ..................... 915 916 *Synopsis* 917 void bfd_preserve_finish (bfd *, struct bfd_preserve *); 918 *Description* 919 This function should be called when the bfd state saved by 920 bfd_preserve_save is no longer needed. ie. when the back-end object_p 921 function returns with success. 678 922 679 923 `bfd_get_mtime' … … 714 958 to read. This function at least allows us to answer the quesion, "is 715 959 the size reasonable?". 716 717 `bfd_get_gp_size'718 .................719 720 *Synopsis*721 int bfd_get_gp_size(bfd *abfd);722 *Description*723 Return the maximum size of objects to be optimized using the GP724 register under MIPS ECOFF. This is typically set by the `-G' argument725 to the compiler, assembler or linker.726 727 `bfd_set_gp_size'728 .................729 730 *Synopsis*731 void bfd_set_gp_size(bfd *abfd, int i);732 *Description*733 Set the maximum size of objects to be optimized using the GP register734 under ECOFF or MIPS ELF. This is typically set by the `-G' argument to735 the compiler, assembler or linker.736 737 `bfd_scan_vma'738 ..............739 740 *Synopsis*741 bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base);742 *Description*743 Convert, like `strtoul', a numerical expression STRING into a `bfd_vma'744 integer, and return that integer. (Though without as many bells and745 whistles as `strtoul'.) The expression is assumed to be unsigned746 (i.e., positive). If given a BASE, it is used as the base for747 conversion. A base of 0 causes the function to interpret the string in748 hex if a leading "0x" or "0X" is found, otherwise in octal if a leading749 zero is found, otherwise in decimal.750 751 Overflow is not detected.752 753 `bfd_copy_private_bfd_data'754 ...........................755 756 *Synopsis*757 boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);758 *Description*759 Copy private BFD information from the BFD IBFD to the the BFD OBFD.760 Return `true' on success, `false' on error. Possible error returns are:761 762 * `bfd_error_no_memory' - Not enough memory exists to create private763 data for OBFD.764 765 #define bfd_copy_private_bfd_data(ibfd, obfd) \766 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \767 (ibfd, obfd))768 769 `bfd_merge_private_bfd_data'770 ............................771 772 *Synopsis*773 boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);774 *Description*775 Merge private BFD information from the BFD IBFD to the the output file776 BFD OBFD when linking. Return `true' on success, `false' on error.777 Possible error returns are:778 779 * `bfd_error_no_memory' - Not enough memory exists to create private780 data for OBFD.781 782 #define bfd_merge_private_bfd_data(ibfd, obfd) \783 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \784 (ibfd, obfd))785 786 `bfd_set_private_flags'787 .......................788 789 *Synopsis*790 boolean bfd_set_private_flags(bfd *abfd, flagword flags);791 *Description*792 Set private BFD flag information in the BFD ABFD. Return `true' on793 success, `false' on error. Possible error returns are:794 795 * `bfd_error_no_memory' - Not enough memory exists to create private796 data for OBFD.797 798 #define bfd_set_private_flags(abfd, flags) \799 BFD_SEND (abfd, _bfd_set_private_flags, \800 (abfd, flags))801 802 `stuff'803 .......804 805 *Description*806 Stuff which should be documented:807 #define bfd_sizeof_headers(abfd, reloc) \808 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))809 810 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \811 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))812 813 /* Do these three do anything useful at all, for any back end? */814 #define bfd_debug_info_start(abfd) \815 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))816 817 #define bfd_debug_info_end(abfd) \818 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))819 820 #define bfd_debug_info_accumulate(abfd, section) \821 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))822 823 824 #define bfd_stat_arch_elt(abfd, stat) \825 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))826 827 #define bfd_update_armap_timestamp(abfd) \828 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))829 830 #define bfd_set_arch_mach(abfd, arch, mach)\831 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))832 833 #define bfd_relax_section(abfd, section, link_info, again) \834 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))835 836 #define bfd_gc_sections(abfd, link_info) \837 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))838 839 #define bfd_link_hash_table_create(abfd) \840 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))841 842 #define bfd_link_add_symbols(abfd, info) \843 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))844 845 #define bfd_final_link(abfd, info) \846 BFD_SEND (abfd, _bfd_final_link, (abfd, info))847 848 #define bfd_free_cached_info(abfd) \849 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))850 851 #define bfd_get_dynamic_symtab_upper_bound(abfd) \852 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))853 854 #define bfd_print_private_bfd_data(abfd, file)\855 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))856 857 #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \858 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))859 860 #define bfd_get_dynamic_reloc_upper_bound(abfd) \861 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))862 863 #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \864 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))865 866 extern bfd_byte *bfd_get_relocated_section_contents867 PARAMS ((bfd *, struct bfd_link_info *,868 struct bfd_link_order *, bfd_byte *,869 boolean, asymbol **));870 960 871 961 * Menu: … … 890 980 File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: BFD front end, Up: BFD front end 891 981 892 Memory usage982 Memory Usage 893 983 ============ 894 984 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-2
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 46 46 /* The name of the section; the name isn't a copy, the pointer is 47 47 the same as that passed to bfd_make_section. */ 48 49 48 const char *name; 50 49 51 50 /* A unique sequence number. */ 52 53 51 int id; 54 52 55 /* Which section is it; 0..nth. */ 56 53 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ 57 54 int index; 58 55 59 56 /* The next section in the list belonging to the BFD, or NULL. */ 60 61 57 struct sec *next; 62 58 … … 64 60 flags are read in from the object file, and some are 65 61 synthesized from other information. */ 66 67 62 flagword flags; 68 63 … … 81 76 #define SEC_RELOC 0x004 82 77 83 #if 0 /* Obsolete ? */ 84 #define SEC_BALIGN 0x008 85 #endif 78 /* ELF reserves 4 processor specific bits and 8 operating system 79 specific bits in sh_flags; at present we can get away with just 80 one in communicating between the assembler and BFD, but this 81 isn't a good long-term solution. */ 82 #define SEC_ARCH_BIT_0 0x008 86 83 87 84 /* A signal to the OS that the section contains read only data. */ … … 109 106 #define SEC_CONSTRUCTOR 0x100 110 107 111 /* The section is a constructor, and should be placed at the112 end of the text, data, or bss section(?). */113 #define SEC_CONSTRUCTOR_TEXT 0x1100114 #define SEC_CONSTRUCTOR_DATA 0x2100115 #define SEC_CONSTRUCTOR_BSS 0x3100116 117 108 /* The section has contents - a data section could be 118 109 `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be … … 135 126 #define SEC_COFF_SHARED_LIBRARY 0x800 136 127 128 /* The section contains thread local data. */ 129 #define SEC_THREAD_LOCAL 0x1000 130 137 131 /* The section has GOT references. This flag is only for the 138 132 linker, and is currently only used by the elf32-hppa back end. … … 166 160 #define SEC_EXCLUDE 0x40000 167 161 168 /* The contents of this section are to be sorted by the 169 based on the address specified in the associated symbol 170 table. */ 162 /* The contents of this section are to be sorted based on the sum of 163 the symbol and addend values specified by the associated relocation 164 entries. Entries without associated relocation entries will be 165 appended to the end of the section in an unspecified order. */ 171 166 #define SEC_SORT_ENTRIES 0x80000 172 167 … … 226 221 #define SEC_CLINK 0x10000000 227 222 223 /* Attempt to merge identical entities in the section. 224 Entity size is given in the entsize field. */ 225 #define SEC_MERGE 0x20000000 226 227 /* If given with SEC_MERGE, entities to merge are zero terminated 228 strings where entsize specifies character size instead of fixed 229 size entries. */ 230 #define SEC_STRINGS 0x40000000 231 232 /* This section contains data about section groups. */ 233 #define SEC_GROUP 0x80000000 234 228 235 /* End of section flags. */ 229 236 … … 240 247 241 248 /* Another mark flag used by some of the linker backends. Set for 242 output sections that have a input section. */249 output sections that have an input section. */ 243 250 unsigned int linker_has_input : 1; 244 251 … … 246 253 unsigned int gc_mark : 1; 247 254 248 /* Used by the ELF code to mark sections which have been allocated to segments. */ 255 /* The following flags are used by the ELF linker. */ 256 257 /* Mark sections which have been allocated to segments. */ 249 258 unsigned int segment_mark : 1; 259 260 /* Type of sec_info information. */ 261 unsigned int sec_info_type:3; 262 #define ELF_INFO_TYPE_NONE 0 263 #define ELF_INFO_TYPE_STABS 1 264 #define ELF_INFO_TYPE_MERGE 2 265 #define ELF_INFO_TYPE_EH_FRAME 3 266 #define ELF_INFO_TYPE_JUST_SYMS 4 267 268 /* Nonzero if this section uses RELA relocations, rather than REL. */ 269 unsigned int use_rela_p:1; 270 271 /* Bits used by various backends. */ 272 unsigned int has_tls_reloc:1; 273 274 /* Nonzero if this section needs the relax finalize pass. */ 275 unsigned int need_finalize_relax:1; 276 277 /* Usused bits. */ 278 unsigned int flag12:1; 279 unsigned int flag13:1; 280 unsigned int flag14:1; 281 unsigned int flag15:1; 282 unsigned int flag16:4; 283 unsigned int flag20:4; 284 unsigned int flag24:8; 250 285 251 286 /* End of internal packed boolean fields. */ … … 257 292 the default address for `.data' is dependent on the specific 258 293 target and various flags). */ 259 260 294 bfd_vma vma; 261 295 262 296 /* The load address of the section - where it would be in a 263 297 rom image; really only used for writing section header 264 information. */ 265 298 information. */ 266 299 bfd_vma lma; 267 300 … … 269 302 Contains a value even if the section has no contents (e.g., the 270 303 size of `.bss'). This will be filled in after relocation. */ 271 272 304 bfd_size_type _cooked_size; 273 305 … … 275 307 value is the same as the size, but if some relaxing has 276 308 been done, then this value will be bigger. */ 277 278 309 bfd_size_type _raw_size; 279 310 … … 285 316 would be 100. However, if the target byte size is 16 bits 286 317 (bfd_octets_per_byte is "2"), this value would be 50. */ 287 288 318 bfd_vma output_offset; 289 319 290 320 /* The output section through which to map on output. */ 291 292 321 struct sec *output_section; 293 322 294 323 /* The alignment requirement of the section, as an exponent of 2 - 295 324 e.g., 3 aligns to 2^3 (or 8). */ 296 297 325 unsigned int alignment_power; 298 326 299 327 /* If an input section, a pointer to a vector of relocation 300 328 records for the data in this section. */ 301 302 329 struct reloc_cache_entry *relocation; 303 330 304 331 /* If an output section, a pointer to a vector of pointers to 305 332 relocation records for the data in this section. */ 306 307 333 struct reloc_cache_entry **orelocation; 308 334 309 /* The number of relocation records in one of the above */ 310 335 /* The number of relocation records in one of the above. */ 311 336 unsigned reloc_count; 312 337 … … 315 340 316 341 /* File position of section data. */ 317 318 342 file_ptr filepos; 319 343 320 344 /* File position of relocation info. */ 321 322 345 file_ptr rel_filepos; 323 346 324 347 /* File position of line data. */ 325 326 348 file_ptr line_filepos; 327 349 328 350 /* Pointer to data for applications. */ 329 330 351 PTR userdata; 331 352 … … 335 356 336 357 /* Attached line number information. */ 337 338 358 alent *lineno; 339 359 340 360 /* Number of line number records. */ 341 342 361 unsigned int lineno_count; 343 362 363 /* Entity size for merging purposes. */ 364 unsigned int entsize; 365 344 366 /* Optional information about a COMDAT entry; NULL if not COMDAT. */ 345 346 367 struct bfd_comdat_info *comdat; 347 348 /* Points to the kept section if this section is a link-once section,349 and is discarded. */350 struct sec *kept_section;351 368 352 369 /* When a section is being output, this value changes as more 353 370 linenumbers are written out. */ 354 355 371 file_ptr moving_line_filepos; 356 372 357 373 /* What the section number is in the target world. */ 358 359 374 int target_index; 360 375 … … 363 378 /* If this is a constructor section then here is a list of the 364 379 relocations created to relocate items within it. */ 365 366 380 struct relent_chain *constructor_chain; 367 381 368 382 /* The BFD which owns the section. */ 369 370 383 bfd *owner; 371 384 372 /* A symbol which points at this section only */385 /* A symbol which points at this section only. */ 373 386 struct symbol_cache_entry *symbol; 374 387 struct symbol_cache_entry **symbol_ptr_ptr; … … 376 389 struct bfd_link_order *link_order_head; 377 390 struct bfd_link_order *link_order_tail; 378 } asection ;391 } asection; 379 392 380 393 /* These sections are global, and are managed by BFD. The application … … 388 401 #define BFD_IND_SECTION_NAME "*IND*" 389 402 390 /* the absolute section*/403 /* The absolute section. */ 391 404 extern const asection bfd_abs_section; 392 405 #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) 393 406 #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) 394 /* Pointer to the undefined section */407 /* Pointer to the undefined section. */ 395 408 extern const asection bfd_und_section; 396 409 #define bfd_und_section_ptr ((asection *) &bfd_und_section) 397 410 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) 398 /* Pointer to the common section */411 /* Pointer to the common section. */ 399 412 extern const asection bfd_com_section; 400 413 #define bfd_com_section_ptr ((asection *) &bfd_com_section) 401 /* Pointer to the indirect section */414 /* Pointer to the indirect section. */ 402 415 extern const asection bfd_ind_section; 403 416 #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) 404 417 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) 418 419 #define bfd_is_const_section(SEC) \ 420 ( ((SEC) == bfd_abs_section_ptr) \ 421 || ((SEC) == bfd_und_section_ptr) \ 422 || ((SEC) == bfd_com_section_ptr) \ 423 || ((SEC) == bfd_ind_section_ptr)) 405 424 406 425 extern const struct symbol_cache_entry * const bfd_abs_symbol; … … 414 433 ((section)->reloc_done ? (section)->_cooked_size \ 415 434 : (abort (), (bfd_size_type) 1)) 435 436 /* Macros to handle insertion and deletion of a bfd's sections. These 437 only handle the list pointers, ie. do not adjust section_count, 438 target_index etc. */ 439 #define bfd_section_list_remove(ABFD, PS) \ 440 do \ 441 { \ 442 asection **_ps = PS; \ 443 asection *_s = *_ps; \ 444 *_ps = _s->next; \ 445 if (_s->next == NULL) \ 446 (ABFD)->section_tail = _ps; \ 447 } \ 448 while (0) 449 #define bfd_section_list_insert(ABFD, PS, S) \ 450 do \ 451 { \ 452 asection **_ps = PS; \ 453 asection *_s = S; \ 454 _s->next = *_ps; \ 455 *_ps = _s; \ 456 if (_s->next == NULL) \ 457 (ABFD)->section_tail = &_s->next; \ 458 } \ 459 while (0) 416 460 417 461 … … 422 466 423 467 These are the functions exported by the section handling part of BFD. 468 469 `bfd_section_list_clear' 470 ........................ 471 472 *Synopsis* 473 void bfd_section_list_clear (bfd *); 474 *Description* 475 Clears the section list, and also resets the section count and hash 476 table entries. 424 477 425 478 `bfd_get_section_by_name' … … 501 554 502 555 *Synopsis* 503 b oolean bfd_set_section_flags(bfd *abfd, asection *sec, flagword flags);556 bfd_boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags); 504 557 *Description* 505 558 Set the attributes of the section SEC in the BFD ABFD to the value 506 FLAGS. Return ` true' on success, `false' on error. Possible error559 FLAGS. Return `TRUE' on success, `FALSE' on error. Possible error 507 560 returns are: 508 561 … … 537 590 538 591 *Synopsis* 539 b oolean bfd_set_section_size(bfd *abfd, asection *sec, bfd_size_type val);540 *Description* 541 Set SEC to the size VAL. If the operation is ok, then ` true' is542 returned, else ` false'.592 bfd_boolean bfd_set_section_size (bfd *abfd, asection *sec, bfd_size_type val); 593 *Description* 594 Set SEC to the size VAL. If the operation is ok, then `TRUE' is 595 returned, else `FALSE'. 543 596 544 597 Possible error returns: … … 550 603 551 604 *Synopsis* 552 boolean bfd_set_section_contents 553 (bfd *abfd, 554 asection *section, 555 PTR data, 556 file_ptr offset, 605 bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, 606 PTR data, file_ptr offset, 557 607 bfd_size_type count); 558 608 *Description* … … 561 611 starting at offset OFFSET for COUNT octets. 562 612 563 Normally ` true' is returned, else `false'. Possible error returns613 Normally `TRUE' is returned, else `FALSE'. Possible error returns 564 614 are: 565 615 * `bfd_error_no_contents' - The output section does not have the … … 574 624 575 625 *Synopsis* 576 b oolean bfd_get_section_contents577 (bfd *abfd, asection *section, PTR location,578 file_ptr offset,bfd_size_type count);626 bfd_boolean bfd_get_section_contents (bfd *abfd, asection *section, 627 PTR location, file_ptr offset, 628 bfd_size_type count); 579 629 *Description* 580 630 Read data from SECTION in BFD ABFD into memory starting at LOCATION. … … 585 635 are requested or if the section does not have the `SEC_HAS_CONTENTS' 586 636 flag set, then the LOCATION is filled with zeroes. If no errors occur, 587 ` true' is returned, else `false'.637 `TRUE' is returned, else `FALSE'. 588 638 589 639 `bfd_copy_private_section_data' … … 591 641 592 642 *Synopsis* 593 boolean bfd_copy_private_section_data(bfd *ibfd, asection *isec, bfd *obfd, asection *osec); 643 bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, 644 bfd *obfd, asection *osec); 594 645 *Description* 595 646 Copy private section information from ISEC in the BFD IBFD to the 596 section OSEC in the BFD OBFD. Return ` true' on success, `false' on647 section OSEC in the BFD OBFD. Return `TRUE' on success, `FALSE' on 597 648 error. Possible error returns are: 598 649 … … 612 663 *Description* 613 664 Remove SECTION from the output. If the output section becomes empty, 614 remove it from the output bfd. INFO may be NULL; if it is not, it is 615 used to decide whether the output section is empty. 665 remove it from the output bfd. 666 667 This function won't actually do anything except twiddle flags if 668 called too late in the linking process, when it's not safe to remove 669 sections. 670 671 `bfd_generic_discard_group' 672 ........................... 673 674 *Synopsis* 675 bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); 676 *Description* 677 Remove all members of GROUP from the output. 616 678 617 679 … … 670 732 FAIL 671 733 672 if (storage_needed == 0) {673 return;674 }734 if (storage_needed == 0) 735 return; 736 675 737 symbol_table = (asymbol **) xmalloc (storage_needed); 676 738 ... … … 681 743 FAIL 682 744 683 for (i = 0; i < number_of_symbols; i++) { 684 process_symbol (symbol_table[i]); 685 } 745 for (i = 0; i < number_of_symbols; i++) 746 process_symbol (symbol_table[i]); 686 747 687 748 All storage for the symbols themselves is in an objalloc connected … … 704 765 705 766 #include "bfd.h" 706 main()767 int main (void) 707 768 { 708 769 bfd *abfd; … … 710 771 asymbol *new; 711 772 712 abfd = bfd_openw ("foo","a.out-sunos-big");713 bfd_set_format (abfd, bfd_object);714 new = bfd_make_empty_symbol (abfd);773 abfd = bfd_openw ("foo","a.out-sunos-big"); 774 bfd_set_format (abfd, bfd_object); 775 new = bfd_make_empty_symbol (abfd); 715 776 new->name = "dummy_symbol"; 716 new->section = bfd_make_section_old_way (abfd, ".text");777 new->section = bfd_make_section_old_way (abfd, ".text"); 717 778 new->flags = BSF_GLOBAL; 718 779 new->value = 0x12345; … … 721 782 ptrs[1] = (asymbol *)0; 722 783 723 bfd_set_symtab(abfd, ptrs, 1); 724 bfd_close(abfd); 784 bfd_set_symtab (abfd, ptrs, 1); 785 bfd_close (abfd); 786 return 0; 725 787 } 726 788 … … 768 830 typedef struct symbol_cache_entry 769 831 { 770 /* A pointer to the BFD which owns the symbol. This information 771 is necessary so that a back end can work out what additional 772 information (invisible to the application writer) is carried 773 with the symbol. 774 775 This field is *almost* redundant, since you can use section->owner 776 instead, except that some symbols point to the global sections 777 bfd_{abs,com,und}_section. This could be fixed by making 778 these globals be per-bfd (or per-target-flavor). FIXME. */ 779 780 struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 781 782 /* The text of the symbol. The name is left alone, and not copied; the 783 application may not alter it. */ 784 CONST char *name; 785 786 /* The value of the symbol. This really should be a union of a 787 numeric value with a pointer, since some flags indicate that 788 a pointer to another symbol is stored here. */ 832 /* A pointer to the BFD which owns the symbol. This information 833 is necessary so that a back end can work out what additional 834 information (invisible to the application writer) is carried 835 with the symbol. 836 837 This field is *almost* redundant, since you can use section->owner 838 instead, except that some symbols point to the global sections 839 bfd_{abs,com,und}_section. This could be fixed by making 840 these globals be per-bfd (or per-target-flavor). FIXME. */ 841 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 842 843 /* The text of the symbol. The name is left alone, and not copied; the 844 application may not alter it. */ 845 const char *name; 846 847 /* The value of the symbol. This really should be a union of a 848 numeric value with a pointer, since some flags indicate that 849 a pointer to another symbol is stored here. */ 789 850 symvalue value; 790 851 791 /* Attributes of a symbol: */ 792 852 /* Attributes of a symbol. */ 793 853 #define BSF_NO_FLAGS 0x00 794 854 795 /* The symbol has local scope; `static' in `C'. The value796 is the offset into the section of the data.*/855 /* The symbol has local scope; `static' in `C'. The value 856 is the offset into the section of the data. */ 797 857 #define BSF_LOCAL 0x01 798 858 799 /* The symbol has global scope; initialized data in `C'. The800 value is the offset into the section of the data.*/859 /* The symbol has global scope; initialized data in `C'. The 860 value is the offset into the section of the data. */ 801 861 #define BSF_GLOBAL 0x02 802 862 803 /* The symbol has global scope and is exported. The value is804 the offset into the section of the data.*/805 #define BSF_EXPORT BSF_GLOBAL /* no real difference*/806 807 /* A normal C symbol would be one of:808 `BSF_LOCAL', `BSF_FORT_COMM', `BSF_UNDEFINED' or809 `BSF_GLOBAL'*/810 811 /* The symbol is a debugging record. The value has an arbitary812 meaning, unless BSF_DEBUGGING_RELOC is also set. */863 /* The symbol has global scope and is exported. The value is 864 the offset into the section of the data. */ 865 #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ 866 867 /* A normal C symbol would be one of: 868 `BSF_LOCAL', `BSF_FORT_COMM', `BSF_UNDEFINED' or 869 `BSF_GLOBAL'. */ 870 871 /* The symbol is a debugging record. The value has an arbitary 872 meaning, unless BSF_DEBUGGING_RELOC is also set. */ 813 873 #define BSF_DEBUGGING 0x08 814 874 815 /* The symbol denotes a function entry point. Used in ELF,816 perhaps others someday. */875 /* The symbol denotes a function entry point. Used in ELF, 876 perhaps others someday. */ 817 877 #define BSF_FUNCTION 0x10 818 878 819 /* Used by the linker.*/879 /* Used by the linker. */ 820 880 #define BSF_KEEP 0x20 821 881 #define BSF_KEEP_G 0x40 822 882 823 /* A weak global symbol, overridable without warnings by824 a regular global symbol of the same name. */883 /* A weak global symbol, overridable without warnings by 884 a regular global symbol of the same name. */ 825 885 #define BSF_WEAK 0x80 826 886 827 /* This symbol was created to point to a section, e.g. ELF's828 STT_SECTION symbols. */887 /* This symbol was created to point to a section, e.g. ELF's 888 STT_SECTION symbols. */ 829 889 #define BSF_SECTION_SYM 0x100 830 890 831 /* The symbol used to be a common symbol, but now it is832 allocated.*/891 /* The symbol used to be a common symbol, but now it is 892 allocated. */ 833 893 #define BSF_OLD_COMMON 0x200 834 894 835 /* The default value for common data.*/895 /* The default value for common data. */ 836 896 #define BFD_FORT_COMM_DEFAULT_VALUE 0 837 897 838 /* In some files the type of a symbol sometimes alters its 839 location in an output file - ie in coff a `ISFCN' symbol 840 which is also `C_EXT' symbol appears where it was 841 declared and not at the end of a section. This bit is set 842 by the target BFD part to convey this information. */ 843 898 /* In some files the type of a symbol sometimes alters its 899 location in an output file - ie in coff a `ISFCN' symbol 900 which is also `C_EXT' symbol appears where it was 901 declared and not at the end of a section. This bit is set 902 by the target BFD part to convey this information. */ 844 903 #define BSF_NOT_AT_END 0x400 845 904 846 /* Signal that the symbol is the label of constructor section.*/905 /* Signal that the symbol is the label of constructor section. */ 847 906 #define BSF_CONSTRUCTOR 0x800 848 907 849 /* Signal that the symbol is a warning symbol. The name is a850 warning. The name of the next symbol is the one to warn about;851 if a reference is made to a symbol with the same name as the next852 symbol, a warning is issued by the linker.*/908 /* Signal that the symbol is a warning symbol. The name is a 909 warning. The name of the next symbol is the one to warn about; 910 if a reference is made to a symbol with the same name as the next 911 symbol, a warning is issued by the linker. */ 853 912 #define BSF_WARNING 0x1000 854 913 855 /* Signal that the symbol is indirect. This symbol is an indirect856 pointer to the symbol with the same name as the next symbol.*/914 /* Signal that the symbol is indirect. This symbol is an indirect 915 pointer to the symbol with the same name as the next symbol. */ 857 916 #define BSF_INDIRECT 0x2000 858 917 859 /* BSF_FILE marks symbols that contain a file name. This is used860 for ELF STT_FILE symbols. */918 /* BSF_FILE marks symbols that contain a file name. This is used 919 for ELF STT_FILE symbols. */ 861 920 #define BSF_FILE 0x4000 862 921 863 /* Symbol is from dynamic linking information. */922 /* Symbol is from dynamic linking information. */ 864 923 #define BSF_DYNAMIC 0x8000 865 924 866 /* The symbol denotes a data object. Used in ELF, and perhaps867 others someday. */925 /* The symbol denotes a data object. Used in ELF, and perhaps 926 others someday. */ 868 927 #define BSF_OBJECT 0x10000 869 928 870 /* This symbol is a debugging symbol. The value is the offset871 into the section of the data. BSF_DEBUGGING should be set872 as well. */929 /* This symbol is a debugging symbol. The value is the offset 930 into the section of the data. BSF_DEBUGGING should be set 931 as well. */ 873 932 #define BSF_DEBUGGING_RELOC 0x20000 874 933 934 /* This symbol is thread local. Used in ELF. */ 935 #define BSF_THREAD_LOCAL 0x40000 936 875 937 flagword flags; 876 938 877 /* A pointer to the section to which this symbol is878 relative. This will always be non NULL, there are special879 sections for undefined and absolute symbols. */939 /* A pointer to the section to which this symbol is 940 relative. This will always be non NULL, there are special 941 sections for undefined and absolute symbols. */ 880 942 struct sec *section; 881 943 882 /* Back end special data. */944 /* Back end special data. */ 883 945 union 884 946 { 885 947 PTR p; 886 948 bfd_vma i; 887 } udata; 888 889 } asymbol; 949 } 950 udata; 951 } 952 asymbol; 890 953 891 954 … … 910 973 911 974 *Synopsis* 912 b oolean bfd_is_local_label(bfd *abfd, asymbol *sym);913 *Description* 914 Return trueif the given symbol SYM in the BFD ABFD is a compiler915 generated local label, else return false.975 bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); 976 *Description* 977 Return TRUE if the given symbol SYM in the BFD ABFD is a compiler 978 generated local label, else return FALSE. 916 979 917 980 `bfd_is_local_label_name' … … 919 982 920 983 *Synopsis* 921 b oolean bfd_is_local_label_name(bfd *abfd, const char *name);922 *Description* 923 Return trueif a symbol with the name NAME in the BFD ABFD is a924 compiler generated local label, else return false. This just checks984 bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); 985 *Description* 986 Return TRUE if a symbol with the name NAME in the BFD ABFD is a 987 compiler generated local label, else return FALSE. This just checks 925 988 whether the name has the form of a local label. 926 989 #define bfd_is_local_label_name(abfd, name) \ … … 942 1005 943 1006 *Synopsis* 944 b oolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);1007 bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); 945 1008 *Description* 946 1009 Arrange that when the output BFD ABFD is closed, the table LOCATION of … … 951 1014 952 1015 *Synopsis* 953 void bfd_print_symbol_vandf (PTR file, asymbol *symbol);1016 void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol); 954 1017 *Description* 955 1018 Print the value and flags of the SYMBOL supplied to the stream FILE. … … 969 1032 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 970 1033 1034 `_bfd_generic_make_empty_symbol' 1035 ................................ 1036 1037 *Synopsis* 1038 asymbol * _bfd_generic_make_empty_symbol (bfd *); 1039 *Description* 1040 Create a new `asymbol' structure for the BFD ABFD and return a pointer 1041 to it. Used by core file routines, binary back-end and anywhere else 1042 where no private info is needed. 1043 971 1044 `bfd_make_debug_symbol' 972 1045 ....................... … … 986 1059 987 1060 *Synopsis* 988 int bfd_decode_symclass (asymbol *symbol);1061 int bfd_decode_symclass (asymbol *symbol); 989 1062 990 1063 `bfd_is_undefined_symclass' … … 996 1069 997 1070 *Synopsis* 998 b oolean bfd_is_undefined_symclass (int symclass);1071 bfd_boolean bfd_is_undefined_symclass (int symclass); 999 1072 1000 1073 `bfd_symbol_info' … … 1006 1079 1007 1080 *Synopsis* 1008 void bfd_symbol_info (asymbol *symbol, symbol_info *ret);1081 void bfd_symbol_info (asymbol *symbol, symbol_info *ret); 1009 1082 1010 1083 `bfd_copy_private_symbol_data' … … 1012 1085 1013 1086 *Synopsis* 1014 b oolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);1087 bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); 1015 1088 *Description* 1016 1089 Copy private symbol information from ISYM in the BFD IBFD to the symbol 1017 OSYM in the BFD OBFD. Return ` true' on success, `false' on error.1090 OSYM in the BFD OBFD. Return `TRUE' on success, `FALSE' on error. 1018 1091 Possible error returns are: 1019 1092 … … 1094 1167 1095 1168 *Synopsis* 1096 b oolean bfd_set_archive_head(bfd *output, bfd *new_head);1169 bfd_boolean bfd_set_archive_head(bfd *output, bfd *new_head); 1097 1170 *Description* 1098 1171 Set the head of the chain of BFDs contained in the archive OUTPUT to … … 1133 1206 1134 1207 *Synopsis* 1135 b oolean bfd_check_format(bfd *abfd, bfd_format format);1208 bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); 1136 1209 *Description* 1137 1210 Verify if the file attached to the BFD ABFD is compatible with the … … 1145 1218 file, or an error results. 1146 1219 1147 The function returns ` true' on success, otherwise `false' with one1220 The function returns `TRUE' on success, otherwise `FALSE' with one 1148 1221 of the following error codes: 1149 1222 … … 1164 1237 1165 1238 *Synopsis* 1166 boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); 1167 *Description* 1168 Like `bfd_check_format', except when it returns false with `bfd_errno' 1239 bfd_boolean bfd_check_format_matches (bfd *abfd, bfd_format format, 1240 char ***matching); 1241 *Description* 1242 Like `bfd_check_format', except when it returns FALSE with `bfd_errno' 1169 1243 set to `bfd_error_file_ambiguously_recognized'. In that case, if 1170 1244 MATCHING is not NULL, it will be filled in with a NULL-terminated list … … 1179 1253 1180 1254 *Synopsis* 1181 b oolean bfd_set_format(bfd *abfd, bfd_format format);1255 bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); 1182 1256 *Description* 1183 1257 This function sets the file format of the BFD ABFD to the format … … 1190 1264 1191 1265 *Synopsis* 1192 CONST char *bfd_format_string(bfd_format format);1266 const char *bfd_format_string (bfd_format format); 1193 1267 *Description* 1194 1268 Return a pointer to a const string `invalid', `object', `archive', -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-3
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 27 27 typedef enum bfd_reloc_status 28 28 { 29 /* No errors detected*/29 /* No errors detected. */ 30 30 bfd_reloc_ok, 31 31 32 /* The relocation was performed, but there was an overflow.*/32 /* The relocation was performed, but there was an overflow. */ 33 33 bfd_reloc_overflow, 34 34 35 /* The address to relocate was not within the section supplied.*/35 /* The address to relocate was not within the section supplied. */ 36 36 bfd_reloc_outofrange, 37 37 38 /* Used by special functions*/38 /* Used by special functions. */ 39 39 bfd_reloc_continue, 40 40 41 /* Unsupported relocation size requested.*/41 /* Unsupported relocation size requested. */ 42 42 bfd_reloc_notsupported, 43 43 44 /* Unused*/44 /* Unused. */ 45 45 bfd_reloc_other, 46 46 47 /* The symbol to relocate against was undefined.*/47 /* The symbol to relocate against was undefined. */ 48 48 bfd_reloc_undefined, 49 49 50 /* The relocation was performed, but may not be ok - presently51 generated only when linking i960 coff files with i960 b.out52 symbols. If this type is returned, the error_message argument53 to bfd_perform_relocation will be set. */50 /* The relocation was performed, but may not be ok - presently 51 generated only when linking i960 coff files with i960 b.out 52 symbols. If this type is returned, the error_message argument 53 to bfd_perform_relocation will be set. */ 54 54 bfd_reloc_dangerous 55 55 } … … 59 59 typedef struct reloc_cache_entry 60 60 { 61 /* A pointer into the canonical table of pointers*/61 /* A pointer into the canonical table of pointers. */ 62 62 struct symbol_cache_entry **sym_ptr_ptr; 63 63 64 /* offset in section*/64 /* offset in section. */ 65 65 bfd_size_type address; 66 66 67 /* addend for relocation value*/67 /* addend for relocation value. */ 68 68 bfd_vma addend; 69 69 70 /* Pointer to how to perform the required relocation*/70 /* Pointer to how to perform the required relocation. */ 71 71 reloc_howto_type *howto; 72 72 73 } arelent; 73 } 74 arelent; 74 75 *Description* 75 76 Here is a description of each of the fields within an `arelent': … … 194 195 enum complain_overflow 195 196 { 196 /* Do not complain on overflow.*/197 /* Do not complain on overflow. */ 197 198 complain_overflow_dont, 198 199 199 /* Complain if the bitfield overflows, whether it is considered200 as signed or unsigned.*/200 /* Complain if the bitfield overflows, whether it is considered 201 as signed or unsigned. */ 201 202 complain_overflow_bitfield, 202 203 203 /* Complain if the value overflows when considered as signed204 number.*/204 /* Complain if the value overflows when considered as signed 205 number. */ 205 206 complain_overflow_signed, 206 207 207 /* Complain if the value overflows when considered as an208 unsigned number.*/208 /* Complain if the value overflows when considered as an 209 unsigned number. */ 209 210 complain_overflow_unsigned 210 211 }; … … 216 217 information that libbfd needs to know to tie up a back end's data. 217 218 218 struct symbol_cache_entry; /* Forward declaration */219 struct symbol_cache_entry; /* Forward declaration. */ 219 220 220 221 struct reloc_howto_struct 221 222 { 222 /* The type field has mainly a documentary use - the back end can223 do what it wants with it, though normally the back end's224 external idea of what a reloc number is stored225 in this field.For example, a PC relative word relocation226 in a coff environment has the type 023 - because that's227 what the outside world calls a R_PCRWORD reloc.*/223 /* The type field has mainly a documentary use - the back end can 224 do what it wants with it, though normally the back end's 225 external idea of what a reloc number is stored 226 in this field. For example, a PC relative word relocation 227 in a coff environment has the type 023 - because that's 228 what the outside world calls a R_PCRWORD reloc. */ 228 229 unsigned int type; 229 230 230 /* The value the final relocation is shifted right by.This drops231 unwanted data from the relocation. */231 /* The value the final relocation is shifted right by. This drops 232 unwanted data from the relocation. */ 232 233 unsigned int rightshift; 233 234 234 /* The size of the item to be relocated. This is *not* a235 power-of-two measure. To get the number of bytes operated236 on by a type of relocation, use bfd_get_reloc_size. */235 /* The size of the item to be relocated. This is *not* a 236 power-of-two measure. To get the number of bytes operated 237 on by a type of relocation, use bfd_get_reloc_size. */ 237 238 int size; 238 239 239 /* The number of bits in the item to be relocated. This is used240 when doing overflow checking. */240 /* The number of bits in the item to be relocated. This is used 241 when doing overflow checking. */ 241 242 unsigned int bitsize; 242 243 243 /* Notes that the relocation is relative to the location in the244 data section of the addend.The relocation function will245 subtract from the relocation value the address of the location246 being relocated.*/247 b oolean pc_relative;248 249 /* The bit position of the reloc value in the destination.250 The relocated value is left shifted by this amount.*/244 /* Notes that the relocation is relative to the location in the 245 data section of the addend. The relocation function will 246 subtract from the relocation value the address of the location 247 being relocated. */ 248 bfd_boolean pc_relative; 249 250 /* The bit position of the reloc value in the destination. 251 The relocated value is left shifted by this amount. */ 251 252 unsigned int bitpos; 252 253 253 /* What type of overflow error should be checked for when254 relocating.*/254 /* What type of overflow error should be checked for when 255 relocating. */ 255 256 enum complain_overflow complain_on_overflow; 256 257 257 /* If this field is non null, then the supplied function is258 called rather than the normal function.This allows really259 strange relocation methods to be accomodated (e.g., i960 callj260 instructions).*/258 /* If this field is non null, then the supplied function is 259 called rather than the normal function. This allows really 260 strange relocation methods to be accomodated (e.g., i960 callj 261 instructions). */ 261 262 bfd_reloc_status_type (*special_function) 262 PARAMS ((bfd *abfd, 263 arelent *reloc_entry, 264 struct symbol_cache_entry *symbol, 265 PTR data, 266 asection *input_section, 267 bfd *output_bfd, 268 char **error_message)); 269 270 /* The textual name of the relocation type. */ 263 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, 264 bfd *, char **)); 265 266 /* The textual name of the relocation type. */ 271 267 char *name; 272 268 273 /* Some formats record a relocation addend in the section contents 274 rather than with the relocation. For ELF formats this is the 275 distinction between USE_REL and USE_RELA (though the code checks 276 for USE_REL == 1/0). The value of this field is TRUE if the 277 addend is recorded with the section contents; when performing a 278 partial link (ld -r) the section contents (the data) will be 279 modified. The value of this field is FALSE if addends are 280 recorded with the relocation (in arelent.addend); when performing 281 a partial link the relocation will be modified. 282 All relocations for all ELF USE_RELA targets should set this field 283 to FALSE (values of TRUE should be looked on with suspicion). 284 However, the converse is not true: not all relocations of all ELF 285 USE_REL targets set this field to TRUE. Why this is so is peculiar 286 to each particular target. For relocs that aren't used in partial 287 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 288 boolean partial_inplace; 289 290 /* The src_mask selects which parts of the read in data 291 are to be used in the relocation sum. E.g., if this was an 8 bit 292 byte of data which we read and relocated, this would be 293 0x000000ff. When we have relocs which have an addend, such as 294 sun4 extended relocs, the value in the offset part of a 295 relocating field is garbage so we never use it. In this case 296 the mask would be 0x00000000. */ 269 /* Some formats record a relocation addend in the section contents 270 rather than with the relocation. For ELF formats this is the 271 distinction between USE_REL and USE_RELA (though the code checks 272 for USE_REL == 1/0). The value of this field is TRUE if the 273 addend is recorded with the section contents; when performing a 274 partial link (ld -r) the section contents (the data) will be 275 modified. The value of this field is FALSE if addends are 276 recorded with the relocation (in arelent.addend); when performing 277 a partial link the relocation will be modified. 278 All relocations for all ELF USE_RELA targets should set this field 279 to FALSE (values of TRUE should be looked on with suspicion). 280 However, the converse is not true: not all relocations of all ELF 281 USE_REL targets set this field to TRUE. Why this is so is peculiar 282 to each particular target. For relocs that aren't used in partial 283 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 284 bfd_boolean partial_inplace; 285 286 /* src_mask selects the part of the instruction (or data) to be used 287 in the relocation sum. If the target relocations don't have an 288 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 289 dst_mask to extract the addend from the section contents. If 290 relocations do have an addend in the reloc, eg. ELF USE_RELA, this 291 field should be zero. Non-zero values for ELF USE_RELA targets are 292 bogus as in those cases the value in the dst_mask part of the 293 section contents should be treated as garbage. */ 297 294 bfd_vma src_mask; 298 295 299 /* The dst_mask selects which parts of the instruction are replaced 300 into the instruction. In most cases src_mask == dst_mask, 301 except in the above special case, where dst_mask would be 302 0x000000ff, and src_mask would be 0x00000000. */ 296 /* dst_mask selects which parts of the instruction (or data) are 297 replaced with a relocated value. */ 303 298 bfd_vma dst_mask; 304 299 305 /* When some formats create PC relative instructions, they leave 306 the value of the pc of the place being relocated in the offset 307 slot of the instruction, so that a PC relative relocation can 308 be made just by adding in an ordinary offset (e.g., sun3 a.out). 309 Some formats leave the displacement part of an instruction 310 empty (e.g., m88k bcs); this flag signals the fact.*/ 311 boolean pcrel_offset; 312 300 /* When some formats create PC relative instructions, they leave 301 the value of the pc of the place being relocated in the offset 302 slot of the instruction, so that a PC relative relocation can 303 be made just by adding in an ordinary offset (e.g., sun3 a.out). 304 Some formats leave the displacement part of an instruction 305 empty (e.g., m88k bcs); this flag signals the fact. */ 306 bfd_boolean pcrel_offset; 313 307 }; 314 308 … … 318 312 *Description* 319 313 The HOWTO define is horrible and will go away. 320 #define HOWTO(C, R, S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \321 { (unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}314 #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 315 { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 322 316 323 317 *Description* 324 318 And will be replaced with the totally magic way. But for the moment, we 325 319 are compatible, so do it this way. 326 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) 320 #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 321 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 322 NAME, FALSE, 0, 0, IN) 327 323 328 324 *Description* 329 325 This is used to fill in an empty howto entry in an array. 330 326 #define EMPTY_HOWTO(C) \ 331 HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) 327 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 328 NULL, FALSE, 0, 0, FALSE) 332 329 333 330 *Description* 334 331 Helper routine to turn a symbol into a relocation value. 335 #define HOWTO_PREPARE(relocation, symbol) \ 336 { \ 337 if (symbol != (asymbol *)NULL) { \ 338 if (bfd_is_com_section (symbol->section)) { \ 339 relocation = 0; \ 340 } \ 341 else { \ 342 relocation = symbol->value; \ 343 } \ 344 } \ 345 } 332 #define HOWTO_PREPARE(relocation, symbol) \ 333 { \ 334 if (symbol != (asymbol *) NULL) \ 335 { \ 336 if (bfd_is_com_section (symbol->section)) \ 337 { \ 338 relocation = 0; \ 339 } \ 340 else \ 341 { \ 342 relocation = symbol->value; \ 343 } \ 344 } \ 345 } 346 346 347 347 `bfd_get_reloc_size' … … 359 359 *Description* 360 360 How relocs are tied together in an `asection': 361 typedef struct relent_chain { 361 typedef struct relent_chain 362 { 362 363 arelent relent; 363 struct relent_chain *next; 364 } arelent_chain; 364 struct relent_chain *next; 365 } 366 arelent_chain; 365 367 366 368 `bfd_check_overflow' … … 426 428 assembler. 427 429 428 429 File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations430 431 The howto manager432 =================433 434 When an application wants to create a relocation, but doesn't know435 what the target machine might call it, it can find out by using this436 bit of code.437 438 `bfd_reloc_code_type'439 .....................440 441 *Description*442 The insides of a reloc code. The idea is that, eventually, there will443 be one enumerator for every type of relocation we ever do. Pass one of444 these values to `bfd_reloc_type_lookup', and it'll return a howto445 pointer.446 447 This does mean that the application must determine the correct448 enumerator value; you can't get a howto pointer from a random set of449 attributes.450 451 Here are the possible values for `enum bfd_reloc_code_real':452 453 - : BFD_RELOC_64454 - : BFD_RELOC_32455 - : BFD_RELOC_26456 - : BFD_RELOC_24457 - : BFD_RELOC_16458 - : BFD_RELOC_14459 - : BFD_RELOC_8460 Basic absolute relocations of N bits.461 462 - : BFD_RELOC_64_PCREL463 - : BFD_RELOC_32_PCREL464 - : BFD_RELOC_24_PCREL465 - : BFD_RELOC_16_PCREL466 - : BFD_RELOC_12_PCREL467 - : BFD_RELOC_8_PCREL468 PC-relative relocations. Sometimes these are relative to the469 address of the relocation itself; sometimes they are relative to470 the start of the section containing the relocation. It depends on471 the specific target.472 473 The 24-bit relocation is used in some Intel 960 configurations.474 475 - : BFD_RELOC_32_GOT_PCREL476 - : BFD_RELOC_16_GOT_PCREL477 - : BFD_RELOC_8_GOT_PCREL478 - : BFD_RELOC_32_GOTOFF479 - : BFD_RELOC_16_GOTOFF480 - : BFD_RELOC_LO16_GOTOFF481 - : BFD_RELOC_HI16_GOTOFF482 - : BFD_RELOC_HI16_S_GOTOFF483 - : BFD_RELOC_8_GOTOFF484 - : BFD_RELOC_32_PLT_PCREL485 - : BFD_RELOC_24_PLT_PCREL486 - : BFD_RELOC_16_PLT_PCREL487 - : BFD_RELOC_8_PLT_PCREL488 - : BFD_RELOC_32_PLTOFF489 - : BFD_RELOC_16_PLTOFF490 - : BFD_RELOC_LO16_PLTOFF491 - : BFD_RELOC_HI16_PLTOFF492 - : BFD_RELOC_HI16_S_PLTOFF493 - : BFD_RELOC_8_PLTOFF494 For ELF.495 496 - : BFD_RELOC_68K_GLOB_DAT497 - : BFD_RELOC_68K_JMP_SLOT498 - : BFD_RELOC_68K_RELATIVE499 Relocations used by 68K ELF.500 501 - : BFD_RELOC_32_BASEREL502 - : BFD_RELOC_16_BASEREL503 - : BFD_RELOC_LO16_BASEREL504 - : BFD_RELOC_HI16_BASEREL505 - : BFD_RELOC_HI16_S_BASEREL506 - : BFD_RELOC_8_BASEREL507 - : BFD_RELOC_RVA508 Linkage-table relative.509 510 - : BFD_RELOC_8_FFnn511 Absolute 8-bit relocation, but used to form an address like 0xFFnn.512 513 - : BFD_RELOC_32_PCREL_S2514 - : BFD_RELOC_16_PCREL_S2515 - : BFD_RELOC_23_PCREL_S2516 These PC-relative relocations are stored as word displacements -517 i.e., byte displacements shifted right two bits. The 30-bit word518 displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the519 SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The520 signed 16-bit displacement is used on the MIPS, and the 23-bit521 displacement is used on the Alpha.522 523 - : BFD_RELOC_HI22524 - : BFD_RELOC_LO10525 High 22 bits and low 10 bits of 32-bit value, placed into lower526 bits of the target word. These are used on the SPARC.527 528 - : BFD_RELOC_GPREL16529 - : BFD_RELOC_GPREL32530 For systems that allocate a Global Pointer register, these are531 displacements off that register. These relocation types are532 handled specially, because the value the register will have is533 decided relatively late.534 535 - : BFD_RELOC_I960_CALLJ536 Reloc types used for i960/b.out.537 538 - : BFD_RELOC_NONE539 - : BFD_RELOC_SPARC_WDISP22540 - : BFD_RELOC_SPARC22541 - : BFD_RELOC_SPARC13542 - : BFD_RELOC_SPARC_GOT10543 - : BFD_RELOC_SPARC_GOT13544 - : BFD_RELOC_SPARC_GOT22545 - : BFD_RELOC_SPARC_PC10546 - : BFD_RELOC_SPARC_PC22547 - : BFD_RELOC_SPARC_WPLT30548 - : BFD_RELOC_SPARC_COPY549 - : BFD_RELOC_SPARC_GLOB_DAT550 - : BFD_RELOC_SPARC_JMP_SLOT551 - : BFD_RELOC_SPARC_RELATIVE552 - : BFD_RELOC_SPARC_UA16553 - : BFD_RELOC_SPARC_UA32554 - : BFD_RELOC_SPARC_UA64555 SPARC ELF relocations. There is probably some overlap with other556 relocation types already defined.557 558 - : BFD_RELOC_SPARC_BASE13559 - : BFD_RELOC_SPARC_BASE22560 I think these are specific to SPARC a.out (e.g., Sun 4).561 562 - : BFD_RELOC_SPARC_64563 - : BFD_RELOC_SPARC_10564 - : BFD_RELOC_SPARC_11565 - : BFD_RELOC_SPARC_OLO10566 - : BFD_RELOC_SPARC_HH22567 - : BFD_RELOC_SPARC_HM10568 - : BFD_RELOC_SPARC_LM22569 - : BFD_RELOC_SPARC_PC_HH22570 - : BFD_RELOC_SPARC_PC_HM10571 - : BFD_RELOC_SPARC_PC_LM22572 - : BFD_RELOC_SPARC_WDISP16573 - : BFD_RELOC_SPARC_WDISP19574 - : BFD_RELOC_SPARC_7575 - : BFD_RELOC_SPARC_6576 - : BFD_RELOC_SPARC_5577 - : BFD_RELOC_SPARC_DISP64578 - : BFD_RELOC_SPARC_PLT64579 - : BFD_RELOC_SPARC_HIX22580 - : BFD_RELOC_SPARC_LOX10581 - : BFD_RELOC_SPARC_H44582 - : BFD_RELOC_SPARC_M44583 - : BFD_RELOC_SPARC_L44584 - : BFD_RELOC_SPARC_REGISTER585 SPARC64 relocations586 587 - : BFD_RELOC_SPARC_REV32588 SPARC little endian relocation589 590 - : BFD_RELOC_ALPHA_GPDISP_HI16591 Alpha ECOFF and ELF relocations. Some of these treat the symbol or592 "addend" in some special way. For GPDISP_HI16 ("gpdisp")593 relocations, the symbol is ignored when writing; when reading, it594 will be the absolute section symbol. The addend is the595 displacement in bytes of the "lda" instruction from the "ldah"596 instruction (which is at the address of this reloc).597 598 - : BFD_RELOC_ALPHA_GPDISP_LO16599 For GPDISP_LO16 ("ignore") relocations, the symbol is handled as600 with GPDISP_HI16 relocs. The addend is ignored when writing the601 relocations out, and is filled in with the file's GP value on602 reading, for convenience.603 604 - : BFD_RELOC_ALPHA_GPDISP605 The ELF GPDISP relocation is exactly the same as the GPDISP_HI16606 relocation except that there is no accompanying GPDISP_LO16607 relocation.608 609 - : BFD_RELOC_ALPHA_LITERAL610 - : BFD_RELOC_ALPHA_ELF_LITERAL611 - : BFD_RELOC_ALPHA_LITUSE612 The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;613 the assembler turns it into a LDQ instruction to load the address614 of the symbol, and then fills in a register in the real615 instruction.616 617 The LITERAL reloc, at the LDQ instruction, refers to the .lita618 section symbol. The addend is ignored when writing, but is filled619 in with the file's GP value on reading, for convenience, as with620 the GPDISP_LO16 reloc.621 622 The ELF_LITERAL reloc is somewhere between 16_GOTOFF and623 GPDISP_LO16. It should refer to the symbol to be referenced, as624 with 16_GOTOFF, but it generates output not based on the position625 within the .got section, but relative to the GP value chosen for626 the file during the final link stage.627 628 The LITUSE reloc, on the instruction using the loaded address,629 gives information to the linker that it might be able to use to630 optimize away some literal section references. The symbol is631 ignored (read as the absolute section symbol), and the "addend"632 indicates the type of instruction using the register: 1 - "memory"633 fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target634 of branch)635 636 The GNU linker currently doesn't do any of this optimizing.637 638 - : BFD_RELOC_ALPHA_USER_LITERAL639 - : BFD_RELOC_ALPHA_USER_LITUSE_BASE640 - : BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF641 - : BFD_RELOC_ALPHA_USER_LITUSE_JSR642 - : BFD_RELOC_ALPHA_USER_GPDISP643 - : BFD_RELOC_ALPHA_USER_GPRELHIGH644 - : BFD_RELOC_ALPHA_USER_GPRELLOW645 The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to646 process the explicit !<reloc>!sequence relocations, and are mapped647 into the normal relocations at the end of processing.648 649 - : BFD_RELOC_ALPHA_HINT650 The HINT relocation indicates a value that should be filled into651 the "hint" field of a jmp/jsr/ret instruction, for possible branch-652 prediction logic which may be provided on some processors.653 654 - : BFD_RELOC_ALPHA_LINKAGE655 The LINKAGE relocation outputs a linkage pair in the object file,656 which is filled by the linker.657 658 - : BFD_RELOC_ALPHA_CODEADDR659 The CODEADDR relocation outputs a STO_CA in the object file, which660 is filled by the linker.661 662 - : BFD_RELOC_MIPS_JMP663 Bits 27..2 of the relocation address shifted right 2 bits; simple664 reloc otherwise.665 666 - : BFD_RELOC_MIPS16_JMP667 The MIPS16 jump instruction.668 669 - : BFD_RELOC_MIPS16_GPREL670 MIPS16 GP relative reloc.671 672 - : BFD_RELOC_HI16673 High 16 bits of 32-bit value; simple reloc.674 675 - : BFD_RELOC_HI16_S676 High 16 bits of 32-bit value but the low 16 bits will be sign677 extended and added to form the final result. If the low 16 bits678 form a negative number, we need to add one to the high value to679 compensate for the borrow when the low bits are added.680 681 - : BFD_RELOC_LO16682 Low 16 bits.683 684 - : BFD_RELOC_PCREL_HI16_S685 Like BFD_RELOC_HI16_S, but PC relative.686 687 - : BFD_RELOC_PCREL_LO16688 Like BFD_RELOC_LO16, but PC relative.689 690 - : BFD_RELOC_MIPS_GPREL691 Relocation relative to the global pointer.692 693 - : BFD_RELOC_MIPS_LITERAL694 Relocation against a MIPS literal section.695 696 - : BFD_RELOC_MIPS_GOT16697 - : BFD_RELOC_MIPS_CALL16698 - : BFD_RELOC_MIPS_GPREL32699 - : BFD_RELOC_MIPS_GOT_HI16700 - : BFD_RELOC_MIPS_GOT_LO16701 - : BFD_RELOC_MIPS_CALL_HI16702 - : BFD_RELOC_MIPS_CALL_LO16703 - : BFD_RELOC_MIPS_SUB704 - : BFD_RELOC_MIPS_GOT_PAGE705 - : BFD_RELOC_MIPS_GOT_OFST706 - : BFD_RELOC_MIPS_GOT_DISP707 - : BFD_RELOC_MIPS_SHIFT5708 - : BFD_RELOC_MIPS_SHIFT6709 - : BFD_RELOC_MIPS_INSERT_A710 - : BFD_RELOC_MIPS_INSERT_B711 - : BFD_RELOC_MIPS_DELETE712 - : BFD_RELOC_MIPS_HIGHEST713 - : BFD_RELOC_MIPS_HIGHER714 - : BFD_RELOC_MIPS_SCN_DISP715 - : BFD_RELOC_MIPS_REL16716 - : BFD_RELOC_MIPS_RELGOT717 - : BFD_RELOC_MIPS_JALR718 MIPS ELF relocations.719 720 - : BFD_RELOC_386_GOT32721 - : BFD_RELOC_386_PLT32722 - : BFD_RELOC_386_COPY723 - : BFD_RELOC_386_GLOB_DAT724 - : BFD_RELOC_386_JUMP_SLOT725 - : BFD_RELOC_386_RELATIVE726 - : BFD_RELOC_386_GOTOFF727 - : BFD_RELOC_386_GOTPC728 i386/elf relocations729 730 - : BFD_RELOC_X86_64_GOT32731 - : BFD_RELOC_X86_64_PLT32732 - : BFD_RELOC_X86_64_COPY733 - : BFD_RELOC_X86_64_GLOB_DAT734 - : BFD_RELOC_X86_64_JUMP_SLOT735 - : BFD_RELOC_X86_64_RELATIVE736 - : BFD_RELOC_X86_64_GOTPCREL737 - : BFD_RELOC_X86_64_32S738 x86-64/elf relocations739 740 - : BFD_RELOC_NS32K_IMM_8741 - : BFD_RELOC_NS32K_IMM_16742 - : BFD_RELOC_NS32K_IMM_32743 - : BFD_RELOC_NS32K_IMM_8_PCREL744 - : BFD_RELOC_NS32K_IMM_16_PCREL745 - : BFD_RELOC_NS32K_IMM_32_PCREL746 - : BFD_RELOC_NS32K_DISP_8747 - : BFD_RELOC_NS32K_DISP_16748 - : BFD_RELOC_NS32K_DISP_32749 - : BFD_RELOC_NS32K_DISP_8_PCREL750 - : BFD_RELOC_NS32K_DISP_16_PCREL751 - : BFD_RELOC_NS32K_DISP_32_PCREL752 ns32k relocations753 754 - : BFD_RELOC_PJ_CODE_HI16755 - : BFD_RELOC_PJ_CODE_LO16756 - : BFD_RELOC_PJ_CODE_DIR16757 - : BFD_RELOC_PJ_CODE_DIR32758 - : BFD_RELOC_PJ_CODE_REL16759 - : BFD_RELOC_PJ_CODE_REL32760 Picojava relocs. Not all of these appear in object files.761 762 - : BFD_RELOC_PPC_B26763 - : BFD_RELOC_PPC_BA26764 - : BFD_RELOC_PPC_TOC16765 - : BFD_RELOC_PPC_B16766 - : BFD_RELOC_PPC_B16_BRTAKEN767 - : BFD_RELOC_PPC_B16_BRNTAKEN768 - : BFD_RELOC_PPC_BA16769 - : BFD_RELOC_PPC_BA16_BRTAKEN770 - : BFD_RELOC_PPC_BA16_BRNTAKEN771 - : BFD_RELOC_PPC_COPY772 - : BFD_RELOC_PPC_GLOB_DAT773 - : BFD_RELOC_PPC_JMP_SLOT774 - : BFD_RELOC_PPC_RELATIVE775 - : BFD_RELOC_PPC_LOCAL24PC776 - : BFD_RELOC_PPC_EMB_NADDR32777 - : BFD_RELOC_PPC_EMB_NADDR16778 - : BFD_RELOC_PPC_EMB_NADDR16_LO779 - : BFD_RELOC_PPC_EMB_NADDR16_HI780 - : BFD_RELOC_PPC_EMB_NADDR16_HA781 - : BFD_RELOC_PPC_EMB_SDAI16782 - : BFD_RELOC_PPC_EMB_SDA2I16783 - : BFD_RELOC_PPC_EMB_SDA2REL784 - : BFD_RELOC_PPC_EMB_SDA21785 - : BFD_RELOC_PPC_EMB_MRKREF786 - : BFD_RELOC_PPC_EMB_RELSEC16787 - : BFD_RELOC_PPC_EMB_RELST_LO788 - : BFD_RELOC_PPC_EMB_RELST_HI789 - : BFD_RELOC_PPC_EMB_RELST_HA790 - : BFD_RELOC_PPC_EMB_BIT_FLD791 - : BFD_RELOC_PPC_EMB_RELSDA792 Power(rs6000) and PowerPC relocations.793 794 - : BFD_RELOC_I370_D12795 IBM 370/390 relocations796 797 - : BFD_RELOC_CTOR798 The type of reloc used to build a contructor table - at the moment799 probably a 32 bit wide absolute relocation, but the target can800 choose. It generally does map to one of the other relocation801 types.802 803 - : BFD_RELOC_ARM_PCREL_BRANCH804 ARM 26 bit pc-relative branch. The lowest two bits must be zero805 and are not stored in the instruction.806 807 - : BFD_RELOC_ARM_PCREL_BLX808 ARM 26 bit pc-relative branch. The lowest bit must be zero and is809 not stored in the instruction. The 2nd lowest bit comes from a 1810 bit field in the instruction.811 812 - : BFD_RELOC_THUMB_PCREL_BLX813 Thumb 22 bit pc-relative branch. The lowest bit must be zero and814 is not stored in the instruction. The 2nd lowest bit comes from a815 1 bit field in the instruction.816 817 - : BFD_RELOC_ARM_IMMEDIATE818 - : BFD_RELOC_ARM_ADRL_IMMEDIATE819 - : BFD_RELOC_ARM_OFFSET_IMM820 - : BFD_RELOC_ARM_SHIFT_IMM821 - : BFD_RELOC_ARM_SWI822 - : BFD_RELOC_ARM_MULTI823 - : BFD_RELOC_ARM_CP_OFF_IMM824 - : BFD_RELOC_ARM_ADR_IMM825 - : BFD_RELOC_ARM_LDR_IMM826 - : BFD_RELOC_ARM_LITERAL827 - : BFD_RELOC_ARM_IN_POOL828 - : BFD_RELOC_ARM_OFFSET_IMM8829 - : BFD_RELOC_ARM_HWLITERAL830 - : BFD_RELOC_ARM_THUMB_ADD831 - : BFD_RELOC_ARM_THUMB_IMM832 - : BFD_RELOC_ARM_THUMB_SHIFT833 - : BFD_RELOC_ARM_THUMB_OFFSET834 - : BFD_RELOC_ARM_GOT12835 - : BFD_RELOC_ARM_GOT32836 - : BFD_RELOC_ARM_JUMP_SLOT837 - : BFD_RELOC_ARM_COPY838 - : BFD_RELOC_ARM_GLOB_DAT839 - : BFD_RELOC_ARM_PLT32840 - : BFD_RELOC_ARM_RELATIVE841 - : BFD_RELOC_ARM_GOTOFF842 - : BFD_RELOC_ARM_GOTPC843 These relocs are only used within the ARM assembler. They are not844 (at present) written to any object files.845 846 - : BFD_RELOC_SH_PCDISP8BY2847 - : BFD_RELOC_SH_PCDISP12BY2848 - : BFD_RELOC_SH_IMM4849 - : BFD_RELOC_SH_IMM4BY2850 - : BFD_RELOC_SH_IMM4BY4851 - : BFD_RELOC_SH_IMM8852 - : BFD_RELOC_SH_IMM8BY2853 - : BFD_RELOC_SH_IMM8BY4854 - : BFD_RELOC_SH_PCRELIMM8BY2855 - : BFD_RELOC_SH_PCRELIMM8BY4856 - : BFD_RELOC_SH_SWITCH16857 - : BFD_RELOC_SH_SWITCH32858 - : BFD_RELOC_SH_USES859 - : BFD_RELOC_SH_COUNT860 - : BFD_RELOC_SH_ALIGN861 - : BFD_RELOC_SH_CODE862 - : BFD_RELOC_SH_DATA863 - : BFD_RELOC_SH_LABEL864 - : BFD_RELOC_SH_LOOP_START865 - : BFD_RELOC_SH_LOOP_END866 - : BFD_RELOC_SH_COPY867 - : BFD_RELOC_SH_GLOB_DAT868 - : BFD_RELOC_SH_JMP_SLOT869 - : BFD_RELOC_SH_RELATIVE870 - : BFD_RELOC_SH_GOTPC871 Hitachi SH relocs. Not all of these appear in object files.872 873 - : BFD_RELOC_THUMB_PCREL_BRANCH9874 - : BFD_RELOC_THUMB_PCREL_BRANCH12875 - : BFD_RELOC_THUMB_PCREL_BRANCH23876 Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must877 be zero and is not stored in the instruction.878 879 - : BFD_RELOC_ARC_B22_PCREL880 ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two881 bits must be zero and are not stored in the instruction. The high882 20 bits are installed in bits 26 through 7 of the instruction.883 884 - : BFD_RELOC_ARC_B26885 ARC 26 bit absolute branch. The lowest two bits must be zero and886 are not stored in the instruction. The high 24 bits are installed887 in bits 23 through 0.888 889 - : BFD_RELOC_D10V_10_PCREL_R890 Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2891 bits assumed to be 0.892 893 - : BFD_RELOC_D10V_10_PCREL_L894 Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2895 bits assumed to be 0. This is the same as the previous reloc896 except it is in the left container, i.e., shifted left 15 bits.897 898 - : BFD_RELOC_D10V_18899 This is an 18-bit reloc with the right 2 bits assumed to be 0.900 901 - : BFD_RELOC_D10V_18_PCREL902 This is an 18-bit reloc with the right 2 bits assumed to be 0.903 904 - : BFD_RELOC_D30V_6905 Mitsubishi D30V relocs. This is a 6-bit absolute reloc.906 907 - : BFD_RELOC_D30V_9_PCREL908 This is a 6-bit pc-relative reloc with the right 3 bits assumed to909 be 0.910 911 - : BFD_RELOC_D30V_9_PCREL_R912 This is a 6-bit pc-relative reloc with the right 3 bits assumed to913 be 0. Same as the previous reloc but on the right side of the914 container.915 916 - : BFD_RELOC_D30V_15917 This is a 12-bit absolute reloc with the right 3 bitsassumed to be918 0.919 920 - : BFD_RELOC_D30V_15_PCREL921 This is a 12-bit pc-relative reloc with the right 3 bits assumed922 to be 0.923 924 - : BFD_RELOC_D30V_15_PCREL_R925 This is a 12-bit pc-relative reloc with the right 3 bits assumed926 to be 0. Same as the previous reloc but on the right side of the927 container.928 929 - : BFD_RELOC_D30V_21930 This is an 18-bit absolute reloc with the right 3 bits assumed to931 be 0.932 933 - : BFD_RELOC_D30V_21_PCREL934 This is an 18-bit pc-relative reloc with the right 3 bits assumed935 to be 0.936 937 - : BFD_RELOC_D30V_21_PCREL_R938 This is an 18-bit pc-relative reloc with the right 3 bits assumed939 to be 0. Same as the previous reloc but on the right side of the940 container.941 942 - : BFD_RELOC_D30V_32943 This is a 32-bit absolute reloc.944 945 - : BFD_RELOC_D30V_32_PCREL946 This is a 32-bit pc-relative reloc.947 948 - : BFD_RELOC_M32R_24949 Mitsubishi M32R relocs. This is a 24 bit absolute address.950 951 - : BFD_RELOC_M32R_10_PCREL952 This is a 10-bit pc-relative reloc with the right 2 bits assumed953 to be 0.954 955 - : BFD_RELOC_M32R_18_PCREL956 This is an 18-bit reloc with the right 2 bits assumed to be 0.957 958 - : BFD_RELOC_M32R_26_PCREL959 This is a 26-bit reloc with the right 2 bits assumed to be 0.960 961 - : BFD_RELOC_M32R_HI16_ULO962 This is a 16-bit reloc containing the high 16 bits of an address963 used when the lower 16 bits are treated as unsigned.964 965 - : BFD_RELOC_M32R_HI16_SLO966 This is a 16-bit reloc containing the high 16 bits of an address967 used when the lower 16 bits are treated as signed.968 969 - : BFD_RELOC_M32R_LO16970 This is a 16-bit reloc containing the lower 16 bits of an address.971 972 - : BFD_RELOC_M32R_SDA16973 This is a 16-bit reloc containing the small data area offset for974 use in add3, load, and store instructions.975 976 - : BFD_RELOC_V850_9_PCREL977 This is a 9-bit reloc978 979 - : BFD_RELOC_V850_22_PCREL980 This is a 22-bit reloc981 982 - : BFD_RELOC_V850_SDA_16_16_OFFSET983 This is a 16 bit offset from the short data area pointer.984 985 - : BFD_RELOC_V850_SDA_15_16_OFFSET986 This is a 16 bit offset (of which only 15 bits are used) from the987 short data area pointer.988 989 - : BFD_RELOC_V850_ZDA_16_16_OFFSET990 This is a 16 bit offset from the zero data area pointer.991 992 - : BFD_RELOC_V850_ZDA_15_16_OFFSET993 This is a 16 bit offset (of which only 15 bits are used) from the994 zero data area pointer.995 996 - : BFD_RELOC_V850_TDA_6_8_OFFSET997 This is an 8 bit offset (of which only 6 bits are used) from the998 tiny data area pointer.999 1000 - : BFD_RELOC_V850_TDA_7_8_OFFSET1001 This is an 8bit offset (of which only 7 bits are used) from the1002 tiny data area pointer.1003 1004 - : BFD_RELOC_V850_TDA_7_7_OFFSET1005 This is a 7 bit offset from the tiny data area pointer.1006 1007 - : BFD_RELOC_V850_TDA_16_16_OFFSET1008 This is a 16 bit offset from the tiny data area pointer.1009 1010 - : BFD_RELOC_V850_TDA_4_5_OFFSET1011 This is a 5 bit offset (of which only 4 bits are used) from the1012 tiny data area pointer.1013 1014 - : BFD_RELOC_V850_TDA_4_4_OFFSET1015 This is a 4 bit offset from the tiny data area pointer.1016 1017 - : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET1018 This is a 16 bit offset from the short data area pointer, with the1019 bits placed non-contigously in the instruction.1020 1021 - : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET1022 This is a 16 bit offset from the zero data area pointer, with the1023 bits placed non-contigously in the instruction.1024 1025 - : BFD_RELOC_V850_CALLT_6_7_OFFSET1026 This is a 6 bit offset from the call table base pointer.1027 1028 - : BFD_RELOC_V850_CALLT_16_16_OFFSET1029 This is a 16 bit offset from the call table base pointer.1030 1031 - : BFD_RELOC_MN10300_32_PCREL1032 This is a 32bit pcrel reloc for the mn10300, offset by two bytes1033 in the instruction.1034 1035 - : BFD_RELOC_MN10300_16_PCREL1036 This is a 16bit pcrel reloc for the mn10300, offset by two bytes1037 in the instruction.1038 1039 - : BFD_RELOC_TIC30_LDP1040 This is a 8bit DP reloc for the tms320c30, where the most1041 significant 8 bits of a 24 bit word are placed into the least1042 significant 8 bits of the opcode.1043 1044 - : BFD_RELOC_TIC54X_PARTLS71045 This is a 7bit reloc for the tms320c54x, where the least1046 significant 7 bits of a 16 bit word are placed into the least1047 significant 7 bits of the opcode.1048 1049 - : BFD_RELOC_TIC54X_PARTMS91050 This is a 9bit DP reloc for the tms320c54x, where the most1051 significant 9 bits of a 16 bit word are placed into the least1052 significant 9 bits of the opcode.1053 1054 - : BFD_RELOC_TIC54X_231055 This is an extended address 23-bit reloc for the tms320c54x.1056 1057 - : BFD_RELOC_TIC54X_16_OF_231058 This is a 16-bit reloc for the tms320c54x, where the least1059 significant 16 bits of a 23-bit extended address are placed into1060 the opcode.1061 1062 - : BFD_RELOC_TIC54X_MS7_OF_231063 This is a reloc for the tms320c54x, where the most significant 71064 bits of a 23-bit extended address are placed into the opcode.1065 1066 - : BFD_RELOC_FR30_481067 This is a 48 bit reloc for the FR30 that stores 32 bits.1068 1069 - : BFD_RELOC_FR30_201070 This is a 32 bit reloc for the FR30 that stores 20 bits split up1071 into two sections.1072 1073 - : BFD_RELOC_FR30_6_IN_41074 This is a 16 bit reloc for the FR30 that stores a 6 bit word1075 offset in 4 bits.1076 1077 - : BFD_RELOC_FR30_8_IN_81078 This is a 16 bit reloc for the FR30 that stores an 8 bit byte1079 offset into 8 bits.1080 1081 - : BFD_RELOC_FR30_9_IN_81082 This is a 16 bit reloc for the FR30 that stores a 9 bit short1083 offset into 8 bits.1084 1085 - : BFD_RELOC_FR30_10_IN_81086 This is a 16 bit reloc for the FR30 that stores a 10 bit word1087 offset into 8 bits.1088 1089 - : BFD_RELOC_FR30_9_PCREL1090 This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative1091 short offset into 8 bits.1092 1093 - : BFD_RELOC_FR30_12_PCREL1094 This is a 16 bit reloc for the FR30 that stores a 12 bit pc1095 relative short offset into 11 bits.1096 1097 - : BFD_RELOC_MCORE_PCREL_IMM8BY41098 - : BFD_RELOC_MCORE_PCREL_IMM11BY21099 - : BFD_RELOC_MCORE_PCREL_IMM4BY21100 - : BFD_RELOC_MCORE_PCREL_321101 - : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY21102 - : BFD_RELOC_MCORE_RVA1103 Motorola Mcore relocations.1104 1105 - : BFD_RELOC_AVR_7_PCREL1106 This is a 16 bit reloc for the AVR that stores 8 bit pc relative1107 short offset into 7 bits.1108 1109 - : BFD_RELOC_AVR_13_PCREL1110 This is a 16 bit reloc for the AVR that stores 13 bit pc relative1111 short offset into 12 bits.1112 1113 - : BFD_RELOC_AVR_16_PM1114 This is a 16 bit reloc for the AVR that stores 17 bit value1115 (usually program memory address) into 16 bits.1116 1117 - : BFD_RELOC_AVR_LO8_LDI1118 This is a 16 bit reloc for the AVR that stores 8 bit value (usually1119 data memory address) into 8 bit immediate value of LDI insn.1120 1121 - : BFD_RELOC_AVR_HI8_LDI1122 This is a 16 bit reloc for the AVR that stores 8 bit value (high 81123 bit of data memory address) into 8 bit immediate value of LDI insn.1124 1125 - : BFD_RELOC_AVR_HH8_LDI1126 This is a 16 bit reloc for the AVR that stores 8 bit value (most1127 high 8 bit of program memory address) into 8 bit immediate value1128 of LDI insn.1129 1130 - : BFD_RELOC_AVR_LO8_LDI_NEG1131 This is a 16 bit reloc for the AVR that stores negated 8 bit value1132 (usually data memory address) into 8 bit immediate value of SUBI1133 insn.1134 1135 - : BFD_RELOC_AVR_HI8_LDI_NEG1136 This is a 16 bit reloc for the AVR that stores negated 8 bit value1137 (high 8 bit of data memory address) into 8 bit immediate value of1138 SUBI insn.1139 1140 - : BFD_RELOC_AVR_HH8_LDI_NEG1141 This is a 16 bit reloc for the AVR that stores negated 8 bit value1142 (most high 8 bit of program memory address) into 8 bit immediate1143 value of LDI or SUBI insn.1144 1145 - : BFD_RELOC_AVR_LO8_LDI_PM1146 This is a 16 bit reloc for the AVR that stores 8 bit value (usually1147 command address) into 8 bit immediate value of LDI insn.1148 1149 - : BFD_RELOC_AVR_HI8_LDI_PM1150 This is a 16 bit reloc for the AVR that stores 8 bit value (high 81151 bit of command address) into 8 bit immediate value of LDI insn.1152 1153 - : BFD_RELOC_AVR_HH8_LDI_PM1154 This is a 16 bit reloc for the AVR that stores 8 bit value (most1155 high 8 bit of command address) into 8 bit immediate value of LDI1156 insn.1157 1158 - : BFD_RELOC_AVR_LO8_LDI_PM_NEG1159 This is a 16 bit reloc for the AVR that stores negated 8 bit value1160 (usually command address) into 8 bit immediate value of SUBI insn.1161 1162 - : BFD_RELOC_AVR_HI8_LDI_PM_NEG1163 This is a 16 bit reloc for the AVR that stores negated 8 bit value1164 (high 8 bit of 16 bit command address) into 8 bit immediate value1165 of SUBI insn.1166 1167 - : BFD_RELOC_AVR_HH8_LDI_PM_NEG1168 This is a 16 bit reloc for the AVR that stores negated 8 bit value1169 (high 6 bit of 22 bit command address) into 8 bit immediate value1170 of SUBI insn.1171 1172 - : BFD_RELOC_AVR_CALL1173 This is a 32 bit reloc for the AVR that stores 23 bit value into1174 22 bits.1175 1176 - : BFD_RELOC_VTABLE_INHERIT1177 - : BFD_RELOC_VTABLE_ENTRY1178 These two relocations are used by the linker to determine which of1179 the entries in a C++ virtual function table are actually used.1180 When the -gc-sections option is given, the linker will zero out1181 the entries that are not used, so that the code for those1182 functions need not be included in the output.1183 1184 VTABLE_INHERIT is a zero-space relocation used to describe to the1185 linker the inheritence tree of a C++ virtual function table. The1186 relocation's symbol should be the parent class' vtable, and the1187 relocation should be located at the child vtable.1188 1189 VTABLE_ENTRY is a zero-space relocation that describes the use of a1190 virtual function table entry. The reloc's symbol should refer to1191 the table of the class mentioned in the code. Off of that base,1192 an offset describes the entry that is being used. For Rela hosts,1193 this offset is stored in the reloc's addend. For Rel hosts, we1194 are forced to put this offset in the reloc's section offset.1195 1196 - : BFD_RELOC_IA64_IMM141197 - : BFD_RELOC_IA64_IMM221198 - : BFD_RELOC_IA64_IMM641199 - : BFD_RELOC_IA64_DIR32MSB1200 - : BFD_RELOC_IA64_DIR32LSB1201 - : BFD_RELOC_IA64_DIR64MSB1202 - : BFD_RELOC_IA64_DIR64LSB1203 - : BFD_RELOC_IA64_GPREL221204 - : BFD_RELOC_IA64_GPREL64I1205 - : BFD_RELOC_IA64_GPREL32MSB1206 - : BFD_RELOC_IA64_GPREL32LSB1207 - : BFD_RELOC_IA64_GPREL64MSB1208 - : BFD_RELOC_IA64_GPREL64LSB1209 - : BFD_RELOC_IA64_LTOFF221210 - : BFD_RELOC_IA64_LTOFF64I1211 - : BFD_RELOC_IA64_PLTOFF221212 - : BFD_RELOC_IA64_PLTOFF64I1213 - : BFD_RELOC_IA64_PLTOFF64MSB1214 - : BFD_RELOC_IA64_PLTOFF64LSB1215 - : BFD_RELOC_IA64_FPTR64I1216 - : BFD_RELOC_IA64_FPTR32MSB1217 - : BFD_RELOC_IA64_FPTR32LSB1218 - : BFD_RELOC_IA64_FPTR64MSB1219 - : BFD_RELOC_IA64_FPTR64LSB1220 - : BFD_RELOC_IA64_PCREL21B1221 - : BFD_RELOC_IA64_PCREL21BI1222 - : BFD_RELOC_IA64_PCREL21M1223 - : BFD_RELOC_IA64_PCREL21F1224 - : BFD_RELOC_IA64_PCREL221225 - : BFD_RELOC_IA64_PCREL60B1226 - : BFD_RELOC_IA64_PCREL64I1227 - : BFD_RELOC_IA64_PCREL32MSB1228 - : BFD_RELOC_IA64_PCREL32LSB1229 - : BFD_RELOC_IA64_PCREL64MSB1230 - : BFD_RELOC_IA64_PCREL64LSB1231 - : BFD_RELOC_IA64_LTOFF_FPTR221232 - : BFD_RELOC_IA64_LTOFF_FPTR64I1233 - : BFD_RELOC_IA64_LTOFF_FPTR64MSB1234 - : BFD_RELOC_IA64_LTOFF_FPTR64LSB1235 - : BFD_RELOC_IA64_SEGREL32MSB1236 - : BFD_RELOC_IA64_SEGREL32LSB1237 - : BFD_RELOC_IA64_SEGREL64MSB1238 - : BFD_RELOC_IA64_SEGREL64LSB1239 - : BFD_RELOC_IA64_SECREL32MSB1240 - : BFD_RELOC_IA64_SECREL32LSB1241 - : BFD_RELOC_IA64_SECREL64MSB1242 - : BFD_RELOC_IA64_SECREL64LSB1243 - : BFD_RELOC_IA64_REL32MSB1244 - : BFD_RELOC_IA64_REL32LSB1245 - : BFD_RELOC_IA64_REL64MSB1246 - : BFD_RELOC_IA64_REL64LSB1247 - : BFD_RELOC_IA64_LTV32MSB1248 - : BFD_RELOC_IA64_LTV32LSB1249 - : BFD_RELOC_IA64_LTV64MSB1250 - : BFD_RELOC_IA64_LTV64LSB1251 - : BFD_RELOC_IA64_IPLTMSB1252 - : BFD_RELOC_IA64_IPLTLSB1253 - : BFD_RELOC_IA64_COPY1254 - : BFD_RELOC_IA64_TPREL221255 - : BFD_RELOC_IA64_TPREL64MSB1256 - : BFD_RELOC_IA64_TPREL64LSB1257 - : BFD_RELOC_IA64_LTOFF_TP221258 - : BFD_RELOC_IA64_LTOFF22X1259 - : BFD_RELOC_IA64_LDXMOV1260 Intel IA64 Relocations.1261 1262 - : BFD_RELOC_M68HC11_HI81263 Motorola 68HC11 reloc. This is the 8 bits high part of an1264 absolute address.1265 1266 - : BFD_RELOC_M68HC11_LO81267 Motorola 68HC11 reloc. This is the 8 bits low part of an absolute1268 address.1269 1270 - : BFD_RELOC_M68HC11_3B1271 Motorola 68HC11 reloc. This is the 3 bits of a value.1272 1273 - : BFD_RELOC_CRIS_BDISP81274 - : BFD_RELOC_CRIS_UNSIGNED_51275 - : BFD_RELOC_CRIS_SIGNED_61276 - : BFD_RELOC_CRIS_UNSIGNED_61277 - : BFD_RELOC_CRIS_UNSIGNED_41278 These relocs are only used within the CRIS assembler. They are not1279 (at present) written to any object files.1280 1281 - : BFD_RELOC_860_COPY1282 - : BFD_RELOC_860_GLOB_DAT1283 - : BFD_RELOC_860_JUMP_SLOT1284 - : BFD_RELOC_860_RELATIVE1285 - : BFD_RELOC_860_PC261286 - : BFD_RELOC_860_PLT261287 - : BFD_RELOC_860_PC161288 - : BFD_RELOC_860_LOW01289 - : BFD_RELOC_860_SPLIT01290 - : BFD_RELOC_860_LOW11291 - : BFD_RELOC_860_SPLIT11292 - : BFD_RELOC_860_LOW21293 - : BFD_RELOC_860_SPLIT21294 - : BFD_RELOC_860_LOW31295 - : BFD_RELOC_860_LOGOT01296 - : BFD_RELOC_860_SPGOT01297 - : BFD_RELOC_860_LOGOT11298 - : BFD_RELOC_860_SPGOT11299 - : BFD_RELOC_860_LOGOTOFF01300 - : BFD_RELOC_860_SPGOTOFF01301 - : BFD_RELOC_860_LOGOTOFF11302 - : BFD_RELOC_860_SPGOTOFF11303 - : BFD_RELOC_860_LOGOTOFF21304 - : BFD_RELOC_860_LOGOTOFF31305 - : BFD_RELOC_860_LOPC1306 - : BFD_RELOC_860_HIGHADJ1307 - : BFD_RELOC_860_HAGOT1308 - : BFD_RELOC_860_HAGOTOFF1309 - : BFD_RELOC_860_HAPC1310 - : BFD_RELOC_860_HIGH1311 - : BFD_RELOC_860_HIGOT1312 - : BFD_RELOC_860_HIGOTOFF1313 Intel i860 Relocations.1314 1315 1316 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;1317 1318 `bfd_reloc_type_lookup'1319 .......................1320 1321 *Synopsis*1322 reloc_howto_type *1323 bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);1324 *Description*1325 Return a pointer to a howto structure which, when invoked, will perform1326 the relocation CODE on data from the architecture noted.1327 1328 `bfd_default_reloc_type_lookup'1329 ...............................1330 1331 *Synopsis*1332 reloc_howto_type *bfd_default_reloc_type_lookup1333 (bfd *abfd, bfd_reloc_code_real_type code);1334 *Description*1335 Provides a default relocation lookup routine for any architecture.1336 1337 `bfd_get_reloc_code_name'1338 .........................1339 1340 *Synopsis*1341 const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);1342 *Description*1343 Provides a printable name for the supplied relocation code. Useful1344 mainly for printing error messages.1345 1346 `bfd_generic_relax_section'1347 ...........................1348 1349 *Synopsis*1350 boolean bfd_generic_relax_section1351 (bfd *abfd,1352 asection *section,1353 struct bfd_link_info *,1354 boolean *);1355 *Description*1356 Provides default handling for relaxing for back ends which don't do1357 relaxing - i.e., does nothing.1358 1359 `bfd_generic_gc_sections'1360 .........................1361 1362 *Synopsis*1363 boolean bfd_generic_gc_sections1364 (bfd *, struct bfd_link_info *);1365 *Description*1366 Provides default handling for relaxing for back ends which don't do1367 section gc - i.e., does nothing.1368 1369 `bfd_generic_get_relocated_section_contents'1370 ............................................1371 1372 *Synopsis*1373 bfd_byte *1374 bfd_generic_get_relocated_section_contents (bfd *abfd,1375 struct bfd_link_info *link_info,1376 struct bfd_link_order *link_order,1377 bfd_byte *data,1378 boolean relocateable,1379 asymbol **symbols);1380 *Description*1381 Provides default handling of relocation effort for back ends which1382 can't be bothered to do it efficiently.1383 1384 1385 File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end1386 1387 Core files1388 ==========1389 1390 *Description*1391 These are functions pertaining to core files.1392 1393 `bfd_core_file_failing_command'1394 ...............................1395 1396 *Synopsis*1397 CONST char *bfd_core_file_failing_command(bfd *abfd);1398 *Description*1399 Return a read-only string explaining which program was running when it1400 failed and produced the core file ABFD.1401 1402 `bfd_core_file_failing_signal'1403 ..............................1404 1405 *Synopsis*1406 int bfd_core_file_failing_signal(bfd *abfd);1407 *Description*1408 Returns the signal number which caused the core dump which generated1409 the file the BFD ABFD is attached to.1410 1411 `core_file_matches_executable_p'1412 ................................1413 1414 *Synopsis*1415 boolean core_file_matches_executable_p1416 (bfd *core_bfd, bfd *exec_bfd);1417 *Description*1418 Return `true' if the core file attached to CORE_BFD was generated by a1419 run of the executable file attached to EXEC_BFD, `false' otherwise.1420 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-4
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 17 17 18 18 19 File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations 20 21 The howto manager 22 ================= 23 24 When an application wants to create a relocation, but doesn't know 25 what the target machine might call it, it can find out by using this 26 bit of code. 27 28 `bfd_reloc_code_type' 29 ..................... 30 31 *Description* 32 The insides of a reloc code. The idea is that, eventually, there will 33 be one enumerator for every type of relocation we ever do. Pass one of 34 these values to `bfd_reloc_type_lookup', and it'll return a howto 35 pointer. 36 37 This does mean that the application must determine the correct 38 enumerator value; you can't get a howto pointer from a random set of 39 attributes. 40 41 Here are the possible values for `enum bfd_reloc_code_real': 42 43 - : BFD_RELOC_64 44 - : BFD_RELOC_32 45 - : BFD_RELOC_26 46 - : BFD_RELOC_24 47 - : BFD_RELOC_16 48 - : BFD_RELOC_14 49 - : BFD_RELOC_8 50 Basic absolute relocations of N bits. 51 52 - : BFD_RELOC_64_PCREL 53 - : BFD_RELOC_32_PCREL 54 - : BFD_RELOC_24_PCREL 55 - : BFD_RELOC_16_PCREL 56 - : BFD_RELOC_12_PCREL 57 - : BFD_RELOC_8_PCREL 58 PC-relative relocations. Sometimes these are relative to the 59 address of the relocation itself; sometimes they are relative to 60 the start of the section containing the relocation. It depends on 61 the specific target. 62 63 The 24-bit relocation is used in some Intel 960 configurations. 64 65 - : BFD_RELOC_32_GOT_PCREL 66 - : BFD_RELOC_16_GOT_PCREL 67 - : BFD_RELOC_8_GOT_PCREL 68 - : BFD_RELOC_32_GOTOFF 69 - : BFD_RELOC_16_GOTOFF 70 - : BFD_RELOC_LO16_GOTOFF 71 - : BFD_RELOC_HI16_GOTOFF 72 - : BFD_RELOC_HI16_S_GOTOFF 73 - : BFD_RELOC_8_GOTOFF 74 - : BFD_RELOC_64_PLT_PCREL 75 - : BFD_RELOC_32_PLT_PCREL 76 - : BFD_RELOC_24_PLT_PCREL 77 - : BFD_RELOC_16_PLT_PCREL 78 - : BFD_RELOC_8_PLT_PCREL 79 - : BFD_RELOC_64_PLTOFF 80 - : BFD_RELOC_32_PLTOFF 81 - : BFD_RELOC_16_PLTOFF 82 - : BFD_RELOC_LO16_PLTOFF 83 - : BFD_RELOC_HI16_PLTOFF 84 - : BFD_RELOC_HI16_S_PLTOFF 85 - : BFD_RELOC_8_PLTOFF 86 For ELF. 87 88 - : BFD_RELOC_68K_GLOB_DAT 89 - : BFD_RELOC_68K_JMP_SLOT 90 - : BFD_RELOC_68K_RELATIVE 91 Relocations used by 68K ELF. 92 93 - : BFD_RELOC_32_BASEREL 94 - : BFD_RELOC_16_BASEREL 95 - : BFD_RELOC_LO16_BASEREL 96 - : BFD_RELOC_HI16_BASEREL 97 - : BFD_RELOC_HI16_S_BASEREL 98 - : BFD_RELOC_8_BASEREL 99 - : BFD_RELOC_RVA 100 Linkage-table relative. 101 102 - : BFD_RELOC_8_FFnn 103 Absolute 8-bit relocation, but used to form an address like 0xFFnn. 104 105 - : BFD_RELOC_32_PCREL_S2 106 - : BFD_RELOC_16_PCREL_S2 107 - : BFD_RELOC_23_PCREL_S2 108 These PC-relative relocations are stored as word displacements - 109 i.e., byte displacements shifted right two bits. The 30-bit word 110 displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the 111 SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 112 signed 16-bit displacement is used on the MIPS, and the 23-bit 113 displacement is used on the Alpha. 114 115 - : BFD_RELOC_HI22 116 - : BFD_RELOC_LO10 117 High 22 bits and low 10 bits of 32-bit value, placed into lower 118 bits of the target word. These are used on the SPARC. 119 120 - : BFD_RELOC_GPREL16 121 - : BFD_RELOC_GPREL32 122 For systems that allocate a Global Pointer register, these are 123 displacements off that register. These relocation types are 124 handled specially, because the value the register will have is 125 decided relatively late. 126 127 - : BFD_RELOC_I960_CALLJ 128 Reloc types used for i960/b.out. 129 130 - : BFD_RELOC_NONE 131 - : BFD_RELOC_SPARC_WDISP22 132 - : BFD_RELOC_SPARC22 133 - : BFD_RELOC_SPARC13 134 - : BFD_RELOC_SPARC_GOT10 135 - : BFD_RELOC_SPARC_GOT13 136 - : BFD_RELOC_SPARC_GOT22 137 - : BFD_RELOC_SPARC_PC10 138 - : BFD_RELOC_SPARC_PC22 139 - : BFD_RELOC_SPARC_WPLT30 140 - : BFD_RELOC_SPARC_COPY 141 - : BFD_RELOC_SPARC_GLOB_DAT 142 - : BFD_RELOC_SPARC_JMP_SLOT 143 - : BFD_RELOC_SPARC_RELATIVE 144 - : BFD_RELOC_SPARC_UA16 145 - : BFD_RELOC_SPARC_UA32 146 - : BFD_RELOC_SPARC_UA64 147 SPARC ELF relocations. There is probably some overlap with other 148 relocation types already defined. 149 150 - : BFD_RELOC_SPARC_BASE13 151 - : BFD_RELOC_SPARC_BASE22 152 I think these are specific to SPARC a.out (e.g., Sun 4). 153 154 - : BFD_RELOC_SPARC_64 155 - : BFD_RELOC_SPARC_10 156 - : BFD_RELOC_SPARC_11 157 - : BFD_RELOC_SPARC_OLO10 158 - : BFD_RELOC_SPARC_HH22 159 - : BFD_RELOC_SPARC_HM10 160 - : BFD_RELOC_SPARC_LM22 161 - : BFD_RELOC_SPARC_PC_HH22 162 - : BFD_RELOC_SPARC_PC_HM10 163 - : BFD_RELOC_SPARC_PC_LM22 164 - : BFD_RELOC_SPARC_WDISP16 165 - : BFD_RELOC_SPARC_WDISP19 166 - : BFD_RELOC_SPARC_7 167 - : BFD_RELOC_SPARC_6 168 - : BFD_RELOC_SPARC_5 169 - : BFD_RELOC_SPARC_DISP64 170 - : BFD_RELOC_SPARC_PLT32 171 - : BFD_RELOC_SPARC_PLT64 172 - : BFD_RELOC_SPARC_HIX22 173 - : BFD_RELOC_SPARC_LOX10 174 - : BFD_RELOC_SPARC_H44 175 - : BFD_RELOC_SPARC_M44 176 - : BFD_RELOC_SPARC_L44 177 - : BFD_RELOC_SPARC_REGISTER 178 SPARC64 relocations 179 180 - : BFD_RELOC_SPARC_REV32 181 SPARC little endian relocation 182 183 - : BFD_RELOC_SPARC_TLS_GD_HI22 184 - : BFD_RELOC_SPARC_TLS_GD_LO10 185 - : BFD_RELOC_SPARC_TLS_GD_ADD 186 - : BFD_RELOC_SPARC_TLS_GD_CALL 187 - : BFD_RELOC_SPARC_TLS_LDM_HI22 188 - : BFD_RELOC_SPARC_TLS_LDM_LO10 189 - : BFD_RELOC_SPARC_TLS_LDM_ADD 190 - : BFD_RELOC_SPARC_TLS_LDM_CALL 191 - : BFD_RELOC_SPARC_TLS_LDO_HIX22 192 - : BFD_RELOC_SPARC_TLS_LDO_LOX10 193 - : BFD_RELOC_SPARC_TLS_LDO_ADD 194 - : BFD_RELOC_SPARC_TLS_IE_HI22 195 - : BFD_RELOC_SPARC_TLS_IE_LO10 196 - : BFD_RELOC_SPARC_TLS_IE_LD 197 - : BFD_RELOC_SPARC_TLS_IE_LDX 198 - : BFD_RELOC_SPARC_TLS_IE_ADD 199 - : BFD_RELOC_SPARC_TLS_LE_HIX22 200 - : BFD_RELOC_SPARC_TLS_LE_LOX10 201 - : BFD_RELOC_SPARC_TLS_DTPMOD32 202 - : BFD_RELOC_SPARC_TLS_DTPMOD64 203 - : BFD_RELOC_SPARC_TLS_DTPOFF32 204 - : BFD_RELOC_SPARC_TLS_DTPOFF64 205 - : BFD_RELOC_SPARC_TLS_TPOFF32 206 - : BFD_RELOC_SPARC_TLS_TPOFF64 207 SPARC TLS relocations 208 209 - : BFD_RELOC_ALPHA_GPDISP_HI16 210 Alpha ECOFF and ELF relocations. Some of these treat the symbol or 211 "addend" in some special way. For GPDISP_HI16 ("gpdisp") 212 relocations, the symbol is ignored when writing; when reading, it 213 will be the absolute section symbol. The addend is the 214 displacement in bytes of the "lda" instruction from the "ldah" 215 instruction (which is at the address of this reloc). 216 217 - : BFD_RELOC_ALPHA_GPDISP_LO16 218 For GPDISP_LO16 ("ignore") relocations, the symbol is handled as 219 with GPDISP_HI16 relocs. The addend is ignored when writing the 220 relocations out, and is filled in with the file's GP value on 221 reading, for convenience. 222 223 - : BFD_RELOC_ALPHA_GPDISP 224 The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 225 relocation except that there is no accompanying GPDISP_LO16 226 relocation. 227 228 - : BFD_RELOC_ALPHA_LITERAL 229 - : BFD_RELOC_ALPHA_ELF_LITERAL 230 - : BFD_RELOC_ALPHA_LITUSE 231 The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; 232 the assembler turns it into a LDQ instruction to load the address 233 of the symbol, and then fills in a register in the real 234 instruction. 235 236 The LITERAL reloc, at the LDQ instruction, refers to the .lita 237 section symbol. The addend is ignored when writing, but is filled 238 in with the file's GP value on reading, for convenience, as with 239 the GPDISP_LO16 reloc. 240 241 The ELF_LITERAL reloc is somewhere between 16_GOTOFF and 242 GPDISP_LO16. It should refer to the symbol to be referenced, as 243 with 16_GOTOFF, but it generates output not based on the position 244 within the .got section, but relative to the GP value chosen for 245 the file during the final link stage. 246 247 The LITUSE reloc, on the instruction using the loaded address, 248 gives information to the linker that it might be able to use to 249 optimize away some literal section references. The symbol is 250 ignored (read as the absolute section symbol), and the "addend" 251 indicates the type of instruction using the register: 1 - "memory" 252 fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target 253 of branch) 254 255 - : BFD_RELOC_ALPHA_HINT 256 The HINT relocation indicates a value that should be filled into 257 the "hint" field of a jmp/jsr/ret instruction, for possible branch- 258 prediction logic which may be provided on some processors. 259 260 - : BFD_RELOC_ALPHA_LINKAGE 261 The LINKAGE relocation outputs a linkage pair in the object file, 262 which is filled by the linker. 263 264 - : BFD_RELOC_ALPHA_CODEADDR 265 The CODEADDR relocation outputs a STO_CA in the object file, which 266 is filled by the linker. 267 268 - : BFD_RELOC_ALPHA_GPREL_HI16 269 - : BFD_RELOC_ALPHA_GPREL_LO16 270 The GPREL_HI/LO relocations together form a 32-bit offset from the 271 GP register. 272 273 - : BFD_RELOC_ALPHA_BRSGP 274 Like BFD_RELOC_23_PCREL_S2, except that the source and target must 275 share a common GP, and the target address is adjusted for 276 STO_ALPHA_STD_GPLOAD. 277 278 - : BFD_RELOC_ALPHA_TLSGD 279 - : BFD_RELOC_ALPHA_TLSLDM 280 - : BFD_RELOC_ALPHA_DTPMOD64 281 - : BFD_RELOC_ALPHA_GOTDTPREL16 282 - : BFD_RELOC_ALPHA_DTPREL64 283 - : BFD_RELOC_ALPHA_DTPREL_HI16 284 - : BFD_RELOC_ALPHA_DTPREL_LO16 285 - : BFD_RELOC_ALPHA_DTPREL16 286 - : BFD_RELOC_ALPHA_GOTTPREL16 287 - : BFD_RELOC_ALPHA_TPREL64 288 - : BFD_RELOC_ALPHA_TPREL_HI16 289 - : BFD_RELOC_ALPHA_TPREL_LO16 290 - : BFD_RELOC_ALPHA_TPREL16 291 Alpha thread-local storage relocations. 292 293 - : BFD_RELOC_MIPS_JMP 294 Bits 27..2 of the relocation address shifted right 2 bits; simple 295 reloc otherwise. 296 297 - : BFD_RELOC_MIPS16_JMP 298 The MIPS16 jump instruction. 299 300 - : BFD_RELOC_MIPS16_GPREL 301 MIPS16 GP relative reloc. 302 303 - : BFD_RELOC_HI16 304 High 16 bits of 32-bit value; simple reloc. 305 306 - : BFD_RELOC_HI16_S 307 High 16 bits of 32-bit value but the low 16 bits will be sign 308 extended and added to form the final result. If the low 16 bits 309 form a negative number, we need to add one to the high value to 310 compensate for the borrow when the low bits are added. 311 312 - : BFD_RELOC_LO16 313 Low 16 bits. 314 315 - : BFD_RELOC_PCREL_HI16_S 316 Like BFD_RELOC_HI16_S, but PC relative. 317 318 - : BFD_RELOC_PCREL_LO16 319 Like BFD_RELOC_LO16, but PC relative. 320 321 - : BFD_RELOC_MIPS_LITERAL 322 Relocation against a MIPS literal section. 323 324 - : BFD_RELOC_MIPS_GOT16 325 - : BFD_RELOC_MIPS_CALL16 326 - : BFD_RELOC_MIPS_GOT_HI16 327 - : BFD_RELOC_MIPS_GOT_LO16 328 - : BFD_RELOC_MIPS_CALL_HI16 329 - : BFD_RELOC_MIPS_CALL_LO16 330 - : BFD_RELOC_MIPS_SUB 331 - : BFD_RELOC_MIPS_GOT_PAGE 332 - : BFD_RELOC_MIPS_GOT_OFST 333 - : BFD_RELOC_MIPS_GOT_DISP 334 - : BFD_RELOC_MIPS_SHIFT5 335 - : BFD_RELOC_MIPS_SHIFT6 336 - : BFD_RELOC_MIPS_INSERT_A 337 - : BFD_RELOC_MIPS_INSERT_B 338 - : BFD_RELOC_MIPS_DELETE 339 - : BFD_RELOC_MIPS_HIGHEST 340 - : BFD_RELOC_MIPS_HIGHER 341 - : BFD_RELOC_MIPS_SCN_DISP 342 - : BFD_RELOC_MIPS_REL16 343 - : BFD_RELOC_MIPS_RELGOT 344 - : BFD_RELOC_MIPS_JALR 345 - : BFD_RELOC_FRV_LABEL16 346 - : BFD_RELOC_FRV_LABEL24 347 - : BFD_RELOC_FRV_LO16 348 - : BFD_RELOC_FRV_HI16 349 - : BFD_RELOC_FRV_GPREL12 350 - : BFD_RELOC_FRV_GPRELU12 351 - : BFD_RELOC_FRV_GPREL32 352 - : BFD_RELOC_FRV_GPRELHI 353 - : BFD_RELOC_FRV_GPRELLO 354 Fujitsu Frv Relocations. 355 MIPS ELF relocations. 356 357 - : BFD_RELOC_386_GOT32 358 - : BFD_RELOC_386_PLT32 359 - : BFD_RELOC_386_COPY 360 - : BFD_RELOC_386_GLOB_DAT 361 - : BFD_RELOC_386_JUMP_SLOT 362 - : BFD_RELOC_386_RELATIVE 363 - : BFD_RELOC_386_GOTOFF 364 - : BFD_RELOC_386_GOTPC 365 - : BFD_RELOC_386_TLS_TPOFF 366 - : BFD_RELOC_386_TLS_IE 367 - : BFD_RELOC_386_TLS_GOTIE 368 - : BFD_RELOC_386_TLS_LE 369 - : BFD_RELOC_386_TLS_GD 370 - : BFD_RELOC_386_TLS_LDM 371 - : BFD_RELOC_386_TLS_LDO_32 372 - : BFD_RELOC_386_TLS_IE_32 373 - : BFD_RELOC_386_TLS_LE_32 374 - : BFD_RELOC_386_TLS_DTPMOD32 375 - : BFD_RELOC_386_TLS_DTPOFF32 376 - : BFD_RELOC_386_TLS_TPOFF32 377 i386/elf relocations 378 379 - : BFD_RELOC_X86_64_GOT32 380 - : BFD_RELOC_X86_64_PLT32 381 - : BFD_RELOC_X86_64_COPY 382 - : BFD_RELOC_X86_64_GLOB_DAT 383 - : BFD_RELOC_X86_64_JUMP_SLOT 384 - : BFD_RELOC_X86_64_RELATIVE 385 - : BFD_RELOC_X86_64_GOTPCREL 386 - : BFD_RELOC_X86_64_32S 387 - : BFD_RELOC_X86_64_DTPMOD64 388 - : BFD_RELOC_X86_64_DTPOFF64 389 - : BFD_RELOC_X86_64_TPOFF64 390 - : BFD_RELOC_X86_64_TLSGD 391 - : BFD_RELOC_X86_64_TLSLD 392 - : BFD_RELOC_X86_64_DTPOFF32 393 - : BFD_RELOC_X86_64_GOTTPOFF 394 - : BFD_RELOC_X86_64_TPOFF32 395 x86-64/elf relocations 396 397 - : BFD_RELOC_NS32K_IMM_8 398 - : BFD_RELOC_NS32K_IMM_16 399 - : BFD_RELOC_NS32K_IMM_32 400 - : BFD_RELOC_NS32K_IMM_8_PCREL 401 - : BFD_RELOC_NS32K_IMM_16_PCREL 402 - : BFD_RELOC_NS32K_IMM_32_PCREL 403 - : BFD_RELOC_NS32K_DISP_8 404 - : BFD_RELOC_NS32K_DISP_16 405 - : BFD_RELOC_NS32K_DISP_32 406 - : BFD_RELOC_NS32K_DISP_8_PCREL 407 - : BFD_RELOC_NS32K_DISP_16_PCREL 408 - : BFD_RELOC_NS32K_DISP_32_PCREL 409 ns32k relocations 410 411 - : BFD_RELOC_PDP11_DISP_8_PCREL 412 - : BFD_RELOC_PDP11_DISP_6_PCREL 413 PDP11 relocations 414 415 - : BFD_RELOC_PJ_CODE_HI16 416 - : BFD_RELOC_PJ_CODE_LO16 417 - : BFD_RELOC_PJ_CODE_DIR16 418 - : BFD_RELOC_PJ_CODE_DIR32 419 - : BFD_RELOC_PJ_CODE_REL16 420 - : BFD_RELOC_PJ_CODE_REL32 421 Picojava relocs. Not all of these appear in object files. 422 423 - : BFD_RELOC_PPC_B26 424 - : BFD_RELOC_PPC_BA26 425 - : BFD_RELOC_PPC_TOC16 426 - : BFD_RELOC_PPC_B16 427 - : BFD_RELOC_PPC_B16_BRTAKEN 428 - : BFD_RELOC_PPC_B16_BRNTAKEN 429 - : BFD_RELOC_PPC_BA16 430 - : BFD_RELOC_PPC_BA16_BRTAKEN 431 - : BFD_RELOC_PPC_BA16_BRNTAKEN 432 - : BFD_RELOC_PPC_COPY 433 - : BFD_RELOC_PPC_GLOB_DAT 434 - : BFD_RELOC_PPC_JMP_SLOT 435 - : BFD_RELOC_PPC_RELATIVE 436 - : BFD_RELOC_PPC_LOCAL24PC 437 - : BFD_RELOC_PPC_EMB_NADDR32 438 - : BFD_RELOC_PPC_EMB_NADDR16 439 - : BFD_RELOC_PPC_EMB_NADDR16_LO 440 - : BFD_RELOC_PPC_EMB_NADDR16_HI 441 - : BFD_RELOC_PPC_EMB_NADDR16_HA 442 - : BFD_RELOC_PPC_EMB_SDAI16 443 - : BFD_RELOC_PPC_EMB_SDA2I16 444 - : BFD_RELOC_PPC_EMB_SDA2REL 445 - : BFD_RELOC_PPC_EMB_SDA21 446 - : BFD_RELOC_PPC_EMB_MRKREF 447 - : BFD_RELOC_PPC_EMB_RELSEC16 448 - : BFD_RELOC_PPC_EMB_RELST_LO 449 - : BFD_RELOC_PPC_EMB_RELST_HI 450 - : BFD_RELOC_PPC_EMB_RELST_HA 451 - : BFD_RELOC_PPC_EMB_BIT_FLD 452 - : BFD_RELOC_PPC_EMB_RELSDA 453 - : BFD_RELOC_PPC64_HIGHER 454 - : BFD_RELOC_PPC64_HIGHER_S 455 - : BFD_RELOC_PPC64_HIGHEST 456 - : BFD_RELOC_PPC64_HIGHEST_S 457 - : BFD_RELOC_PPC64_TOC16_LO 458 - : BFD_RELOC_PPC64_TOC16_HI 459 - : BFD_RELOC_PPC64_TOC16_HA 460 - : BFD_RELOC_PPC64_TOC 461 - : BFD_RELOC_PPC64_PLTGOT16 462 - : BFD_RELOC_PPC64_PLTGOT16_LO 463 - : BFD_RELOC_PPC64_PLTGOT16_HI 464 - : BFD_RELOC_PPC64_PLTGOT16_HA 465 - : BFD_RELOC_PPC64_ADDR16_DS 466 - : BFD_RELOC_PPC64_ADDR16_LO_DS 467 - : BFD_RELOC_PPC64_GOT16_DS 468 - : BFD_RELOC_PPC64_GOT16_LO_DS 469 - : BFD_RELOC_PPC64_PLT16_LO_DS 470 - : BFD_RELOC_PPC64_SECTOFF_DS 471 - : BFD_RELOC_PPC64_SECTOFF_LO_DS 472 - : BFD_RELOC_PPC64_TOC16_DS 473 - : BFD_RELOC_PPC64_TOC16_LO_DS 474 - : BFD_RELOC_PPC64_PLTGOT16_DS 475 - : BFD_RELOC_PPC64_PLTGOT16_LO_DS 476 Power(rs6000) and PowerPC relocations. 477 478 - : BFD_RELOC_PPC_TLS 479 - : BFD_RELOC_PPC_DTPMOD 480 - : BFD_RELOC_PPC_TPREL16 481 - : BFD_RELOC_PPC_TPREL16_LO 482 - : BFD_RELOC_PPC_TPREL16_HI 483 - : BFD_RELOC_PPC_TPREL16_HA 484 - : BFD_RELOC_PPC_TPREL 485 - : BFD_RELOC_PPC_DTPREL16 486 - : BFD_RELOC_PPC_DTPREL16_LO 487 - : BFD_RELOC_PPC_DTPREL16_HI 488 - : BFD_RELOC_PPC_DTPREL16_HA 489 - : BFD_RELOC_PPC_DTPREL 490 - : BFD_RELOC_PPC_GOT_TLSGD16 491 - : BFD_RELOC_PPC_GOT_TLSGD16_LO 492 - : BFD_RELOC_PPC_GOT_TLSGD16_HI 493 - : BFD_RELOC_PPC_GOT_TLSGD16_HA 494 - : BFD_RELOC_PPC_GOT_TLSLD16 495 - : BFD_RELOC_PPC_GOT_TLSLD16_LO 496 - : BFD_RELOC_PPC_GOT_TLSLD16_HI 497 - : BFD_RELOC_PPC_GOT_TLSLD16_HA 498 - : BFD_RELOC_PPC_GOT_TPREL16 499 - : BFD_RELOC_PPC_GOT_TPREL16_LO 500 - : BFD_RELOC_PPC_GOT_TPREL16_HI 501 - : BFD_RELOC_PPC_GOT_TPREL16_HA 502 - : BFD_RELOC_PPC_GOT_DTPREL16 503 - : BFD_RELOC_PPC_GOT_DTPREL16_LO 504 - : BFD_RELOC_PPC_GOT_DTPREL16_HI 505 - : BFD_RELOC_PPC_GOT_DTPREL16_HA 506 - : BFD_RELOC_PPC64_TPREL16_DS 507 - : BFD_RELOC_PPC64_TPREL16_LO_DS 508 - : BFD_RELOC_PPC64_TPREL16_HIGHER 509 - : BFD_RELOC_PPC64_TPREL16_HIGHERA 510 - : BFD_RELOC_PPC64_TPREL16_HIGHEST 511 - : BFD_RELOC_PPC64_TPREL16_HIGHESTA 512 - : BFD_RELOC_PPC64_DTPREL16_DS 513 - : BFD_RELOC_PPC64_DTPREL16_LO_DS 514 - : BFD_RELOC_PPC64_DTPREL16_HIGHER 515 - : BFD_RELOC_PPC64_DTPREL16_HIGHERA 516 - : BFD_RELOC_PPC64_DTPREL16_HIGHEST 517 - : BFD_RELOC_PPC64_DTPREL16_HIGHESTA 518 PowerPC and PowerPC64 thread-local storage relocations. 519 520 - : BFD_RELOC_I370_D12 521 IBM 370/390 relocations 522 523 - : BFD_RELOC_CTOR 524 The type of reloc used to build a contructor table - at the moment 525 probably a 32 bit wide absolute relocation, but the target can 526 choose. It generally does map to one of the other relocation 527 types. 528 529 - : BFD_RELOC_ARM_PCREL_BRANCH 530 ARM 26 bit pc-relative branch. The lowest two bits must be zero 531 and are not stored in the instruction. 532 533 - : BFD_RELOC_ARM_PCREL_BLX 534 ARM 26 bit pc-relative branch. The lowest bit must be zero and is 535 not stored in the instruction. The 2nd lowest bit comes from a 1 536 bit field in the instruction. 537 538 - : BFD_RELOC_THUMB_PCREL_BLX 539 Thumb 22 bit pc-relative branch. The lowest bit must be zero and 540 is not stored in the instruction. The 2nd lowest bit comes from a 541 1 bit field in the instruction. 542 543 - : BFD_RELOC_ARM_IMMEDIATE 544 - : BFD_RELOC_ARM_ADRL_IMMEDIATE 545 - : BFD_RELOC_ARM_OFFSET_IMM 546 - : BFD_RELOC_ARM_SHIFT_IMM 547 - : BFD_RELOC_ARM_SWI 548 - : BFD_RELOC_ARM_MULTI 549 - : BFD_RELOC_ARM_CP_OFF_IMM 550 - : BFD_RELOC_ARM_CP_OFF_IMM_S2 551 - : BFD_RELOC_ARM_ADR_IMM 552 - : BFD_RELOC_ARM_LDR_IMM 553 - : BFD_RELOC_ARM_LITERAL 554 - : BFD_RELOC_ARM_IN_POOL 555 - : BFD_RELOC_ARM_OFFSET_IMM8 556 - : BFD_RELOC_ARM_HWLITERAL 557 - : BFD_RELOC_ARM_THUMB_ADD 558 - : BFD_RELOC_ARM_THUMB_IMM 559 - : BFD_RELOC_ARM_THUMB_SHIFT 560 - : BFD_RELOC_ARM_THUMB_OFFSET 561 - : BFD_RELOC_ARM_GOT12 562 - : BFD_RELOC_ARM_GOT32 563 - : BFD_RELOC_ARM_JUMP_SLOT 564 - : BFD_RELOC_ARM_COPY 565 - : BFD_RELOC_ARM_GLOB_DAT 566 - : BFD_RELOC_ARM_PLT32 567 - : BFD_RELOC_ARM_RELATIVE 568 - : BFD_RELOC_ARM_GOTOFF 569 - : BFD_RELOC_ARM_GOTPC 570 These relocs are only used within the ARM assembler. They are not 571 (at present) written to any object files. 572 573 - : BFD_RELOC_SH_PCDISP8BY2 574 - : BFD_RELOC_SH_PCDISP12BY2 575 - : BFD_RELOC_SH_IMM4 576 - : BFD_RELOC_SH_IMM4BY2 577 - : BFD_RELOC_SH_IMM4BY4 578 - : BFD_RELOC_SH_IMM8 579 - : BFD_RELOC_SH_IMM8BY2 580 - : BFD_RELOC_SH_IMM8BY4 581 - : BFD_RELOC_SH_PCRELIMM8BY2 582 - : BFD_RELOC_SH_PCRELIMM8BY4 583 - : BFD_RELOC_SH_SWITCH16 584 - : BFD_RELOC_SH_SWITCH32 585 - : BFD_RELOC_SH_USES 586 - : BFD_RELOC_SH_COUNT 587 - : BFD_RELOC_SH_ALIGN 588 - : BFD_RELOC_SH_CODE 589 - : BFD_RELOC_SH_DATA 590 - : BFD_RELOC_SH_LABEL 591 - : BFD_RELOC_SH_LOOP_START 592 - : BFD_RELOC_SH_LOOP_END 593 - : BFD_RELOC_SH_COPY 594 - : BFD_RELOC_SH_GLOB_DAT 595 - : BFD_RELOC_SH_JMP_SLOT 596 - : BFD_RELOC_SH_RELATIVE 597 - : BFD_RELOC_SH_GOTPC 598 - : BFD_RELOC_SH_GOT_LOW16 599 - : BFD_RELOC_SH_GOT_MEDLOW16 600 - : BFD_RELOC_SH_GOT_MEDHI16 601 - : BFD_RELOC_SH_GOT_HI16 602 - : BFD_RELOC_SH_GOTPLT_LOW16 603 - : BFD_RELOC_SH_GOTPLT_MEDLOW16 604 - : BFD_RELOC_SH_GOTPLT_MEDHI16 605 - : BFD_RELOC_SH_GOTPLT_HI16 606 - : BFD_RELOC_SH_PLT_LOW16 607 - : BFD_RELOC_SH_PLT_MEDLOW16 608 - : BFD_RELOC_SH_PLT_MEDHI16 609 - : BFD_RELOC_SH_PLT_HI16 610 - : BFD_RELOC_SH_GOTOFF_LOW16 611 - : BFD_RELOC_SH_GOTOFF_MEDLOW16 612 - : BFD_RELOC_SH_GOTOFF_MEDHI16 613 - : BFD_RELOC_SH_GOTOFF_HI16 614 - : BFD_RELOC_SH_GOTPC_LOW16 615 - : BFD_RELOC_SH_GOTPC_MEDLOW16 616 - : BFD_RELOC_SH_GOTPC_MEDHI16 617 - : BFD_RELOC_SH_GOTPC_HI16 618 - : BFD_RELOC_SH_COPY64 619 - : BFD_RELOC_SH_GLOB_DAT64 620 - : BFD_RELOC_SH_JMP_SLOT64 621 - : BFD_RELOC_SH_RELATIVE64 622 - : BFD_RELOC_SH_GOT10BY4 623 - : BFD_RELOC_SH_GOT10BY8 624 - : BFD_RELOC_SH_GOTPLT10BY4 625 - : BFD_RELOC_SH_GOTPLT10BY8 626 - : BFD_RELOC_SH_GOTPLT32 627 - : BFD_RELOC_SH_SHMEDIA_CODE 628 - : BFD_RELOC_SH_IMMU5 629 - : BFD_RELOC_SH_IMMS6 630 - : BFD_RELOC_SH_IMMS6BY32 631 - : BFD_RELOC_SH_IMMU6 632 - : BFD_RELOC_SH_IMMS10 633 - : BFD_RELOC_SH_IMMS10BY2 634 - : BFD_RELOC_SH_IMMS10BY4 635 - : BFD_RELOC_SH_IMMS10BY8 636 - : BFD_RELOC_SH_IMMS16 637 - : BFD_RELOC_SH_IMMU16 638 - : BFD_RELOC_SH_IMM_LOW16 639 - : BFD_RELOC_SH_IMM_LOW16_PCREL 640 - : BFD_RELOC_SH_IMM_MEDLOW16 641 - : BFD_RELOC_SH_IMM_MEDLOW16_PCREL 642 - : BFD_RELOC_SH_IMM_MEDHI16 643 - : BFD_RELOC_SH_IMM_MEDHI16_PCREL 644 - : BFD_RELOC_SH_IMM_HI16 645 - : BFD_RELOC_SH_IMM_HI16_PCREL 646 - : BFD_RELOC_SH_PT_16 647 - : BFD_RELOC_SH_TLS_GD_32 648 - : BFD_RELOC_SH_TLS_LD_32 649 - : BFD_RELOC_SH_TLS_LDO_32 650 - : BFD_RELOC_SH_TLS_IE_32 651 - : BFD_RELOC_SH_TLS_LE_32 652 - : BFD_RELOC_SH_TLS_DTPMOD32 653 - : BFD_RELOC_SH_TLS_DTPOFF32 654 - : BFD_RELOC_SH_TLS_TPOFF32 655 Renesas / SuperH SH relocs. Not all of these appear in object 656 files. 657 658 - : BFD_RELOC_THUMB_PCREL_BRANCH9 659 - : BFD_RELOC_THUMB_PCREL_BRANCH12 660 - : BFD_RELOC_THUMB_PCREL_BRANCH23 661 Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must 662 be zero and is not stored in the instruction. 663 664 - : BFD_RELOC_ARC_B22_PCREL 665 ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two 666 bits must be zero and are not stored in the instruction. The high 667 20 bits are installed in bits 26 through 7 of the instruction. 668 669 - : BFD_RELOC_ARC_B26 670 ARC 26 bit absolute branch. The lowest two bits must be zero and 671 are not stored in the instruction. The high 24 bits are installed 672 in bits 23 through 0. 673 674 - : BFD_RELOC_D10V_10_PCREL_R 675 Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 676 bits assumed to be 0. 677 678 - : BFD_RELOC_D10V_10_PCREL_L 679 Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 680 bits assumed to be 0. This is the same as the previous reloc 681 except it is in the left container, i.e., shifted left 15 bits. 682 683 - : BFD_RELOC_D10V_18 684 This is an 18-bit reloc with the right 2 bits assumed to be 0. 685 686 - : BFD_RELOC_D10V_18_PCREL 687 This is an 18-bit reloc with the right 2 bits assumed to be 0. 688 689 - : BFD_RELOC_D30V_6 690 Mitsubishi D30V relocs. This is a 6-bit absolute reloc. 691 692 - : BFD_RELOC_D30V_9_PCREL 693 This is a 6-bit pc-relative reloc with the right 3 bits assumed to 694 be 0. 695 696 - : BFD_RELOC_D30V_9_PCREL_R 697 This is a 6-bit pc-relative reloc with the right 3 bits assumed to 698 be 0. Same as the previous reloc but on the right side of the 699 container. 700 701 - : BFD_RELOC_D30V_15 702 This is a 12-bit absolute reloc with the right 3 bitsassumed to be 703 0. 704 705 - : BFD_RELOC_D30V_15_PCREL 706 This is a 12-bit pc-relative reloc with the right 3 bits assumed 707 to be 0. 708 709 - : BFD_RELOC_D30V_15_PCREL_R 710 This is a 12-bit pc-relative reloc with the right 3 bits assumed 711 to be 0. Same as the previous reloc but on the right side of the 712 container. 713 714 - : BFD_RELOC_D30V_21 715 This is an 18-bit absolute reloc with the right 3 bits assumed to 716 be 0. 717 718 - : BFD_RELOC_D30V_21_PCREL 719 This is an 18-bit pc-relative reloc with the right 3 bits assumed 720 to be 0. 721 722 - : BFD_RELOC_D30V_21_PCREL_R 723 This is an 18-bit pc-relative reloc with the right 3 bits assumed 724 to be 0. Same as the previous reloc but on the right side of the 725 container. 726 727 - : BFD_RELOC_D30V_32 728 This is a 32-bit absolute reloc. 729 730 - : BFD_RELOC_D30V_32_PCREL 731 This is a 32-bit pc-relative reloc. 732 733 - : BFD_RELOC_DLX_HI16_S 734 DLX relocs 735 736 - : BFD_RELOC_DLX_LO16 737 DLX relocs 738 739 - : BFD_RELOC_DLX_JMP26 740 DLX relocs 741 742 - : BFD_RELOC_M32R_24 743 Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit 744 absolute address. 745 746 - : BFD_RELOC_M32R_10_PCREL 747 This is a 10-bit pc-relative reloc with the right 2 bits assumed 748 to be 0. 749 750 - : BFD_RELOC_M32R_18_PCREL 751 This is an 18-bit reloc with the right 2 bits assumed to be 0. 752 753 - : BFD_RELOC_M32R_26_PCREL 754 This is a 26-bit reloc with the right 2 bits assumed to be 0. 755 756 - : BFD_RELOC_M32R_HI16_ULO 757 This is a 16-bit reloc containing the high 16 bits of an address 758 used when the lower 16 bits are treated as unsigned. 759 760 - : BFD_RELOC_M32R_HI16_SLO 761 This is a 16-bit reloc containing the high 16 bits of an address 762 used when the lower 16 bits are treated as signed. 763 764 - : BFD_RELOC_M32R_LO16 765 This is a 16-bit reloc containing the lower 16 bits of an address. 766 767 - : BFD_RELOC_M32R_SDA16 768 This is a 16-bit reloc containing the small data area offset for 769 use in add3, load, and store instructions. 770 771 - : BFD_RELOC_V850_9_PCREL 772 This is a 9-bit reloc 773 774 - : BFD_RELOC_V850_22_PCREL 775 This is a 22-bit reloc 776 777 - : BFD_RELOC_V850_SDA_16_16_OFFSET 778 This is a 16 bit offset from the short data area pointer. 779 780 - : BFD_RELOC_V850_SDA_15_16_OFFSET 781 This is a 16 bit offset (of which only 15 bits are used) from the 782 short data area pointer. 783 784 - : BFD_RELOC_V850_ZDA_16_16_OFFSET 785 This is a 16 bit offset from the zero data area pointer. 786 787 - : BFD_RELOC_V850_ZDA_15_16_OFFSET 788 This is a 16 bit offset (of which only 15 bits are used) from the 789 zero data area pointer. 790 791 - : BFD_RELOC_V850_TDA_6_8_OFFSET 792 This is an 8 bit offset (of which only 6 bits are used) from the 793 tiny data area pointer. 794 795 - : BFD_RELOC_V850_TDA_7_8_OFFSET 796 This is an 8bit offset (of which only 7 bits are used) from the 797 tiny data area pointer. 798 799 - : BFD_RELOC_V850_TDA_7_7_OFFSET 800 This is a 7 bit offset from the tiny data area pointer. 801 802 - : BFD_RELOC_V850_TDA_16_16_OFFSET 803 This is a 16 bit offset from the tiny data area pointer. 804 805 - : BFD_RELOC_V850_TDA_4_5_OFFSET 806 This is a 5 bit offset (of which only 4 bits are used) from the 807 tiny data area pointer. 808 809 - : BFD_RELOC_V850_TDA_4_4_OFFSET 810 This is a 4 bit offset from the tiny data area pointer. 811 812 - : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET 813 This is a 16 bit offset from the short data area pointer, with the 814 bits placed non-contigously in the instruction. 815 816 - : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET 817 This is a 16 bit offset from the zero data area pointer, with the 818 bits placed non-contigously in the instruction. 819 820 - : BFD_RELOC_V850_CALLT_6_7_OFFSET 821 This is a 6 bit offset from the call table base pointer. 822 823 - : BFD_RELOC_V850_CALLT_16_16_OFFSET 824 This is a 16 bit offset from the call table base pointer. 825 826 - : BFD_RELOC_V850_LONGCALL 827 Used for relaxing indirect function calls. 828 829 - : BFD_RELOC_V850_LONGJUMP 830 Used for relaxing indirect jumps. 831 832 - : BFD_RELOC_V850_ALIGN 833 Used to maintain alignment whilst relaxing. 834 835 - : BFD_RELOC_MN10300_32_PCREL 836 This is a 32bit pcrel reloc for the mn10300, offset by two bytes 837 in the instruction. 838 839 - : BFD_RELOC_MN10300_16_PCREL 840 This is a 16bit pcrel reloc for the mn10300, offset by two bytes 841 in the instruction. 842 843 - : BFD_RELOC_TIC30_LDP 844 This is a 8bit DP reloc for the tms320c30, where the most 845 significant 8 bits of a 24 bit word are placed into the least 846 significant 8 bits of the opcode. 847 848 - : BFD_RELOC_TIC54X_PARTLS7 849 This is a 7bit reloc for the tms320c54x, where the least 850 significant 7 bits of a 16 bit word are placed into the least 851 significant 7 bits of the opcode. 852 853 - : BFD_RELOC_TIC54X_PARTMS9 854 This is a 9bit DP reloc for the tms320c54x, where the most 855 significant 9 bits of a 16 bit word are placed into the least 856 significant 9 bits of the opcode. 857 858 - : BFD_RELOC_TIC54X_23 859 This is an extended address 23-bit reloc for the tms320c54x. 860 861 - : BFD_RELOC_TIC54X_16_OF_23 862 This is a 16-bit reloc for the tms320c54x, where the least 863 significant 16 bits of a 23-bit extended address are placed into 864 the opcode. 865 866 - : BFD_RELOC_TIC54X_MS7_OF_23 867 This is a reloc for the tms320c54x, where the most significant 7 868 bits of a 23-bit extended address are placed into the opcode. 869 870 - : BFD_RELOC_FR30_48 871 This is a 48 bit reloc for the FR30 that stores 32 bits. 872 873 - : BFD_RELOC_FR30_20 874 This is a 32 bit reloc for the FR30 that stores 20 bits split up 875 into two sections. 876 877 - : BFD_RELOC_FR30_6_IN_4 878 This is a 16 bit reloc for the FR30 that stores a 6 bit word 879 offset in 4 bits. 880 881 - : BFD_RELOC_FR30_8_IN_8 882 This is a 16 bit reloc for the FR30 that stores an 8 bit byte 883 offset into 8 bits. 884 885 - : BFD_RELOC_FR30_9_IN_8 886 This is a 16 bit reloc for the FR30 that stores a 9 bit short 887 offset into 8 bits. 888 889 - : BFD_RELOC_FR30_10_IN_8 890 This is a 16 bit reloc for the FR30 that stores a 10 bit word 891 offset into 8 bits. 892 893 - : BFD_RELOC_FR30_9_PCREL 894 This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 895 short offset into 8 bits. 896 897 - : BFD_RELOC_FR30_12_PCREL 898 This is a 16 bit reloc for the FR30 that stores a 12 bit pc 899 relative short offset into 11 bits. 900 901 - : BFD_RELOC_MCORE_PCREL_IMM8BY4 902 - : BFD_RELOC_MCORE_PCREL_IMM11BY2 903 - : BFD_RELOC_MCORE_PCREL_IMM4BY2 904 - : BFD_RELOC_MCORE_PCREL_32 905 - : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 906 - : BFD_RELOC_MCORE_RVA 907 Motorola Mcore relocations. 908 909 - : BFD_RELOC_MMIX_GETA 910 - : BFD_RELOC_MMIX_GETA_1 911 - : BFD_RELOC_MMIX_GETA_2 912 - : BFD_RELOC_MMIX_GETA_3 913 These are relocations for the GETA instruction. 914 915 - : BFD_RELOC_MMIX_CBRANCH 916 - : BFD_RELOC_MMIX_CBRANCH_J 917 - : BFD_RELOC_MMIX_CBRANCH_1 918 - : BFD_RELOC_MMIX_CBRANCH_2 919 - : BFD_RELOC_MMIX_CBRANCH_3 920 These are relocations for a conditional branch instruction. 921 922 - : BFD_RELOC_MMIX_PUSHJ 923 - : BFD_RELOC_MMIX_PUSHJ_1 924 - : BFD_RELOC_MMIX_PUSHJ_2 925 - : BFD_RELOC_MMIX_PUSHJ_3 926 These are relocations for the PUSHJ instruction. 927 928 - : BFD_RELOC_MMIX_JMP 929 - : BFD_RELOC_MMIX_JMP_1 930 - : BFD_RELOC_MMIX_JMP_2 931 - : BFD_RELOC_MMIX_JMP_3 932 These are relocations for the JMP instruction. 933 934 - : BFD_RELOC_MMIX_ADDR19 935 This is a relocation for a relative address as in a GETA 936 instruction or a branch. 937 938 - : BFD_RELOC_MMIX_ADDR27 939 This is a relocation for a relative address as in a JMP 940 instruction. 941 942 - : BFD_RELOC_MMIX_REG_OR_BYTE 943 This is a relocation for an instruction field that may be a general 944 register or a value 0..255. 945 946 - : BFD_RELOC_MMIX_REG 947 This is a relocation for an instruction field that may be a general 948 register. 949 950 - : BFD_RELOC_MMIX_BASE_PLUS_OFFSET 951 This is a relocation for two instruction fields holding a register 952 and an offset, the equivalent of the relocation. 953 954 - : BFD_RELOC_MMIX_LOCAL 955 This relocation is an assertion that the expression is not 956 allocated as a global register. It does not modify contents. 957 958 - : BFD_RELOC_AVR_7_PCREL 959 This is a 16 bit reloc for the AVR that stores 8 bit pc relative 960 short offset into 7 bits. 961 962 - : BFD_RELOC_AVR_13_PCREL 963 This is a 16 bit reloc for the AVR that stores 13 bit pc relative 964 short offset into 12 bits. 965 966 - : BFD_RELOC_AVR_16_PM 967 This is a 16 bit reloc for the AVR that stores 17 bit value 968 (usually program memory address) into 16 bits. 969 970 - : BFD_RELOC_AVR_LO8_LDI 971 This is a 16 bit reloc for the AVR that stores 8 bit value (usually 972 data memory address) into 8 bit immediate value of LDI insn. 973 974 - : BFD_RELOC_AVR_HI8_LDI 975 This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 976 bit of data memory address) into 8 bit immediate value of LDI insn. 977 978 - : BFD_RELOC_AVR_HH8_LDI 979 This is a 16 bit reloc for the AVR that stores 8 bit value (most 980 high 8 bit of program memory address) into 8 bit immediate value 981 of LDI insn. 982 983 - : BFD_RELOC_AVR_LO8_LDI_NEG 984 This is a 16 bit reloc for the AVR that stores negated 8 bit value 985 (usually data memory address) into 8 bit immediate value of SUBI 986 insn. 987 988 - : BFD_RELOC_AVR_HI8_LDI_NEG 989 This is a 16 bit reloc for the AVR that stores negated 8 bit value 990 (high 8 bit of data memory address) into 8 bit immediate value of 991 SUBI insn. 992 993 - : BFD_RELOC_AVR_HH8_LDI_NEG 994 This is a 16 bit reloc for the AVR that stores negated 8 bit value 995 (most high 8 bit of program memory address) into 8 bit immediate 996 value of LDI or SUBI insn. 997 998 - : BFD_RELOC_AVR_LO8_LDI_PM 999 This is a 16 bit reloc for the AVR that stores 8 bit value (usually 1000 command address) into 8 bit immediate value of LDI insn. 1001 1002 - : BFD_RELOC_AVR_HI8_LDI_PM 1003 This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 1004 bit of command address) into 8 bit immediate value of LDI insn. 1005 1006 - : BFD_RELOC_AVR_HH8_LDI_PM 1007 This is a 16 bit reloc for the AVR that stores 8 bit value (most 1008 high 8 bit of command address) into 8 bit immediate value of LDI 1009 insn. 1010 1011 - : BFD_RELOC_AVR_LO8_LDI_PM_NEG 1012 This is a 16 bit reloc for the AVR that stores negated 8 bit value 1013 (usually command address) into 8 bit immediate value of SUBI insn. 1014 1015 - : BFD_RELOC_AVR_HI8_LDI_PM_NEG 1016 This is a 16 bit reloc for the AVR that stores negated 8 bit value 1017 (high 8 bit of 16 bit command address) into 8 bit immediate value 1018 of SUBI insn. 1019 1020 - : BFD_RELOC_AVR_HH8_LDI_PM_NEG 1021 This is a 16 bit reloc for the AVR that stores negated 8 bit value 1022 (high 6 bit of 22 bit command address) into 8 bit immediate value 1023 of SUBI insn. 1024 1025 - : BFD_RELOC_AVR_CALL 1026 This is a 32 bit reloc for the AVR that stores 23 bit value into 1027 22 bits. 1028 1029 - : BFD_RELOC_390_12 1030 Direct 12 bit. 1031 1032 - : BFD_RELOC_390_GOT12 1033 12 bit GOT offset. 1034 1035 - : BFD_RELOC_390_PLT32 1036 32 bit PC relative PLT address. 1037 1038 - : BFD_RELOC_390_COPY 1039 Copy symbol at runtime. 1040 1041 - : BFD_RELOC_390_GLOB_DAT 1042 Create GOT entry. 1043 1044 - : BFD_RELOC_390_JMP_SLOT 1045 Create PLT entry. 1046 1047 - : BFD_RELOC_390_RELATIVE 1048 Adjust by program base. 1049 1050 - : BFD_RELOC_390_GOTPC 1051 32 bit PC relative offset to GOT. 1052 1053 - : BFD_RELOC_390_GOT16 1054 16 bit GOT offset. 1055 1056 - : BFD_RELOC_390_PC16DBL 1057 PC relative 16 bit shifted by 1. 1058 1059 - : BFD_RELOC_390_PLT16DBL 1060 16 bit PC rel. PLT shifted by 1. 1061 1062 - : BFD_RELOC_390_PC32DBL 1063 PC relative 32 bit shifted by 1. 1064 1065 - : BFD_RELOC_390_PLT32DBL 1066 32 bit PC rel. PLT shifted by 1. 1067 1068 - : BFD_RELOC_390_GOTPCDBL 1069 32 bit PC rel. GOT shifted by 1. 1070 1071 - : BFD_RELOC_390_GOT64 1072 64 bit GOT offset. 1073 1074 - : BFD_RELOC_390_PLT64 1075 64 bit PC relative PLT address. 1076 1077 - : BFD_RELOC_390_GOTENT 1078 32 bit rel. offset to GOT entry. 1079 1080 - : BFD_RELOC_390_GOTOFF64 1081 64 bit offset to GOT. 1082 1083 - : BFD_RELOC_390_GOTPLT12 1084 12-bit offset to symbol-entry within GOT, with PLT handling. 1085 1086 - : BFD_RELOC_390_GOTPLT16 1087 16-bit offset to symbol-entry within GOT, with PLT handling. 1088 1089 - : BFD_RELOC_390_GOTPLT32 1090 32-bit offset to symbol-entry within GOT, with PLT handling. 1091 1092 - : BFD_RELOC_390_GOTPLT64 1093 64-bit offset to symbol-entry within GOT, with PLT handling. 1094 1095 - : BFD_RELOC_390_GOTPLTENT 1096 32-bit rel. offset to symbol-entry within GOT, with PLT handling. 1097 1098 - : BFD_RELOC_390_PLTOFF16 1099 16-bit rel. offset from the GOT to a PLT entry. 1100 1101 - : BFD_RELOC_390_PLTOFF32 1102 32-bit rel. offset from the GOT to a PLT entry. 1103 1104 - : BFD_RELOC_390_PLTOFF64 1105 64-bit rel. offset from the GOT to a PLT entry. 1106 1107 - : BFD_RELOC_390_TLS_LOAD 1108 - : BFD_RELOC_390_TLS_GDCALL 1109 - : BFD_RELOC_390_TLS_LDCALL 1110 - : BFD_RELOC_390_TLS_GD32 1111 - : BFD_RELOC_390_TLS_GD64 1112 - : BFD_RELOC_390_TLS_GOTIE12 1113 - : BFD_RELOC_390_TLS_GOTIE32 1114 - : BFD_RELOC_390_TLS_GOTIE64 1115 - : BFD_RELOC_390_TLS_LDM32 1116 - : BFD_RELOC_390_TLS_LDM64 1117 - : BFD_RELOC_390_TLS_IE32 1118 - : BFD_RELOC_390_TLS_IE64 1119 - : BFD_RELOC_390_TLS_IEENT 1120 - : BFD_RELOC_390_TLS_LE32 1121 - : BFD_RELOC_390_TLS_LE64 1122 - : BFD_RELOC_390_TLS_LDO32 1123 - : BFD_RELOC_390_TLS_LDO64 1124 - : BFD_RELOC_390_TLS_DTPMOD 1125 - : BFD_RELOC_390_TLS_DTPOFF 1126 - : BFD_RELOC_390_TLS_TPOFF 1127 s390 tls relocations. 1128 1129 - : BFD_RELOC_IP2K_FR9 1130 Scenix IP2K - 9-bit register number / data address 1131 1132 - : BFD_RELOC_IP2K_BANK 1133 Scenix IP2K - 4-bit register/data bank number 1134 1135 - : BFD_RELOC_IP2K_ADDR16CJP 1136 Scenix IP2K - low 13 bits of instruction word address 1137 1138 - : BFD_RELOC_IP2K_PAGE3 1139 Scenix IP2K - high 3 bits of instruction word address 1140 1141 - : BFD_RELOC_IP2K_LO8DATA 1142 - : BFD_RELOC_IP2K_HI8DATA 1143 - : BFD_RELOC_IP2K_EX8DATA 1144 Scenix IP2K - ext/low/high 8 bits of data address 1145 1146 - : BFD_RELOC_IP2K_LO8INSN 1147 - : BFD_RELOC_IP2K_HI8INSN 1148 Scenix IP2K - low/high 8 bits of instruction word address 1149 1150 - : BFD_RELOC_IP2K_PC_SKIP 1151 Scenix IP2K - even/odd PC modifier to modify snb pcl.0 1152 1153 - : BFD_RELOC_IP2K_TEXT 1154 Scenix IP2K - 16 bit word address in text section. 1155 1156 - : BFD_RELOC_IP2K_FR_OFFSET 1157 Scenix IP2K - 7-bit sp or dp offset 1158 1159 - : BFD_RELOC_VPE4KMATH_DATA 1160 - : BFD_RELOC_VPE4KMATH_INSN 1161 Scenix VPE4K coprocessor - data/insn-space addressing 1162 1163 - : BFD_RELOC_VTABLE_INHERIT 1164 - : BFD_RELOC_VTABLE_ENTRY 1165 These two relocations are used by the linker to determine which of 1166 the entries in a C++ virtual function table are actually used. 1167 When the -gc-sections option is given, the linker will zero out 1168 the entries that are not used, so that the code for those 1169 functions need not be included in the output. 1170 1171 VTABLE_INHERIT is a zero-space relocation used to describe to the 1172 linker the inheritence tree of a C++ virtual function table. The 1173 relocation's symbol should be the parent class' vtable, and the 1174 relocation should be located at the child vtable. 1175 1176 VTABLE_ENTRY is a zero-space relocation that describes the use of a 1177 virtual function table entry. The reloc's symbol should refer to 1178 the table of the class mentioned in the code. Off of that base, 1179 an offset describes the entry that is being used. For Rela hosts, 1180 this offset is stored in the reloc's addend. For Rel hosts, we 1181 are forced to put this offset in the reloc's section offset. 1182 1183 - : BFD_RELOC_IA64_IMM14 1184 - : BFD_RELOC_IA64_IMM22 1185 - : BFD_RELOC_IA64_IMM64 1186 - : BFD_RELOC_IA64_DIR32MSB 1187 - : BFD_RELOC_IA64_DIR32LSB 1188 - : BFD_RELOC_IA64_DIR64MSB 1189 - : BFD_RELOC_IA64_DIR64LSB 1190 - : BFD_RELOC_IA64_GPREL22 1191 - : BFD_RELOC_IA64_GPREL64I 1192 - : BFD_RELOC_IA64_GPREL32MSB 1193 - : BFD_RELOC_IA64_GPREL32LSB 1194 - : BFD_RELOC_IA64_GPREL64MSB 1195 - : BFD_RELOC_IA64_GPREL64LSB 1196 - : BFD_RELOC_IA64_LTOFF22 1197 - : BFD_RELOC_IA64_LTOFF64I 1198 - : BFD_RELOC_IA64_PLTOFF22 1199 - : BFD_RELOC_IA64_PLTOFF64I 1200 - : BFD_RELOC_IA64_PLTOFF64MSB 1201 - : BFD_RELOC_IA64_PLTOFF64LSB 1202 - : BFD_RELOC_IA64_FPTR64I 1203 - : BFD_RELOC_IA64_FPTR32MSB 1204 - : BFD_RELOC_IA64_FPTR32LSB 1205 - : BFD_RELOC_IA64_FPTR64MSB 1206 - : BFD_RELOC_IA64_FPTR64LSB 1207 - : BFD_RELOC_IA64_PCREL21B 1208 - : BFD_RELOC_IA64_PCREL21BI 1209 - : BFD_RELOC_IA64_PCREL21M 1210 - : BFD_RELOC_IA64_PCREL21F 1211 - : BFD_RELOC_IA64_PCREL22 1212 - : BFD_RELOC_IA64_PCREL60B 1213 - : BFD_RELOC_IA64_PCREL64I 1214 - : BFD_RELOC_IA64_PCREL32MSB 1215 - : BFD_RELOC_IA64_PCREL32LSB 1216 - : BFD_RELOC_IA64_PCREL64MSB 1217 - : BFD_RELOC_IA64_PCREL64LSB 1218 - : BFD_RELOC_IA64_LTOFF_FPTR22 1219 - : BFD_RELOC_IA64_LTOFF_FPTR64I 1220 - : BFD_RELOC_IA64_LTOFF_FPTR32MSB 1221 - : BFD_RELOC_IA64_LTOFF_FPTR32LSB 1222 - : BFD_RELOC_IA64_LTOFF_FPTR64MSB 1223 - : BFD_RELOC_IA64_LTOFF_FPTR64LSB 1224 - : BFD_RELOC_IA64_SEGREL32MSB 1225 - : BFD_RELOC_IA64_SEGREL32LSB 1226 - : BFD_RELOC_IA64_SEGREL64MSB 1227 - : BFD_RELOC_IA64_SEGREL64LSB 1228 - : BFD_RELOC_IA64_SECREL32MSB 1229 - : BFD_RELOC_IA64_SECREL32LSB 1230 - : BFD_RELOC_IA64_SECREL64MSB 1231 - : BFD_RELOC_IA64_SECREL64LSB 1232 - : BFD_RELOC_IA64_REL32MSB 1233 - : BFD_RELOC_IA64_REL32LSB 1234 - : BFD_RELOC_IA64_REL64MSB 1235 - : BFD_RELOC_IA64_REL64LSB 1236 - : BFD_RELOC_IA64_LTV32MSB 1237 - : BFD_RELOC_IA64_LTV32LSB 1238 - : BFD_RELOC_IA64_LTV64MSB 1239 - : BFD_RELOC_IA64_LTV64LSB 1240 - : BFD_RELOC_IA64_IPLTMSB 1241 - : BFD_RELOC_IA64_IPLTLSB 1242 - : BFD_RELOC_IA64_COPY 1243 - : BFD_RELOC_IA64_LTOFF22X 1244 - : BFD_RELOC_IA64_LDXMOV 1245 - : BFD_RELOC_IA64_TPREL14 1246 - : BFD_RELOC_IA64_TPREL22 1247 - : BFD_RELOC_IA64_TPREL64I 1248 - : BFD_RELOC_IA64_TPREL64MSB 1249 - : BFD_RELOC_IA64_TPREL64LSB 1250 - : BFD_RELOC_IA64_LTOFF_TPREL22 1251 - : BFD_RELOC_IA64_DTPMOD64MSB 1252 - : BFD_RELOC_IA64_DTPMOD64LSB 1253 - : BFD_RELOC_IA64_LTOFF_DTPMOD22 1254 - : BFD_RELOC_IA64_DTPREL14 1255 - : BFD_RELOC_IA64_DTPREL22 1256 - : BFD_RELOC_IA64_DTPREL64I 1257 - : BFD_RELOC_IA64_DTPREL32MSB 1258 - : BFD_RELOC_IA64_DTPREL32LSB 1259 - : BFD_RELOC_IA64_DTPREL64MSB 1260 - : BFD_RELOC_IA64_DTPREL64LSB 1261 - : BFD_RELOC_IA64_LTOFF_DTPREL22 1262 Intel IA64 Relocations. 1263 1264 - : BFD_RELOC_M68HC11_HI8 1265 Motorola 68HC11 reloc. This is the 8 bit high part of an absolute 1266 address. 1267 1268 - : BFD_RELOC_M68HC11_LO8 1269 Motorola 68HC11 reloc. This is the 8 bit low part of an absolute 1270 address. 1271 1272 - : BFD_RELOC_M68HC11_3B 1273 Motorola 68HC11 reloc. This is the 3 bit of a value. 1274 1275 - : BFD_RELOC_M68HC11_RL_JUMP 1276 Motorola 68HC11 reloc. This reloc marks the beginning of a 1277 jump/call instruction. It is used for linker relaxation to 1278 correctly identify beginning of instruction and change some 1279 branchs to use PC-relative addressing mode. 1280 1281 - : BFD_RELOC_M68HC11_RL_GROUP 1282 Motorola 68HC11 reloc. This reloc marks a group of several 1283 instructions that gcc generates and for which the linker 1284 relaxation pass can modify and/or remove some of them. 1285 1286 - : BFD_RELOC_M68HC11_LO16 1287 Motorola 68HC11 reloc. This is the 16-bit lower part of an 1288 address. It is used for 'call' instruction to specify the symbol 1289 address without any special transformation (due to memory bank 1290 window). 1291 1292 - : BFD_RELOC_M68HC11_PAGE 1293 Motorola 68HC11 reloc. This is a 8-bit reloc that specifies the 1294 page number of an address. It is used by 'call' instruction to 1295 specify the page number of the symbol. 1296 1297 - : BFD_RELOC_M68HC11_24 1298 Motorola 68HC11 reloc. This is a 24-bit reloc that represents the 1299 address with a 16-bit value and a 8-bit page number. The symbol 1300 address is transformed to follow the 16K memory bank of 68HC12 1301 (seen as mapped in the window). 1302 1303 - : BFD_RELOC_CRIS_BDISP8 1304 - : BFD_RELOC_CRIS_UNSIGNED_5 1305 - : BFD_RELOC_CRIS_SIGNED_6 1306 - : BFD_RELOC_CRIS_UNSIGNED_6 1307 - : BFD_RELOC_CRIS_UNSIGNED_4 1308 These relocs are only used within the CRIS assembler. They are not 1309 (at present) written to any object files. 1310 1311 - : BFD_RELOC_CRIS_COPY 1312 - : BFD_RELOC_CRIS_GLOB_DAT 1313 - : BFD_RELOC_CRIS_JUMP_SLOT 1314 - : BFD_RELOC_CRIS_RELATIVE 1315 Relocs used in ELF shared libraries for CRIS. 1316 1317 - : BFD_RELOC_CRIS_32_GOT 1318 32-bit offset to symbol-entry within GOT. 1319 1320 - : BFD_RELOC_CRIS_16_GOT 1321 16-bit offset to symbol-entry within GOT. 1322 1323 - : BFD_RELOC_CRIS_32_GOTPLT 1324 32-bit offset to symbol-entry within GOT, with PLT handling. 1325 1326 - : BFD_RELOC_CRIS_16_GOTPLT 1327 16-bit offset to symbol-entry within GOT, with PLT handling. 1328 1329 - : BFD_RELOC_CRIS_32_GOTREL 1330 32-bit offset to symbol, relative to GOT. 1331 1332 - : BFD_RELOC_CRIS_32_PLT_GOTREL 1333 32-bit offset to symbol with PLT entry, relative to GOT. 1334 1335 - : BFD_RELOC_CRIS_32_PLT_PCREL 1336 32-bit offset to symbol with PLT entry, relative to this 1337 relocation. 1338 1339 - : BFD_RELOC_860_COPY 1340 - : BFD_RELOC_860_GLOB_DAT 1341 - : BFD_RELOC_860_JUMP_SLOT 1342 - : BFD_RELOC_860_RELATIVE 1343 - : BFD_RELOC_860_PC26 1344 - : BFD_RELOC_860_PLT26 1345 - : BFD_RELOC_860_PC16 1346 - : BFD_RELOC_860_LOW0 1347 - : BFD_RELOC_860_SPLIT0 1348 - : BFD_RELOC_860_LOW1 1349 - : BFD_RELOC_860_SPLIT1 1350 - : BFD_RELOC_860_LOW2 1351 - : BFD_RELOC_860_SPLIT2 1352 - : BFD_RELOC_860_LOW3 1353 - : BFD_RELOC_860_LOGOT0 1354 - : BFD_RELOC_860_SPGOT0 1355 - : BFD_RELOC_860_LOGOT1 1356 - : BFD_RELOC_860_SPGOT1 1357 - : BFD_RELOC_860_LOGOTOFF0 1358 - : BFD_RELOC_860_SPGOTOFF0 1359 - : BFD_RELOC_860_LOGOTOFF1 1360 - : BFD_RELOC_860_SPGOTOFF1 1361 - : BFD_RELOC_860_LOGOTOFF2 1362 - : BFD_RELOC_860_LOGOTOFF3 1363 - : BFD_RELOC_860_LOPC 1364 - : BFD_RELOC_860_HIGHADJ 1365 - : BFD_RELOC_860_HAGOT 1366 - : BFD_RELOC_860_HAGOTOFF 1367 - : BFD_RELOC_860_HAPC 1368 - : BFD_RELOC_860_HIGH 1369 - : BFD_RELOC_860_HIGOT 1370 - : BFD_RELOC_860_HIGOTOFF 1371 Intel i860 Relocations. 1372 1373 - : BFD_RELOC_OPENRISC_ABS_26 1374 - : BFD_RELOC_OPENRISC_REL_26 1375 OpenRISC Relocations. 1376 1377 - : BFD_RELOC_H8_DIR16A8 1378 - : BFD_RELOC_H8_DIR16R8 1379 - : BFD_RELOC_H8_DIR24A8 1380 - : BFD_RELOC_H8_DIR24R8 1381 - : BFD_RELOC_H8_DIR32A16 1382 H8 elf Relocations. 1383 1384 - : BFD_RELOC_XSTORMY16_REL_12 1385 - : BFD_RELOC_XSTORMY16_12 1386 - : BFD_RELOC_XSTORMY16_24 1387 - : BFD_RELOC_XSTORMY16_FPTR16 1388 Sony Xstormy16 Relocations. 1389 1390 - : BFD_RELOC_VAX_GLOB_DAT 1391 - : BFD_RELOC_VAX_JMP_SLOT 1392 - : BFD_RELOC_VAX_RELATIVE 1393 Relocations used by VAX ELF. 1394 1395 - : BFD_RELOC_MSP430_10_PCREL 1396 - : BFD_RELOC_MSP430_16_PCREL 1397 - : BFD_RELOC_MSP430_16 1398 - : BFD_RELOC_MSP430_16_PCREL_BYTE 1399 - : BFD_RELOC_MSP430_16_BYTE 1400 msp430 specific relocation codes 1401 1402 - : BFD_RELOC_IQ2000_OFFSET_16 1403 - : BFD_RELOC_IQ2000_OFFSET_21 1404 - : BFD_RELOC_IQ2000_UHI16 1405 IQ2000 Relocations. 1406 1407 - : BFD_RELOC_XTENSA_RTLD 1408 Special Xtensa relocation used only by PLT entries in ELF shared 1409 objects to indicate that the runtime linker should set the value 1410 to one of its own internal functions or data structures. 1411 1412 - : BFD_RELOC_XTENSA_GLOB_DAT 1413 - : BFD_RELOC_XTENSA_JMP_SLOT 1414 - : BFD_RELOC_XTENSA_RELATIVE 1415 Xtensa relocations for ELF shared objects. 1416 1417 - : BFD_RELOC_XTENSA_PLT 1418 Xtensa relocation used in ELF object files for symbols that may 1419 require PLT entries. Otherwise, this is just a generic 32-bit 1420 relocation. 1421 1422 - : BFD_RELOC_XTENSA_OP0 1423 - : BFD_RELOC_XTENSA_OP1 1424 - : BFD_RELOC_XTENSA_OP2 1425 Generic Xtensa relocations. Only the operand number is encoded in 1426 the relocation. The details are determined by extracting the 1427 instruction opcode. 1428 1429 - : BFD_RELOC_XTENSA_ASM_EXPAND 1430 Xtensa relocation to mark that the assembler expanded the 1431 instructions from an original target. The expansion size is 1432 encoded in the reloc size. 1433 1434 - : BFD_RELOC_XTENSA_ASM_SIMPLIFY 1435 Xtensa relocation to mark that the linker should simplify 1436 assembler-expanded instructions. This is commonly used internally 1437 by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. 1438 1439 1440 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; 1441 1442 `bfd_reloc_type_lookup' 1443 ....................... 1444 1445 *Synopsis* 1446 reloc_howto_type * 1447 bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); 1448 *Description* 1449 Return a pointer to a howto structure which, when invoked, will perform 1450 the relocation CODE on data from the architecture noted. 1451 1452 `bfd_default_reloc_type_lookup' 1453 ............................... 1454 1455 *Synopsis* 1456 reloc_howto_type *bfd_default_reloc_type_lookup 1457 (bfd *abfd, bfd_reloc_code_real_type code); 1458 *Description* 1459 Provides a default relocation lookup routine for any architecture. 1460 1461 `bfd_get_reloc_code_name' 1462 ......................... 1463 1464 *Synopsis* 1465 const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); 1466 *Description* 1467 Provides a printable name for the supplied relocation code. Useful 1468 mainly for printing error messages. 1469 1470 `bfd_generic_relax_section' 1471 ........................... 1472 1473 *Synopsis* 1474 bfd_boolean bfd_generic_relax_section 1475 (bfd *abfd, 1476 asection *section, 1477 struct bfd_link_info *, 1478 bfd_boolean *); 1479 *Description* 1480 Provides default handling for relaxing for back ends which don't do 1481 relaxing - i.e., does nothing. 1482 1483 `bfd_generic_gc_sections' 1484 ......................... 1485 1486 *Synopsis* 1487 bfd_boolean bfd_generic_gc_sections 1488 (bfd *, struct bfd_link_info *); 1489 *Description* 1490 Provides default handling for relaxing for back ends which don't do 1491 section gc - i.e., does nothing. 1492 1493 `bfd_generic_merge_sections' 1494 ............................ 1495 1496 *Synopsis* 1497 bfd_boolean bfd_generic_merge_sections 1498 (bfd *, struct bfd_link_info *); 1499 *Description* 1500 Provides default handling for SEC_MERGE section merging for back ends 1501 which don't have SEC_MERGE support - i.e., does nothing. 1502 1503 `bfd_generic_get_relocated_section_contents' 1504 ............................................ 1505 1506 *Synopsis* 1507 bfd_byte * 1508 bfd_generic_get_relocated_section_contents (bfd *abfd, 1509 struct bfd_link_info *link_info, 1510 struct bfd_link_order *link_order, 1511 bfd_byte *data, 1512 bfd_boolean relocateable, 1513 asymbol **symbols); 1514 *Description* 1515 Provides default handling of relocation effort for back ends which 1516 can't be bothered to do it efficiently. 1517 1518 1519 File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end 1520 1521 Core files 1522 ========== 1523 1524 *Description* 1525 These are functions pertaining to core files. 1526 1527 `bfd_core_file_failing_command' 1528 ............................... 1529 1530 *Synopsis* 1531 const char *bfd_core_file_failing_command(bfd *abfd); 1532 *Description* 1533 Return a read-only string explaining which program was running when it 1534 failed and produced the core file ABFD. 1535 1536 `bfd_core_file_failing_signal' 1537 .............................. 1538 1539 *Synopsis* 1540 int bfd_core_file_failing_signal(bfd *abfd); 1541 *Description* 1542 Returns the signal number which caused the core dump which generated 1543 the file the BFD ABFD is attached to. 1544 1545 `core_file_matches_executable_p' 1546 ................................ 1547 1548 *Synopsis* 1549 bfd_boolean core_file_matches_executable_p 1550 (bfd *core_bfd, bfd *exec_bfd); 1551 *Description* 1552 Return `TRUE' if the core file attached to CORE_BFD was generated by a 1553 run of the executable file attached to EXEC_BFD, `FALSE' otherwise. 1554 1555 19 1556 File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end 20 1557 … … 59 1596 the BFD with a suggested format. If `target_defaulted' has been set, 60 1597 each possible target type is tried to see if it recognizes the 61 specified format. `bfd_check_format' returns ` true' when the caller1598 specified format. `bfd_check_format' returns `TRUE' when the caller 62 1599 guesses right. 63 1600 … … 66 1603 * bfd_target:: 67 1604 68 69 File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets70 71 bfd_target72 ----------73 74 *Description*75 This structure contains everything that BFD knows about a target. It76 includes things like its byte order, name, and which routines to call77 to do various operations.78 79 Every BFD points to a target structure with its `xvec' member.80 81 The macros below are used to dispatch to functions through the82 `bfd_target' vector. They are used in a number of macros further down83 in `bfd.h', and are also used when calling various routines by hand84 inside the BFD implementation. The ARGLIST argument must be85 parenthesized; it contains all the arguments to the called function.86 87 They make the documentation (more) unpleasant to read, so if someone88 wants to fix this and not break the above, please do.89 #define BFD_SEND(bfd, message, arglist) \90 ((*((bfd)->xvec->message)) arglist)91 92 #ifdef DEBUG_BFD_SEND93 #undef BFD_SEND94 #define BFD_SEND(bfd, message, arglist) \95 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \96 ((*((bfd)->xvec->message)) arglist) : \97 (bfd_assert (__FILE__,__LINE__), NULL))98 #endif99 For operations which index on the BFD format:100 #define BFD_SEND_FMT(bfd, message, arglist) \101 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)102 103 #ifdef DEBUG_BFD_SEND104 #undef BFD_SEND_FMT105 #define BFD_SEND_FMT(bfd, message, arglist) \106 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \107 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \108 (bfd_assert (__FILE__,__LINE__), NULL))109 #endif110 This is the structure which defines the type of BFD this is. The111 `xvec' member of the struct `bfd' itself points here. Each module that112 implements access to a different target under BFD, defines one of these.113 114 FIXME, these names should be rationalised with the names of the115 entry points which call them. Too bad we can't have one macro to define116 them both!117 enum bfd_flavour {118 bfd_target_unknown_flavour,119 bfd_target_aout_flavour,120 bfd_target_coff_flavour,121 bfd_target_ecoff_flavour,122 bfd_target_xcoff_flavour,123 bfd_target_elf_flavour,124 bfd_target_ieee_flavour,125 bfd_target_nlm_flavour,126 bfd_target_oasys_flavour,127 bfd_target_tekhex_flavour,128 bfd_target_srec_flavour,129 bfd_target_ihex_flavour,130 bfd_target_som_flavour,131 bfd_target_os9k_flavour,132 bfd_target_versados_flavour,133 bfd_target_msdos_flavour,134 bfd_target_ovax_flavour,135 bfd_target_evax_flavour136 };137 138 enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };139 140 /* Forward declaration. */141 typedef struct bfd_link_info _bfd_link_info;142 143 typedef struct bfd_target144 {145 Identifies the kind of target, e.g., SunOS4, Ultrix, etc.146 char *name;147 The "flavour" of a back end is a general indication about the148 contents of a file.149 enum bfd_flavour flavour;150 The order of bytes within the data area of a file.151 enum bfd_endian byteorder;152 The order of bytes within the header parts of a file.153 enum bfd_endian header_byteorder;154 A mask of all the flags which an executable may have set - from the155 set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'.156 flagword object_flags;157 A mask of all the flags which a section may have set - from the set158 `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'.159 flagword section_flags;160 The character normally found at the front of a symbol (if any),161 perhaps `_'.162 char symbol_leading_char;163 The pad character for file names within an archive header.164 char ar_pad_char;165 The maximum number of characters in an archive header.166 unsigned short ar_max_namelen;167 Entries for byte swapping for data. These are different from the168 other entry points, since they don't take a BFD asthe first argument.169 Certain other handlers could do the same.170 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));171 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));172 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));173 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));174 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));175 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));176 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));177 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));178 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));179 Byte swapping for the headers180 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));181 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));182 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));183 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));184 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));185 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));186 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));187 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));188 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));189 Format dependent routines: these are vectors of entry points within190 the target vector structure, one for each format to check.191 192 Check the format of a file being read. Return a `bfd_target *' or193 zero.194 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));195 Set the format of a file being written.196 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));197 Write cached information into a file being written, at `bfd_close'.198 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));199 The general target vector. These vectors are initialized using the200 BFD_JUMP_TABLE macros.201 202 /* Generic entry points. */203 #define BFD_JUMP_TABLE_GENERIC(NAME)\204 CAT(NAME,_close_and_cleanup),\205 CAT(NAME,_bfd_free_cached_info),\206 CAT(NAME,_new_section_hook),\207 CAT(NAME,_get_section_contents),\208 CAT(NAME,_get_section_contents_in_window)209 210 /* Called when the BFD is being closed to do any necessary cleanup. */211 boolean (*_close_and_cleanup) PARAMS ((bfd *));212 /* Ask the BFD to free all cached information. */213 boolean (*_bfd_free_cached_info) PARAMS ((bfd *));214 /* Called when a new section is created. */215 boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));216 /* Read the contents of a section. */217 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,218 file_ptr, bfd_size_type));219 boolean (*_bfd_get_section_contents_in_window)220 PARAMS ((bfd *, sec_ptr, bfd_window *,221 file_ptr, bfd_size_type));222 223 /* Entry points to copy private data. */224 #define BFD_JUMP_TABLE_COPY(NAME)\225 CAT(NAME,_bfd_copy_private_bfd_data),\226 CAT(NAME,_bfd_merge_private_bfd_data),\227 CAT(NAME,_bfd_copy_private_section_data),\228 CAT(NAME,_bfd_copy_private_symbol_data),\229 CAT(NAME,_bfd_set_private_flags),\230 CAT(NAME,_bfd_print_private_bfd_data)\231 /* Called to copy BFD general private data from one object file232 to another. */233 boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));234 /* Called to merge BFD general private data from one object file235 to a common output file when linking. */236 boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));237 /* Called to copy BFD private section data from one object file238 to another. */239 boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,240 bfd *, sec_ptr));241 /* Called to copy BFD private symbol data from one symbol242 to another. */243 boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,244 bfd *, asymbol *));245 /* Called to set private backend flags */246 boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));247 248 /* Called to print private BFD data */249 boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));250 251 /* Core file entry points. */252 #define BFD_JUMP_TABLE_CORE(NAME)\253 CAT(NAME,_core_file_failing_command),\254 CAT(NAME,_core_file_failing_signal),\255 CAT(NAME,_core_file_matches_executable_p)256 char * (*_core_file_failing_command) PARAMS ((bfd *));257 int (*_core_file_failing_signal) PARAMS ((bfd *));258 boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));259 260 /* Archive entry points. */261 #define BFD_JUMP_TABLE_ARCHIVE(NAME)\262 CAT(NAME,_slurp_armap),\263 CAT(NAME,_slurp_extended_name_table),\264 CAT(NAME,_construct_extended_name_table),\265 CAT(NAME,_truncate_arname),\266 CAT(NAME,_write_armap),\267 CAT(NAME,_read_ar_hdr),\268 CAT(NAME,_openr_next_archived_file),\269 CAT(NAME,_get_elt_at_index),\270 CAT(NAME,_generic_stat_arch_elt),\271 CAT(NAME,_update_armap_timestamp)272 boolean (*_bfd_slurp_armap) PARAMS ((bfd *));273 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));274 boolean (*_bfd_construct_extended_name_table)275 PARAMS ((bfd *, char **, bfd_size_type *, const char **));276 void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));277 boolean (*write_armap) PARAMS ((bfd *arch,278 unsigned int elength,279 struct orl *map,280 unsigned int orl_count,281 int stridx));282 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));283 bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));284 #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))285 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));286 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));287 boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));288 289 /* Entry points used for symbols. */290 #define BFD_JUMP_TABLE_SYMBOLS(NAME)\291 CAT(NAME,_get_symtab_upper_bound),\292 CAT(NAME,_get_symtab),\293 CAT(NAME,_make_empty_symbol),\294 CAT(NAME,_print_symbol),\295 CAT(NAME,_get_symbol_info),\296 CAT(NAME,_bfd_is_local_label_name),\297 CAT(NAME,_get_lineno),\298 CAT(NAME,_find_nearest_line),\299 CAT(NAME,_bfd_make_debug_symbol),\300 CAT(NAME,_read_minisymbols),\301 CAT(NAME,_minisymbol_to_symbol)302 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));303 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,304 struct symbol_cache_entry **));305 struct symbol_cache_entry *306 (*_bfd_make_empty_symbol) PARAMS ((bfd *));307 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,308 struct symbol_cache_entry *,309 bfd_print_symbol_type));310 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))311 void (*_bfd_get_symbol_info) PARAMS ((bfd *,312 struct symbol_cache_entry *,313 symbol_info *));314 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))315 boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));316 317 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));318 boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,319 struct sec *section, struct symbol_cache_entry **symbols,320 bfd_vma offset, CONST char **file, CONST char **func,321 unsigned int *line));322 /* Back-door to allow format-aware applications to create debug symbols323 while using BFD for everything else. Currently used by the assembler324 when creating COFF files. */325 asymbol * (*_bfd_make_debug_symbol) PARAMS ((326 bfd *abfd,327 void *ptr,328 unsigned long size));329 #define bfd_read_minisymbols(b, d, m, s) \330 BFD_SEND (b, _read_minisymbols, (b, d, m, s))331 long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,332 unsigned int *));333 #define bfd_minisymbol_to_symbol(b, d, m, f) \334 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))335 asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,336 asymbol *));337 338 /* Routines for relocs. */339 #define BFD_JUMP_TABLE_RELOCS(NAME)\340 CAT(NAME,_get_reloc_upper_bound),\341 CAT(NAME,_canonicalize_reloc),\342 CAT(NAME,_bfd_reloc_type_lookup)343 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));344 long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,345 struct symbol_cache_entry **));346 /* See documentation on reloc types. */347 reloc_howto_type *348 (*reloc_type_lookup) PARAMS ((bfd *abfd,349 bfd_reloc_code_real_type code));350 351 /* Routines used when writing an object file. */352 #define BFD_JUMP_TABLE_WRITE(NAME)\353 CAT(NAME,_set_arch_mach),\354 CAT(NAME,_set_section_contents)355 boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,356 unsigned long));357 boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,358 file_ptr, bfd_size_type));359 360 /* Routines used by the linker. */361 #define BFD_JUMP_TABLE_LINK(NAME)\362 CAT(NAME,_sizeof_headers),\363 CAT(NAME,_bfd_get_relocated_section_contents),\364 CAT(NAME,_bfd_relax_section),\365 CAT(NAME,_bfd_link_hash_table_create),\366 CAT(NAME,_bfd_link_add_symbols),\367 CAT(NAME,_bfd_final_link),\368 CAT(NAME,_bfd_link_split_section),\369 CAT(NAME,_bfd_gc_sections)370 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));371 bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,372 struct bfd_link_info *, struct bfd_link_order *,373 bfd_byte *data, boolean relocateable,374 struct symbol_cache_entry **));375 376 boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,377 struct bfd_link_info *, boolean *again));378 379 /* Create a hash table for the linker. Different backends store380 different information in this table. */381 struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));382 383 /* Add symbols from this object file into the hash table. */384 boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));385 386 /* Do a link based on the link_order structures attached to each387 section of the BFD. */388 boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));389 390 /* Should this section be split up into smaller pieces during linking. */391 boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));392 393 /* Remove sections that are not referenced from the output. */394 boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));395 396 /* Routines to handle dynamic symbols and relocs. */397 #define BFD_JUMP_TABLE_DYNAMIC(NAME)\398 CAT(NAME,_get_dynamic_symtab_upper_bound),\399 CAT(NAME,_canonicalize_dynamic_symtab),\400 CAT(NAME,_get_dynamic_reloc_upper_bound),\401 CAT(NAME,_canonicalize_dynamic_reloc)402 /* Get the amount of memory required to hold the dynamic symbols. */403 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));404 /* Read in the dynamic symbols. */405 long (*_bfd_canonicalize_dynamic_symtab)406 PARAMS ((bfd *, struct symbol_cache_entry **));407 /* Get the amount of memory required to hold the dynamic relocs. */408 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));409 /* Read in the dynamic relocs. */410 long (*_bfd_canonicalize_dynamic_reloc)411 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));412 A pointer to an alternative bfd_target in case the current one is not413 satisfactory. This can happen when the target cpu supports both big414 and little endian code, and target chosen by the linker has the wrong415 endianness. The function open_output() in ld/ldlang.c uses this field416 to find an alternative output format that is suitable.417 /* Opposite endian version of this target. */418 const struct bfd_target * alternative_target;419 Data for use by back-end routines, which isn't generic enough to420 belong in this structure.421 PTR backend_data;422 423 } bfd_target;424 425 `bfd_set_default_target'426 ........................427 428 *Synopsis*429 boolean bfd_set_default_target (const char *name);430 *Description*431 Set the default target vector to use when recognizing a BFD. This432 takes the name of the target, which may be a BFD target name or a433 configuration triplet.434 435 `bfd_find_target'436 .................437 438 *Synopsis*439 const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd);440 *Description*441 Return a pointer to the transfer vector for the object target named442 TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the443 environment variable `GNUTARGET'; if that is null or not defined, then444 choose the first entry in the target list. Passing in the string445 "default" or setting the environment variable to "default" will cause446 the first entry in the target list to be returned, and447 "target_defaulted" will be set in the BFD. This causes448 `bfd_check_format' to loop over all the targets to find the one that449 matches the file being read.450 451 `bfd_target_list'452 .................453 454 *Synopsis*455 const char **bfd_target_list(void);456 *Description*457 Return a freshly malloced NULL-terminated vector of the names of all458 the valid BFD targets. Do not modify the names.459 460 `bfd_seach_for_target'461 ......................462 463 *Synopsis*464 const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);465 *Description*466 Return a pointer to the first transfer vector in the list of transfer467 vectors maintained by BFD that produces a non-zero result when passed468 to the function SEARCH_FUNC. The parameter DATA is passed, unexamined,469 to the search function.470 471 472 File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end473 474 Architectures475 =============476 477 BFD keeps one atom in a BFD describing the architecture of the data478 attached to the BFD: a pointer to a `bfd_arch_info_type'.479 480 Pointers to structures can be requested independently of a BFD so481 that an architecture's information can be interrogated without access482 to an open BFD.483 484 The architecture information is provided by each architecture485 package. The set of default architectures is selected by the macro486 `SELECT_ARCHITECTURES'. This is normally set up in the487 `config/TARGET.mt' file of your choice. If the name is not defined,488 then all the architectures supported are included.489 490 When BFD starts up, all the architectures are called with an491 initialize method. It is up to the architecture back end to insert as492 many items into the list of architectures as it wants to; generally493 this would be one for each machine and one for the default case (an494 item with a machine field of 0).495 496 BFD's idea of an architecture is implemented in `archures.c'.497 498 bfd_architecture499 ----------------500 501 *Description*502 This enum gives the object file's CPU architecture, in a global503 sense--i.e., what processor family does it belong to? Another field504 indicates which processor within the family is in use. The machine505 gives a number which distinguishes different versions of the506 architecture, containing, for example, 2 and 3 for Intel i960 KA and507 i960 KB, and 68020 and 68030 for Motorola 68020 and 68030.508 enum bfd_architecture509 {510 bfd_arch_unknown, /* File arch not known */511 bfd_arch_obscure, /* Arch known, not one of these */512 bfd_arch_m68k, /* Motorola 68xxx */513 #define bfd_mach_m68000 1514 #define bfd_mach_m68008 2515 #define bfd_mach_m68010 3516 #define bfd_mach_m68020 4517 #define bfd_mach_m68030 5518 #define bfd_mach_m68040 6519 #define bfd_mach_m68060 7520 #define bfd_mach_cpu32 8521 #define bfd_mach_mcf5200 9522 #define bfd_mach_mcf5206e 10523 #define bfd_mach_mcf5307 11524 #define bfd_mach_mcf5407 12525 bfd_arch_vax, /* DEC Vax */526 bfd_arch_i960, /* Intel 960 */527 /* The order of the following is important.528 lower number indicates a machine type that529 only accepts a subset of the instructions530 available to machines with higher numbers.531 The exception is the "ca", which is532 incompatible with all other machines except533 "core". */534 535 #define bfd_mach_i960_core 1536 #define bfd_mach_i960_ka_sa 2537 #define bfd_mach_i960_kb_sb 3538 #define bfd_mach_i960_mc 4539 #define bfd_mach_i960_xa 5540 #define bfd_mach_i960_ca 6541 #define bfd_mach_i960_jx 7542 #define bfd_mach_i960_hx 8543 544 bfd_arch_a29k, /* AMD 29000 */545 bfd_arch_sparc, /* SPARC */546 #define bfd_mach_sparc 1547 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */548 #define bfd_mach_sparc_sparclet 2549 #define bfd_mach_sparc_sparclite 3550 #define bfd_mach_sparc_v8plus 4551 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */552 #define bfd_mach_sparc_sparclite_le 6553 #define bfd_mach_sparc_v9 7554 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */555 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */556 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */557 /* Nonzero if MACH has the v9 instruction set. */558 #define bfd_mach_sparc_v9_p(mach) \559 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \560 && (mach) != bfd_mach_sparc_sparclite_le)561 bfd_arch_mips, /* MIPS Rxxxx */562 #define bfd_mach_mips3000 3000563 #define bfd_mach_mips3900 3900564 #define bfd_mach_mips4000 4000565 #define bfd_mach_mips4010 4010566 #define bfd_mach_mips4100 4100567 #define bfd_mach_mips4111 4111568 #define bfd_mach_mips4300 4300569 #define bfd_mach_mips4400 4400570 #define bfd_mach_mips4600 4600571 #define bfd_mach_mips4650 4650572 #define bfd_mach_mips5000 5000573 #define bfd_mach_mips6000 6000574 #define bfd_mach_mips8000 8000575 #define bfd_mach_mips10000 10000576 #define bfd_mach_mips12000 12000577 #define bfd_mach_mips16 16578 #define bfd_mach_mips32 32579 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */580 #define bfd_mach_mips5 5581 #define bfd_mach_mips64 64582 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */583 bfd_arch_i386, /* Intel 386 */584 #define bfd_mach_i386_i386 0585 #define bfd_mach_i386_i8086 1586 #define bfd_mach_i386_i386_intel_syntax 2587 #define bfd_mach_x86_64 3588 #define bfd_mach_x86_64_intel_syntax 4589 bfd_arch_we32k, /* AT&T WE32xxx */590 bfd_arch_tahoe, /* CCI/Harris Tahoe */591 bfd_arch_i860, /* Intel 860 */592 bfd_arch_i370, /* IBM 360/370 Mainframes */593 bfd_arch_romp, /* IBM ROMP PC/RT */594 bfd_arch_alliant, /* Alliant */595 bfd_arch_convex, /* Convex */596 bfd_arch_m88k, /* Motorola 88xxx */597 bfd_arch_pyramid, /* Pyramid Technology */598 bfd_arch_h8300, /* Hitachi H8/300 */599 #define bfd_mach_h8300 1600 #define bfd_mach_h8300h 2601 #define bfd_mach_h8300s 3602 bfd_arch_powerpc, /* PowerPC */603 #define bfd_mach_ppc 0604 #define bfd_mach_ppc_403 403605 #define bfd_mach_ppc_403gc 4030606 #define bfd_mach_ppc_505 505607 #define bfd_mach_ppc_601 601608 #define bfd_mach_ppc_602 602609 #define bfd_mach_ppc_603 603610 #define bfd_mach_ppc_ec603e 6031611 #define bfd_mach_ppc_604 604612 #define bfd_mach_ppc_620 620613 #define bfd_mach_ppc_630 630614 #define bfd_mach_ppc_750 750615 #define bfd_mach_ppc_860 860616 #define bfd_mach_ppc_a35 35617 #define bfd_mach_ppc_rs64ii 642618 #define bfd_mach_ppc_rs64iii 643619 #define bfd_mach_ppc_7400 7400620 bfd_arch_rs6000, /* IBM RS/6000 */621 #define bfd_mach_rs6k 0622 #define bfd_mach_rs6k_rs1 6001623 #define bfd_mach_rs6k_rsc 6003624 #define bfd_mach_rs6k_rs2 6002625 bfd_arch_hppa, /* HP PA RISC */626 bfd_arch_d10v, /* Mitsubishi D10V */627 #define bfd_mach_d10v 0628 #define bfd_mach_d10v_ts2 2629 #define bfd_mach_d10v_ts3 3630 bfd_arch_d30v, /* Mitsubishi D30V */631 bfd_arch_m68hc11, /* Motorola 68HC11 */632 bfd_arch_m68hc12, /* Motorola 68HC12 */633 bfd_arch_z8k, /* Zilog Z8000 */634 #define bfd_mach_z8001 1635 #define bfd_mach_z8002 2636 bfd_arch_h8500, /* Hitachi H8/500 */637 bfd_arch_sh, /* Hitachi SH */638 #define bfd_mach_sh 0639 #define bfd_mach_sh2 0x20640 #define bfd_mach_sh_dsp 0x2d641 #define bfd_mach_sh3 0x30642 #define bfd_mach_sh3_dsp 0x3d643 #define bfd_mach_sh3e 0x3e644 #define bfd_mach_sh4 0x40645 bfd_arch_alpha, /* Dec Alpha */646 #define bfd_mach_alpha_ev4 0x10647 #define bfd_mach_alpha_ev5 0x20648 #define bfd_mach_alpha_ev6 0x30649 bfd_arch_arm, /* Advanced Risc Machines ARM */650 #define bfd_mach_arm_2 1651 #define bfd_mach_arm_2a 2652 #define bfd_mach_arm_3 3653 #define bfd_mach_arm_3M 4654 #define bfd_mach_arm_4 5655 #define bfd_mach_arm_4T 6656 #define bfd_mach_arm_5 7657 #define bfd_mach_arm_5T 8658 #define bfd_mach_arm_5TE 9659 #define bfd_mach_arm_XScale 10660 bfd_arch_ns32k, /* National Semiconductors ns32000 */661 bfd_arch_w65, /* WDC 65816 */662 bfd_arch_tic30, /* Texas Instruments TMS320C30 */663 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */664 bfd_arch_tic80, /* TI TMS320c80 (MVP) */665 bfd_arch_v850, /* NEC V850 */666 #define bfd_mach_v850 0667 #define bfd_mach_v850e 'E'668 #define bfd_mach_v850ea 'A'669 bfd_arch_arc, /* ARC Cores */670 #define bfd_mach_arc_5 0671 #define bfd_mach_arc_6 1672 #define bfd_mach_arc_7 2673 #define bfd_mach_arc_8 3674 bfd_arch_m32r, /* Mitsubishi M32R/D */675 #define bfd_mach_m32r 0 /* backwards compatibility */676 #define bfd_mach_m32rx 'x'677 bfd_arch_mn10200, /* Matsushita MN10200 */678 bfd_arch_mn10300, /* Matsushita MN10300 */679 #define bfd_mach_mn10300 300680 #define bfd_mach_am33 330681 bfd_arch_fr30,682 #define bfd_mach_fr30 0x46523330683 bfd_arch_mcore,684 bfd_arch_ia64, /* HP/Intel ia64 */685 #define bfd_mach_ia64_elf64 0686 #define bfd_mach_ia64_elf32 1687 bfd_arch_pj,688 bfd_arch_avr, /* Atmel AVR microcontrollers */689 #define bfd_mach_avr1 1690 #define bfd_mach_avr2 2691 #define bfd_mach_avr3 3692 #define bfd_mach_avr4 4693 #define bfd_mach_avr5 5694 bfd_arch_cris, /* Axis CRIS */695 bfd_arch_last696 };697 698 bfd_arch_info699 -------------700 701 *Description*702 This structure contains information on architectures for use within BFD.703 704 typedef struct bfd_arch_info705 {706 int bits_per_word;707 int bits_per_address;708 int bits_per_byte;709 enum bfd_architecture arch;710 unsigned long mach;711 const char *arch_name;712 const char *printable_name;713 unsigned int section_align_power;714 /* True if this is the default machine for the architecture. */715 boolean the_default;716 const struct bfd_arch_info * (*compatible)717 PARAMS ((const struct bfd_arch_info *a,718 const struct bfd_arch_info *b));719 720 boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));721 722 const struct bfd_arch_info *next;723 } bfd_arch_info_type;724 725 `bfd_printable_name'726 ....................727 728 *Synopsis*729 const char *bfd_printable_name(bfd *abfd);730 *Description*731 Return a printable string representing the architecture and machine732 from the pointer to the architecture info structure.733 734 `bfd_scan_arch'735 ...............736 737 *Synopsis*738 const bfd_arch_info_type *bfd_scan_arch(const char *string);739 *Description*740 Figure out if BFD supports any cpu which could be described with the741 name STRING. Return a pointer to an `arch_info' structure if a machine742 is found, otherwise NULL.743 744 `bfd_arch_list'745 ...............746 747 *Synopsis*748 const char **bfd_arch_list(void);749 *Description*750 Return a freshly malloced NULL-terminated vector of the names of all751 the valid BFD architectures. Do not modify the names.752 753 `bfd_arch_get_compatible'754 .........................755 756 *Synopsis*757 const bfd_arch_info_type *bfd_arch_get_compatible(758 const bfd *abfd,759 const bfd *bbfd);760 *Description*761 Determine whether two BFDs' architectures and machine types are762 compatible. Calculates the lowest common denominator between the two763 architectures and machine types implied by the BFDs and returns a764 pointer to an `arch_info' structure describing the compatible machine.765 766 `bfd_default_arch_struct'767 .........................768 769 *Description*770 The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which771 has been initialized to a fairly generic state. A BFD starts life by772 pointing to this structure, until the correct back end has determined773 the real architecture of the file.774 extern const bfd_arch_info_type bfd_default_arch_struct;775 776 `bfd_set_arch_info'777 ...................778 779 *Synopsis*780 void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg);781 *Description*782 Set the architecture info of ABFD to ARG.783 784 `bfd_default_set_arch_mach'785 ...........................786 787 *Synopsis*788 boolean bfd_default_set_arch_mach(bfd *abfd,789 enum bfd_architecture arch,790 unsigned long mach);791 *Description*792 Set the architecture and machine type in BFD ABFD to ARCH and MACH.793 Find the correct pointer to a structure and insert it into the794 `arch_info' pointer.795 796 `bfd_get_arch'797 ..............798 799 *Synopsis*800 enum bfd_architecture bfd_get_arch(bfd *abfd);801 *Description*802 Return the enumerated type which describes the BFD ABFD's architecture.803 804 `bfd_get_mach'805 ..............806 807 *Synopsis*808 unsigned long bfd_get_mach(bfd *abfd);809 *Description*810 Return the long type which describes the BFD ABFD's machine.811 812 `bfd_arch_bits_per_byte'813 ........................814 815 *Synopsis*816 unsigned int bfd_arch_bits_per_byte(bfd *abfd);817 *Description*818 Return the number of bits in one of the BFD ABFD's architecture's bytes.819 820 `bfd_arch_bits_per_address'821 ...........................822 823 *Synopsis*824 unsigned int bfd_arch_bits_per_address(bfd *abfd);825 *Description*826 Return the number of bits in one of the BFD ABFD's architecture's827 addresses.828 829 `bfd_default_compatible'830 ........................831 832 *Synopsis*833 const bfd_arch_info_type *bfd_default_compatible834 (const bfd_arch_info_type *a,835 const bfd_arch_info_type *b);836 *Description*837 The default function for testing for compatibility.838 839 `bfd_default_scan'840 ..................841 842 *Synopsis*843 boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);844 *Description*845 The default function for working out whether this is an architecture846 hit and a machine hit.847 848 `bfd_get_arch_info'849 ...................850 851 *Synopsis*852 const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd);853 *Description*854 Return the architecture info struct in ABFD.855 856 `bfd_lookup_arch'857 .................858 859 *Synopsis*860 const bfd_arch_info_type *bfd_lookup_arch861 (enum bfd_architecture862 arch,863 unsigned long machine);864 *Description*865 Look for the architecure info structure which matches the arguments866 ARCH and MACHINE. A machine of 0 matches the machine/architecture867 structure which marks itself as the default.868 869 `bfd_printable_arch_mach'870 .........................871 872 *Synopsis*873 const char *bfd_printable_arch_mach874 (enum bfd_architecture arch, unsigned long machine);875 *Description*876 Return a printable string representing the architecture and machine877 type.878 879 This routine is depreciated.880 881 `bfd_octets_per_byte'882 .....................883 884 *Synopsis*885 unsigned int bfd_octets_per_byte(bfd *abfd);886 *Description*887 Return the number of octets (8-bit quantities) per target byte (minimum888 addressable unit). In most cases, this will be one, but some DSP889 targets have 16, 32, or even 48 bits per byte.890 891 `bfd_arch_mach_octets_per_byte'892 ...............................893 894 *Synopsis*895 unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,896 unsigned long machine);897 *Description*898 See bfd_octets_per_byte.899 900 This routine is provided for those cases where a bfd * is not901 available902 903 904 File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end905 906 Opening and closing BFDs907 ========================908 909 `bfd_openr'910 ...........911 912 *Synopsis*913 bfd *bfd_openr(CONST char *filename, CONST char *target);914 *Description*915 Open the file FILENAME (using `fopen') with the target TARGET. Return916 a pointer to the created BFD.917 918 Calls `bfd_find_target', so TARGET is interpreted as by that919 function.920 921 If `NULL' is returned then an error has occured. Possible errors922 are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call'923 error.924 925 `bfd_fdopenr'926 .............927 928 *Synopsis*929 bfd *bfd_fdopenr(CONST char *filename, CONST char *target, int fd);930 *Description*931 `bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It932 opens a BFD on a file already described by the FD supplied.933 934 When the file is later `bfd_close'd, the file descriptor will be935 closed.936 937 If the caller desires that this file descriptor be cached by BFD938 (opened as needed, closed as needed to free descriptors for other939 opens), with the supplied FD used as an initial file descriptor (but940 subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the941 returned BFD. The default is to assume no cacheing; the file942 descriptor will remain open until `bfd_close', and will not be affected943 by BFD operations on other files.944 945 Possible errors are `bfd_error_no_memory',946 `bfd_error_invalid_target' and `bfd_error_system_call'.947 948 `bfd_openstreamr'949 .................950 951 *Synopsis*952 bfd *bfd_openstreamr(const char *, const char *, PTR);953 *Description*954 Open a BFD for read access on an existing stdio stream. When the BFD955 is passed to `bfd_close', the stream will be closed.956 957 `bfd_openw'958 ...........959 960 *Synopsis*961 bfd *bfd_openw(CONST char *filename, CONST char *target);962 *Description*963 Create a BFD, associated with file FILENAME, using the file format964 TARGET, and return a pointer to it.965 966 Possible errors are `bfd_error_system_call', `bfd_error_no_memory',967 `bfd_error_invalid_target'.968 969 `bfd_close'970 ...........971 972 *Synopsis*973 boolean bfd_close(bfd *abfd);974 *Description*975 Close a BFD. If the BFD was open for writing, then pending operations976 are completed and the file written out and closed. If the created file977 is executable, then `chmod' is called to mark it as such.978 979 All memory attached to the BFD is released.980 981 The file descriptor associated with the BFD is closed (even if it982 was passed in to BFD by `bfd_fdopenr').983 984 *Returns*985 `true' is returned if all is ok, otherwise `false'.986 987 `bfd_close_all_done'988 ....................989 990 *Synopsis*991 boolean bfd_close_all_done(bfd *);992 *Description*993 Close a BFD. Differs from `bfd_close' since it does not complete any994 pending operations. This routine would be used if the application had995 just used BFD for swapping and didn't want to use any of the writing996 code.997 998 If the created file is executable, then `chmod' is called to mark it999 as such.1000 1001 All memory attached to the BFD is released.1002 1003 *Returns*1004 `true' is returned if all is ok, otherwise `false'.1005 1006 `bfd_create'1007 ............1008 1009 *Synopsis*1010 bfd *bfd_create(CONST char *filename, bfd *templ);1011 *Description*1012 Create a new BFD in the manner of `bfd_openw', but without opening a1013 file. The new BFD takes the target from the target used by TEMPLATE. The1014 format is always set to `bfd_object'.1015 1016 `bfd_make_writable'1017 ...................1018 1019 *Synopsis*1020 boolean bfd_make_writable(bfd *abfd);1021 *Description*1022 Takes a BFD as created by `bfd_create' and converts it into one like as1023 returned by `bfd_openw'. It does this by converting the BFD to1024 BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on1025 this bfd later.1026 1027 *Returns*1028 `true' is returned if all is ok, otherwise `false'.1029 1030 `bfd_make_readable'1031 ...................1032 1033 *Synopsis*1034 boolean bfd_make_readable(bfd *abfd);1035 *Description*1036 Takes a BFD as created by `bfd_create' and `bfd_make_writable' and1037 converts it into one like as returned by `bfd_openr'. It does this by1038 writing the contents out to the memory buffer, then reversing the1039 direction.1040 1041 *Returns*1042 `true' is returned if all is ok, otherwise `false'.1043 1044 `bfd_alloc'1045 ...........1046 1047 *Synopsis*1048 PTR bfd_alloc (bfd *abfd, size_t wanted);1049 *Description*1050 Allocate a block of WANTED bytes of memory attached to `abfd' and1051 return a pointer to it.1052 1053 1054 File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end1055 1056 Internal functions1057 ==================1058 1059 *Description*1060 These routines are used within BFD. They are not intended for export,1061 but are documented here for completeness.1062 1063 `bfd_write_bigendian_4byte_int'1064 ...............................1065 1066 *Synopsis*1067 void bfd_write_bigendian_4byte_int(bfd *abfd, int i);1068 *Description*1069 Write a 4 byte integer I to the output BFD ABFD, in big endian order1070 regardless of what else is going on. This is useful in archives.1071 1072 `bfd_put_size'1073 ..............1074 1075 `bfd_get_size'1076 ..............1077 1078 *Description*1079 These macros as used for reading and writing raw data in sections; each1080 access (except for bytes) is vectored through the target format of the1081 BFD and mangled accordingly. The mangling performs any necessary endian1082 translations and removes alignment restrictions. Note that types1083 accepted and returned by these macros are identical so they can be1084 swapped around in macros--for example, `libaout.h' defines `GET_WORD'1085 to either `bfd_get_32' or `bfd_get_64'.1086 1087 In the put routines, VAL must be a `bfd_vma'. If we are on a system1088 without prototypes, the caller is responsible for making sure that is1089 true, with a cast if necessary. We don't cast them in the macro1090 definitions because that would prevent `lint' or `gcc -Wall' from1091 detecting sins such as passing a pointer. To detect calling these with1092 less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit1093 `bfd_vma''s.1094 1095 /* Byte swapping macros for user section data. */1096 1097 #define bfd_put_8(abfd, val, ptr) \1098 ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))1099 #define bfd_put_signed_8 \1100 bfd_put_81101 #define bfd_get_8(abfd, ptr) \1102 (*(unsigned char *) (ptr))1103 #define bfd_get_signed_8(abfd, ptr) \1104 ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)1105 1106 #define bfd_put_16(abfd, val, ptr) \1107 BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))1108 #define bfd_put_signed_16 \1109 bfd_put_161110 #define bfd_get_16(abfd, ptr) \1111 BFD_SEND(abfd, bfd_getx16, (ptr))1112 #define bfd_get_signed_16(abfd, ptr) \1113 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))1114 1115 #define bfd_put_32(abfd, val, ptr) \1116 BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))1117 #define bfd_put_signed_32 \1118 bfd_put_321119 #define bfd_get_32(abfd, ptr) \1120 BFD_SEND(abfd, bfd_getx32, (ptr))1121 #define bfd_get_signed_32(abfd, ptr) \1122 BFD_SEND(abfd, bfd_getx_signed_32, (ptr))1123 1124 #define bfd_put_64(abfd, val, ptr) \1125 BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))1126 #define bfd_put_signed_64 \1127 bfd_put_641128 #define bfd_get_64(abfd, ptr) \1129 BFD_SEND(abfd, bfd_getx64, (ptr))1130 #define bfd_get_signed_64(abfd, ptr) \1131 BFD_SEND(abfd, bfd_getx_signed_64, (ptr))1132 1133 #define bfd_get(bits, abfd, ptr) \1134 ((bits) == 8 ? bfd_get_8 (abfd, ptr) \1135 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \1136 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \1137 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \1138 : (abort (), (bfd_vma) - 1))1139 1140 #define bfd_put(bits, abfd, val, ptr) \1141 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \1142 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \1143 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \1144 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \1145 : (abort (), (void) 0))1146 1147 `bfd_h_put_size'1148 ................1149 1150 *Description*1151 These macros have the same function as their `bfd_get_x' bretheren,1152 except that they are used for removing information for the header1153 records of object files. Believe it or not, some object files keep1154 their header records in big endian order and their data in little1155 endian order.1156 1157 /* Byte swapping macros for file header data. */1158 1159 #define bfd_h_put_8(abfd, val, ptr) \1160 bfd_put_8 (abfd, val, ptr)1161 #define bfd_h_put_signed_8(abfd, val, ptr) \1162 bfd_put_8 (abfd, val, ptr)1163 #define bfd_h_get_8(abfd, ptr) \1164 bfd_get_8 (abfd, ptr)1165 #define bfd_h_get_signed_8(abfd, ptr) \1166 bfd_get_signed_8 (abfd, ptr)1167 1168 #define bfd_h_put_16(abfd, val, ptr) \1169 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))1170 #define bfd_h_put_signed_16 \1171 bfd_h_put_161172 #define bfd_h_get_16(abfd, ptr) \1173 BFD_SEND(abfd, bfd_h_getx16,(ptr))1174 #define bfd_h_get_signed_16(abfd, ptr) \1175 BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))1176 1177 #define bfd_h_put_32(abfd, val, ptr) \1178 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))1179 #define bfd_h_put_signed_32 \1180 bfd_h_put_321181 #define bfd_h_get_32(abfd, ptr) \1182 BFD_SEND(abfd, bfd_h_getx32,(ptr))1183 #define bfd_h_get_signed_32(abfd, ptr) \1184 BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))1185 1186 #define bfd_h_put_64(abfd, val, ptr) \1187 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))1188 #define bfd_h_put_signed_64 \1189 bfd_h_put_641190 #define bfd_h_get_64(abfd, ptr) \1191 BFD_SEND(abfd, bfd_h_getx64,(ptr))1192 #define bfd_h_get_signed_64(abfd, ptr) \1193 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))1194 1195 `bfd_log2'1196 ..........1197 1198 *Synopsis*1199 unsigned int bfd_log2(bfd_vma x);1200 *Description*1201 Return the log base 2 of the value supplied, rounded up. E.g., an X of1202 1025 returns 11.1203 1204 1205 File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end1206 1207 File caching1208 ============1209 1210 The file caching mechanism is embedded within BFD and allows the1211 application to open as many BFDs as it wants without regard to the1212 underlying operating system's file descriptor limit (often as low as 201213 open files). The module in `cache.c' maintains a least recently used1214 list of `BFD_CACHE_MAX_OPEN' files, and exports the name1215 `bfd_cache_lookup', which runs around and makes sure that the required1216 BFD is open. If not, then it chooses a file to close, closes it and1217 opens the one wanted, returning its file handle.1218 1219 `BFD_CACHE_MAX_OPEN macro'1220 ..........................1221 1222 *Description*1223 The maximum number of files which the cache will keep open at one time.1224 #define BFD_CACHE_MAX_OPEN 101225 1226 `bfd_last_cache'1227 ................1228 1229 *Synopsis*1230 extern bfd *bfd_last_cache;1231 *Description*1232 Zero, or a pointer to the topmost BFD on the chain. This is used by1233 the `bfd_cache_lookup' macro in `libbfd.h' to determine when it can1234 avoid a function call.1235 1236 `bfd_cache_lookup'1237 ..................1238 1239 *Description*1240 Check to see if the required BFD is the same as the last one looked up.1241 If so, then it can use the stream in the BFD with impunity, since it1242 can't have changed since the last lookup; otherwise, it has to perform1243 the complicated lookup function.1244 #define bfd_cache_lookup(x) \1245 ((x)==bfd_last_cache? \1246 (FILE*) (bfd_last_cache->iostream): \1247 bfd_cache_lookup_worker(x))1248 1249 `bfd_cache_init'1250 ................1251 1252 *Synopsis*1253 boolean bfd_cache_init (bfd *abfd);1254 *Description*1255 Add a newly opened BFD to the cache.1256 1257 `bfd_cache_close'1258 .................1259 1260 *Synopsis*1261 boolean bfd_cache_close (bfd *abfd);1262 *Description*1263 Remove the BFD ABFD from the cache. If the attached file is open, then1264 close it too.1265 1266 *Returns*1267 `false' is returned if closing the file fails, `true' is returned if1268 all is well.1269 1270 `bfd_open_file'1271 ...............1272 1273 *Synopsis*1274 FILE* bfd_open_file(bfd *abfd);1275 *Description*1276 Call the OS to open a file for ABFD. Return the `FILE *' (possibly1277 `NULL') that results from this operation. Set up the BFD so that1278 future accesses know the file is open. If the `FILE *' returned is1279 `NULL', then it won't have been put in the cache, so it won't have to1280 be removed from it.1281 1282 `bfd_cache_lookup_worker'1283 .........................1284 1285 *Synopsis*1286 FILE *bfd_cache_lookup_worker(bfd *abfd);1287 *Description*1288 Called when the macro `bfd_cache_lookup' fails to find a quick answer.1289 Find a file descriptor for ABFD. If necessary, it open it. If there1290 are already more than `BFD_CACHE_MAX_OPEN' files open, it tries to1291 close one first, to avoid running out of file descriptors.1292 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-5
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 17 17 18 18 19 File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end 20 21 Linker Functions 22 ================ 23 24 The linker uses three special entry points in the BFD target vector. 25 It is not necessary to write special routines for these entry points 26 when creating a new BFD back end, since generic versions are provided. 27 However, writing them can speed up linking and make it use 28 significantly less runtime memory. 29 30 The first routine creates a hash table used by the other routines. 31 The second routine adds the symbols from an object file to the hash 32 table. The third routine takes all the object files and links them 33 together to create the output file. These routines are designed so 34 that the linker proper does not need to know anything about the symbols 35 in the object files that it is linking. The linker merely arranges the 36 sections as directed by the linker script and lets BFD handle the 37 details of symbols and relocs. 38 39 The second routine and third routines are passed a pointer to a 40 `struct bfd_link_info' structure (defined in `bfdlink.h') which holds 41 information relevant to the link, including the linker hash table 42 (which was created by the first routine) and a set of callback 43 functions to the linker proper. 44 45 The generic linker routines are in `linker.c', and use the header 46 file `genlink.h'. As of this writing, the only back ends which have 47 implemented versions of these routines are a.out (in `aoutx.h') and 48 ECOFF (in `ecoff.c'). The a.out routines are used as examples 49 throughout this section. 50 51 * Menu: 52 53 * Creating a Linker Hash Table:: 54 * Adding Symbols to the Hash Table:: 55 * Performing the Final Link:: 19 File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets 20 21 bfd_target 22 ---------- 23 24 *Description* 25 This structure contains everything that BFD knows about a target. It 26 includes things like its byte order, name, and which routines to call 27 to do various operations. 28 29 Every BFD points to a target structure with its `xvec' member. 30 31 The macros below are used to dispatch to functions through the 32 `bfd_target' vector. They are used in a number of macros further down 33 in `bfd.h', and are also used when calling various routines by hand 34 inside the BFD implementation. The ARGLIST argument must be 35 parenthesized; it contains all the arguments to the called function. 36 37 They make the documentation (more) unpleasant to read, so if someone 38 wants to fix this and not break the above, please do. 39 #define BFD_SEND(bfd, message, arglist) \ 40 ((*((bfd)->xvec->message)) arglist) 41 42 #ifdef DEBUG_BFD_SEND 43 #undef BFD_SEND 44 #define BFD_SEND(bfd, message, arglist) \ 45 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ 46 ((*((bfd)->xvec->message)) arglist) : \ 47 (bfd_assert (__FILE__,__LINE__), NULL)) 48 #endif 49 For operations which index on the BFD format: 50 #define BFD_SEND_FMT(bfd, message, arglist) \ 51 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) 52 53 #ifdef DEBUG_BFD_SEND 54 #undef BFD_SEND_FMT 55 #define BFD_SEND_FMT(bfd, message, arglist) \ 56 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ 57 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ 58 (bfd_assert (__FILE__,__LINE__), NULL)) 59 #endif 60 This is the structure which defines the type of BFD this is. The 61 `xvec' member of the struct `bfd' itself points here. Each module that 62 implements access to a different target under BFD, defines one of these. 63 64 FIXME, these names should be rationalised with the names of the 65 entry points which call them. Too bad we can't have one macro to define 66 them both! 67 enum bfd_flavour 68 { 69 bfd_target_unknown_flavour, 70 bfd_target_aout_flavour, 71 bfd_target_coff_flavour, 72 bfd_target_ecoff_flavour, 73 bfd_target_xcoff_flavour, 74 bfd_target_elf_flavour, 75 bfd_target_ieee_flavour, 76 bfd_target_nlm_flavour, 77 bfd_target_oasys_flavour, 78 bfd_target_tekhex_flavour, 79 bfd_target_srec_flavour, 80 bfd_target_ihex_flavour, 81 bfd_target_som_flavour, 82 bfd_target_os9k_flavour, 83 bfd_target_versados_flavour, 84 bfd_target_msdos_flavour, 85 bfd_target_ovax_flavour, 86 bfd_target_evax_flavour, 87 bfd_target_mmo_flavour, 88 bfd_target_mach_o_flavour, 89 bfd_target_pef_flavour, 90 bfd_target_pef_xlib_flavour, 91 bfd_target_sym_flavour 92 }; 93 94 enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; 95 96 /* Forward declaration. */ 97 typedef struct bfd_link_info _bfd_link_info; 98 99 typedef struct bfd_target 100 { 101 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ 102 char *name; 103 104 /* The "flavour" of a back end is a general indication about 105 the contents of a file. */ 106 enum bfd_flavour flavour; 107 108 /* The order of bytes within the data area of a file. */ 109 enum bfd_endian byteorder; 110 111 /* The order of bytes within the header parts of a file. */ 112 enum bfd_endian header_byteorder; 113 114 /* A mask of all the flags which an executable may have set - 115 from the set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. */ 116 flagword object_flags; 117 118 /* A mask of all the flags which a section may have set - from 119 the set `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. */ 120 flagword section_flags; 121 122 /* The character normally found at the front of a symbol. 123 (if any), perhaps `_'. */ 124 char symbol_leading_char; 125 126 /* The pad character for file names within an archive header. */ 127 char ar_pad_char; 128 129 /* The maximum number of characters in an archive header. */ 130 unsigned short ar_max_namelen; 131 132 /* Entries for byte swapping for data. These are different from the 133 other entry points, since they don't take a BFD asthe first argument. 134 Certain other handlers could do the same. */ 135 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 136 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 137 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 138 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 139 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 140 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 141 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 142 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 143 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 144 145 /* Byte swapping for the headers. */ 146 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 147 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 148 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 149 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 150 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 151 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 152 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 153 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 154 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 155 156 /* Format dependent routines: these are vectors of entry points 157 within the target vector structure, one for each format to check. */ 158 159 /* Check the format of a file being read. Return a `bfd_target *' or zero. */ 160 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 161 162 /* Set the format of a file being written. */ 163 bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 164 165 /* Write cached information into a file being written, at `bfd_close'. */ 166 bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 167 The general target vector. These vectors are initialized using the 168 BFD_JUMP_TABLE macros. 169 170 /* Generic entry points. */ 171 Do not "beautify" the CONCAT* macro args. Traditional C will not 172 remove whitespace added here, and thus will fail to concatenate the 173 tokens. 174 #define BFD_JUMP_TABLE_GENERIC(NAME) \ 175 CONCAT2 (NAME,_close_and_cleanup), \ 176 CONCAT2 (NAME,_bfd_free_cached_info), \ 177 CONCAT2 (NAME,_new_section_hook), \ 178 CONCAT2 (NAME,_get_section_contents), \ 179 CONCAT2 (NAME,_get_section_contents_in_window) 180 181 /* Called when the BFD is being closed to do any necessary cleanup. */ 182 bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 183 /* Ask the BFD to free all cached information. */ 184 bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 185 /* Called when a new section is created. */ 186 bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 187 /* Read the contents of a section. */ 188 bfd_boolean (*_bfd_get_section_contents) 189 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 190 bfd_boolean (*_bfd_get_section_contents_in_window) 191 PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 192 193 /* Entry points to copy private data. */ 194 #define BFD_JUMP_TABLE_COPY(NAME) \ 195 CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 196 CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 197 CONCAT2 (NAME,_bfd_copy_private_section_data), \ 198 CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 199 CONCAT2 (NAME,_bfd_set_private_flags), \ 200 CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 201 /* Called to copy BFD general private data from one object file 202 to another. */ 203 bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 204 /* Called to merge BFD general private data from one object file 205 to a common output file when linking. */ 206 bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 207 /* Called to copy BFD private section data from one object file 208 to another. */ 209 bfd_boolean (*_bfd_copy_private_section_data) 210 PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 211 /* Called to copy BFD private symbol data from one symbol 212 to another. */ 213 bfd_boolean (*_bfd_copy_private_symbol_data) 214 PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 215 /* Called to set private backend flags. */ 216 bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 217 218 /* Called to print private BFD data. */ 219 bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 220 221 /* Core file entry points. */ 222 #define BFD_JUMP_TABLE_CORE(NAME) \ 223 CONCAT2 (NAME,_core_file_failing_command), \ 224 CONCAT2 (NAME,_core_file_failing_signal), \ 225 CONCAT2 (NAME,_core_file_matches_executable_p) 226 char * (*_core_file_failing_command) PARAMS ((bfd *)); 227 int (*_core_file_failing_signal) PARAMS ((bfd *)); 228 bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 229 230 /* Archive entry points. */ 231 #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 232 CONCAT2 (NAME,_slurp_armap), \ 233 CONCAT2 (NAME,_slurp_extended_name_table), \ 234 CONCAT2 (NAME,_construct_extended_name_table), \ 235 CONCAT2 (NAME,_truncate_arname), \ 236 CONCAT2 (NAME,_write_armap), \ 237 CONCAT2 (NAME,_read_ar_hdr), \ 238 CONCAT2 (NAME,_openr_next_archived_file), \ 239 CONCAT2 (NAME,_get_elt_at_index), \ 240 CONCAT2 (NAME,_generic_stat_arch_elt), \ 241 CONCAT2 (NAME,_update_armap_timestamp) 242 bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 243 bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 244 bfd_boolean (*_bfd_construct_extended_name_table) 245 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 246 void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 247 bfd_boolean (*write_armap) 248 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 249 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 250 bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 251 #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 252 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 253 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 254 bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 255 256 /* Entry points used for symbols. */ 257 #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 258 CONCAT2 (NAME,_get_symtab_upper_bound), \ 259 CONCAT2 (NAME,_get_symtab), \ 260 CONCAT2 (NAME,_make_empty_symbol), \ 261 CONCAT2 (NAME,_print_symbol), \ 262 CONCAT2 (NAME,_get_symbol_info), \ 263 CONCAT2 (NAME,_bfd_is_local_label_name), \ 264 CONCAT2 (NAME,_get_lineno), \ 265 CONCAT2 (NAME,_find_nearest_line), \ 266 CONCAT2 (NAME,_bfd_make_debug_symbol), \ 267 CONCAT2 (NAME,_read_minisymbols), \ 268 CONCAT2 (NAME,_minisymbol_to_symbol) 269 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 270 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 271 struct symbol_cache_entry **)); 272 struct symbol_cache_entry * 273 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 274 void (*_bfd_print_symbol) 275 PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 276 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 277 void (*_bfd_get_symbol_info) 278 PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 279 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 280 bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 281 282 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 283 bfd_boolean (*_bfd_find_nearest_line) 284 PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 285 const char **, const char **, unsigned int *)); 286 /* Back-door to allow format-aware applications to create debug symbols 287 while using BFD for everything else. Currently used by the assembler 288 when creating COFF files. */ 289 asymbol * (*_bfd_make_debug_symbol) 290 PARAMS ((bfd *, void *, unsigned long size)); 291 #define bfd_read_minisymbols(b, d, m, s) \ 292 BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 293 long (*_read_minisymbols) 294 PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 295 #define bfd_minisymbol_to_symbol(b, d, m, f) \ 296 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 297 asymbol * (*_minisymbol_to_symbol) 298 PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 299 300 /* Routines for relocs. */ 301 #define BFD_JUMP_TABLE_RELOCS(NAME) \ 302 CONCAT2 (NAME,_get_reloc_upper_bound), \ 303 CONCAT2 (NAME,_canonicalize_reloc), \ 304 CONCAT2 (NAME,_bfd_reloc_type_lookup) 305 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 306 long (*_bfd_canonicalize_reloc) 307 PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 308 /* See documentation on reloc types. */ 309 reloc_howto_type * 310 (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 311 312 /* Routines used when writing an object file. */ 313 #define BFD_JUMP_TABLE_WRITE(NAME) \ 314 CONCAT2 (NAME,_set_arch_mach), \ 315 CONCAT2 (NAME,_set_section_contents) 316 bfd_boolean (*_bfd_set_arch_mach) 317 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 318 bfd_boolean (*_bfd_set_section_contents) 319 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 320 321 /* Routines used by the linker. */ 322 #define BFD_JUMP_TABLE_LINK(NAME) \ 323 CONCAT2 (NAME,_sizeof_headers), \ 324 CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 325 CONCAT2 (NAME,_bfd_relax_section), \ 326 CONCAT2 (NAME,_bfd_link_hash_table_create), \ 327 CONCAT2 (NAME,_bfd_link_hash_table_free), \ 328 CONCAT2 (NAME,_bfd_link_add_symbols), \ 329 CONCAT2 (NAME,_bfd_link_just_syms), \ 330 CONCAT2 (NAME,_bfd_final_link), \ 331 CONCAT2 (NAME,_bfd_link_split_section), \ 332 CONCAT2 (NAME,_bfd_gc_sections), \ 333 CONCAT2 (NAME,_bfd_merge_sections), \ 334 CONCAT2 (NAME,_bfd_discard_group) 335 int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 336 bfd_byte * (*_bfd_get_relocated_section_contents) 337 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 338 bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 339 340 bfd_boolean (*_bfd_relax_section) 341 PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 342 343 /* Create a hash table for the linker. Different backends store 344 different information in this table. */ 345 struct bfd_link_hash_table * 346 (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 347 348 /* Release the memory associated with the linker hash table. */ 349 void (*_bfd_link_hash_table_free) 350 PARAMS ((struct bfd_link_hash_table *)); 351 352 /* Add symbols from this object file into the hash table. */ 353 bfd_boolean (*_bfd_link_add_symbols) 354 PARAMS ((bfd *, struct bfd_link_info *)); 355 356 /* Indicate that we are only retrieving symbol values from this section. */ 357 void (*_bfd_link_just_syms) 358 PARAMS ((asection *, struct bfd_link_info *)); 359 360 /* Do a link based on the link_order structures attached to each 361 section of the BFD. */ 362 bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 363 364 /* Should this section be split up into smaller pieces during linking. */ 365 bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 366 367 /* Remove sections that are not referenced from the output. */ 368 bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 369 370 /* Attempt to merge SEC_MERGE sections. */ 371 bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 372 373 /* Discard members of a group. */ 374 bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 375 376 /* Routines to handle dynamic symbols and relocs. */ 377 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 378 CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 379 CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 380 CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 381 CONCAT2 (NAME,_canonicalize_dynamic_reloc) 382 /* Get the amount of memory required to hold the dynamic symbols. */ 383 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 384 /* Read in the dynamic symbols. */ 385 long (*_bfd_canonicalize_dynamic_symtab) 386 PARAMS ((bfd *, struct symbol_cache_entry **)); 387 /* Get the amount of memory required to hold the dynamic relocs. */ 388 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 389 /* Read in the dynamic relocs. */ 390 long (*_bfd_canonicalize_dynamic_reloc) 391 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 392 A pointer to an alternative bfd_target in case the current one is not 393 satisfactory. This can happen when the target cpu supports both big 394 and little endian code, and target chosen by the linker has the wrong 395 endianness. The function open_output() in ld/ldlang.c uses this field 396 to find an alternative output format that is suitable. 397 /* Opposite endian version of this target. */ 398 const struct bfd_target * alternative_target; 399 400 /* Data for use by back-end routines, which isn't 401 generic enough to belong in this structure. */ 402 PTR backend_data; 403 404 } bfd_target; 405 406 `bfd_set_default_target' 407 ........................ 408 409 *Synopsis* 410 bfd_boolean bfd_set_default_target (const char *name); 411 *Description* 412 Set the default target vector to use when recognizing a BFD. This 413 takes the name of the target, which may be a BFD target name or a 414 configuration triplet. 415 416 `bfd_find_target' 417 ................. 418 419 *Synopsis* 420 const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); 421 *Description* 422 Return a pointer to the transfer vector for the object target named 423 TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the 424 environment variable `GNUTARGET'; if that is null or not defined, then 425 choose the first entry in the target list. Passing in the string 426 "default" or setting the environment variable to "default" will cause 427 the first entry in the target list to be returned, and 428 "target_defaulted" will be set in the BFD. This causes 429 `bfd_check_format' to loop over all the targets to find the one that 430 matches the file being read. 431 432 `bfd_target_list' 433 ................. 434 435 *Synopsis* 436 const char ** bfd_target_list (void); 437 *Description* 438 Return a freshly malloced NULL-terminated vector of the names of all 439 the valid BFD targets. Do not modify the names. 440 441 `bfd_seach_for_target' 442 ...................... 443 444 *Synopsis* 445 const bfd_target * bfd_search_for_target (int (* search_func) 446 (const bfd_target *, void *), 447 void *); 448 *Description* 449 Return a pointer to the first transfer vector in the list of transfer 450 vectors maintained by BFD that produces a non-zero result when passed 451 to the function SEARCH_FUNC. The parameter DATA is passed, unexamined, 452 to the search function. 56 453 57 454 58 File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions 59 60 Creating a linker hash table 61 ---------------------------- 62 63 The linker routines must create a hash table, which must be derived 64 from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash 65 Tables::, for information on how to create a derived hash table. This 66 entry point is called using the target vector of the linker output file. 67 68 The `_bfd_link_hash_table_create' entry point must allocate and 69 initialize an instance of the desired hash table. If the back end does 70 not require any additional information to be stored with the entries in 71 the hash table, the entry point may simply create a `struct 72 bfd_link_hash_table'. Most likely, however, some additional 73 information will be needed. 74 75 For example, with each entry in the hash table the a.out linker 76 keeps the index the symbol has in the final output file (this index 77 number is used so that when doing a relocateable link the symbol index 78 used in the output file can be quickly filled in when copying over a 79 reloc). The a.out linker code defines the required structures and 80 functions for a hash table derived from `struct bfd_link_hash_table'. 81 The a.out linker hash table is created by the function 82 `NAME(aout,link_hash_table_create)'; it simply allocates space for the 83 hash table, initializes it, and returns a pointer to it. 84 85 When writing the linker routines for a new back end, you will 86 generally not know exactly which fields will be required until you have 87 finished. You should simply create a new hash table which defines no 88 additional fields, and then simply add fields as they become necessary. 455 File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end 456 457 Architectures 458 ============= 459 460 BFD keeps one atom in a BFD describing the architecture of the data 461 attached to the BFD: a pointer to a `bfd_arch_info_type'. 462 463 Pointers to structures can be requested independently of a BFD so 464 that an architecture's information can be interrogated without access 465 to an open BFD. 466 467 The architecture information is provided by each architecture 468 package. The set of default architectures is selected by the macro 469 `SELECT_ARCHITECTURES'. This is normally set up in the 470 `config/TARGET.mt' file of your choice. If the name is not defined, 471 then all the architectures supported are included. 472 473 When BFD starts up, all the architectures are called with an 474 initialize method. It is up to the architecture back end to insert as 475 many items into the list of architectures as it wants to; generally 476 this would be one for each machine and one for the default case (an 477 item with a machine field of 0). 478 479 BFD's idea of an architecture is implemented in `archures.c'. 480 481 bfd_architecture 482 ---------------- 483 484 *Description* 485 This enum gives the object file's CPU architecture, in a global 486 sense--i.e., what processor family does it belong to? Another field 487 indicates which processor within the family is in use. The machine 488 gives a number which distinguishes different versions of the 489 architecture, containing, for example, 2 and 3 for Intel i960 KA and 490 i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. 491 enum bfd_architecture 492 { 493 bfd_arch_unknown, /* File arch not known. */ 494 bfd_arch_obscure, /* Arch known, not one of these. */ 495 bfd_arch_m68k, /* Motorola 68xxx */ 496 #define bfd_mach_m68000 1 497 #define bfd_mach_m68008 2 498 #define bfd_mach_m68010 3 499 #define bfd_mach_m68020 4 500 #define bfd_mach_m68030 5 501 #define bfd_mach_m68040 6 502 #define bfd_mach_m68060 7 503 #define bfd_mach_cpu32 8 504 #define bfd_mach_mcf5200 9 505 #define bfd_mach_mcf5206e 10 506 #define bfd_mach_mcf5307 11 507 #define bfd_mach_mcf5407 12 508 bfd_arch_vax, /* DEC Vax */ 509 bfd_arch_i960, /* Intel 960 */ 510 /* The order of the following is important. 511 lower number indicates a machine type that 512 only accepts a subset of the instructions 513 available to machines with higher numbers. 514 The exception is the "ca", which is 515 incompatible with all other machines except 516 "core". */ 517 518 #define bfd_mach_i960_core 1 519 #define bfd_mach_i960_ka_sa 2 520 #define bfd_mach_i960_kb_sb 3 521 #define bfd_mach_i960_mc 4 522 #define bfd_mach_i960_xa 5 523 #define bfd_mach_i960_ca 6 524 #define bfd_mach_i960_jx 7 525 #define bfd_mach_i960_hx 8 526 527 bfd_arch_or32, /* OpenRISC 32 */ 528 529 bfd_arch_a29k, /* AMD 29000 */ 530 bfd_arch_sparc, /* SPARC */ 531 #define bfd_mach_sparc 1 532 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ 533 #define bfd_mach_sparc_sparclet 2 534 #define bfd_mach_sparc_sparclite 3 535 #define bfd_mach_sparc_v8plus 4 536 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 537 #define bfd_mach_sparc_sparclite_le 6 538 #define bfd_mach_sparc_v9 7 539 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 540 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 541 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 542 /* Nonzero if MACH has the v9 instruction set. */ 543 #define bfd_mach_sparc_v9_p(mach) \ 544 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ 545 && (mach) != bfd_mach_sparc_sparclite_le) 546 bfd_arch_mips, /* MIPS Rxxxx */ 547 #define bfd_mach_mips3000 3000 548 #define bfd_mach_mips3900 3900 549 #define bfd_mach_mips4000 4000 550 #define bfd_mach_mips4010 4010 551 #define bfd_mach_mips4100 4100 552 #define bfd_mach_mips4111 4111 553 #define bfd_mach_mips4120 4120 554 #define bfd_mach_mips4300 4300 555 #define bfd_mach_mips4400 4400 556 #define bfd_mach_mips4600 4600 557 #define bfd_mach_mips4650 4650 558 #define bfd_mach_mips5000 5000 559 #define bfd_mach_mips5400 5400 560 #define bfd_mach_mips5500 5500 561 #define bfd_mach_mips6000 6000 562 #define bfd_mach_mips8000 8000 563 #define bfd_mach_mips10000 10000 564 #define bfd_mach_mips12000 12000 565 #define bfd_mach_mips16 16 566 #define bfd_mach_mips5 5 567 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ 568 #define bfd_mach_mipsisa32 32 569 #define bfd_mach_mipsisa32r2 33 570 #define bfd_mach_mipsisa64 64 571 bfd_arch_i386, /* Intel 386 */ 572 #define bfd_mach_i386_i386 1 573 #define bfd_mach_i386_i8086 2 574 #define bfd_mach_i386_i386_intel_syntax 3 575 #define bfd_mach_x86_64 64 576 #define bfd_mach_x86_64_intel_syntax 65 577 bfd_arch_we32k, /* AT&T WE32xxx */ 578 bfd_arch_tahoe, /* CCI/Harris Tahoe */ 579 bfd_arch_i860, /* Intel 860 */ 580 bfd_arch_i370, /* IBM 360/370 Mainframes */ 581 bfd_arch_romp, /* IBM ROMP PC/RT */ 582 bfd_arch_alliant, /* Alliant */ 583 bfd_arch_convex, /* Convex */ 584 bfd_arch_m88k, /* Motorola 88xxx */ 585 bfd_arch_m98k, /* Motorola 98xxx */ 586 bfd_arch_pyramid, /* Pyramid Technology */ 587 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ 588 #define bfd_mach_h8300 1 589 #define bfd_mach_h8300h 2 590 #define bfd_mach_h8300s 3 591 #define bfd_mach_h8300hn 4 592 #define bfd_mach_h8300sn 5 593 bfd_arch_pdp11, /* DEC PDP-11 */ 594 bfd_arch_powerpc, /* PowerPC */ 595 #define bfd_mach_ppc 32 596 #define bfd_mach_ppc64 64 597 #define bfd_mach_ppc_403 403 598 #define bfd_mach_ppc_403gc 4030 599 #define bfd_mach_ppc_505 505 600 #define bfd_mach_ppc_601 601 601 #define bfd_mach_ppc_602 602 602 #define bfd_mach_ppc_603 603 603 #define bfd_mach_ppc_ec603e 6031 604 #define bfd_mach_ppc_604 604 605 #define bfd_mach_ppc_620 620 606 #define bfd_mach_ppc_630 630 607 #define bfd_mach_ppc_750 750 608 #define bfd_mach_ppc_860 860 609 #define bfd_mach_ppc_a35 35 610 #define bfd_mach_ppc_rs64ii 642 611 #define bfd_mach_ppc_rs64iii 643 612 #define bfd_mach_ppc_7400 7400 613 #define bfd_mach_ppc_e500 500 614 bfd_arch_rs6000, /* IBM RS/6000 */ 615 #define bfd_mach_rs6k 6000 616 #define bfd_mach_rs6k_rs1 6001 617 #define bfd_mach_rs6k_rsc 6003 618 #define bfd_mach_rs6k_rs2 6002 619 bfd_arch_hppa, /* HP PA RISC */ 620 bfd_arch_d10v, /* Mitsubishi D10V */ 621 #define bfd_mach_d10v 1 622 #define bfd_mach_d10v_ts2 2 623 #define bfd_mach_d10v_ts3 3 624 bfd_arch_d30v, /* Mitsubishi D30V */ 625 bfd_arch_dlx, /* DLX */ 626 bfd_arch_m68hc11, /* Motorola 68HC11 */ 627 bfd_arch_m68hc12, /* Motorola 68HC12 */ 628 #define bfd_mach_m6812_default 0 629 #define bfd_mach_m6812 1 630 #define bfd_mach_m6812s 2 631 bfd_arch_z8k, /* Zilog Z8000 */ 632 #define bfd_mach_z8001 1 633 #define bfd_mach_z8002 2 634 bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ 635 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ 636 #define bfd_mach_sh 1 637 #define bfd_mach_sh2 0x20 638 #define bfd_mach_sh_dsp 0x2d 639 #define bfd_mach_sh2e 0x2e 640 #define bfd_mach_sh3 0x30 641 #define bfd_mach_sh3_dsp 0x3d 642 #define bfd_mach_sh3e 0x3e 643 #define bfd_mach_sh4 0x40 644 #define bfd_mach_sh5 0x50 645 bfd_arch_alpha, /* Dec Alpha */ 646 #define bfd_mach_alpha_ev4 0x10 647 #define bfd_mach_alpha_ev5 0x20 648 #define bfd_mach_alpha_ev6 0x30 649 bfd_arch_arm, /* Advanced Risc Machines ARM. */ 650 #define bfd_mach_arm_unknown 0 651 #define bfd_mach_arm_2 1 652 #define bfd_mach_arm_2a 2 653 #define bfd_mach_arm_3 3 654 #define bfd_mach_arm_3M 4 655 #define bfd_mach_arm_4 5 656 #define bfd_mach_arm_4T 6 657 #define bfd_mach_arm_5 7 658 #define bfd_mach_arm_5T 8 659 #define bfd_mach_arm_5TE 9 660 #define bfd_mach_arm_XScale 10 661 #define bfd_mach_arm_ep9312 11 662 #define bfd_mach_arm_iWMMXt 12 663 bfd_arch_ns32k, /* National Semiconductors ns32000 */ 664 bfd_arch_w65, /* WDC 65816 */ 665 bfd_arch_tic30, /* Texas Instruments TMS320C30 */ 666 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ 667 #define bfd_mach_tic3x 30 668 #define bfd_mach_tic4x 40 669 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ 670 bfd_arch_tic80, /* TI TMS320c80 (MVP) */ 671 bfd_arch_v850, /* NEC V850 */ 672 #define bfd_mach_v850 1 673 #define bfd_mach_v850e 'E' 674 bfd_arch_arc, /* ARC Cores */ 675 #define bfd_mach_arc_5 5 676 #define bfd_mach_arc_6 6 677 #define bfd_mach_arc_7 7 678 #define bfd_mach_arc_8 8 679 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ 680 #define bfd_mach_m32r 1 /* For backwards compatibility. */ 681 #define bfd_mach_m32rx 'x' 682 bfd_arch_mn10200, /* Matsushita MN10200 */ 683 bfd_arch_mn10300, /* Matsushita MN10300 */ 684 #define bfd_mach_mn10300 300 685 #define bfd_mach_am33 330 686 bfd_arch_fr30, 687 #define bfd_mach_fr30 0x46523330 688 bfd_arch_frv, 689 #define bfd_mach_frv 1 690 #define bfd_mach_frvsimple 2 691 #define bfd_mach_fr300 300 692 #define bfd_mach_fr400 400 693 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ 694 #define bfd_mach_fr500 500 695 bfd_arch_mcore, 696 bfd_arch_ia64, /* HP/Intel ia64 */ 697 #define bfd_mach_ia64_elf64 64 698 #define bfd_mach_ia64_elf32 32 699 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 700 #define bfd_mach_ip2022 1 701 #define bfd_mach_ip2022ext 2 702 bfd_arch_iq2000, /* Vitesse IQ2000. */ 703 #define bfd_mach_iq2000 1 704 #define bfd_mach_iq10 2 705 bfd_arch_pj, 706 bfd_arch_avr, /* Atmel AVR microcontrollers. */ 707 #define bfd_mach_avr1 1 708 #define bfd_mach_avr2 2 709 #define bfd_mach_avr3 3 710 #define bfd_mach_avr4 4 711 #define bfd_mach_avr5 5 712 bfd_arch_cris, /* Axis CRIS */ 713 bfd_arch_s390, /* IBM s390 */ 714 #define bfd_mach_s390_31 31 715 #define bfd_mach_s390_64 64 716 bfd_arch_openrisc, /* OpenRISC */ 717 bfd_arch_mmix, /* Donald Knuth's educational processor. */ 718 bfd_arch_xstormy16, 719 #define bfd_mach_xstormy16 1 720 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 721 #define bfd_mach_msp110 110 722 #define bfd_mach_msp11 11 723 #define bfd_mach_msp12 12 724 #define bfd_mach_msp13 13 725 #define bfd_mach_msp14 14 726 #define bfd_mach_msp41 41 727 #define bfd_mach_msp31 31 728 #define bfd_mach_msp32 32 729 #define bfd_mach_msp33 33 730 #define bfd_mach_msp43 43 731 #define bfd_mach_msp44 44 732 #define bfd_mach_msp15 15 733 #define bfd_mach_msp16 16 734 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 735 #define bfd_mach_xtensa 1 736 bfd_arch_last 737 }; 738 739 bfd_arch_info 740 ------------- 741 742 *Description* 743 This structure contains information on architectures for use within BFD. 744 745 typedef struct bfd_arch_info 746 { 747 int bits_per_word; 748 int bits_per_address; 749 int bits_per_byte; 750 enum bfd_architecture arch; 751 unsigned long mach; 752 const char *arch_name; 753 const char *printable_name; 754 unsigned int section_align_power; 755 /* TRUE if this is the default machine for the architecture. 756 The default arch should be the first entry for an arch so that 757 all the entries for that arch can be accessed via `next'. */ 758 bfd_boolean the_default; 759 const struct bfd_arch_info * (*compatible) 760 PARAMS ((const struct bfd_arch_info *a, 761 const struct bfd_arch_info *b)); 762 763 bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); 764 765 const struct bfd_arch_info *next; 766 } 767 bfd_arch_info_type; 768 769 `bfd_printable_name' 770 .................... 771 772 *Synopsis* 773 const char *bfd_printable_name(bfd *abfd); 774 *Description* 775 Return a printable string representing the architecture and machine 776 from the pointer to the architecture info structure. 777 778 `bfd_scan_arch' 779 ............... 780 781 *Synopsis* 782 const bfd_arch_info_type *bfd_scan_arch(const char *string); 783 *Description* 784 Figure out if BFD supports any cpu which could be described with the 785 name STRING. Return a pointer to an `arch_info' structure if a machine 786 is found, otherwise NULL. 787 788 `bfd_arch_list' 789 ............... 790 791 *Synopsis* 792 const char **bfd_arch_list(void); 793 *Description* 794 Return a freshly malloced NULL-terminated vector of the names of all 795 the valid BFD architectures. Do not modify the names. 796 797 `bfd_arch_get_compatible' 798 ......................... 799 800 *Synopsis* 801 const bfd_arch_info_type *bfd_arch_get_compatible( 802 const bfd *abfd, 803 const bfd *bbfd, 804 bfd_boolean accept_unknowns); 805 *Description* 806 Determine whether two BFDs' architectures and machine types are 807 compatible. Calculates the lowest common denominator between the two 808 architectures and machine types implied by the BFDs and returns a 809 pointer to an `arch_info' structure describing the compatible machine. 810 811 `bfd_default_arch_struct' 812 ......................... 813 814 *Description* 815 The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which 816 has been initialized to a fairly generic state. A BFD starts life by 817 pointing to this structure, until the correct back end has determined 818 the real architecture of the file. 819 extern const bfd_arch_info_type bfd_default_arch_struct; 820 821 `bfd_set_arch_info' 822 ................... 823 824 *Synopsis* 825 void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg); 826 *Description* 827 Set the architecture info of ABFD to ARG. 828 829 `bfd_default_set_arch_mach' 830 ........................... 831 832 *Synopsis* 833 bfd_boolean bfd_default_set_arch_mach(bfd *abfd, 834 enum bfd_architecture arch, 835 unsigned long mach); 836 *Description* 837 Set the architecture and machine type in BFD ABFD to ARCH and MACH. 838 Find the correct pointer to a structure and insert it into the 839 `arch_info' pointer. 840 841 `bfd_get_arch' 842 .............. 843 844 *Synopsis* 845 enum bfd_architecture bfd_get_arch(bfd *abfd); 846 *Description* 847 Return the enumerated type which describes the BFD ABFD's architecture. 848 849 `bfd_get_mach' 850 .............. 851 852 *Synopsis* 853 unsigned long bfd_get_mach(bfd *abfd); 854 *Description* 855 Return the long type which describes the BFD ABFD's machine. 856 857 `bfd_arch_bits_per_byte' 858 ........................ 859 860 *Synopsis* 861 unsigned int bfd_arch_bits_per_byte(bfd *abfd); 862 *Description* 863 Return the number of bits in one of the BFD ABFD's architecture's bytes. 864 865 `bfd_arch_bits_per_address' 866 ........................... 867 868 *Synopsis* 869 unsigned int bfd_arch_bits_per_address(bfd *abfd); 870 *Description* 871 Return the number of bits in one of the BFD ABFD's architecture's 872 addresses. 873 874 `bfd_default_compatible' 875 ........................ 876 877 *Synopsis* 878 const bfd_arch_info_type *bfd_default_compatible 879 (const bfd_arch_info_type *a, 880 const bfd_arch_info_type *b); 881 *Description* 882 The default function for testing for compatibility. 883 884 `bfd_default_scan' 885 .................. 886 887 *Synopsis* 888 bfd_boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); 889 *Description* 890 The default function for working out whether this is an architecture 891 hit and a machine hit. 892 893 `bfd_get_arch_info' 894 ................... 895 896 *Synopsis* 897 const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd); 898 *Description* 899 Return the architecture info struct in ABFD. 900 901 `bfd_lookup_arch' 902 ................. 903 904 *Synopsis* 905 const bfd_arch_info_type *bfd_lookup_arch 906 (enum bfd_architecture 907 arch, 908 unsigned long machine); 909 *Description* 910 Look for the architecure info structure which matches the arguments 911 ARCH and MACHINE. A machine of 0 matches the machine/architecture 912 structure which marks itself as the default. 913 914 `bfd_printable_arch_mach' 915 ......................... 916 917 *Synopsis* 918 const char *bfd_printable_arch_mach 919 (enum bfd_architecture arch, unsigned long machine); 920 *Description* 921 Return a printable string representing the architecture and machine 922 type. 923 924 This routine is depreciated. 925 926 `bfd_octets_per_byte' 927 ..................... 928 929 *Synopsis* 930 unsigned int bfd_octets_per_byte(bfd *abfd); 931 *Description* 932 Return the number of octets (8-bit quantities) per target byte (minimum 933 addressable unit). In most cases, this will be one, but some DSP 934 targets have 16, 32, or even 48 bits per byte. 935 936 `bfd_arch_mach_octets_per_byte' 937 ............................... 938 939 *Synopsis* 940 unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, 941 unsigned long machine); 942 *Description* 943 See bfd_octets_per_byte. 944 945 This routine is provided for those cases where a bfd * is not 946 available 89 947 90 948 91 File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions 92 93 Adding symbols to the hash table 94 -------------------------------- 95 96 The linker proper will call the `_bfd_link_add_symbols' entry point 97 for each object file or archive which is to be linked (typically these 98 are the files named on the command line, but some may also come from 99 the linker script). The entry point is responsible for examining the 100 file. For an object file, BFD must add any relevant symbol information 101 to the hash table. For an archive, BFD must determine which elements 102 of the archive should be used and adding them to the link. 103 104 The a.out version of this entry point is 105 `NAME(aout,link_add_symbols)'. 106 107 * Menu: 108 109 * Differing file formats:: 110 * Adding symbols from an object file:: 111 * Adding symbols from an archive:: 112 113 114 File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table 115 116 Differing file formats 117 ...................... 118 119 Normally all the files involved in a link will be of the same 120 format, but it is also possible to link together different format 121 object files, and the back end must support that. The 122 `_bfd_link_add_symbols' entry point is called via the target vector of 123 the file to be added. This has an important consequence: the function 124 may not assume that the hash table is the type created by the 125 corresponding `_bfd_link_hash_table_create' vector. All the 126 `_bfd_link_add_symbols' function can assume about the hash table is 127 that it is derived from `struct bfd_link_hash_table'. 128 129 Sometimes the `_bfd_link_add_symbols' function must store some 130 information in the hash table entry to be used by the `_bfd_final_link' 131 function. In such a case the `creator' field of the hash table must be 132 checked to make sure that the hash table was created by an object file 133 of the same format. 134 135 The `_bfd_final_link' routine must be prepared to handle a hash 136 entry without any extra information added by the 137 `_bfd_link_add_symbols' function. A hash entry without extra 138 information will also occur when the linker script directs the linker 139 to create a symbol. Note that, regardless of how a hash table entry is 140 added, all the fields will be initialized to some sort of null value by 141 the hash table entry initialization function. 142 143 See `ecoff_link_add_externals' for an example of how to check the 144 `creator' field before saving information (in this case, the ECOFF 145 external symbol debugging information) in a hash table entry. 146 147 148 File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table 149 150 Adding symbols from an object file 151 .................................. 152 153 When the `_bfd_link_add_symbols' routine is passed an object file, 154 it must add all externally visible symbols in that object file to the 155 hash table. The actual work of adding the symbol to the hash table is 156 normally handled by the function `_bfd_generic_link_add_one_symbol'. 157 The `_bfd_link_add_symbols' routine is responsible for reading all the 158 symbols from the object file and passing the correct information to 159 `_bfd_generic_link_add_one_symbol'. 160 161 The `_bfd_link_add_symbols' routine should not use 162 `bfd_canonicalize_symtab' to read the symbols. The point of providing 163 this routine is to avoid the overhead of converting the symbols into 164 generic `asymbol' structures. 165 166 `_bfd_generic_link_add_one_symbol' handles the details of combining 167 common symbols, warning about multiple definitions, and so forth. It 168 takes arguments which describe the symbol to add, notably symbol flags, 169 a section, and an offset. The symbol flags include such things as 170 `BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object 171 file, or something like `bfd_und_section_ptr' for an undefined symbol 172 or `bfd_com_section_ptr' for a common symbol. 173 174 If the `_bfd_final_link' routine is also going to need to read the 175 symbol information, the `_bfd_link_add_symbols' routine should save it 176 somewhere attached to the object file BFD. However, the information 177 should only be saved if the `keep_memory' field of the `info' argument 178 is true, so that the `-no-keep-memory' linker switch is effective. 179 180 The a.out function which adds symbols from an object file is 181 `aout_link_add_object_symbols', and most of the interesting work is in 182 `aout_link_add_symbols'. The latter saves pointers to the hash tables 183 entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol 184 number, so that the `_bfd_final_link' routine does not have to call the 185 hash table lookup routine to locate the entry. 186 187 188 File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table 189 190 Adding symbols from an archive 191 .............................. 192 193 When the `_bfd_link_add_symbols' routine is passed an archive, it 194 must look through the symbols defined by the archive and decide which 195 elements of the archive should be included in the link. For each such 196 element it must call the `add_archive_element' linker callback, and it 197 must add the symbols from the object file to the linker hash table. 198 199 In most cases the work of looking through the symbols in the archive 200 should be done by the `_bfd_generic_link_add_archive_symbols' function. 201 This function builds a hash table from the archive symbol table and 202 looks through the list of undefined symbols to see which elements 203 should be included. `_bfd_generic_link_add_archive_symbols' is passed 204 a function to call to make the final decision about adding an archive 205 element to the link and to do the actual work of adding the symbols to 206 the linker hash table. 207 208 The function passed to `_bfd_generic_link_add_archive_symbols' must 209 read the symbols of the archive element and decide whether the archive 210 element should be included in the link. If the element is to be 211 included, the `add_archive_element' linker callback routine must be 212 called with the element as an argument, and the elements symbols must 213 be added to the linker hash table just as though the element had itself 214 been passed to the `_bfd_link_add_symbols' function. 215 216 When the a.out `_bfd_link_add_symbols' function receives an archive, 217 it calls `_bfd_generic_link_add_archive_symbols' passing 218 `aout_link_check_archive_element' as the function argument. 219 `aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. 220 If the latter decides to add the element (an element is only added if 221 it provides a real, non-common, definition for a previously undefined 222 or common symbol) it calls the `add_archive_element' callback and then 223 `aout_link_check_archive_element' calls `aout_link_add_symbols' to 224 actually add the symbols to the linker hash table. 225 226 The ECOFF back end is unusual in that it does not normally call 227 `_bfd_generic_link_add_archive_symbols', because ECOFF archives already 228 contain a hash table of symbols. The ECOFF back end searches the 229 archive itself to avoid the overhead of creating a new hash table. 230 231 232 File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions 233 234 Performing the final link 235 ------------------------- 236 237 When all the input files have been processed, the linker calls the 238 `_bfd_final_link' entry point of the output BFD. This routine is 239 responsible for producing the final output file, which has several 240 aspects. It must relocate the contents of the input sections and copy 241 the data into the output sections. It must build an output symbol 242 table including any local symbols from the input files and the global 243 symbols from the hash table. When producing relocateable output, it 244 must modify the input relocs and write them into the output file. 245 There may also be object format dependent work to be done. 246 247 The linker will also call the `write_object_contents' entry point 248 when the BFD is closed. The two entry points must work together in 249 order to produce the correct output file. 250 251 The details of how this works are inevitably dependent upon the 252 specific object file format. The a.out `_bfd_final_link' routine is 253 `NAME(aout,final_link)'. 254 255 * Menu: 256 257 * Information provided by the linker:: 258 * Relocating the section contents:: 259 * Writing the symbol table:: 260 261 262 File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link 263 264 Information provided by the linker 265 .................................. 266 267 Before the linker calls the `_bfd_final_link' entry point, it sets 268 up some data structures for the function to use. 269 270 The `input_bfds' field of the `bfd_link_info' structure will point 271 to a list of all the input files included in the link. These files are 272 linked through the `link_next' field of the `bfd' structure. 273 274 Each section in the output file will have a list of `link_order' 275 structures attached to the `link_order_head' field (the `link_order' 276 structure is defined in `bfdlink.h'). These structures describe how to 277 create the contents of the output section in terms of the contents of 278 various input sections, fill constants, and, eventually, other types of 279 information. They also describe relocs that must be created by the BFD 280 backend, but do not correspond to any input file; this is used to 281 support -Ur, which builds constructors while generating a relocateable 282 object file. 283 284 285 File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link 286 287 Relocating the section contents 288 ............................... 289 290 The `_bfd_final_link' function should look through the `link_order' 291 structures attached to each section of the output file. Each 292 `link_order' structure should either be handled specially, or it should 293 be passed to the function `_bfd_default_link_order' which will do the 294 right thing (`_bfd_default_link_order' is defined in `linker.c'). 295 296 For efficiency, a `link_order' of type `bfd_indirect_link_order' 297 whose associated section belongs to a BFD of the same format as the 298 output BFD must be handled specially. This type of `link_order' 299 describes part of an output section in terms of a section belonging to 300 one of the input files. The `_bfd_final_link' function should read the 301 contents of the section and any associated relocs, apply the relocs to 302 the section contents, and write out the modified section contents. If 303 performing a relocateable link, the relocs themselves must also be 304 modified and written out. 305 306 The functions `_bfd_relocate_contents' and 307 `_bfd_final_link_relocate' provide some general support for performing 308 the actual relocations, notably overflow checking. Their arguments 309 include information about the symbol the relocation is against and a 310 `reloc_howto_type' argument which describes the relocation to perform. 311 These functions are defined in `reloc.c'. 312 313 The a.out function which handles reading, relocating, and writing 314 section contents is `aout_link_input_section'. The actual relocation 315 is done in `aout_link_input_section_std' and 316 `aout_link_input_section_ext'. 317 318 319 File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link 320 321 Writing the symbol table 322 ........................ 323 324 The `_bfd_final_link' function must gather all the symbols in the 325 input files and write them out. It must also write out all the symbols 326 in the global hash table. This must be controlled by the `strip' and 327 `discard' fields of the `bfd_link_info' structure. 328 329 The local symbols of the input files will not have been entered into 330 the linker hash table. The `_bfd_final_link' routine must consider 331 each input file and include the symbols in the output file. It may be 332 convenient to do this when looking through the `link_order' structures, 333 or it may be done by stepping through the `input_bfds' list. 334 335 The `_bfd_final_link' routine must also traverse the global hash 336 table to gather all the externally visible symbols. It is possible 337 that most of the externally visible symbols may be written out when 338 considering the symbols of each input file, but it is still necessary 339 to traverse the hash table since the linker script may have defined 340 some symbols that are not in any of the input files. 341 342 The `strip' field of the `bfd_link_info' structure controls which 343 symbols are written out. The possible values are listed in 344 `bfdlink.h'. If the value is `strip_some', then the `keep_hash' field 345 of the `bfd_link_info' structure is a hash table of symbols to keep; 346 each symbol should be looked up in this hash table, and only symbols 347 which are present should be included in the output file. 348 349 If the `strip' field of the `bfd_link_info' structure permits local 350 symbols to be written out, the `discard' field is used to further 351 controls which local symbols are included in the output file. If the 352 value is `discard_l', then all local symbols which begin with a certain 353 prefix are discarded; this is controlled by the 354 `bfd_is_local_label_name' entry point. 355 356 The a.out backend handles symbols by calling 357 `aout_link_write_symbols' on each input BFD and then traversing the 358 global hash table with the function `aout_link_write_other_symbol'. It 359 builds a string table while writing out the symbols, which is written 360 to the output file at the end of `NAME(aout,final_link)'. 361 362 `bfd_link_split_section' 363 ........................ 364 365 *Synopsis* 366 boolean bfd_link_split_section(bfd *abfd, asection *sec); 367 *Description* 368 Return nonzero if SEC should be split during a reloceatable or final 369 link. 370 #define bfd_link_split_section(abfd, sec) \ 371 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) 372 373 374 File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end 375 376 Hash Tables 377 =========== 378 379 BFD provides a simple set of hash table functions. Routines are 380 provided to initialize a hash table, to free a hash table, to look up a 381 string in a hash table and optionally create an entry for it, and to 382 traverse a hash table. There is currently no routine to delete an 383 string from a hash table. 384 385 The basic hash table does not permit any data to be stored with a 386 string. However, a hash table is designed to present a base class from 387 which other types of hash tables may be derived. These derived types 388 may store additional information with the string. Hash tables were 389 implemented in this way, rather than simply providing a data pointer in 390 a hash table entry, because they were designed for use by the linker 391 back ends. The linker may create thousands of hash table entries, and 392 the overhead of allocating private data and storing and following 393 pointers becomes noticeable. 394 395 The basic hash table code is in `hash.c'. 396 397 * Menu: 398 399 * Creating and Freeing a Hash Table:: 400 * Looking Up or Entering a String:: 401 * Traversing a Hash Table:: 402 * Deriving a New Hash Table Type:: 403 404 405 File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables 406 407 Creating and freeing a hash table 408 --------------------------------- 409 410 To create a hash table, create an instance of a `struct 411 bfd_hash_table' (defined in `bfd.h') and call `bfd_hash_table_init' (if 412 you know approximately how many entries you will need, the function 413 `bfd_hash_table_init_n', which takes a SIZE argument, may be used). 414 `bfd_hash_table_init' returns `false' if some sort of error occurs. 415 416 The function `bfd_hash_table_init' take as an argument a function to 417 use to create new entries. For a basic hash table, use the function 418 `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why 419 you would want to use a different value for this argument. 420 421 `bfd_hash_table_init' will create an objalloc which will be used to 422 allocate new entries. You may allocate memory on this objalloc using 423 `bfd_hash_allocate'. 424 425 Use `bfd_hash_table_free' to free up all the memory that has been 426 allocated for a hash table. This will not free up the `struct 427 bfd_hash_table' itself, which you must provide. 428 429 430 File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables 431 432 Looking up or entering a string 433 ------------------------------- 434 435 The function `bfd_hash_lookup' is used both to look up a string in 436 the hash table and to create a new entry. 437 438 If the CREATE argument is `false', `bfd_hash_lookup' will look up a 439 string. If the string is found, it will returns a pointer to a `struct 440 bfd_hash_entry'. If the string is not found in the table 441 `bfd_hash_lookup' will return `NULL'. You should not modify any of the 442 fields in the returns `struct bfd_hash_entry'. 443 444 If the CREATE argument is `true', the string will be entered into 445 the hash table if it is not already there. Either way a pointer to a 446 `struct bfd_hash_entry' will be returned, either to the existing 447 structure or to a newly created one. In this case, a `NULL' return 448 means that an error occurred. 449 450 If the CREATE argument is `true', and a new entry is created, the 451 COPY argument is used to decide whether to copy the string onto the 452 hash table objalloc or not. If COPY is passed as `false', you must be 453 careful not to deallocate or modify the string as long as the hash table 454 exists. 455 456 457 File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables 458 459 Traversing a hash table 460 ----------------------- 461 462 The function `bfd_hash_traverse' may be used to traverse a hash 463 table, calling a function on each element. The traversal is done in a 464 random order. 465 466 `bfd_hash_traverse' takes as arguments a function and a generic 467 `void *' pointer. The function is called with a hash table entry (a 468 `struct bfd_hash_entry *') and the generic pointer passed to 469 `bfd_hash_traverse'. The function must return a `boolean' value, which 470 indicates whether to continue traversing the hash table. If the 471 function returns `false', `bfd_hash_traverse' will stop the traversal 472 and return immediately. 473 474 475 File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables 476 477 Deriving a new hash table type 478 ------------------------------ 479 480 Many uses of hash tables want to store additional information which 481 each entry in the hash table. Some also find it convenient to store 482 additional information with the hash table itself. This may be done 483 using a derived hash table. 484 485 Since C is not an object oriented language, creating a derived hash 486 table requires sticking together some boilerplate routines with a few 487 differences specific to the type of hash table you want to create. 488 489 An example of a derived hash table is the linker hash table. The 490 structures for this are defined in `bfdlink.h'. The functions are in 491 `linker.c'. 492 493 You may also derive a hash table from an already derived hash table. 494 For example, the a.out linker backend code uses a hash table derived 495 from the linker hash table. 496 497 * Menu: 498 499 * Define the Derived Structures:: 500 * Write the Derived Creation Routine:: 501 * Write Other Derived Routines:: 502 503 504 File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type 505 506 Define the derived structures 507 ............................. 508 509 You must define a structure for an entry in the hash table, and a 510 structure for the hash table itself. 511 512 The first field in the structure for an entry in the hash table must 513 be of the type used for an entry in the hash table you are deriving 514 from. If you are deriving from a basic hash table this is `struct 515 bfd_hash_entry', which is defined in `bfd.h'. The first field in the 516 structure for the hash table itself must be of the type of the hash 517 table you are deriving from itself. If you are deriving from a basic 518 hash table, this is `struct bfd_hash_table'. 519 520 For example, the linker hash table defines `struct 521 bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of 522 type `struct bfd_hash_entry'. Similarly, the first field in `struct 523 bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. 524 525 526 File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type 527 528 Write the derived creation routine 529 .................................. 530 531 You must write a routine which will create and initialize an entry 532 in the hash table. This routine is passed as the function argument to 533 `bfd_hash_table_init'. 534 535 In order to permit other hash tables to be derived from the hash 536 table you are creating, this routine must be written in a standard way. 537 538 The first argument to the creation routine is a pointer to a hash 539 table entry. This may be `NULL', in which case the routine should 540 allocate the right amount of space. Otherwise the space has already 541 been allocated by a hash table type derived from this one. 542 543 After allocating space, the creation routine must call the creation 544 routine of the hash table type it is derived from, passing in a pointer 545 to the space it just allocated. This will initialize any fields used 546 by the base hash table. 547 548 Finally the creation routine must initialize any local fields for 549 the new hash table type. 550 551 Here is a boilerplate example of a creation routine. FUNCTION_NAME 552 is the name of the routine. ENTRY_TYPE is the type of an entry in the 553 hash table you are creating. BASE_NEWFUNC is the name of the creation 554 routine of the hash table type your hash table is derived from. 555 556 struct bfd_hash_entry * 557 FUNCTION_NAME (entry, table, string) 558 struct bfd_hash_entry *entry; 559 struct bfd_hash_table *table; 560 const char *string; 561 { 562 struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; 563 564 /* Allocate the structure if it has not already been allocated by a 565 derived class. */ 566 if (ret == (ENTRY_TYPE *) NULL) 567 { 568 ret = ((ENTRY_TYPE *) 569 bfd_hash_allocate (table, sizeof (ENTRY_TYPE))); 570 if (ret == (ENTRY_TYPE *) NULL) 571 return NULL; 572 } 573 574 /* Call the allocation method of the base class. */ 575 ret = ((ENTRY_TYPE *) 576 BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); 577 578 /* Initialize the local fields here. */ 579 580 return (struct bfd_hash_entry *) ret; 581 } 582 *Description* 583 The creation routine for the linker hash table, which is in `linker.c', 584 looks just like this example. FUNCTION_NAME is 585 `_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. 586 BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic 587 hash table. 588 589 `_bfd_link_hash_newfunc' also initializes the local fields in a 590 linker hash table entry: `type', `written' and `next'. 591 592 593 File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type 594 595 Write other derived routines 949 File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end 950 951 Opening and closing BFDs 952 ======================== 953 954 `bfd_openr' 955 ........... 956 957 *Synopsis* 958 bfd *bfd_openr(const char *filename, const char *target); 959 *Description* 960 Open the file FILENAME (using `fopen') with the target TARGET. Return 961 a pointer to the created BFD. 962 963 Calls `bfd_find_target', so TARGET is interpreted as by that 964 function. 965 966 If `NULL' is returned then an error has occured. Possible errors 967 are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' 968 error. 969 970 `bfd_fdopenr' 971 ............. 972 973 *Synopsis* 974 bfd *bfd_fdopenr(const char *filename, const char *target, int fd); 975 *Description* 976 `bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It 977 opens a BFD on a file already described by the FD supplied. 978 979 When the file is later `bfd_close'd, the file descriptor will be 980 closed. If the caller desires that this file descriptor be cached by 981 BFD (opened as needed, closed as needed to free descriptors for other 982 opens), with the supplied FD used as an initial file descriptor (but 983 subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the 984 returned BFD. The default is to assume no cacheing; the file 985 descriptor will remain open until `bfd_close', and will not be affected 986 by BFD operations on other files. 987 988 Possible errors are `bfd_error_no_memory', 989 `bfd_error_invalid_target' and `bfd_error_system_call'. 990 991 `bfd_openstreamr' 992 ................. 993 994 *Synopsis* 995 bfd *bfd_openstreamr(const char *, const char *, PTR); 996 *Description* 997 Open a BFD for read access on an existing stdio stream. When the BFD 998 is passed to `bfd_close', the stream will be closed. 999 1000 `bfd_openw' 1001 ........... 1002 1003 *Synopsis* 1004 bfd *bfd_openw(const char *filename, const char *target); 1005 *Description* 1006 Create a BFD, associated with file FILENAME, using the file format 1007 TARGET, and return a pointer to it. 1008 1009 Possible errors are `bfd_error_system_call', `bfd_error_no_memory', 1010 `bfd_error_invalid_target'. 1011 1012 `bfd_close' 1013 ........... 1014 1015 *Synopsis* 1016 bfd_boolean bfd_close (bfd *abfd); 1017 *Description* 1018 Close a BFD. If the BFD was open for writing, then pending operations 1019 are completed and the file written out and closed. If the created file 1020 is executable, then `chmod' is called to mark it as such. 1021 1022 All memory attached to the BFD is released. 1023 1024 The file descriptor associated with the BFD is closed (even if it 1025 was passed in to BFD by `bfd_fdopenr'). 1026 1027 *Returns* 1028 `TRUE' is returned if all is ok, otherwise `FALSE'. 1029 1030 `bfd_close_all_done' 1031 .................... 1032 1033 *Synopsis* 1034 bfd_boolean bfd_close_all_done (bfd *); 1035 *Description* 1036 Close a BFD. Differs from `bfd_close' since it does not complete any 1037 pending operations. This routine would be used if the application had 1038 just used BFD for swapping and didn't want to use any of the writing 1039 code. 1040 1041 If the created file is executable, then `chmod' is called to mark it 1042 as such. 1043 1044 All memory attached to the BFD is released. 1045 1046 *Returns* 1047 `TRUE' is returned if all is ok, otherwise `FALSE'. 1048 1049 `bfd_create' 1050 ............ 1051 1052 *Synopsis* 1053 bfd *bfd_create(const char *filename, bfd *templ); 1054 *Description* 1055 Create a new BFD in the manner of `bfd_openw', but without opening a 1056 file. The new BFD takes the target from the target used by TEMPLATE. 1057 The format is always set to `bfd_object'. 1058 1059 `bfd_make_writable' 1060 ................... 1061 1062 *Synopsis* 1063 bfd_boolean bfd_make_writable (bfd *abfd); 1064 *Description* 1065 Takes a BFD as created by `bfd_create' and converts it into one like as 1066 returned by `bfd_openw'. It does this by converting the BFD to 1067 BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on 1068 this bfd later. 1069 1070 *Returns* 1071 `TRUE' is returned if all is ok, otherwise `FALSE'. 1072 1073 `bfd_make_readable' 1074 ................... 1075 1076 *Synopsis* 1077 bfd_boolean bfd_make_readable (bfd *abfd); 1078 *Description* 1079 Takes a BFD as created by `bfd_create' and `bfd_make_writable' and 1080 converts it into one like as returned by `bfd_openr'. It does this by 1081 writing the contents out to the memory buffer, then reversing the 1082 direction. 1083 1084 *Returns* 1085 `TRUE' is returned if all is ok, otherwise `FALSE'. 1086 1087 `bfd_alloc' 1088 ........... 1089 1090 *Synopsis* 1091 PTR bfd_alloc (bfd *abfd, size_t wanted); 1092 *Description* 1093 Allocate a block of WANTED bytes of memory attached to `abfd' and 1094 return a pointer to it. 1095 1096 `calc_crc32' 1097 ............ 1098 1099 *Synopsis* 1100 unsigned long calc_crc32 (unsigned long crc, const unsigned char *buf, size_t len); 1101 *Description* 1102 Advance the CRC32 given by CRC through LEN bytes of BUF. Return the 1103 updated CRC32 value. 1104 1105 `get_debug_link_info' 1106 ..................... 1107 1108 *Synopsis* 1109 char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out) 1110 *Description* 1111 fetch the filename and CRC32 value for any separate debuginfo 1112 associated with ABFD. Return NULL if no such info found, otherwise 1113 return filename and update CRC32_OUT. 1114 1115 `separate_debug_file_exists' 596 1116 ............................ 597 1117 598 You will want to write other routines for your new hash table, as 599 well. 600 601 You will want an initialization routine which calls the 602 initialization routine of the hash table you are deriving from and 603 initializes any other local fields. For the linker hash table, this is 604 `_bfd_link_hash_table_init' in `linker.c'. 605 606 You will want a lookup routine which calls the lookup routine of the 607 hash table you are deriving from and casts the result. The linker hash 608 table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an 609 additional argument which it uses to decide how to return the looked up 610 value). 611 612 You may want a traversal routine. This should just call the 613 traversal routine of the hash table you are deriving from with 614 appropriate casts. The linker hash table uses `bfd_link_hash_traverse' 615 in `linker.c'. 616 617 These routines may simply be defined as macros. For example, the 618 a.out backend linker hash table, which is derived from the linker hash 619 table, uses macros for the lookup and traversal routines. These are 620 `aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. 621 622 623 File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top 624 625 BFD back ends 626 ************* 627 628 * Menu: 629 630 * What to Put Where:: 631 * aout :: a.out backends 632 * coff :: coff backends 633 * elf :: elf backends 634 635 636 File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends 637 638 All of BFD lives in one directory. 639 640 641 File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends 642 643 a.out backends 644 ============== 645 646 *Description* 647 BFD supports a number of different flavours of a.out format, though the 648 major differences are only the sizes of the structures on disk, and the 649 shape of the relocation information. 650 651 The support is split into a basic support file `aoutx.h' and other 652 files which derive functions from the base. One derivation file is 653 `aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions 654 support for sun3, sun4, 386 and 29k a.out files, to create a target 655 jump vector for a specific target. 656 657 This information is further split out into more specific files for 658 each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for 659 the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out 660 format. 661 662 The base file `aoutx.h' defines general mechanisms for reading and 663 writing records to and from disk and various other methods which BFD 664 requires. It is included by `aout32.c' and `aout64.c' to form the names 665 `aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. 666 667 As an example, this is what goes on to make the back end for a sun4, 668 from `aout32.c': 669 670 #define ARCH_SIZE 32 671 #include "aoutx.h" 672 673 Which exports names: 674 675 ... 676 aout_32_canonicalize_reloc 677 aout_32_find_nearest_line 678 aout_32_get_lineno 679 aout_32_get_reloc_upper_bound 680 ... 681 682 from `sunos.c': 683 684 #define TARGET_NAME "a.out-sunos-big" 685 #define VECNAME sunos_big_vec 686 #include "aoutf1.h" 687 688 requires all the names from `aout32.c', and produces the jump vector 689 690 sunos_big_vec 691 692 The file `host-aout.c' is a special case. It is for a large set of 693 hosts that use "more or less standard" a.out files, and for which 694 cross-debugging is not interesting. It uses the standard 32-bit a.out 695 support routines, but determines the file offsets and addresses of the 696 text, data, and BSS sections, the machine architecture and machine 697 type, and the entry point address, in a host-dependent manner. Once 698 these values have been determined, generic code is used to handle the 699 object file. 700 701 When porting it to run on a new system, you must supply: 702 703 HOST_PAGE_SIZE 704 HOST_SEGMENT_SIZE 705 HOST_MACHINE_ARCH (optional) 706 HOST_MACHINE_MACHINE (optional) 707 HOST_TEXT_START_ADDR 708 HOST_STACK_END_ADDR 709 710 in the file `../include/sys/h-XXX.h' (for your host). These values, 711 plus the structures and macros defined in `a.out.h' on your host 712 system, will produce a BFD target that will access ordinary a.out files 713 on your host. To configure a new machine to use `host-aout.c', specify: 714 715 TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec 716 TDEPFILES= host-aout.o trad-core.o 717 718 in the `config/XXX.mt' file, and modify `configure.in' to use the 719 `XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration 720 is selected. 721 722 Relocations 723 ----------- 724 725 *Description* 726 The file `aoutx.h' provides for both the _standard_ and _extended_ 727 forms of a.out relocation records. 728 729 The standard records contain only an address, a symbol index, and a 730 type field. The extended records (used on 29ks and sparcs) also have a 731 full integer for an addend. 732 733 Internal entry points 734 --------------------- 735 736 *Description* 737 `aoutx.h' exports several routines for accessing the contents of an 738 a.out file, which are gathered and exported in turn by various format 739 specific files (eg sunos.c). 740 741 `aout_SIZE_swap_exec_header_in' 742 ............................... 743 744 *Synopsis* 745 void aout_SIZE_swap_exec_header_in, 746 (bfd *abfd, 747 struct external_exec *raw_bytes, 748 struct internal_exec *execp); 749 *Description* 750 Swap the information in an executable header RAW_BYTES taken from a raw 751 byte stream memory image into the internal exec header structure EXECP. 752 753 `aout_SIZE_swap_exec_header_out' 754 ................................ 755 756 *Synopsis* 757 void aout_SIZE_swap_exec_header_out 758 (bfd *abfd, 759 struct internal_exec *execp, 760 struct external_exec *raw_bytes); 761 *Description* 762 Swap the information in an internal exec header structure EXECP into 763 the buffer RAW_BYTES ready for writing to disk. 764 765 `aout_SIZE_some_aout_object_p' 766 .............................. 767 768 *Synopsis* 769 const bfd_target *aout_SIZE_some_aout_object_p 770 (bfd *abfd, 771 const bfd_target *(*callback_to_real_object_p) ()); 772 *Description* 773 Some a.out variant thinks that the file open in ABFD checking is an 774 a.out file. Do some more checking, and set up for access if it really 775 is. Call back to the calling environment's "finish up" function just 776 before returning, to handle any last-minute setup. 777 778 `aout_SIZE_mkobject' 779 .................... 780 781 *Synopsis* 782 boolean aout_SIZE_mkobject, (bfd *abfd); 783 *Description* 784 Initialize BFD ABFD for use with a.out files. 785 786 `aout_SIZE_machine_type' 787 ........................ 788 789 *Synopsis* 790 enum machine_type aout_SIZE_machine_type 791 (enum bfd_architecture arch, 792 unsigned long machine)); 793 *Description* 794 Keep track of machine architecture and machine type for a.out's. Return 795 the `machine_type' for a particular architecture and machine, or 796 `M_UNKNOWN' if that exact architecture and machine can't be represented 797 in a.out format. 798 799 If the architecture is understood, machine type 0 (default) is 800 always understood. 801 802 `aout_SIZE_set_arch_mach' 803 ......................... 804 805 *Synopsis* 806 boolean aout_SIZE_set_arch_mach, 807 (bfd *, 808 enum bfd_architecture arch, 809 unsigned long machine)); 810 *Description* 811 Set the architecture and the machine of the BFD ABFD to the values ARCH 812 and MACHINE. Verify that ABFD's format can support the architecture 813 required. 814 815 `aout_SIZE_new_section_hook' 816 ............................ 817 818 *Synopsis* 819 boolean aout_SIZE_new_section_hook, 820 (bfd *abfd, 821 asection *newsect)); 822 *Description* 823 Called by the BFD in response to a `bfd_make_section' request. 824 1118 *Synopsis* 1119 bfd_boolean separate_debug_file_exists (char * name, unsigned long crc32) 1120 *Description* 1121 Checks to see if NAME is a file and if its contents match CRC32. 1122 1123 `find_separate_debug_file' 1124 .......................... 1125 1126 *Synopsis* 1127 char * find_separate_debug_file (bfd *abfd) 1128 *Description* 1129 Searches ABFD for a reference to separate debugging information, scans 1130 various locations in the filesystem, including the file tree rooted at 1131 DEBUG_FILE_DIRECTORY, and returns a filename of such debugging 1132 information if the file is found and has matching CRC32. Returns NULL 1133 if no reference to debugging file exists, or file cannot be found. 1134 1135 `bfd_follow_gnu_debuglink' 1136 .......................... 1137 1138 *Synopsis* 1139 char * bfd_follow_gnu_debuglink(bfd *abfd, const char *dir); 1140 *Description* 1141 Takes a BFD and searches it for a .gnu_debuglink section. If this 1142 section is found, examines the section for the name and checksum of a 1143 '.debug' file containing auxiliary debugging information. Searches 1144 filesystem for .debug file in some standard locations, including the 1145 directory tree rooted at DIR, and if found returns the full filename. 1146 If DIR is NULL, will search default path configured into libbfd at 1147 build time. 1148 1149 *Returns* 1150 `NULL' on any errors or failure to locate the .debug file, otherwise a 1151 pointer to a heap-allocated string containing the filename. The caller 1152 is responsible for freeing this string. 1153 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-6
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 17 17 18 18 19 File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends 20 21 coff backends 22 ============= 23 24 BFD supports a number of different flavours of coff format. The 25 major differences between formats are the sizes and alignments of 26 fields in structures on disk, and the occasional extra field. 27 28 Coff in all its varieties is implemented with a few common files and 29 a number of implementation specific files. For example, The 88k bcs 30 coff format is implemented in the file `coff-m88k.c'. This file 31 `#include's `coff/m88k.h' which defines the external structure of the 32 coff format for the 88k, and `coff/internal.h' which defines the 33 internal structure. `coff-m88k.c' also defines the relocations used by 34 the 88k format *Note Relocations::. 35 36 The Intel i960 processor version of coff is implemented in 37 `coff-i960.c'. This file has the same structure as `coff-m88k.c', 38 except that it includes `coff/i960.h' rather than `coff-m88k.h'. 39 40 Porting to a new version of coff 19 File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end 20 21 Internal functions 22 ================== 23 24 *Description* 25 These routines are used within BFD. They are not intended for export, 26 but are documented here for completeness. 27 28 `bfd_write_bigendian_4byte_int' 29 ............................... 30 31 *Synopsis* 32 bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); 33 *Description* 34 Write a 4 byte integer I to the output BFD ABFD, in big endian order 35 regardless of what else is going on. This is useful in archives. 36 37 `bfd_put_size' 38 .............. 39 40 `bfd_get_size' 41 .............. 42 43 *Description* 44 These macros as used for reading and writing raw data in sections; each 45 access (except for bytes) is vectored through the target format of the 46 BFD and mangled accordingly. The mangling performs any necessary endian 47 translations and removes alignment restrictions. Note that types 48 accepted and returned by these macros are identical so they can be 49 swapped around in macros--for example, `libaout.h' defines `GET_WORD' 50 to either `bfd_get_32' or `bfd_get_64'. 51 52 In the put routines, VAL must be a `bfd_vma'. If we are on a system 53 without prototypes, the caller is responsible for making sure that is 54 true, with a cast if necessary. We don't cast them in the macro 55 definitions because that would prevent `lint' or `gcc -Wall' from 56 detecting sins such as passing a pointer. To detect calling these with 57 less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit 58 `bfd_vma''s. 59 60 /* Byte swapping macros for user section data. */ 61 62 #define bfd_put_8(abfd, val, ptr) \ 63 ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) 64 #define bfd_put_signed_8 \ 65 bfd_put_8 66 #define bfd_get_8(abfd, ptr) \ 67 (*(unsigned char *) (ptr) & 0xff) 68 #define bfd_get_signed_8(abfd, ptr) \ 69 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) 70 71 #define bfd_put_16(abfd, val, ptr) \ 72 BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) 73 #define bfd_put_signed_16 \ 74 bfd_put_16 75 #define bfd_get_16(abfd, ptr) \ 76 BFD_SEND(abfd, bfd_getx16, (ptr)) 77 #define bfd_get_signed_16(abfd, ptr) \ 78 BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) 79 80 #define bfd_put_32(abfd, val, ptr) \ 81 BFD_SEND(abfd, bfd_putx32, ((val),(ptr))) 82 #define bfd_put_signed_32 \ 83 bfd_put_32 84 #define bfd_get_32(abfd, ptr) \ 85 BFD_SEND(abfd, bfd_getx32, (ptr)) 86 #define bfd_get_signed_32(abfd, ptr) \ 87 BFD_SEND(abfd, bfd_getx_signed_32, (ptr)) 88 89 #define bfd_put_64(abfd, val, ptr) \ 90 BFD_SEND(abfd, bfd_putx64, ((val), (ptr))) 91 #define bfd_put_signed_64 \ 92 bfd_put_64 93 #define bfd_get_64(abfd, ptr) \ 94 BFD_SEND(abfd, bfd_getx64, (ptr)) 95 #define bfd_get_signed_64(abfd, ptr) \ 96 BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) 97 98 #define bfd_get(bits, abfd, ptr) \ 99 ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ 100 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ 101 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ 102 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ 103 : (abort (), (bfd_vma) - 1)) 104 105 #define bfd_put(bits, abfd, val, ptr) \ 106 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ 107 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ 108 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ 109 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ 110 : (abort (), (void) 0)) 111 112 `bfd_h_put_size' 113 ................ 114 115 *Description* 116 These macros have the same function as their `bfd_get_x' brethren, 117 except that they are used for removing information for the header 118 records of object files. Believe it or not, some object files keep 119 their header records in big endian order and their data in little 120 endian order. 121 122 /* Byte swapping macros for file header data. */ 123 124 #define bfd_h_put_8(abfd, val, ptr) \ 125 bfd_put_8 (abfd, val, ptr) 126 #define bfd_h_put_signed_8(abfd, val, ptr) \ 127 bfd_put_8 (abfd, val, ptr) 128 #define bfd_h_get_8(abfd, ptr) \ 129 bfd_get_8 (abfd, ptr) 130 #define bfd_h_get_signed_8(abfd, ptr) \ 131 bfd_get_signed_8 (abfd, ptr) 132 133 #define bfd_h_put_16(abfd, val, ptr) \ 134 BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) 135 #define bfd_h_put_signed_16 \ 136 bfd_h_put_16 137 #define bfd_h_get_16(abfd, ptr) \ 138 BFD_SEND (abfd, bfd_h_getx16, (ptr)) 139 #define bfd_h_get_signed_16(abfd, ptr) \ 140 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) 141 142 #define bfd_h_put_32(abfd, val, ptr) \ 143 BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) 144 #define bfd_h_put_signed_32 \ 145 bfd_h_put_32 146 #define bfd_h_get_32(abfd, ptr) \ 147 BFD_SEND (abfd, bfd_h_getx32, (ptr)) 148 #define bfd_h_get_signed_32(abfd, ptr) \ 149 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) 150 151 #define bfd_h_put_64(abfd, val, ptr) \ 152 BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) 153 #define bfd_h_put_signed_64 \ 154 bfd_h_put_64 155 #define bfd_h_get_64(abfd, ptr) \ 156 BFD_SEND (abfd, bfd_h_getx64, (ptr)) 157 #define bfd_h_get_signed_64(abfd, ptr) \ 158 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) 159 160 /* Refinements on the above, which should eventually go away. Save 161 cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ 162 163 #define H_PUT_64(abfd, val, where) \ 164 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 165 166 #define H_PUT_32(abfd, val, where) \ 167 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 168 169 #define H_PUT_16(abfd, val, where) \ 170 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 171 172 #define H_PUT_8 bfd_h_put_8 173 174 #define H_PUT_S64(abfd, val, where) \ 175 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 176 177 #define H_PUT_S32(abfd, val, where) \ 178 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 179 180 #define H_PUT_S16(abfd, val, where) \ 181 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 182 183 #define H_PUT_S8 bfd_h_put_signed_8 184 185 #define H_GET_64(abfd, where) \ 186 bfd_h_get_64 ((abfd), (bfd_byte *) (where)) 187 188 #define H_GET_32(abfd, where) \ 189 bfd_h_get_32 ((abfd), (bfd_byte *) (where)) 190 191 #define H_GET_16(abfd, where) \ 192 bfd_h_get_16 ((abfd), (bfd_byte *) (where)) 193 194 #define H_GET_8 bfd_h_get_8 195 196 #define H_GET_S64(abfd, where) \ 197 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) 198 199 #define H_GET_S32(abfd, where) \ 200 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) 201 202 #define H_GET_S16(abfd, where) \ 203 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) 204 205 #define H_GET_S8 bfd_h_get_signed_8 206 207 `bfd_log2' 208 .......... 209 210 *Synopsis* 211 unsigned int bfd_log2 (bfd_vma x); 212 *Description* 213 Return the log base 2 of the value supplied, rounded up. E.g., an X of 214 1025 returns 11. A X of 0 returns 0. 215 216 217 File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end 218 219 File caching 220 ============ 221 222 The file caching mechanism is embedded within BFD and allows the 223 application to open as many BFDs as it wants without regard to the 224 underlying operating system's file descriptor limit (often as low as 20 225 open files). The module in `cache.c' maintains a least recently used 226 list of `BFD_CACHE_MAX_OPEN' files, and exports the name 227 `bfd_cache_lookup', which runs around and makes sure that the required 228 BFD is open. If not, then it chooses a file to close, closes it and 229 opens the one wanted, returning its file handle. 230 231 `BFD_CACHE_MAX_OPEN macro' 232 .......................... 233 234 *Description* 235 The maximum number of files which the cache will keep open at one time. 236 #define BFD_CACHE_MAX_OPEN 10 237 238 `bfd_last_cache' 239 ................ 240 241 *Synopsis* 242 extern bfd *bfd_last_cache; 243 *Description* 244 Zero, or a pointer to the topmost BFD on the chain. This is used by 245 the `bfd_cache_lookup' macro in `libbfd.h' to determine when it can 246 avoid a function call. 247 248 `bfd_cache_lookup' 249 .................. 250 251 *Description* 252 Check to see if the required BFD is the same as the last one looked up. 253 If so, then it can use the stream in the BFD with impunity, since it 254 can't have changed since the last lookup; otherwise, it has to perform 255 the complicated lookup function. 256 #define bfd_cache_lookup(x) \ 257 ((x)==bfd_last_cache? \ 258 (FILE*) (bfd_last_cache->iostream): \ 259 bfd_cache_lookup_worker(x)) 260 261 `bfd_cache_init' 262 ................ 263 264 *Synopsis* 265 bfd_boolean bfd_cache_init (bfd *abfd); 266 *Description* 267 Add a newly opened BFD to the cache. 268 269 `bfd_cache_close' 270 ................. 271 272 *Synopsis* 273 bfd_boolean bfd_cache_close (bfd *abfd); 274 *Description* 275 Remove the BFD ABFD from the cache. If the attached file is open, then 276 close it too. 277 278 *Returns* 279 `FALSE' is returned if closing the file fails, `TRUE' is returned if 280 all is well. 281 282 `bfd_open_file' 283 ............... 284 285 *Synopsis* 286 FILE* bfd_open_file(bfd *abfd); 287 *Description* 288 Call the OS to open a file for ABFD. Return the `FILE *' (possibly 289 `NULL') that results from this operation. Set up the BFD so that 290 future accesses know the file is open. If the `FILE *' returned is 291 `NULL', then it won't have been put in the cache, so it won't have to 292 be removed from it. 293 294 `bfd_cache_lookup_worker' 295 ......................... 296 297 *Synopsis* 298 FILE *bfd_cache_lookup_worker(bfd *abfd); 299 *Description* 300 Called when the macro `bfd_cache_lookup' fails to find a quick answer. 301 Find a file descriptor for ABFD. If necessary, it open it. If there 302 are already more than `BFD_CACHE_MAX_OPEN' files open, it tries to 303 close one first, to avoid running out of file descriptors. 304 305 306 File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end 307 308 Linker Functions 309 ================ 310 311 The linker uses three special entry points in the BFD target vector. 312 It is not necessary to write special routines for these entry points 313 when creating a new BFD back end, since generic versions are provided. 314 However, writing them can speed up linking and make it use 315 significantly less runtime memory. 316 317 The first routine creates a hash table used by the other routines. 318 The second routine adds the symbols from an object file to the hash 319 table. The third routine takes all the object files and links them 320 together to create the output file. These routines are designed so 321 that the linker proper does not need to know anything about the symbols 322 in the object files that it is linking. The linker merely arranges the 323 sections as directed by the linker script and lets BFD handle the 324 details of symbols and relocs. 325 326 The second routine and third routines are passed a pointer to a 327 `struct bfd_link_info' structure (defined in `bfdlink.h') which holds 328 information relevant to the link, including the linker hash table 329 (which was created by the first routine) and a set of callback 330 functions to the linker proper. 331 332 The generic linker routines are in `linker.c', and use the header 333 file `genlink.h'. As of this writing, the only back ends which have 334 implemented versions of these routines are a.out (in `aoutx.h') and 335 ECOFF (in `ecoff.c'). The a.out routines are used as examples 336 throughout this section. 337 338 * Menu: 339 340 * Creating a Linker Hash Table:: 341 * Adding Symbols to the Hash Table:: 342 * Performing the Final Link:: 343 344 345 File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions 346 347 Creating a linker hash table 348 ---------------------------- 349 350 The linker routines must create a hash table, which must be derived 351 from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash 352 Tables::, for information on how to create a derived hash table. This 353 entry point is called using the target vector of the linker output file. 354 355 The `_bfd_link_hash_table_create' entry point must allocate and 356 initialize an instance of the desired hash table. If the back end does 357 not require any additional information to be stored with the entries in 358 the hash table, the entry point may simply create a `struct 359 bfd_link_hash_table'. Most likely, however, some additional 360 information will be needed. 361 362 For example, with each entry in the hash table the a.out linker 363 keeps the index the symbol has in the final output file (this index 364 number is used so that when doing a relocateable link the symbol index 365 used in the output file can be quickly filled in when copying over a 366 reloc). The a.out linker code defines the required structures and 367 functions for a hash table derived from `struct bfd_link_hash_table'. 368 The a.out linker hash table is created by the function 369 `NAME(aout,link_hash_table_create)'; it simply allocates space for the 370 hash table, initializes it, and returns a pointer to it. 371 372 When writing the linker routines for a new back end, you will 373 generally not know exactly which fields will be required until you have 374 finished. You should simply create a new hash table which defines no 375 additional fields, and then simply add fields as they become necessary. 376 377 378 File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions 379 380 Adding symbols to the hash table 41 381 -------------------------------- 42 382 43 The recommended method is to select from the existing 44 implementations the version of coff which is most like the one you want 45 to use. For example, we'll say that i386 coff is the one you select, 46 and that your coff flavour is called foo. Copy `i386coff.c' to 47 `foocoff.c', copy `../include/coff/i386.h' to `../include/coff/foo.h', 48 and add the lines to `targets.c' and `Makefile.in' so that your new 49 back end is used. Alter the shapes of the structures in 50 `../include/coff/foo.h' so that they match what you need. You will 51 probably also have to add `#ifdef's to the code in `coff/internal.h' and 52 `coffcode.h' if your version of coff is too wild. 53 54 You can verify that your new BFD backend works quite simply by 55 building `objdump' from the `binutils' directory, and making sure that 56 its version of what's going on and your host system's idea (assuming it 57 has the pretty standard coff dump utility, usually called `att-dump' or 58 just `dump') are the same. Then clean up your code, and send what 59 you've done to Cygnus. Then your stuff will be in the next release, and 60 you won't have to keep integrating it. 61 62 How the coff backend works 63 -------------------------- 64 65 File layout 66 ........... 67 68 The Coff backend is split into generic routines that are applicable 69 to any Coff target and routines that are specific to a particular 70 target. The target-specific routines are further split into ones which 71 are basically the same for all Coff targets except that they use the 72 external symbol format or use different values for certain constants. 73 74 The generic routines are in `coffgen.c'. These routines work for 75 any Coff target. They use some hooks into the target specific code; 76 the hooks are in a `bfd_coff_backend_data' structure, one of which 77 exists for each target. 78 79 The essentially similar target-specific routines are in 80 `coffcode.h'. This header file includes executable C code. The 81 various Coff targets first include the appropriate Coff header file, 82 make any special defines that are needed, and then include `coffcode.h'. 83 84 Some of the Coff targets then also have additional routines in the 85 target source file itself. 86 87 For example, `coff-i960.c' includes `coff/internal.h' and 88 `coff/i960.h'. It then defines a few constants, such as `I960', and 89 includes `coffcode.h'. Since the i960 has complex relocation types, 90 `coff-i960.c' also includes some code to manipulate the i960 relocs. 91 This code is not in `coffcode.h' because it would not be used by any 92 other target. 93 94 Bit twiddling 95 ............. 96 97 Each flavour of coff supported in BFD has its own header file 98 describing the external layout of the structures. There is also an 99 internal description of the coff layout, in `coff/internal.h'. A major 100 function of the coff backend is swapping the bytes and twiddling the 101 bits to translate the external form of the structures into the normal 102 internal form. This is all performed in the `bfd_swap'_thing_direction 103 routines. Some elements are different sizes between different versions 104 of coff; it is the duty of the coff version specific include file to 105 override the definitions of various packing routines in `coffcode.h'. 106 E.g., the size of line number entry in coff is sometimes 16 bits, and 107 sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' 108 will select the correct one. No doubt, some day someone will find a 109 version of coff which has a varying field size not catered to at the 110 moment. To port BFD, that person will have to add more `#defines'. 111 Three of the bit twiddling routines are exported to `gdb'; 112 `coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB' 113 reads the symbol table on its own, but uses BFD to fix things up. More 114 of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', 115 `coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', 116 `coff_swap_filehdr_out', `coff_swap_aouthdr_out', 117 `coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol 118 table and reloc drudgery itself, thereby saving the internal BFD 119 overhead, but uses BFD to swap things on the way out, making cross 120 ports much safer. Doing so also allows BFD (and thus the linker) to 121 use the same header files as `gas', which makes one avenue to disaster 122 disappear. 123 124 Symbol reading 125 .............. 126 127 The simple canonical form for symbols used by BFD is not rich enough 128 to keep all the information available in a coff symbol table. The back 129 end gets around this problem by keeping the original symbol table 130 around, "behind the scenes". 131 132 When a symbol table is requested (through a call to 133 `bfd_canonicalize_symtab'), a request gets through to 134 `coff_get_normalized_symtab'. This reads the symbol table from the coff 135 file and swaps all the structures inside into the internal form. It 136 also fixes up all the pointers in the table (represented in the file by 137 offsets from the first symbol in the table) into physical pointers to 138 elements in the new internal table. This involves some work since the 139 meanings of fields change depending upon context: a field that is a 140 pointer to another structure in the symbol table at one moment may be 141 the size in bytes of a structure at the next. Another pass is made 142 over the table. All symbols which mark file names (`C_FILE' symbols) 143 are modified so that the internal string points to the value in the 144 auxent (the real filename) rather than the normal text associated with 145 the symbol (`".file"'). 146 147 At this time the symbol names are moved around. Coff stores all 148 symbols less than nine characters long physically within the symbol 149 table; longer strings are kept at the end of the file in the string 150 table. This pass moves all strings into memory and replaces them with 151 pointers to the strings. 152 153 The symbol table is massaged once again, this time to create the 154 canonical table used by the BFD application. Each symbol is inspected 155 in turn, and a decision made (using the `sclass' field) about the 156 various flags to set in the `asymbol'. *Note Symbols::. The generated 157 canonical table shares strings with the hidden internal symbol table. 158 159 Any linenumbers are read from the coff file too, and attached to the 160 symbols which own the functions the linenumbers belong to. 161 162 Symbol writing 163 .............. 164 165 Writing a symbol to a coff file which didn't come from a coff file 166 will lose any debugging information. The `asymbol' structure remembers 167 the BFD from which the symbol was taken, and on output the back end 168 makes sure that the same destination target as source target is present. 169 170 When the symbols have come from a coff file then all the debugging 171 information is preserved. 172 173 Symbol tables are provided for writing to the back end in a vector 174 of pointers to pointers. This allows applications like the linker to 175 accumulate and output large symbol tables without having to do too much 176 byte copying. 177 178 This function runs through the provided symbol table and patches 179 each symbol marked as a file place holder (`C_FILE') to point to the 180 next file place holder in the list. It also marks each `offset' field 181 in the list with the offset from the first symbol of the current symbol. 182 183 Another function of this procedure is to turn the canonical value 184 form of BFD into the form used by coff. Internally, BFD expects symbol 185 values to be offsets from a section base; so a symbol physically at 186 0x120, but in a section starting at 0x100, would have the value 0x20. 187 Coff expects symbols to contain their final value, so symbols have 188 their values changed at this point to reflect their sum with their 189 owning section. This transformation uses the `output_section' field of 190 the `asymbol''s `asection' *Note Sections::. 191 192 * `coff_mangle_symbols' 193 This routine runs though the provided symbol table and uses the 194 offsets generated by the previous pass and the pointers generated when 195 the symbol table was read in to create the structured hierachy required 196 by coff. It changes each pointer to a symbol into the index into the 197 symbol table of the asymbol. 198 199 * `coff_write_symbols' 200 This routine runs through the symbol table and patches up the 201 symbols from their internal form into the coff way, calls the bit 202 twiddlers, and writes out the table to the file. 203 204 `coff_symbol_type' 205 .................. 206 207 *Description* 208 The hidden information for an `asymbol' is described in a 209 `combined_entry_type': 210 211 212 typedef struct coff_ptr_struct 383 The linker proper will call the `_bfd_link_add_symbols' entry point 384 for each object file or archive which is to be linked (typically these 385 are the files named on the command line, but some may also come from 386 the linker script). The entry point is responsible for examining the 387 file. For an object file, BFD must add any relevant symbol information 388 to the hash table. For an archive, BFD must determine which elements 389 of the archive should be used and adding them to the link. 390 391 The a.out version of this entry point is 392 `NAME(aout,link_add_symbols)'. 393 394 * Menu: 395 396 * Differing file formats:: 397 * Adding symbols from an object file:: 398 * Adding symbols from an archive:: 399 400 401 File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table 402 403 Differing file formats 404 ...................... 405 406 Normally all the files involved in a link will be of the same 407 format, but it is also possible to link together different format 408 object files, and the back end must support that. The 409 `_bfd_link_add_symbols' entry point is called via the target vector of 410 the file to be added. This has an important consequence: the function 411 may not assume that the hash table is the type created by the 412 corresponding `_bfd_link_hash_table_create' vector. All the 413 `_bfd_link_add_symbols' function can assume about the hash table is 414 that it is derived from `struct bfd_link_hash_table'. 415 416 Sometimes the `_bfd_link_add_symbols' function must store some 417 information in the hash table entry to be used by the `_bfd_final_link' 418 function. In such a case the `creator' field of the hash table must be 419 checked to make sure that the hash table was created by an object file 420 of the same format. 421 422 The `_bfd_final_link' routine must be prepared to handle a hash 423 entry without any extra information added by the 424 `_bfd_link_add_symbols' function. A hash entry without extra 425 information will also occur when the linker script directs the linker 426 to create a symbol. Note that, regardless of how a hash table entry is 427 added, all the fields will be initialized to some sort of null value by 428 the hash table entry initialization function. 429 430 See `ecoff_link_add_externals' for an example of how to check the 431 `creator' field before saving information (in this case, the ECOFF 432 external symbol debugging information) in a hash table entry. 433 434 435 File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table 436 437 Adding symbols from an object file 438 .................................. 439 440 When the `_bfd_link_add_symbols' routine is passed an object file, 441 it must add all externally visible symbols in that object file to the 442 hash table. The actual work of adding the symbol to the hash table is 443 normally handled by the function `_bfd_generic_link_add_one_symbol'. 444 The `_bfd_link_add_symbols' routine is responsible for reading all the 445 symbols from the object file and passing the correct information to 446 `_bfd_generic_link_add_one_symbol'. 447 448 The `_bfd_link_add_symbols' routine should not use 449 `bfd_canonicalize_symtab' to read the symbols. The point of providing 450 this routine is to avoid the overhead of converting the symbols into 451 generic `asymbol' structures. 452 453 `_bfd_generic_link_add_one_symbol' handles the details of combining 454 common symbols, warning about multiple definitions, and so forth. It 455 takes arguments which describe the symbol to add, notably symbol flags, 456 a section, and an offset. The symbol flags include such things as 457 `BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object 458 file, or something like `bfd_und_section_ptr' for an undefined symbol 459 or `bfd_com_section_ptr' for a common symbol. 460 461 If the `_bfd_final_link' routine is also going to need to read the 462 symbol information, the `_bfd_link_add_symbols' routine should save it 463 somewhere attached to the object file BFD. However, the information 464 should only be saved if the `keep_memory' field of the `info' argument 465 is TRUE, so that the `-no-keep-memory' linker switch is effective. 466 467 The a.out function which adds symbols from an object file is 468 `aout_link_add_object_symbols', and most of the interesting work is in 469 `aout_link_add_symbols'. The latter saves pointers to the hash tables 470 entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol 471 number, so that the `_bfd_final_link' routine does not have to call the 472 hash table lookup routine to locate the entry. 473 474 475 File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table 476 477 Adding symbols from an archive 478 .............................. 479 480 When the `_bfd_link_add_symbols' routine is passed an archive, it 481 must look through the symbols defined by the archive and decide which 482 elements of the archive should be included in the link. For each such 483 element it must call the `add_archive_element' linker callback, and it 484 must add the symbols from the object file to the linker hash table. 485 486 In most cases the work of looking through the symbols in the archive 487 should be done by the `_bfd_generic_link_add_archive_symbols' function. 488 This function builds a hash table from the archive symbol table and 489 looks through the list of undefined symbols to see which elements 490 should be included. `_bfd_generic_link_add_archive_symbols' is passed 491 a function to call to make the final decision about adding an archive 492 element to the link and to do the actual work of adding the symbols to 493 the linker hash table. 494 495 The function passed to `_bfd_generic_link_add_archive_symbols' must 496 read the symbols of the archive element and decide whether the archive 497 element should be included in the link. If the element is to be 498 included, the `add_archive_element' linker callback routine must be 499 called with the element as an argument, and the elements symbols must 500 be added to the linker hash table just as though the element had itself 501 been passed to the `_bfd_link_add_symbols' function. 502 503 When the a.out `_bfd_link_add_symbols' function receives an archive, 504 it calls `_bfd_generic_link_add_archive_symbols' passing 505 `aout_link_check_archive_element' as the function argument. 506 `aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. 507 If the latter decides to add the element (an element is only added if 508 it provides a real, non-common, definition for a previously undefined 509 or common symbol) it calls the `add_archive_element' callback and then 510 `aout_link_check_archive_element' calls `aout_link_add_symbols' to 511 actually add the symbols to the linker hash table. 512 513 The ECOFF back end is unusual in that it does not normally call 514 `_bfd_generic_link_add_archive_symbols', because ECOFF archives already 515 contain a hash table of symbols. The ECOFF back end searches the 516 archive itself to avoid the overhead of creating a new hash table. 517 518 519 File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions 520 521 Performing the final link 522 ------------------------- 523 524 When all the input files have been processed, the linker calls the 525 `_bfd_final_link' entry point of the output BFD. This routine is 526 responsible for producing the final output file, which has several 527 aspects. It must relocate the contents of the input sections and copy 528 the data into the output sections. It must build an output symbol 529 table including any local symbols from the input files and the global 530 symbols from the hash table. When producing relocateable output, it 531 must modify the input relocs and write them into the output file. 532 There may also be object format dependent work to be done. 533 534 The linker will also call the `write_object_contents' entry point 535 when the BFD is closed. The two entry points must work together in 536 order to produce the correct output file. 537 538 The details of how this works are inevitably dependent upon the 539 specific object file format. The a.out `_bfd_final_link' routine is 540 `NAME(aout,final_link)'. 541 542 * Menu: 543 544 * Information provided by the linker:: 545 * Relocating the section contents:: 546 * Writing the symbol table:: 547 548 549 File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link 550 551 Information provided by the linker 552 .................................. 553 554 Before the linker calls the `_bfd_final_link' entry point, it sets 555 up some data structures for the function to use. 556 557 The `input_bfds' field of the `bfd_link_info' structure will point 558 to a list of all the input files included in the link. These files are 559 linked through the `link_next' field of the `bfd' structure. 560 561 Each section in the output file will have a list of `link_order' 562 structures attached to the `link_order_head' field (the `link_order' 563 structure is defined in `bfdlink.h'). These structures describe how to 564 create the contents of the output section in terms of the contents of 565 various input sections, fill constants, and, eventually, other types of 566 information. They also describe relocs that must be created by the BFD 567 backend, but do not correspond to any input file; this is used to 568 support -Ur, which builds constructors while generating a relocateable 569 object file. 570 571 572 File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link 573 574 Relocating the section contents 575 ............................... 576 577 The `_bfd_final_link' function should look through the `link_order' 578 structures attached to each section of the output file. Each 579 `link_order' structure should either be handled specially, or it should 580 be passed to the function `_bfd_default_link_order' which will do the 581 right thing (`_bfd_default_link_order' is defined in `linker.c'). 582 583 For efficiency, a `link_order' of type `bfd_indirect_link_order' 584 whose associated section belongs to a BFD of the same format as the 585 output BFD must be handled specially. This type of `link_order' 586 describes part of an output section in terms of a section belonging to 587 one of the input files. The `_bfd_final_link' function should read the 588 contents of the section and any associated relocs, apply the relocs to 589 the section contents, and write out the modified section contents. If 590 performing a relocateable link, the relocs themselves must also be 591 modified and written out. 592 593 The functions `_bfd_relocate_contents' and 594 `_bfd_final_link_relocate' provide some general support for performing 595 the actual relocations, notably overflow checking. Their arguments 596 include information about the symbol the relocation is against and a 597 `reloc_howto_type' argument which describes the relocation to perform. 598 These functions are defined in `reloc.c'. 599 600 The a.out function which handles reading, relocating, and writing 601 section contents is `aout_link_input_section'. The actual relocation 602 is done in `aout_link_input_section_std' and 603 `aout_link_input_section_ext'. 604 605 606 File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link 607 608 Writing the symbol table 609 ........................ 610 611 The `_bfd_final_link' function must gather all the symbols in the 612 input files and write them out. It must also write out all the symbols 613 in the global hash table. This must be controlled by the `strip' and 614 `discard' fields of the `bfd_link_info' structure. 615 616 The local symbols of the input files will not have been entered into 617 the linker hash table. The `_bfd_final_link' routine must consider 618 each input file and include the symbols in the output file. It may be 619 convenient to do this when looking through the `link_order' structures, 620 or it may be done by stepping through the `input_bfds' list. 621 622 The `_bfd_final_link' routine must also traverse the global hash 623 table to gather all the externally visible symbols. It is possible 624 that most of the externally visible symbols may be written out when 625 considering the symbols of each input file, but it is still necessary 626 to traverse the hash table since the linker script may have defined 627 some symbols that are not in any of the input files. 628 629 The `strip' field of the `bfd_link_info' structure controls which 630 symbols are written out. The possible values are listed in 631 `bfdlink.h'. If the value is `strip_some', then the `keep_hash' field 632 of the `bfd_link_info' structure is a hash table of symbols to keep; 633 each symbol should be looked up in this hash table, and only symbols 634 which are present should be included in the output file. 635 636 If the `strip' field of the `bfd_link_info' structure permits local 637 symbols to be written out, the `discard' field is used to further 638 controls which local symbols are included in the output file. If the 639 value is `discard_l', then all local symbols which begin with a certain 640 prefix are discarded; this is controlled by the 641 `bfd_is_local_label_name' entry point. 642 643 The a.out backend handles symbols by calling 644 `aout_link_write_symbols' on each input BFD and then traversing the 645 global hash table with the function `aout_link_write_other_symbol'. It 646 builds a string table while writing out the symbols, which is written 647 to the output file at the end of `NAME(aout,final_link)'. 648 649 `bfd_link_split_section' 650 ........................ 651 652 *Synopsis* 653 bfd_boolean bfd_link_split_section(bfd *abfd, asection *sec); 654 *Description* 655 Return nonzero if SEC should be split during a reloceatable or final 656 link. 657 #define bfd_link_split_section(abfd, sec) \ 658 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) 659 660 661 File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end 662 663 Hash Tables 664 =========== 665 666 BFD provides a simple set of hash table functions. Routines are 667 provided to initialize a hash table, to free a hash table, to look up a 668 string in a hash table and optionally create an entry for it, and to 669 traverse a hash table. There is currently no routine to delete an 670 string from a hash table. 671 672 The basic hash table does not permit any data to be stored with a 673 string. However, a hash table is designed to present a base class from 674 which other types of hash tables may be derived. These derived types 675 may store additional information with the string. Hash tables were 676 implemented in this way, rather than simply providing a data pointer in 677 a hash table entry, because they were designed for use by the linker 678 back ends. The linker may create thousands of hash table entries, and 679 the overhead of allocating private data and storing and following 680 pointers becomes noticeable. 681 682 The basic hash table code is in `hash.c'. 683 684 * Menu: 685 686 * Creating and Freeing a Hash Table:: 687 * Looking Up or Entering a String:: 688 * Traversing a Hash Table:: 689 * Deriving a New Hash Table Type:: 690 691 692 File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables 693 694 Creating and freeing a hash table 695 --------------------------------- 696 697 To create a hash table, create an instance of a `struct 698 bfd_hash_table' (defined in `bfd.h') and call `bfd_hash_table_init' (if 699 you know approximately how many entries you will need, the function 700 `bfd_hash_table_init_n', which takes a SIZE argument, may be used). 701 `bfd_hash_table_init' returns `FALSE' if some sort of error occurs. 702 703 The function `bfd_hash_table_init' take as an argument a function to 704 use to create new entries. For a basic hash table, use the function 705 `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why 706 you would want to use a different value for this argument. 707 708 `bfd_hash_table_init' will create an objalloc which will be used to 709 allocate new entries. You may allocate memory on this objalloc using 710 `bfd_hash_allocate'. 711 712 Use `bfd_hash_table_free' to free up all the memory that has been 713 allocated for a hash table. This will not free up the `struct 714 bfd_hash_table' itself, which you must provide. 715 716 717 File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables 718 719 Looking up or entering a string 720 ------------------------------- 721 722 The function `bfd_hash_lookup' is used both to look up a string in 723 the hash table and to create a new entry. 724 725 If the CREATE argument is `FALSE', `bfd_hash_lookup' will look up a 726 string. If the string is found, it will returns a pointer to a `struct 727 bfd_hash_entry'. If the string is not found in the table 728 `bfd_hash_lookup' will return `NULL'. You should not modify any of the 729 fields in the returns `struct bfd_hash_entry'. 730 731 If the CREATE argument is `TRUE', the string will be entered into 732 the hash table if it is not already there. Either way a pointer to a 733 `struct bfd_hash_entry' will be returned, either to the existing 734 structure or to a newly created one. In this case, a `NULL' return 735 means that an error occurred. 736 737 If the CREATE argument is `TRUE', and a new entry is created, the 738 COPY argument is used to decide whether to copy the string onto the 739 hash table objalloc or not. If COPY is passed as `FALSE', you must be 740 careful not to deallocate or modify the string as long as the hash table 741 exists. 742 743 744 File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables 745 746 Traversing a hash table 747 ----------------------- 748 749 The function `bfd_hash_traverse' may be used to traverse a hash 750 table, calling a function on each element. The traversal is done in a 751 random order. 752 753 `bfd_hash_traverse' takes as arguments a function and a generic 754 `void *' pointer. The function is called with a hash table entry (a 755 `struct bfd_hash_entry *') and the generic pointer passed to 756 `bfd_hash_traverse'. The function must return a `boolean' value, which 757 indicates whether to continue traversing the hash table. If the 758 function returns `FALSE', `bfd_hash_traverse' will stop the traversal 759 and return immediately. 760 761 762 File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables 763 764 Deriving a new hash table type 765 ------------------------------ 766 767 Many uses of hash tables want to store additional information which 768 each entry in the hash table. Some also find it convenient to store 769 additional information with the hash table itself. This may be done 770 using a derived hash table. 771 772 Since C is not an object oriented language, creating a derived hash 773 table requires sticking together some boilerplate routines with a few 774 differences specific to the type of hash table you want to create. 775 776 An example of a derived hash table is the linker hash table. The 777 structures for this are defined in `bfdlink.h'. The functions are in 778 `linker.c'. 779 780 You may also derive a hash table from an already derived hash table. 781 For example, the a.out linker backend code uses a hash table derived 782 from the linker hash table. 783 784 * Menu: 785 786 * Define the Derived Structures:: 787 * Write the Derived Creation Routine:: 788 * Write Other Derived Routines:: 789 790 791 File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type 792 793 Define the derived structures 794 ............................. 795 796 You must define a structure for an entry in the hash table, and a 797 structure for the hash table itself. 798 799 The first field in the structure for an entry in the hash table must 800 be of the type used for an entry in the hash table you are deriving 801 from. If you are deriving from a basic hash table this is `struct 802 bfd_hash_entry', which is defined in `bfd.h'. The first field in the 803 structure for the hash table itself must be of the type of the hash 804 table you are deriving from itself. If you are deriving from a basic 805 hash table, this is `struct bfd_hash_table'. 806 807 For example, the linker hash table defines `struct 808 bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of 809 type `struct bfd_hash_entry'. Similarly, the first field in `struct 810 bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. 811 812 813 File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type 814 815 Write the derived creation routine 816 .................................. 817 818 You must write a routine which will create and initialize an entry 819 in the hash table. This routine is passed as the function argument to 820 `bfd_hash_table_init'. 821 822 In order to permit other hash tables to be derived from the hash 823 table you are creating, this routine must be written in a standard way. 824 825 The first argument to the creation routine is a pointer to a hash 826 table entry. This may be `NULL', in which case the routine should 827 allocate the right amount of space. Otherwise the space has already 828 been allocated by a hash table type derived from this one. 829 830 After allocating space, the creation routine must call the creation 831 routine of the hash table type it is derived from, passing in a pointer 832 to the space it just allocated. This will initialize any fields used 833 by the base hash table. 834 835 Finally the creation routine must initialize any local fields for 836 the new hash table type. 837 838 Here is a boilerplate example of a creation routine. FUNCTION_NAME 839 is the name of the routine. ENTRY_TYPE is the type of an entry in the 840 hash table you are creating. BASE_NEWFUNC is the name of the creation 841 routine of the hash table type your hash table is derived from. 842 843 struct bfd_hash_entry * 844 FUNCTION_NAME (entry, table, string) 845 struct bfd_hash_entry *entry; 846 struct bfd_hash_table *table; 847 const char *string; 213 848 { 214 215 /* Remembers the offset from the first symbol in the file for 216 this symbol. Generated by coff_renumber_symbols. */ 217 unsigned int offset; 218 219 /* Should the value of this symbol be renumbered. Used for 220 XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ 221 unsigned int fix_value : 1; 222 223 /* Should the tag field of this symbol be renumbered. 224 Created by coff_pointerize_aux. */ 225 unsigned int fix_tag : 1; 226 227 /* Should the endidx field of this symbol be renumbered. 228 Created by coff_pointerize_aux. */ 229 unsigned int fix_end : 1; 230 231 /* Should the x_csect.x_scnlen field be renumbered. 232 Created by coff_pointerize_aux. */ 233 unsigned int fix_scnlen : 1; 234 235 /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the 236 index into the line number entries. Set by 237 coff_slurp_symbol_table. */ 238 unsigned int fix_line : 1; 239 240 /* The container for the symbol structure as read and translated 241 from the file. */ 242 243 union { 244 union internal_auxent auxent; 245 struct internal_syment syment; 246 } u; 247 } combined_entry_type; 248 249 250 /* Each canonical asymbol really looks like this: */ 251 252 typedef struct coff_symbol_struct 253 { 254 /* The actual symbol which the rest of BFD works with */ 255 asymbol symbol; 256 257 /* A pointer to the hidden information for this symbol */ 258 combined_entry_type *native; 259 260 /* A pointer to the linenumber information for this symbol */ 261 struct lineno_cache_entry *lineno; 262 263 /* Have the line numbers been relocated yet ? */ 264 boolean done_lineno; 265 } coff_symbol_type; 266 267 `bfd_coff_backend_data' 268 ....................... 269 270 /* COFF symbol classifications. */ 271 272 enum coff_symbol_classification 273 { 274 /* Global symbol. */ 275 COFF_SYMBOL_GLOBAL, 276 /* Common symbol. */ 277 COFF_SYMBOL_COMMON, 278 /* Undefined symbol. */ 279 COFF_SYMBOL_UNDEFINED, 280 /* Local symbol. */ 281 COFF_SYMBOL_LOCAL, 282 /* PE section symbol. */ 283 COFF_SYMBOL_PE_SECTION 284 }; 285 Special entry points for gdb to swap in coff symbol table parts: 286 typedef struct 287 { 288 void (*_bfd_coff_swap_aux_in) PARAMS (( 289 bfd *abfd, 290 PTR ext, 291 int type, 292 int class, 293 int indaux, 294 int numaux, 295 PTR in)); 296 297 void (*_bfd_coff_swap_sym_in) PARAMS (( 298 bfd *abfd , 299 PTR ext, 300 PTR in)); 301 302 void (*_bfd_coff_swap_lineno_in) PARAMS (( 303 bfd *abfd, 304 PTR ext, 305 PTR in)); 306 Special entry points for gas to swap out coff parts: 307 unsigned int (*_bfd_coff_swap_aux_out) PARAMS (( 308 bfd *abfd, 309 PTR in, 310 int type, 311 int class, 312 int indaux, 313 int numaux, 314 PTR ext)); 315 316 unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( 317 bfd *abfd, 318 PTR in, 319 PTR ext)); 320 321 unsigned int (*_bfd_coff_swap_lineno_out) PARAMS (( 322 bfd *abfd, 323 PTR in, 324 PTR ext)); 325 326 unsigned int (*_bfd_coff_swap_reloc_out) PARAMS (( 327 bfd *abfd, 328 PTR src, 329 PTR dst)); 330 331 unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS (( 332 bfd *abfd, 333 PTR in, 334 PTR out)); 335 336 unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS (( 337 bfd *abfd, 338 PTR in, 339 PTR out)); 340 341 unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS (( 342 bfd *abfd, 343 PTR in, 344 PTR out)); 345 Special entry points for generic COFF routines to call target 346 dependent COFF routines: 347 unsigned int _bfd_filhsz; 348 unsigned int _bfd_aoutsz; 349 unsigned int _bfd_scnhsz; 350 unsigned int _bfd_symesz; 351 unsigned int _bfd_auxesz; 352 unsigned int _bfd_relsz; 353 unsigned int _bfd_linesz; 354 unsigned int _bfd_filnmlen; 355 boolean _bfd_coff_long_filenames; 356 boolean _bfd_coff_long_section_names; 357 unsigned int _bfd_coff_default_section_alignment_power; 358 boolean _bfd_coff_force_symnames_in_strings; 359 unsigned int _bfd_coff_debug_string_prefix_length; 360 void (*_bfd_coff_swap_filehdr_in) PARAMS (( 361 bfd *abfd, 362 PTR ext, 363 PTR in)); 364 void (*_bfd_coff_swap_aouthdr_in) PARAMS (( 365 bfd *abfd, 366 PTR ext, 367 PTR in)); 368 void (*_bfd_coff_swap_scnhdr_in) PARAMS (( 369 bfd *abfd, 370 PTR ext, 371 PTR in)); 372 void (*_bfd_coff_swap_reloc_in) PARAMS (( 373 bfd *abfd, 374 PTR ext, 375 PTR in)); 376 boolean (*_bfd_coff_bad_format_hook) PARAMS (( 377 bfd *abfd, 378 PTR internal_filehdr)); 379 boolean (*_bfd_coff_set_arch_mach_hook) PARAMS (( 380 bfd *abfd, 381 PTR internal_filehdr)); 382 PTR (*_bfd_coff_mkobject_hook) PARAMS (( 383 bfd *abfd, 384 PTR internal_filehdr, 385 PTR internal_aouthdr)); 386 flagword (*_bfd_styp_to_sec_flags_hook) PARAMS (( 387 bfd *abfd, 388 PTR internal_scnhdr, 389 const char *name, 390 asection *section)); 391 void (*_bfd_set_alignment_hook) PARAMS (( 392 bfd *abfd, 393 asection *sec, 394 PTR internal_scnhdr)); 395 boolean (*_bfd_coff_slurp_symbol_table) PARAMS (( 396 bfd *abfd)); 397 boolean (*_bfd_coff_symname_in_debug) PARAMS (( 398 bfd *abfd, 399 struct internal_syment *sym)); 400 boolean (*_bfd_coff_pointerize_aux_hook) PARAMS (( 401 bfd *abfd, 402 combined_entry_type *table_base, 403 combined_entry_type *symbol, 404 unsigned int indaux, 405 combined_entry_type *aux)); 406 boolean (*_bfd_coff_print_aux) PARAMS (( 407 bfd *abfd, 408 FILE *file, 409 combined_entry_type *table_base, 410 combined_entry_type *symbol, 411 combined_entry_type *aux, 412 unsigned int indaux)); 413 void (*_bfd_coff_reloc16_extra_cases) PARAMS (( 414 bfd *abfd, 415 struct bfd_link_info *link_info, 416 struct bfd_link_order *link_order, 417 arelent *reloc, 418 bfd_byte *data, 419 unsigned int *src_ptr, 420 unsigned int *dst_ptr)); 421 int (*_bfd_coff_reloc16_estimate) PARAMS (( 422 bfd *abfd, 423 asection *input_section, 424 arelent *r, 425 unsigned int shrink, 426 struct bfd_link_info *link_info)); 427 enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS (( 428 bfd *abfd, 429 struct internal_syment *)); 430 boolean (*_bfd_coff_compute_section_file_positions) PARAMS (( 431 bfd *abfd)); 432 boolean (*_bfd_coff_start_final_link) PARAMS (( 433 bfd *output_bfd, 434 struct bfd_link_info *info)); 435 boolean (*_bfd_coff_relocate_section) PARAMS (( 436 bfd *output_bfd, 437 struct bfd_link_info *info, 438 bfd *input_bfd, 439 asection *input_section, 440 bfd_byte *contents, 441 struct internal_reloc *relocs, 442 struct internal_syment *syms, 443 asection **sections)); 444 reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS (( 445 bfd *abfd, 446 asection *sec, 447 struct internal_reloc *rel, 448 struct coff_link_hash_entry *h, 449 struct internal_syment *sym, 450 bfd_vma *addendp)); 451 boolean (*_bfd_coff_adjust_symndx) PARAMS (( 452 bfd *obfd, 453 struct bfd_link_info *info, 454 bfd *ibfd, 455 asection *sec, 456 struct internal_reloc *reloc, 457 boolean *adjustedp)); 458 boolean (*_bfd_coff_link_add_one_symbol) PARAMS (( 459 struct bfd_link_info *info, 460 bfd *abfd, 461 const char *name, 462 flagword flags, 463 asection *section, 464 bfd_vma value, 465 const char *string, 466 boolean copy, 467 boolean collect, 468 struct bfd_link_hash_entry **hashp)); 469 470 boolean (*_bfd_coff_link_output_has_begun) PARAMS (( 471 bfd * abfd, 472 struct coff_final_link_info * pfinfo)); 473 boolean (*_bfd_coff_final_link_postscript) PARAMS (( 474 bfd * abfd, 475 struct coff_final_link_info * pfinfo)); 476 477 } bfd_coff_backend_data; 478 479 #define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) 480 481 #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ 482 ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) 483 484 #define bfd_coff_swap_sym_in(a,e,i) \ 485 ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) 486 487 #define bfd_coff_swap_lineno_in(a,e,i) \ 488 ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) 489 490 #define bfd_coff_swap_reloc_out(abfd, i, o) \ 491 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) 492 493 #define bfd_coff_swap_lineno_out(abfd, i, o) \ 494 ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) 495 496 #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ 497 ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) 498 499 #define bfd_coff_swap_sym_out(abfd, i,o) \ 500 ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) 501 502 #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ 503 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) 504 505 #define bfd_coff_swap_filehdr_out(abfd, i,o) \ 506 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) 507 508 #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ 509 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) 510 511 #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) 512 #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) 513 #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) 514 #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) 515 #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) 516 #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) 517 #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) 518 #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) 519 #define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames) 520 #define bfd_coff_long_section_names(abfd) \ 521 (coff_backend_info (abfd)->_bfd_coff_long_section_names) 522 #define bfd_coff_default_section_alignment_power(abfd) \ 523 (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) 524 #define bfd_coff_swap_filehdr_in(abfd, i,o) \ 525 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) 526 527 #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ 528 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) 529 530 #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ 531 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) 532 533 #define bfd_coff_swap_reloc_in(abfd, i, o) \ 534 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) 535 536 #define bfd_coff_bad_format_hook(abfd, filehdr) \ 537 ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) 538 539 #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ 540 ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) 541 #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ 542 ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) 543 544 #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\ 545 ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ 546 (abfd, scnhdr, name, section)) 547 548 #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ 549 ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) 550 551 #define bfd_coff_slurp_symbol_table(abfd)\ 552 ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) 553 554 #define bfd_coff_symname_in_debug(abfd, sym)\ 555 ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) 556 557 #define bfd_coff_force_symnames_in_strings(abfd)\ 558 (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) 559 560 #define bfd_coff_debug_string_prefix_length(abfd)\ 561 (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) 562 563 #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ 564 ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ 565 (abfd, file, base, symbol, aux, indaux)) 566 567 #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ 568 ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ 569 (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) 570 571 #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ 572 ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ 573 (abfd, section, reloc, shrink, link_info)) 574 575 #define bfd_coff_classify_symbol(abfd, sym)\ 576 ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ 577 (abfd, sym)) 578 579 #define bfd_coff_compute_section_file_positions(abfd)\ 580 ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ 581 (abfd)) 582 583 #define bfd_coff_start_final_link(obfd, info)\ 584 ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ 585 (obfd, info)) 586 #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ 587 ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ 588 (obfd, info, ibfd, o, con, rel, isyms, secs)) 589 #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ 590 ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ 591 (abfd, sec, rel, h, sym, addendp)) 592 #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ 593 ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ 594 (obfd, info, ibfd, sec, rel, adjustedp)) 595 #define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ 596 ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ 597 (info, abfd, name, flags, section, value, string, cp, coll, hashp)) 598 599 #define bfd_coff_link_output_has_begun(a,p) \ 600 ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) 601 #define bfd_coff_final_link_postscript(a,p) \ 602 ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) 603 604 Writing relocations 605 ................... 606 607 To write relocations, the back end steps though the canonical 608 relocation table and create an `internal_reloc'. The symbol index to 609 use is removed from the `offset' field in the symbol table supplied. 610 The address comes directly from the sum of the section base address and 611 the relocation offset; the type is dug directly from the howto field. 612 Then the `internal_reloc' is swapped into the shape of an 613 `external_reloc' and written out to disk. 614 615 Reading linenumbers 616 ................... 617 618 Creating the linenumber table is done by reading in the entire coff 619 linenumber table, and creating another table for internal use. 620 621 A coff linenumber table is structured so that each function is 622 marked as having a line number of 0. Each line within the function is 623 an offset from the first line in the function. The base of the line 624 number information for the table is stored in the symbol associated 625 with the function. 626 627 Note: The PE format uses line number 0 for a flag indicating a new 628 source file. 629 630 The information is copied from the external to the internal table, 631 and each symbol which marks a function is marked by pointing its... 632 633 How does this work ? 634 635 Reading relocations 636 ................... 637 638 Coff relocations are easily transformed into the internal BFD form 639 (`arelent'). 640 641 Reading a coff relocation table is done in the following stages: 642 643 * Read the entire coff relocation table into memory. 644 645 * Process each relocation in turn; first swap it from the external 646 to the internal form. 647 648 * Turn the symbol referenced in the relocation's symbol index into a 649 pointer into the canonical symbol table. This table is the same 650 as the one returned by a call to `bfd_canonicalize_symtab'. The 651 back end will call that routine and save the result if a 652 canonicalization hasn't been done. 653 654 * The reloc index is turned into a pointer to a howto structure, in 655 a back end specific way. For instance, the 386 and 960 use the 656 `r_type' to directly produce an index into a howto table vector; 657 the 88k subtracts a number from the `r_type' field and creates an 658 addend field. 659 660 661 File: bfd.info, Node: elf, Prev: coff, Up: BFD back ends 662 663 ELF backends 664 ============ 665 666 BFD support for ELF formats is being worked on. Currently, the best 667 supported back ends are for sparc and i386 (running svr4 or Solaris 2). 668 669 Documentation of the internals of the support code still needs to be 670 written. The code is changing quickly enough that we haven't bothered 671 yet. 672 673 `bfd_elf_find_section' 674 ...................... 675 676 *Synopsis* 677 struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); 678 *Description* 679 Helper functions for GDB to locate the string tables. Since BFD hides 680 string tables from callers, GDB needs to use an internal hook to find 681 them. Sun's .stabstr, in particular, isn't even pointed to by the 682 .stab section, so ordinary mechanisms wouldn't work to find it, even if 683 we had some. 684 685 686 File: bfd.info, Node: GNU Free Documentation License, Next: Index, Prev: BFD back ends, Up: Top 687 688 GNU Free Documentation License 689 ****************************** 690 691 GNU Free Documentation License 692 693 Version 1.1, March 2000 694 695 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 696 Place, Suite 330, Boston, MA 02111-1307 USA 697 698 Everyone is permitted to copy and distribute verbatim copies of 699 this license document, but changing it is not allowed. 700 701 0. PREAMBLE 702 703 The purpose of this License is to make a manual, textbook, or other 704 written document "free" in the sense of freedom: to assure everyone the 705 effective freedom to copy and redistribute it, with or without 706 modifying it, either commercially or noncommercially. Secondarily, 707 this License preserves for the author and publisher a way to get credit 708 for their work, while not being considered responsible for 709 modifications made by others. 710 711 This License is a kind of "copyleft", which means that derivative 712 works of the document must themselves be free in the same sense. It 713 complements the GNU General Public License, which is a copyleft license 714 designed for free software. 715 716 We have designed this License in order to use it for manuals for free 717 software, because free software needs free documentation: a free 718 program should come with manuals providing the same freedoms that the 719 software does. But this License is not limited to software manuals; it 720 can be used for any textual work, regardless of subject matter or 721 whether it is published as a printed book. We recommend this License 722 principally for works whose purpose is instruction or reference. 723 724 1. APPLICABILITY AND DEFINITIONS 725 726 This License applies to any manual or other work that contains a 727 notice placed by the copyright holder saying it can be distributed 728 under the terms of this License. The "Document", below, refers to any 729 such manual or work. Any member of the public is a licensee, and is 730 addressed as "you". 731 732 A "Modified Version" of the Document means any work containing the 733 Document or a portion of it, either copied verbatim, or with 734 modifications and/or translated into another language. 735 736 A "Secondary Section" is a named appendix or a front-matter section 737 of the Document that deals exclusively with the relationship of the 738 publishers or authors of the Document to the Document's overall subject 739 (or to related matters) and contains nothing that could fall directly 740 within that overall subject. (For example, if the Document is in part a 741 textbook of mathematics, a Secondary Section may not explain any 742 mathematics.) The relationship could be a matter of historical 743 connection with the subject or with related matters, or of legal, 744 commercial, philosophical, ethical or political position regarding them. 745 746 The "Invariant Sections" are certain Secondary Sections whose titles 747 are designated, as being those of Invariant Sections, in the notice 748 that says that the Document is released under this License. 749 750 The "Cover Texts" are certain short passages of text that are listed, 751 as Front-Cover Texts or Back-Cover Texts, in the notice that says that 752 the Document is released under this License. 753 754 A "Transparent" copy of the Document means a machine-readable copy, 755 represented in a format whose specification is available to the general 756 public, whose contents can be viewed and edited directly and 757 straightforwardly with generic text editors or (for images composed of 758 pixels) generic paint programs or (for drawings) some widely available 759 drawing editor, and that is suitable for input to text formatters or 760 for automatic translation to a variety of formats suitable for input to 761 text formatters. A copy made in an otherwise Transparent file format 762 whose markup has been designed to thwart or discourage subsequent 763 modification by readers is not Transparent. A copy that is not 764 "Transparent" is called "Opaque". 765 766 Examples of suitable formats for Transparent copies include plain 767 ASCII without markup, Texinfo input format, LaTeX input format, SGML or 768 XML using a publicly available DTD, and standard-conforming simple HTML 769 designed for human modification. Opaque formats include PostScript, 770 PDF, proprietary formats that can be read and edited only by 771 proprietary word processors, SGML or XML for which the DTD and/or 772 processing tools are not generally available, and the machine-generated 773 HTML produced by some word processors for output purposes only. 774 775 The "Title Page" means, for a printed book, the title page itself, 776 plus such following pages as are needed to hold, legibly, the material 777 this License requires to appear in the title page. For works in 778 formats which do not have any title page as such, "Title Page" means 779 the text near the most prominent appearance of the work's title, 780 preceding the beginning of the body of the text. 781 782 2. VERBATIM COPYING 783 784 You may copy and distribute the Document in any medium, either 785 commercially or noncommercially, provided that this License, the 786 copyright notices, and the license notice saying this License applies 787 to the Document are reproduced in all copies, and that you add no other 788 conditions whatsoever to those of this License. You may not use 789 technical measures to obstruct or control the reading or further 790 copying of the copies you make or distribute. However, you may accept 791 compensation in exchange for copies. If you distribute a large enough 792 number of copies you must also follow the conditions in section 3. 793 794 You may also lend copies, under the same conditions stated above, and 795 you may publicly display copies. 796 797 3. COPYING IN QUANTITY 798 799 If you publish printed copies of the Document numbering more than 800 100, and the Document's license notice requires Cover Texts, you must 801 enclose the copies in covers that carry, clearly and legibly, all these 802 Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts 803 on the back cover. Both covers must also clearly and legibly identify 804 you as the publisher of these copies. The front cover must present the 805 full title with all words of the title equally prominent and visible. 806 You may add other material on the covers in addition. Copying with 807 changes limited to the covers, as long as they preserve the title of 808 the Document and satisfy these conditions, can be treated as verbatim 809 copying in other respects. 810 811 If the required texts for either cover are too voluminous to fit 812 legibly, you should put the first ones listed (as many as fit 813 reasonably) on the actual cover, and continue the rest onto adjacent 814 pages. 815 816 If you publish or distribute Opaque copies of the Document numbering 817 more than 100, you must either include a machine-readable Transparent 818 copy along with each Opaque copy, or state in or with each Opaque copy 819 a publicly-accessible computer-network location containing a complete 820 Transparent copy of the Document, free of added material, which the 821 general network-using public has access to download anonymously at no 822 charge using public-standard network protocols. If you use the latter 823 option, you must take reasonably prudent steps, when you begin 824 distribution of Opaque copies in quantity, to ensure that this 825 Transparent copy will remain thus accessible at the stated location 826 until at least one year after the last time you distribute an Opaque 827 copy (directly or through your agents or retailers) of that edition to 828 the public. 829 830 It is requested, but not required, that you contact the authors of 831 the Document well before redistributing any large number of copies, to 832 give them a chance to provide you with an updated version of the 833 Document. 834 835 4. MODIFICATIONS 836 837 You may copy and distribute a Modified Version of the Document under 838 the conditions of sections 2 and 3 above, provided that you release the 839 Modified Version under precisely this License, with the Modified 840 Version filling the role of the Document, thus licensing distribution 841 and modification of the Modified Version to whoever possesses a copy of 842 it. In addition, you must do these things in the Modified Version: 843 844 A. Use in the Title Page (and on the covers, if any) a title distinct 845 from that of the Document, and from those of previous versions 846 (which should, if there were any, be listed in the History section 847 of the Document). You may use the same title as a previous version 848 if the original publisher of that version gives permission. B. List on 849 the Title Page, as authors, one or more persons or entities 850 responsible for authorship of the modifications in the Modified 851 Version, together with at least five of the principal authors of the 852 Document (all of its principal authors, if it has less than five). C. 853 State on the Title page the name of the publisher of the Modified 854 Version, as the publisher. D. Preserve all the copyright notices of 855 the Document. E. Add an appropriate copyright notice for your 856 modifications adjacent to the other copyright notices. F. Include, 857 immediately after the copyright notices, a license notice giving the 858 public permission to use the Modified Version under the terms of 859 this License, in the form shown in the Addendum below. G. Preserve in 860 that license notice the full lists of Invariant Sections and 861 required Cover Texts given in the Document's license notice. H. 862 Include an unaltered copy of this License. I. Preserve the section 863 entitled "History", and its title, and add to it an item stating at 864 least the title, year, new authors, and publisher of the Modified 865 Version as given on the Title Page. If there is no section entitled 866 "History" in the Document, create one stating the title, year, 867 authors, and publisher of the Document as given on its Title Page, 868 then add an item describing the Modified Version as stated in the 869 previous sentence. J. Preserve the network location, if any, given in 870 the Document for public access to a Transparent copy of the 871 Document, and likewise the network locations given in the Document 872 for previous versions it was based on. These may be placed in the 873 "History" section. You may omit a network location for a work that 874 was published at least four years before the Document itself, or if 875 the original publisher of the version it refers to gives permission. 876 K. In any section entitled "Acknowledgements" or "Dedications", 877 preserve the section's title, and preserve in the section all the 878 substance and tone of each of the contributor acknowledgements 879 and/or dedications given therein. L. Preserve all the Invariant 880 Sections of the Document, unaltered in their text and in their 881 titles. Section numbers or the equivalent are not considered part 882 of the section titles. M. Delete any section entitled "Endorsements". 883 Such a section may not be included in the Modified Version. N. Do 884 not retitle any existing section as "Endorsements" or to conflict in 885 title with any Invariant Section. 886 887 If the Modified Version includes new front-matter sections or 888 appendices that qualify as Secondary Sections and contain no material 889 copied from the Document, you may at your option designate some or all 890 of these sections as invariant. To do this, add their titles to the 891 list of Invariant Sections in the Modified Version's license notice. 892 These titles must be distinct from any other section titles. 893 894 You may add a section entitled "Endorsements", provided it contains 895 nothing but endorsements of your Modified Version by various 896 parties-for example, statements of peer review or that the text has 897 been approved by an organization as the authoritative definition of a 898 standard. 899 900 You may add a passage of up to five words as a Front-Cover Text, and 901 a passage of up to 25 words as a Back-Cover Text, to the end of the list 902 of Cover Texts in the Modified Version. Only one passage of 903 Front-Cover Text and one of Back-Cover Text may be added by (or through 904 arrangements made by) any one entity. If the Document already includes 905 a cover text for the same cover, previously added by you or by 906 arrangement made by the same entity you are acting on behalf of, you 907 may not add another; but you may replace the old one, on explicit 908 permission from the previous publisher that added the old one. 909 910 The author(s) and publisher(s) of the Document do not by this License 911 give permission to use their names for publicity for or to assert or 912 imply endorsement of any Modified Version. 913 914 5. COMBINING DOCUMENTS 915 916 You may combine the Document with other documents released under this 917 License, under the terms defined in section 4 above for modified 918 versions, provided that you include in the combination all of the 919 Invariant Sections of all of the original documents, unmodified, and 920 list them all as Invariant Sections of your combined work in its 921 license notice. 922 923 The combined work need only contain one copy of this License, and 924 multiple identical Invariant Sections may be replaced with a single 925 copy. If there are multiple Invariant Sections with the same name but 926 different contents, make the title of each such section unique by 927 adding at the end of it, in parentheses, the name of the original 928 author or publisher of that section if known, or else a unique number. 929 Make the same adjustment to the section titles in the list of Invariant 930 Sections in the license notice of the combined work. 931 932 In the combination, you must combine any sections entitled "History" 933 in the various original documents, forming one section entitled 934 "History"; likewise combine any sections entitled "Acknowledgements", 935 and any sections entitled "Dedications". You must delete all sections 936 entitled "Endorsements." 937 938 6. COLLECTIONS OF DOCUMENTS 939 940 You may make a collection consisting of the Document and other 941 documents released under this License, and replace the individual 942 copies of this License in the various documents with a single copy that 943 is included in the collection, provided that you follow the rules of 944 this License for verbatim copying of each of the documents in all other 945 respects. 946 947 You may extract a single document from such a collection, and 948 distribute it individually under this License, provided you insert a 949 copy of this License into the extracted document, and follow this 950 License in all other respects regarding verbatim copying of that 951 document. 952 953 7. AGGREGATION WITH INDEPENDENT WORKS 954 955 A compilation of the Document or its derivatives with other separate 956 and independent documents or works, in or on a volume of a storage or 957 distribution medium, does not as a whole count as a Modified Version of 958 the Document, provided no compilation copyright is claimed for the 959 compilation. Such a compilation is called an "aggregate", and this 960 License does not apply to the other self-contained works thus compiled 961 with the Document, on account of their being thus compiled, if they are 962 not themselves derivative works of the Document. 963 964 If the Cover Text requirement of section 3 is applicable to these 965 copies of the Document, then if the Document is less than one quarter 966 of the entire aggregate, the Document's Cover Texts may be placed on 967 covers that surround only the Document within the aggregate. Otherwise 968 they must appear on covers around the whole aggregate. 969 970 8. TRANSLATION 971 972 Translation is considered a kind of modification, so you may 973 distribute translations of the Document under the terms of section 4. 974 Replacing Invariant Sections with translations requires special 975 permission from their copyright holders, but you may include 976 translations of some or all Invariant Sections in addition to the 977 original versions of these Invariant Sections. You may include a 978 translation of this License provided that you also include the original 979 English version of this License. In case of a disagreement between the 980 translation and the original English version of this License, the 981 original English version will prevail. 982 983 9. TERMINATION 984 985 You may not copy, modify, sublicense, or distribute the Document 986 except as expressly provided for under this License. Any other attempt 987 to copy, modify, sublicense or distribute the Document is void, and will 988 automatically terminate your rights under this License. However, 989 parties who have received copies, or rights, from you under this 990 License will not have their licenses terminated so long as such parties 991 remain in full compliance. 992 993 10. FUTURE REVISIONS OF THIS LICENSE 994 995 The Free Software Foundation may publish new, revised versions of 996 the GNU Free Documentation License from time to time. Such new 997 versions will be similar in spirit to the present version, but may 998 differ in detail to address new problems or concerns. See 999 http://www.gnu.org/copyleft/. 1000 1001 Each version of the License is given a distinguishing version number. 1002 If the Document specifies that a particular numbered version of this 1003 License "or any later version" applies to it, you have the option of 1004 following the terms and conditions either of that specified version or 1005 of any later version that has been published (not as a draft) by the 1006 Free Software Foundation. If the Document does not specify a version 1007 number of this License, you may choose any version ever published (not 1008 as a draft) by the Free Software Foundation. 1009 1010 ADDENDUM: How to use this License for your documents 1011 1012 To use this License in a document you have written, include a copy of 1013 the License in the document and put the following copyright and license 1014 notices just after the title page: 1015 1016 Copyright (c) YEAR YOUR NAME. 1017 Permission is granted to copy, distribute and/or modify this document 1018 under the terms of the GNU Free Documentation License, Version 1.1 1019 or any later version published by the Free Software Foundation; 1020 with the Invariant Sections being LIST THEIR TITLES, with the 1021 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 1022 A copy of the license is included in the section entitled "GNU 1023 Free Documentation License". 1024 1025 If you have no Invariant Sections, write "with no Invariant Sections" 1026 instead of saying which ones are invariant. If you have no Front-Cover 1027 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being 1028 LIST"; likewise for Back-Cover Texts. 1029 1030 If your document contains nontrivial examples of program code, we 1031 recommend releasing these examples in parallel under your choice of 1032 free software license, such as the GNU General Public License, to 1033 permit their use in free software. 1034 849 struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; 850 851 /* Allocate the structure if it has not already been allocated by a 852 derived class. */ 853 if (ret == (ENTRY_TYPE *) NULL) 854 { 855 ret = ((ENTRY_TYPE *) 856 bfd_hash_allocate (table, sizeof (ENTRY_TYPE))); 857 if (ret == (ENTRY_TYPE *) NULL) 858 return NULL; 859 } 860 861 /* Call the allocation method of the base class. */ 862 ret = ((ENTRY_TYPE *) 863 BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); 864 865 /* Initialize the local fields here. */ 866 867 return (struct bfd_hash_entry *) ret; 868 } 869 *Description* 870 The creation routine for the linker hash table, which is in `linker.c', 871 looks just like this example. FUNCTION_NAME is 872 `_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. 873 BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic 874 hash table. 875 876 `_bfd_link_hash_newfunc' also initializes the local fields in a 877 linker hash table entry: `type', `written' and `next'. 878 879 880 File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type 881 882 Write other derived routines 883 ............................ 884 885 You will want to write other routines for your new hash table, as 886 well. 887 888 You will want an initialization routine which calls the 889 initialization routine of the hash table you are deriving from and 890 initializes any other local fields. For the linker hash table, this is 891 `_bfd_link_hash_table_init' in `linker.c'. 892 893 You will want a lookup routine which calls the lookup routine of the 894 hash table you are deriving from and casts the result. The linker hash 895 table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an 896 additional argument which it uses to decide how to return the looked up 897 value). 898 899 You may want a traversal routine. This should just call the 900 traversal routine of the hash table you are deriving from with 901 appropriate casts. The linker hash table uses `bfd_link_hash_traverse' 902 in `linker.c'. 903 904 These routines may simply be defined as macros. For example, the 905 a.out backend linker hash table, which is derived from the linker hash 906 table, uses macros for the lookup and traversal routines. These are 907 `aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. 908 909 910 File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top 911 912 BFD back ends 913 ************* 914 915 * Menu: 916 917 * What to Put Where:: 918 * aout :: a.out backends 919 * coff :: coff backends 920 * elf :: elf backends 921 * mmo :: mmo backend 922 923 924 File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends 925 926 All of BFD lives in one directory. 927 928 929 File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends 930 931 a.out backends 932 ============== 933 934 *Description* 935 BFD supports a number of different flavours of a.out format, though the 936 major differences are only the sizes of the structures on disk, and the 937 shape of the relocation information. 938 939 The support is split into a basic support file `aoutx.h' and other 940 files which derive functions from the base. One derivation file is 941 `aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions 942 support for sun3, sun4, 386 and 29k a.out files, to create a target 943 jump vector for a specific target. 944 945 This information is further split out into more specific files for 946 each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for 947 the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out 948 format. 949 950 The base file `aoutx.h' defines general mechanisms for reading and 951 writing records to and from disk and various other methods which BFD 952 requires. It is included by `aout32.c' and `aout64.c' to form the names 953 `aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. 954 955 As an example, this is what goes on to make the back end for a sun4, 956 from `aout32.c': 957 958 #define ARCH_SIZE 32 959 #include "aoutx.h" 960 961 Which exports names: 962 963 ... 964 aout_32_canonicalize_reloc 965 aout_32_find_nearest_line 966 aout_32_get_lineno 967 aout_32_get_reloc_upper_bound 968 ... 969 970 from `sunos.c': 971 972 #define TARGET_NAME "a.out-sunos-big" 973 #define VECNAME sunos_big_vec 974 #include "aoutf1.h" 975 976 requires all the names from `aout32.c', and produces the jump vector 977 978 sunos_big_vec 979 980 The file `host-aout.c' is a special case. It is for a large set of 981 hosts that use "more or less standard" a.out files, and for which 982 cross-debugging is not interesting. It uses the standard 32-bit a.out 983 support routines, but determines the file offsets and addresses of the 984 text, data, and BSS sections, the machine architecture and machine 985 type, and the entry point address, in a host-dependent manner. Once 986 these values have been determined, generic code is used to handle the 987 object file. 988 989 When porting it to run on a new system, you must supply: 990 991 HOST_PAGE_SIZE 992 HOST_SEGMENT_SIZE 993 HOST_MACHINE_ARCH (optional) 994 HOST_MACHINE_MACHINE (optional) 995 HOST_TEXT_START_ADDR 996 HOST_STACK_END_ADDR 997 998 in the file `../include/sys/h-XXX.h' (for your host). These values, 999 plus the structures and macros defined in `a.out.h' on your host 1000 system, will produce a BFD target that will access ordinary a.out files 1001 on your host. To configure a new machine to use `host-aout.c', specify: 1002 1003 TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec 1004 TDEPFILES= host-aout.o trad-core.o 1005 1006 in the `config/XXX.mt' file, and modify `configure.in' to use the 1007 `XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration 1008 is selected. 1009 1010 Relocations 1011 ----------- 1012 1013 *Description* 1014 The file `aoutx.h' provides for both the _standard_ and _extended_ 1015 forms of a.out relocation records. 1016 1017 The standard records contain only an address, a symbol index, and a 1018 type field. The extended records (used on 29ks and sparcs) also have a 1019 full integer for an addend. 1020 1021 Internal entry points 1022 --------------------- 1023 1024 *Description* 1025 `aoutx.h' exports several routines for accessing the contents of an 1026 a.out file, which are gathered and exported in turn by various format 1027 specific files (eg sunos.c). 1028 1029 `aout_SIZE_swap_exec_header_in' 1030 ............................... 1031 1032 *Synopsis* 1033 void aout_SIZE_swap_exec_header_in, 1034 (bfd *abfd, 1035 struct external_exec *raw_bytes, 1036 struct internal_exec *execp); 1037 *Description* 1038 Swap the information in an executable header RAW_BYTES taken from a raw 1039 byte stream memory image into the internal exec header structure EXECP. 1040 1041 `aout_SIZE_swap_exec_header_out' 1042 ................................ 1043 1044 *Synopsis* 1045 void aout_SIZE_swap_exec_header_out 1046 (bfd *abfd, 1047 struct internal_exec *execp, 1048 struct external_exec *raw_bytes); 1049 *Description* 1050 Swap the information in an internal exec header structure EXECP into 1051 the buffer RAW_BYTES ready for writing to disk. 1052 1053 `aout_SIZE_some_aout_object_p' 1054 .............................. 1055 1056 *Synopsis* 1057 const bfd_target *aout_SIZE_some_aout_object_p 1058 (bfd *abfd, 1059 const bfd_target *(*callback_to_real_object_p) ()); 1060 *Description* 1061 Some a.out variant thinks that the file open in ABFD checking is an 1062 a.out file. Do some more checking, and set up for access if it really 1063 is. Call back to the calling environment's "finish up" function just 1064 before returning, to handle any last-minute setup. 1065 1066 `aout_SIZE_mkobject' 1067 .................... 1068 1069 *Synopsis* 1070 bfd_boolean aout_SIZE_mkobject, (bfd *abfd); 1071 *Description* 1072 Initialize BFD ABFD for use with a.out files. 1073 1074 `aout_SIZE_machine_type' 1075 ........................ 1076 1077 *Synopsis* 1078 enum machine_type aout_SIZE_machine_type 1079 (enum bfd_architecture arch, 1080 unsigned long machine)); 1081 *Description* 1082 Keep track of machine architecture and machine type for a.out's. Return 1083 the `machine_type' for a particular architecture and machine, or 1084 `M_UNKNOWN' if that exact architecture and machine can't be represented 1085 in a.out format. 1086 1087 If the architecture is understood, machine type 0 (default) is 1088 always understood. 1089 1090 `aout_SIZE_set_arch_mach' 1091 ......................... 1092 1093 *Synopsis* 1094 bfd_boolean aout_SIZE_set_arch_mach, 1095 (bfd *, 1096 enum bfd_architecture arch, 1097 unsigned long machine)); 1098 *Description* 1099 Set the architecture and the machine of the BFD ABFD to the values ARCH 1100 and MACHINE. Verify that ABFD's format can support the architecture 1101 required. 1102 1103 `aout_SIZE_new_section_hook' 1104 ............................ 1105 1106 *Synopsis* 1107 bfd_boolean aout_SIZE_new_section_hook, 1108 (bfd *abfd, 1109 asection *newsect)); 1110 *Description* 1111 Called by the BFD in response to a `bfd_make_section' request. 1112 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.info-7
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 This is bfd.info, produced by makeinfo version 4. 0from bfd.texinfo.1 This is bfd.info, produced by makeinfo version 4.3 from bfd.texinfo. 2 2 3 3 START-INFO-DIR-ENTRY … … 7 7 This file documents the BFD library. 8 8 9 Copyright (C) 1991, 2000 Free Software Foundation, Inc.9 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 10 10 11 11 Permission is granted to copy, distribute and/or modify this document … … 17 17 18 18 19 File: bfd.info, Node: Index, Prev: GNU Free Documentation License, Up: Top 20 21 Index 22 ***** 19 File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends 20 21 coff backends 22 ============= 23 24 BFD supports a number of different flavours of coff format. The 25 major differences between formats are the sizes and alignments of 26 fields in structures on disk, and the occasional extra field. 27 28 Coff in all its varieties is implemented with a few common files and 29 a number of implementation specific files. For example, The 88k bcs 30 coff format is implemented in the file `coff-m88k.c'. This file 31 `#include's `coff/m88k.h' which defines the external structure of the 32 coff format for the 88k, and `coff/internal.h' which defines the 33 internal structure. `coff-m88k.c' also defines the relocations used by 34 the 88k format *Note Relocations::. 35 36 The Intel i960 processor version of coff is implemented in 37 `coff-i960.c'. This file has the same structure as `coff-m88k.c', 38 except that it includes `coff/i960.h' rather than `coff-m88k.h'. 39 40 Porting to a new version of coff 41 -------------------------------- 42 43 The recommended method is to select from the existing 44 implementations the version of coff which is most like the one you want 45 to use. For example, we'll say that i386 coff is the one you select, 46 and that your coff flavour is called foo. Copy `i386coff.c' to 47 `foocoff.c', copy `../include/coff/i386.h' to `../include/coff/foo.h', 48 and add the lines to `targets.c' and `Makefile.in' so that your new 49 back end is used. Alter the shapes of the structures in 50 `../include/coff/foo.h' so that they match what you need. You will 51 probably also have to add `#ifdef's to the code in `coff/internal.h' and 52 `coffcode.h' if your version of coff is too wild. 53 54 You can verify that your new BFD backend works quite simply by 55 building `objdump' from the `binutils' directory, and making sure that 56 its version of what's going on and your host system's idea (assuming it 57 has the pretty standard coff dump utility, usually called `att-dump' or 58 just `dump') are the same. Then clean up your code, and send what 59 you've done to Cygnus. Then your stuff will be in the next release, and 60 you won't have to keep integrating it. 61 62 How the coff backend works 63 -------------------------- 64 65 File layout 66 ........... 67 68 The Coff backend is split into generic routines that are applicable 69 to any Coff target and routines that are specific to a particular 70 target. The target-specific routines are further split into ones which 71 are basically the same for all Coff targets except that they use the 72 external symbol format or use different values for certain constants. 73 74 The generic routines are in `coffgen.c'. These routines work for 75 any Coff target. They use some hooks into the target specific code; 76 the hooks are in a `bfd_coff_backend_data' structure, one of which 77 exists for each target. 78 79 The essentially similar target-specific routines are in 80 `coffcode.h'. This header file includes executable C code. The 81 various Coff targets first include the appropriate Coff header file, 82 make any special defines that are needed, and then include `coffcode.h'. 83 84 Some of the Coff targets then also have additional routines in the 85 target source file itself. 86 87 For example, `coff-i960.c' includes `coff/internal.h' and 88 `coff/i960.h'. It then defines a few constants, such as `I960', and 89 includes `coffcode.h'. Since the i960 has complex relocation types, 90 `coff-i960.c' also includes some code to manipulate the i960 relocs. 91 This code is not in `coffcode.h' because it would not be used by any 92 other target. 93 94 Bit twiddling 95 ............. 96 97 Each flavour of coff supported in BFD has its own header file 98 describing the external layout of the structures. There is also an 99 internal description of the coff layout, in `coff/internal.h'. A major 100 function of the coff backend is swapping the bytes and twiddling the 101 bits to translate the external form of the structures into the normal 102 internal form. This is all performed in the `bfd_swap'_thing_direction 103 routines. Some elements are different sizes between different versions 104 of coff; it is the duty of the coff version specific include file to 105 override the definitions of various packing routines in `coffcode.h'. 106 E.g., the size of line number entry in coff is sometimes 16 bits, and 107 sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' 108 will select the correct one. No doubt, some day someone will find a 109 version of coff which has a varying field size not catered to at the 110 moment. To port BFD, that person will have to add more `#defines'. 111 Three of the bit twiddling routines are exported to `gdb'; 112 `coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB' 113 reads the symbol table on its own, but uses BFD to fix things up. More 114 of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', 115 `coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', 116 `coff_swap_filehdr_out', `coff_swap_aouthdr_out', 117 `coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol 118 table and reloc drudgery itself, thereby saving the internal BFD 119 overhead, but uses BFD to swap things on the way out, making cross 120 ports much safer. Doing so also allows BFD (and thus the linker) to 121 use the same header files as `gas', which makes one avenue to disaster 122 disappear. 123 124 Symbol reading 125 .............. 126 127 The simple canonical form for symbols used by BFD is not rich enough 128 to keep all the information available in a coff symbol table. The back 129 end gets around this problem by keeping the original symbol table 130 around, "behind the scenes". 131 132 When a symbol table is requested (through a call to 133 `bfd_canonicalize_symtab'), a request gets through to 134 `coff_get_normalized_symtab'. This reads the symbol table from the coff 135 file and swaps all the structures inside into the internal form. It 136 also fixes up all the pointers in the table (represented in the file by 137 offsets from the first symbol in the table) into physical pointers to 138 elements in the new internal table. This involves some work since the 139 meanings of fields change depending upon context: a field that is a 140 pointer to another structure in the symbol table at one moment may be 141 the size in bytes of a structure at the next. Another pass is made 142 over the table. All symbols which mark file names (`C_FILE' symbols) 143 are modified so that the internal string points to the value in the 144 auxent (the real filename) rather than the normal text associated with 145 the symbol (`".file"'). 146 147 At this time the symbol names are moved around. Coff stores all 148 symbols less than nine characters long physically within the symbol 149 table; longer strings are kept at the end of the file in the string 150 table. This pass moves all strings into memory and replaces them with 151 pointers to the strings. 152 153 The symbol table is massaged once again, this time to create the 154 canonical table used by the BFD application. Each symbol is inspected 155 in turn, and a decision made (using the `sclass' field) about the 156 various flags to set in the `asymbol'. *Note Symbols::. The generated 157 canonical table shares strings with the hidden internal symbol table. 158 159 Any linenumbers are read from the coff file too, and attached to the 160 symbols which own the functions the linenumbers belong to. 161 162 Symbol writing 163 .............. 164 165 Writing a symbol to a coff file which didn't come from a coff file 166 will lose any debugging information. The `asymbol' structure remembers 167 the BFD from which the symbol was taken, and on output the back end 168 makes sure that the same destination target as source target is present. 169 170 When the symbols have come from a coff file then all the debugging 171 information is preserved. 172 173 Symbol tables are provided for writing to the back end in a vector 174 of pointers to pointers. This allows applications like the linker to 175 accumulate and output large symbol tables without having to do too much 176 byte copying. 177 178 This function runs through the provided symbol table and patches 179 each symbol marked as a file place holder (`C_FILE') to point to the 180 next file place holder in the list. It also marks each `offset' field 181 in the list with the offset from the first symbol of the current symbol. 182 183 Another function of this procedure is to turn the canonical value 184 form of BFD into the form used by coff. Internally, BFD expects symbol 185 values to be offsets from a section base; so a symbol physically at 186 0x120, but in a section starting at 0x100, would have the value 0x20. 187 Coff expects symbols to contain their final value, so symbols have 188 their values changed at this point to reflect their sum with their 189 owning section. This transformation uses the `output_section' field of 190 the `asymbol''s `asection' *Note Sections::. 191 192 * `coff_mangle_symbols' 193 This routine runs though the provided symbol table and uses the 194 offsets generated by the previous pass and the pointers generated when 195 the symbol table was read in to create the structured hierarchy 196 required by coff. It changes each pointer to a symbol into the index 197 into the symbol table of the asymbol. 198 199 * `coff_write_symbols' 200 This routine runs through the symbol table and patches up the 201 symbols from their internal form into the coff way, calls the bit 202 twiddlers, and writes out the table to the file. 203 204 `coff_symbol_type' 205 .................. 206 207 *Description* 208 The hidden information for an `asymbol' is described in a 209 `combined_entry_type': 210 211 212 typedef struct coff_ptr_struct 213 { 214 /* Remembers the offset from the first symbol in the file for 215 this symbol. Generated by coff_renumber_symbols. */ 216 unsigned int offset; 217 218 /* Should the value of this symbol be renumbered. Used for 219 XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ 220 unsigned int fix_value : 1; 221 222 /* Should the tag field of this symbol be renumbered. 223 Created by coff_pointerize_aux. */ 224 unsigned int fix_tag : 1; 225 226 /* Should the endidx field of this symbol be renumbered. 227 Created by coff_pointerize_aux. */ 228 unsigned int fix_end : 1; 229 230 /* Should the x_csect.x_scnlen field be renumbered. 231 Created by coff_pointerize_aux. */ 232 unsigned int fix_scnlen : 1; 233 234 /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the 235 index into the line number entries. Set by coff_slurp_symbol_table. */ 236 unsigned int fix_line : 1; 237 238 /* The container for the symbol structure as read and translated 239 from the file. */ 240 union 241 { 242 union internal_auxent auxent; 243 struct internal_syment syment; 244 } u; 245 } combined_entry_type; 246 247 248 /* Each canonical asymbol really looks like this: */ 249 250 typedef struct coff_symbol_struct 251 { 252 /* The actual symbol which the rest of BFD works with */ 253 asymbol symbol; 254 255 /* A pointer to the hidden information for this symbol */ 256 combined_entry_type *native; 257 258 /* A pointer to the linenumber information for this symbol */ 259 struct lineno_cache_entry *lineno; 260 261 /* Have the line numbers been relocated yet ? */ 262 bfd_boolean done_lineno; 263 } coff_symbol_type; 264 265 `bfd_coff_backend_data' 266 ....................... 267 268 /* COFF symbol classifications. */ 269 270 enum coff_symbol_classification 271 { 272 /* Global symbol. */ 273 COFF_SYMBOL_GLOBAL, 274 /* Common symbol. */ 275 COFF_SYMBOL_COMMON, 276 /* Undefined symbol. */ 277 COFF_SYMBOL_UNDEFINED, 278 /* Local symbol. */ 279 COFF_SYMBOL_LOCAL, 280 /* PE section symbol. */ 281 COFF_SYMBOL_PE_SECTION 282 }; 283 Special entry points for gdb to swap in coff symbol table parts: 284 typedef struct 285 { 286 void (*_bfd_coff_swap_aux_in) 287 PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 288 289 void (*_bfd_coff_swap_sym_in) 290 PARAMS ((bfd *, PTR, PTR)); 291 292 void (*_bfd_coff_swap_lineno_in) 293 PARAMS ((bfd *, PTR, PTR)); 294 295 unsigned int (*_bfd_coff_swap_aux_out) 296 PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 297 298 unsigned int (*_bfd_coff_swap_sym_out) 299 PARAMS ((bfd *, PTR, PTR)); 300 301 unsigned int (*_bfd_coff_swap_lineno_out) 302 PARAMS ((bfd *, PTR, PTR)); 303 304 unsigned int (*_bfd_coff_swap_reloc_out) 305 PARAMS ((bfd *, PTR, PTR)); 306 307 unsigned int (*_bfd_coff_swap_filehdr_out) 308 PARAMS ((bfd *, PTR, PTR)); 309 310 unsigned int (*_bfd_coff_swap_aouthdr_out) 311 PARAMS ((bfd *, PTR, PTR)); 312 313 unsigned int (*_bfd_coff_swap_scnhdr_out) 314 PARAMS ((bfd *, PTR, PTR)); 315 316 unsigned int _bfd_filhsz; 317 unsigned int _bfd_aoutsz; 318 unsigned int _bfd_scnhsz; 319 unsigned int _bfd_symesz; 320 unsigned int _bfd_auxesz; 321 unsigned int _bfd_relsz; 322 unsigned int _bfd_linesz; 323 unsigned int _bfd_filnmlen; 324 bfd_boolean _bfd_coff_long_filenames; 325 bfd_boolean _bfd_coff_long_section_names; 326 unsigned int _bfd_coff_default_section_alignment_power; 327 bfd_boolean _bfd_coff_force_symnames_in_strings; 328 unsigned int _bfd_coff_debug_string_prefix_length; 329 330 void (*_bfd_coff_swap_filehdr_in) 331 PARAMS ((bfd *, PTR, PTR)); 332 333 void (*_bfd_coff_swap_aouthdr_in) 334 PARAMS ((bfd *, PTR, PTR)); 335 336 void (*_bfd_coff_swap_scnhdr_in) 337 PARAMS ((bfd *, PTR, PTR)); 338 339 void (*_bfd_coff_swap_reloc_in) 340 PARAMS ((bfd *abfd, PTR, PTR)); 341 342 bfd_boolean (*_bfd_coff_bad_format_hook) 343 PARAMS ((bfd *, PTR)); 344 345 bfd_boolean (*_bfd_coff_set_arch_mach_hook) 346 PARAMS ((bfd *, PTR)); 347 348 PTR (*_bfd_coff_mkobject_hook) 349 PARAMS ((bfd *, PTR, PTR)); 350 351 bfd_boolean (*_bfd_styp_to_sec_flags_hook) 352 PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); 353 354 void (*_bfd_set_alignment_hook) 355 PARAMS ((bfd *, asection *, PTR)); 356 357 bfd_boolean (*_bfd_coff_slurp_symbol_table) 358 PARAMS ((bfd *)); 359 360 bfd_boolean (*_bfd_coff_symname_in_debug) 361 PARAMS ((bfd *, struct internal_syment *)); 362 363 bfd_boolean (*_bfd_coff_pointerize_aux_hook) 364 PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, 365 unsigned int, combined_entry_type *)); 366 367 bfd_boolean (*_bfd_coff_print_aux) 368 PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, 369 combined_entry_type *, unsigned int)); 370 371 void (*_bfd_coff_reloc16_extra_cases) 372 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, 373 bfd_byte *, unsigned int *, unsigned int *)); 374 375 int (*_bfd_coff_reloc16_estimate) 376 PARAMS ((bfd *, asection *, arelent *, unsigned int, 377 struct bfd_link_info *)); 378 379 enum coff_symbol_classification (*_bfd_coff_classify_symbol) 380 PARAMS ((bfd *, struct internal_syment *)); 381 382 bfd_boolean (*_bfd_coff_compute_section_file_positions) 383 PARAMS ((bfd *)); 384 385 bfd_boolean (*_bfd_coff_start_final_link) 386 PARAMS ((bfd *, struct bfd_link_info *)); 387 388 bfd_boolean (*_bfd_coff_relocate_section) 389 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, 390 struct internal_reloc *, struct internal_syment *, asection **)); 391 392 reloc_howto_type *(*_bfd_coff_rtype_to_howto) 393 PARAMS ((bfd *, asection *, struct internal_reloc *, 394 struct coff_link_hash_entry *, struct internal_syment *, 395 bfd_vma *)); 396 397 bfd_boolean (*_bfd_coff_adjust_symndx) 398 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, 399 struct internal_reloc *, bfd_boolean *)); 400 401 bfd_boolean (*_bfd_coff_link_add_one_symbol) 402 PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, 403 asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, 404 struct bfd_link_hash_entry **)); 405 406 bfd_boolean (*_bfd_coff_link_output_has_begun) 407 PARAMS ((bfd *, struct coff_final_link_info *)); 408 409 bfd_boolean (*_bfd_coff_final_link_postscript) 410 PARAMS ((bfd *, struct coff_final_link_info *)); 411 412 } bfd_coff_backend_data; 413 414 #define coff_backend_info(abfd) \ 415 ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) 416 417 #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ 418 ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) 419 420 #define bfd_coff_swap_sym_in(a,e,i) \ 421 ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) 422 423 #define bfd_coff_swap_lineno_in(a,e,i) \ 424 ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) 425 426 #define bfd_coff_swap_reloc_out(abfd, i, o) \ 427 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) 428 429 #define bfd_coff_swap_lineno_out(abfd, i, o) \ 430 ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) 431 432 #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ 433 ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) 434 435 #define bfd_coff_swap_sym_out(abfd, i,o) \ 436 ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) 437 438 #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ 439 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) 440 441 #define bfd_coff_swap_filehdr_out(abfd, i,o) \ 442 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) 443 444 #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ 445 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) 446 447 #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) 448 #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) 449 #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) 450 #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) 451 #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) 452 #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) 453 #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) 454 #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) 455 #define bfd_coff_long_filenames(abfd) \ 456 (coff_backend_info (abfd)->_bfd_coff_long_filenames) 457 #define bfd_coff_long_section_names(abfd) \ 458 (coff_backend_info (abfd)->_bfd_coff_long_section_names) 459 #define bfd_coff_default_section_alignment_power(abfd) \ 460 (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) 461 #define bfd_coff_swap_filehdr_in(abfd, i,o) \ 462 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) 463 464 #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ 465 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) 466 467 #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ 468 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) 469 470 #define bfd_coff_swap_reloc_in(abfd, i, o) \ 471 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) 472 473 #define bfd_coff_bad_format_hook(abfd, filehdr) \ 474 ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) 475 476 #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ 477 ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) 478 #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ 479 ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ 480 (abfd, filehdr, aouthdr)) 481 482 #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ 483 ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ 484 (abfd, scnhdr, name, section, flags_ptr)) 485 486 #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ 487 ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) 488 489 #define bfd_coff_slurp_symbol_table(abfd)\ 490 ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) 491 492 #define bfd_coff_symname_in_debug(abfd, sym)\ 493 ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) 494 495 #define bfd_coff_force_symnames_in_strings(abfd)\ 496 (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) 497 498 #define bfd_coff_debug_string_prefix_length(abfd)\ 499 (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) 500 501 #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ 502 ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ 503 (abfd, file, base, symbol, aux, indaux)) 504 505 #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ 506 reloc, data, src_ptr, dst_ptr)\ 507 ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ 508 (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) 509 510 #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ 511 ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ 512 (abfd, section, reloc, shrink, link_info)) 513 514 #define bfd_coff_classify_symbol(abfd, sym)\ 515 ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ 516 (abfd, sym)) 517 518 #define bfd_coff_compute_section_file_positions(abfd)\ 519 ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ 520 (abfd)) 521 522 #define bfd_coff_start_final_link(obfd, info)\ 523 ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ 524 (obfd, info)) 525 #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ 526 ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ 527 (obfd, info, ibfd, o, con, rel, isyms, secs)) 528 #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ 529 ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ 530 (abfd, sec, rel, h, sym, addendp)) 531 #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ 532 ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ 533 (obfd, info, ibfd, sec, rel, adjustedp)) 534 #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ 535 value, string, cp, coll, hashp)\ 536 ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ 537 (info, abfd, name, flags, section, value, string, cp, coll, hashp)) 538 539 #define bfd_coff_link_output_has_begun(a,p) \ 540 ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) 541 #define bfd_coff_final_link_postscript(a,p) \ 542 ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) 543 544 Writing relocations 545 ................... 546 547 To write relocations, the back end steps though the canonical 548 relocation table and create an `internal_reloc'. The symbol index to 549 use is removed from the `offset' field in the symbol table supplied. 550 The address comes directly from the sum of the section base address and 551 the relocation offset; the type is dug directly from the howto field. 552 Then the `internal_reloc' is swapped into the shape of an 553 `external_reloc' and written out to disk. 554 555 Reading linenumbers 556 ................... 557 558 Creating the linenumber table is done by reading in the entire coff 559 linenumber table, and creating another table for internal use. 560 561 A coff linenumber table is structured so that each function is 562 marked as having a line number of 0. Each line within the function is 563 an offset from the first line in the function. The base of the line 564 number information for the table is stored in the symbol associated 565 with the function. 566 567 Note: The PE format uses line number 0 for a flag indicating a new 568 source file. 569 570 The information is copied from the external to the internal table, 571 and each symbol which marks a function is marked by pointing its... 572 573 How does this work ? 574 575 Reading relocations 576 ................... 577 578 Coff relocations are easily transformed into the internal BFD form 579 (`arelent'). 580 581 Reading a coff relocation table is done in the following stages: 582 583 * Read the entire coff relocation table into memory. 584 585 * Process each relocation in turn; first swap it from the external 586 to the internal form. 587 588 * Turn the symbol referenced in the relocation's symbol index into a 589 pointer into the canonical symbol table. This table is the same 590 as the one returned by a call to `bfd_canonicalize_symtab'. The 591 back end will call that routine and save the result if a 592 canonicalization hasn't been done. 593 594 * The reloc index is turned into a pointer to a howto structure, in 595 a back end specific way. For instance, the 386 and 960 use the 596 `r_type' to directly produce an index into a howto table vector; 597 the 88k subtracts a number from the `r_type' field and creates an 598 addend field. 599 600 601 File: bfd.info, Node: elf, Next: mmo, Prev: coff, Up: BFD back ends 602 603 604 605 ELF backends 606 607 BFD support for ELF formats is being worked on. Currently, the best 608 supported back ends are for sparc and i386 (running svr4 or Solaris 2). 609 610 Documentation of the internals of the support code still needs to be 611 written. The code is changing quickly enough that we haven't bothered 612 yet. 613 614 `bfd_elf_find_section' 615 ...................... 616 617 *Synopsis* 618 struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); 619 *Description* 620 Helper functions for GDB to locate the string tables. Since BFD hides 621 string tables from callers, GDB needs to use an internal hook to find 622 them. Sun's .stabstr, in particular, isn't even pointed to by the 623 .stab section, so ordinary mechanisms wouldn't work to find it, even if 624 we had some. 625 626 627 File: bfd.info, Node: mmo, Prev: elf, Up: BFD back ends 628 629 mmo backend 630 =========== 631 632 The mmo object format is used exclusively together with Professor 633 Donald E. Knuth's educational 64-bit processor MMIX. The simulator 634 `mmix' which is available at 635 <http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz> 636 understands this format. That package also includes a combined 637 assembler and linker called `mmixal'. The mmo format has no advantages 638 feature-wise compared to e.g. ELF. It is a simple non-relocatable 639 object format with no support for archives or debugging information, 640 except for symbol value information and line numbers (which is not yet 641 implemented in BFD). See 642 <http://www-cs-faculty.stanford.edu/~knuth/mmix.html> for more 643 information about MMIX. The ELF format is used for intermediate object 644 files in the BFD implementation. 23 645 24 646 * Menu: 25 647 26 * _bfd_final_link_relocate: Relocating the section contents. 27 * _bfd_generic_link_add_archive_symbols: Adding symbols from an archive. 28 * _bfd_generic_link_add_one_symbol: Adding symbols from an object file. 29 * _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table. 30 * _bfd_link_final_link in target vector: Performing the Final Link. 31 * _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table. 32 * _bfd_relocate_contents: Relocating the section contents. 33 * _bfd_strip_section_from_output: section prototypes. 34 * aout_SIZE_machine_type: aout. 35 * aout_SIZE_mkobject: aout. 36 * aout_SIZE_new_section_hook: aout. 37 * aout_SIZE_set_arch_mach: aout. 38 * aout_SIZE_some_aout_object_p: aout. 39 * aout_SIZE_swap_exec_header_in: aout. 40 * aout_SIZE_swap_exec_header_out: aout. 41 * arelent_chain: typedef arelent. 42 * BFD: Overview. 43 * BFD canonical format: Canonical format. 44 * bfd_alloc: Opening and Closing. 45 * bfd_arch_bits_per_address: Architectures. 46 * bfd_arch_bits_per_byte: Architectures. 47 * bfd_arch_get_compatible: Architectures. 48 * bfd_arch_list: Architectures. 49 * bfd_arch_mach_octets_per_byte: Architectures. 50 * bfd_cache_close: File Caching. 51 * bfd_cache_init: File Caching. 52 * bfd_cache_lookup: File Caching. 53 * bfd_cache_lookup_worker: File Caching. 54 * BFD_CACHE_MAX_OPEN macro: File Caching. 55 * bfd_canonicalize_reloc: BFD front end. 56 * bfd_canonicalize_symtab: symbol handling functions. 57 * bfd_check_format: Formats. 58 * bfd_check_format_matches: Formats. 59 * bfd_check_overflow: typedef arelent. 60 * bfd_close: Opening and Closing. 61 * bfd_close_all_done: Opening and Closing. 62 * bfd_coff_backend_data: coff. 63 * bfd_copy_private_bfd_data: BFD front end. 64 * bfd_copy_private_section_data: section prototypes. 65 * bfd_copy_private_symbol_data: symbol handling functions. 66 * bfd_core_file_failing_command: Core Files. 67 * bfd_core_file_failing_signal: Core Files. 68 * bfd_create: Opening and Closing. 69 * bfd_decode_symclass: symbol handling functions. 70 * bfd_default_arch_struct: Architectures. 71 * bfd_default_compatible: Architectures. 72 * bfd_default_reloc_type_lookup: howto manager. 73 * bfd_default_scan: Architectures. 74 * bfd_default_set_arch_mach: Architectures. 75 * bfd_elf_find_section: elf. 76 * bfd_errmsg: BFD front end. 77 * bfd_fdopenr: Opening and Closing. 78 * bfd_find_target: bfd_target. 79 * bfd_format_string: Formats. 80 * bfd_generic_gc_sections: howto manager. 81 * bfd_generic_get_relocated_section_contents: howto manager. 82 * bfd_generic_relax_section: howto manager. 83 * bfd_get_arch: Architectures. 84 * bfd_get_arch_info: Architectures. 85 * bfd_get_arch_size: BFD front end. 86 * bfd_get_error: BFD front end. 87 * bfd_get_error_handler: BFD front end. 88 * bfd_get_gp_size: BFD front end. 89 * bfd_get_mach: Architectures. 90 * bfd_get_mtime: BFD front end. 91 * bfd_get_next_mapent: Archives. 92 * bfd_get_reloc_code_name: howto manager. 93 * bfd_get_reloc_size: typedef arelent. 94 * bfd_get_reloc_upper_bound: BFD front end. 95 * bfd_get_section_by_name: section prototypes. 96 * bfd_get_section_contents: section prototypes. 97 * bfd_get_sign_extend_vma: BFD front end. 98 * bfd_get_size <1>: Internal. 99 * bfd_get_size: BFD front end. 100 * bfd_get_symtab_upper_bound: symbol handling functions. 101 * bfd_get_unique_section_name: section prototypes. 102 * bfd_h_put_size: Internal. 103 * bfd_hash_allocate: Creating and Freeing a Hash Table. 104 * bfd_hash_lookup: Looking Up or Entering a String. 105 * bfd_hash_newfunc: Creating and Freeing a Hash Table. 106 * bfd_hash_table_free: Creating and Freeing a Hash Table. 107 * bfd_hash_table_init: Creating and Freeing a Hash Table. 108 * bfd_hash_table_init_n: Creating and Freeing a Hash Table. 109 * bfd_hash_traverse: Traversing a Hash Table. 110 * bfd_init: Initialization. 111 * bfd_install_relocation: typedef arelent. 112 * bfd_is_local_label: symbol handling functions. 113 * bfd_is_local_label_name: symbol handling functions. 114 * bfd_is_undefined_symclass: symbol handling functions. 115 * bfd_last_cache: File Caching. 116 * bfd_link_split_section: Writing the symbol table. 117 * bfd_log2: Internal. 118 * bfd_lookup_arch: Architectures. 119 * bfd_make_debug_symbol: symbol handling functions. 120 * bfd_make_empty_symbol: symbol handling functions. 121 * bfd_make_readable: Opening and Closing. 122 * bfd_make_section: section prototypes. 123 * bfd_make_section_anyway: section prototypes. 124 * bfd_make_section_old_way: section prototypes. 125 * bfd_make_writable: Opening and Closing. 126 * bfd_map_over_sections: section prototypes. 127 * bfd_merge_private_bfd_data: BFD front end. 128 * bfd_octets_per_byte: Architectures. 129 * bfd_open_file: File Caching. 130 * bfd_openr: Opening and Closing. 131 * bfd_openr_next_archived_file: Archives. 132 * bfd_openstreamr: Opening and Closing. 133 * bfd_openw: Opening and Closing. 134 * bfd_perform_relocation: typedef arelent. 135 * bfd_perror: BFD front end. 136 * bfd_print_symbol_vandf: symbol handling functions. 137 * bfd_printable_arch_mach: Architectures. 138 * bfd_printable_name: Architectures. 139 * bfd_put_size: Internal. 140 * BFD_RELOC_12_PCREL: howto manager. 141 * BFD_RELOC_14: howto manager. 142 * BFD_RELOC_16: howto manager. 143 * BFD_RELOC_16_BASEREL: howto manager. 144 * BFD_RELOC_16_GOT_PCREL: howto manager. 145 * BFD_RELOC_16_GOTOFF: howto manager. 146 * BFD_RELOC_16_PCREL: howto manager. 147 * BFD_RELOC_16_PCREL_S2: howto manager. 148 * BFD_RELOC_16_PLT_PCREL: howto manager. 149 * BFD_RELOC_16_PLTOFF: howto manager. 150 * BFD_RELOC_23_PCREL_S2: howto manager. 151 * BFD_RELOC_24: howto manager. 152 * BFD_RELOC_24_PCREL: howto manager. 153 * BFD_RELOC_24_PLT_PCREL: howto manager. 154 * BFD_RELOC_26: howto manager. 155 * BFD_RELOC_32: howto manager. 156 * BFD_RELOC_32_BASEREL: howto manager. 157 * BFD_RELOC_32_GOT_PCREL: howto manager. 158 * BFD_RELOC_32_GOTOFF: howto manager. 159 * BFD_RELOC_32_PCREL: howto manager. 160 * BFD_RELOC_32_PCREL_S2: howto manager. 161 * BFD_RELOC_32_PLT_PCREL: howto manager. 162 * BFD_RELOC_32_PLTOFF: howto manager. 163 * BFD_RELOC_386_COPY: howto manager. 164 * BFD_RELOC_386_GLOB_DAT: howto manager. 165 * BFD_RELOC_386_GOT32: howto manager. 166 * BFD_RELOC_386_GOTOFF: howto manager. 167 * BFD_RELOC_386_GOTPC: howto manager. 168 * BFD_RELOC_386_JUMP_SLOT: howto manager. 169 * BFD_RELOC_386_PLT32: howto manager. 170 * BFD_RELOC_386_RELATIVE: howto manager. 171 * BFD_RELOC_64: howto manager. 172 * BFD_RELOC_64_PCREL: howto manager. 173 * BFD_RELOC_68K_GLOB_DAT: howto manager. 174 * BFD_RELOC_68K_JMP_SLOT: howto manager. 175 * BFD_RELOC_68K_RELATIVE: howto manager. 176 * BFD_RELOC_8: howto manager. 177 * BFD_RELOC_860_COPY: howto manager. 178 * BFD_RELOC_860_GLOB_DAT: howto manager. 179 * BFD_RELOC_860_HAGOT: howto manager. 180 * BFD_RELOC_860_HAGOTOFF: howto manager. 181 * BFD_RELOC_860_HAPC: howto manager. 182 * BFD_RELOC_860_HIGH: howto manager. 183 * BFD_RELOC_860_HIGHADJ: howto manager. 184 * BFD_RELOC_860_HIGOT: howto manager. 185 * BFD_RELOC_860_HIGOTOFF: howto manager. 186 * BFD_RELOC_860_JUMP_SLOT: howto manager. 187 * BFD_RELOC_860_LOGOT0: howto manager. 188 * BFD_RELOC_860_LOGOT1: howto manager. 189 * BFD_RELOC_860_LOGOTOFF0: howto manager. 190 * BFD_RELOC_860_LOGOTOFF1: howto manager. 191 * BFD_RELOC_860_LOGOTOFF2: howto manager. 192 * BFD_RELOC_860_LOGOTOFF3: howto manager. 193 * BFD_RELOC_860_LOPC: howto manager. 194 * BFD_RELOC_860_LOW0: howto manager. 195 * BFD_RELOC_860_LOW1: howto manager. 196 * BFD_RELOC_860_LOW2: howto manager. 197 * BFD_RELOC_860_LOW3: howto manager. 198 * BFD_RELOC_860_PC16: howto manager. 199 * BFD_RELOC_860_PC26: howto manager. 200 * BFD_RELOC_860_PLT26: howto manager. 201 * BFD_RELOC_860_RELATIVE: howto manager. 202 * BFD_RELOC_860_SPGOT0: howto manager. 203 * BFD_RELOC_860_SPGOT1: howto manager. 204 * BFD_RELOC_860_SPGOTOFF0: howto manager. 205 * BFD_RELOC_860_SPGOTOFF1: howto manager. 206 * BFD_RELOC_860_SPLIT0: howto manager. 207 * BFD_RELOC_860_SPLIT1: howto manager. 208 * BFD_RELOC_860_SPLIT2: howto manager. 209 * BFD_RELOC_8_BASEREL: howto manager. 210 * BFD_RELOC_8_FFnn: howto manager. 211 * BFD_RELOC_8_GOT_PCREL: howto manager. 212 * BFD_RELOC_8_GOTOFF: howto manager. 213 * BFD_RELOC_8_PCREL: howto manager. 214 * BFD_RELOC_8_PLT_PCREL: howto manager. 215 * BFD_RELOC_8_PLTOFF: howto manager. 216 * BFD_RELOC_ALPHA_CODEADDR: howto manager. 217 * BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. 218 * BFD_RELOC_ALPHA_GPDISP: howto manager. 219 * BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. 220 * BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. 221 * BFD_RELOC_ALPHA_HINT: howto manager. 222 * BFD_RELOC_ALPHA_LINKAGE: howto manager. 223 * BFD_RELOC_ALPHA_LITERAL: howto manager. 224 * BFD_RELOC_ALPHA_LITUSE: howto manager. 225 * BFD_RELOC_ALPHA_USER_GPDISP: howto manager. 226 * BFD_RELOC_ALPHA_USER_GPRELHIGH: howto manager. 227 * BFD_RELOC_ALPHA_USER_GPRELLOW: howto manager. 228 * BFD_RELOC_ALPHA_USER_LITERAL: howto manager. 229 * BFD_RELOC_ALPHA_USER_LITUSE_BASE: howto manager. 230 * BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF: howto manager. 231 * BFD_RELOC_ALPHA_USER_LITUSE_JSR: howto manager. 232 * BFD_RELOC_ARC_B22_PCREL: howto manager. 233 * BFD_RELOC_ARC_B26: howto manager. 234 * BFD_RELOC_ARM_ADR_IMM: howto manager. 235 * BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. 236 * BFD_RELOC_ARM_COPY: howto manager. 237 * BFD_RELOC_ARM_CP_OFF_IMM: howto manager. 238 * BFD_RELOC_ARM_GLOB_DAT: howto manager. 239 * BFD_RELOC_ARM_GOT12: howto manager. 240 * BFD_RELOC_ARM_GOT32: howto manager. 241 * BFD_RELOC_ARM_GOTOFF: howto manager. 242 * BFD_RELOC_ARM_GOTPC: howto manager. 243 * BFD_RELOC_ARM_HWLITERAL: howto manager. 244 * BFD_RELOC_ARM_IMMEDIATE: howto manager. 245 * BFD_RELOC_ARM_IN_POOL: howto manager. 246 * BFD_RELOC_ARM_JUMP_SLOT: howto manager. 247 * BFD_RELOC_ARM_LDR_IMM: howto manager. 248 * BFD_RELOC_ARM_LITERAL: howto manager. 249 * BFD_RELOC_ARM_MULTI: howto manager. 250 * BFD_RELOC_ARM_OFFSET_IMM: howto manager. 251 * BFD_RELOC_ARM_OFFSET_IMM8: howto manager. 252 * BFD_RELOC_ARM_PCREL_BLX: howto manager. 253 * BFD_RELOC_ARM_PCREL_BRANCH: howto manager. 254 * BFD_RELOC_ARM_PLT32: howto manager. 255 * BFD_RELOC_ARM_RELATIVE: howto manager. 256 * BFD_RELOC_ARM_SHIFT_IMM: howto manager. 257 * BFD_RELOC_ARM_SWI: howto manager. 258 * BFD_RELOC_ARM_THUMB_ADD: howto manager. 259 * BFD_RELOC_ARM_THUMB_IMM: howto manager. 260 * BFD_RELOC_ARM_THUMB_OFFSET: howto manager. 261 * BFD_RELOC_ARM_THUMB_SHIFT: howto manager. 262 * BFD_RELOC_AVR_13_PCREL: howto manager. 263 * BFD_RELOC_AVR_16_PM: howto manager. 264 * BFD_RELOC_AVR_7_PCREL: howto manager. 265 * BFD_RELOC_AVR_CALL: howto manager. 266 * BFD_RELOC_AVR_HH8_LDI: howto manager. 267 * BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. 268 * BFD_RELOC_AVR_HH8_LDI_PM: howto manager. 269 * BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. 270 * BFD_RELOC_AVR_HI8_LDI: howto manager. 271 * BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. 272 * BFD_RELOC_AVR_HI8_LDI_PM: howto manager. 273 * BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. 274 * BFD_RELOC_AVR_LO8_LDI: howto manager. 275 * BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. 276 * BFD_RELOC_AVR_LO8_LDI_PM: howto manager. 277 * BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. 278 * bfd_reloc_code_type: howto manager. 279 * BFD_RELOC_CRIS_BDISP8: howto manager. 280 * BFD_RELOC_CRIS_SIGNED_6: howto manager. 281 * BFD_RELOC_CRIS_UNSIGNED_4: howto manager. 282 * BFD_RELOC_CRIS_UNSIGNED_5: howto manager. 283 * BFD_RELOC_CRIS_UNSIGNED_6: howto manager. 284 * BFD_RELOC_CTOR: howto manager. 285 * BFD_RELOC_D10V_10_PCREL_L: howto manager. 286 * BFD_RELOC_D10V_10_PCREL_R: howto manager. 287 * BFD_RELOC_D10V_18: howto manager. 288 * BFD_RELOC_D10V_18_PCREL: howto manager. 289 * BFD_RELOC_D30V_15: howto manager. 290 * BFD_RELOC_D30V_15_PCREL: howto manager. 291 * BFD_RELOC_D30V_15_PCREL_R: howto manager. 292 * BFD_RELOC_D30V_21: howto manager. 293 * BFD_RELOC_D30V_21_PCREL: howto manager. 294 * BFD_RELOC_D30V_21_PCREL_R: howto manager. 295 * BFD_RELOC_D30V_32: howto manager. 296 * BFD_RELOC_D30V_32_PCREL: howto manager. 297 * BFD_RELOC_D30V_6: howto manager. 298 * BFD_RELOC_D30V_9_PCREL: howto manager. 299 * BFD_RELOC_D30V_9_PCREL_R: howto manager. 300 * BFD_RELOC_FR30_10_IN_8: howto manager. 301 * BFD_RELOC_FR30_12_PCREL: howto manager. 302 * BFD_RELOC_FR30_20: howto manager. 303 * BFD_RELOC_FR30_48: howto manager. 304 * BFD_RELOC_FR30_6_IN_4: howto manager. 305 * BFD_RELOC_FR30_8_IN_8: howto manager. 306 * BFD_RELOC_FR30_9_IN_8: howto manager. 307 * BFD_RELOC_FR30_9_PCREL: howto manager. 308 * BFD_RELOC_GPREL16: howto manager. 309 * BFD_RELOC_GPREL32: howto manager. 310 * BFD_RELOC_HI16: howto manager. 311 * BFD_RELOC_HI16_BASEREL: howto manager. 312 * BFD_RELOC_HI16_GOTOFF: howto manager. 313 * BFD_RELOC_HI16_PLTOFF: howto manager. 314 * BFD_RELOC_HI16_S: howto manager. 315 * BFD_RELOC_HI16_S_BASEREL: howto manager. 316 * BFD_RELOC_HI16_S_GOTOFF: howto manager. 317 * BFD_RELOC_HI16_S_PLTOFF: howto manager. 318 * BFD_RELOC_HI22: howto manager. 319 * BFD_RELOC_I370_D12: howto manager. 320 * BFD_RELOC_I960_CALLJ: howto manager. 321 * BFD_RELOC_IA64_COPY: howto manager. 322 * BFD_RELOC_IA64_DIR32LSB: howto manager. 323 * BFD_RELOC_IA64_DIR32MSB: howto manager. 324 * BFD_RELOC_IA64_DIR64LSB: howto manager. 325 * BFD_RELOC_IA64_DIR64MSB: howto manager. 326 * BFD_RELOC_IA64_FPTR32LSB: howto manager. 327 * BFD_RELOC_IA64_FPTR32MSB: howto manager. 328 * BFD_RELOC_IA64_FPTR64I: howto manager. 329 * BFD_RELOC_IA64_FPTR64LSB: howto manager. 330 * BFD_RELOC_IA64_FPTR64MSB: howto manager. 331 * BFD_RELOC_IA64_GPREL22: howto manager. 332 * BFD_RELOC_IA64_GPREL32LSB: howto manager. 333 * BFD_RELOC_IA64_GPREL32MSB: howto manager. 334 * BFD_RELOC_IA64_GPREL64I: howto manager. 335 * BFD_RELOC_IA64_GPREL64LSB: howto manager. 336 * BFD_RELOC_IA64_GPREL64MSB: howto manager. 337 * BFD_RELOC_IA64_IMM14: howto manager. 338 * BFD_RELOC_IA64_IMM22: howto manager. 339 * BFD_RELOC_IA64_IMM64: howto manager. 340 * BFD_RELOC_IA64_IPLTLSB: howto manager. 341 * BFD_RELOC_IA64_IPLTMSB: howto manager. 342 * BFD_RELOC_IA64_LDXMOV: howto manager. 343 * BFD_RELOC_IA64_LTOFF22: howto manager. 344 * BFD_RELOC_IA64_LTOFF22X: howto manager. 345 * BFD_RELOC_IA64_LTOFF64I: howto manager. 346 * BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. 347 * BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. 348 * BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. 349 * BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. 350 * BFD_RELOC_IA64_LTOFF_TP22: howto manager. 351 * BFD_RELOC_IA64_LTV32LSB: howto manager. 352 * BFD_RELOC_IA64_LTV32MSB: howto manager. 353 * BFD_RELOC_IA64_LTV64LSB: howto manager. 354 * BFD_RELOC_IA64_LTV64MSB: howto manager. 355 * BFD_RELOC_IA64_PCREL21B: howto manager. 356 * BFD_RELOC_IA64_PCREL21BI: howto manager. 357 * BFD_RELOC_IA64_PCREL21F: howto manager. 358 * BFD_RELOC_IA64_PCREL21M: howto manager. 359 * BFD_RELOC_IA64_PCREL22: howto manager. 360 * BFD_RELOC_IA64_PCREL32LSB: howto manager. 361 * BFD_RELOC_IA64_PCREL32MSB: howto manager. 362 * BFD_RELOC_IA64_PCREL60B: howto manager. 363 * BFD_RELOC_IA64_PCREL64I: howto manager. 364 * BFD_RELOC_IA64_PCREL64LSB: howto manager. 365 * BFD_RELOC_IA64_PCREL64MSB: howto manager. 366 * BFD_RELOC_IA64_PLTOFF22: howto manager. 367 * BFD_RELOC_IA64_PLTOFF64I: howto manager. 368 * BFD_RELOC_IA64_PLTOFF64LSB: howto manager. 369 * BFD_RELOC_IA64_PLTOFF64MSB: howto manager. 370 * BFD_RELOC_IA64_REL32LSB: howto manager. 371 * BFD_RELOC_IA64_REL32MSB: howto manager. 372 * BFD_RELOC_IA64_REL64LSB: howto manager. 373 * BFD_RELOC_IA64_REL64MSB: howto manager. 374 * BFD_RELOC_IA64_SECREL32LSB: howto manager. 375 * BFD_RELOC_IA64_SECREL32MSB: howto manager. 376 * BFD_RELOC_IA64_SECREL64LSB: howto manager. 377 * BFD_RELOC_IA64_SECREL64MSB: howto manager. 378 * BFD_RELOC_IA64_SEGREL32LSB: howto manager. 379 * BFD_RELOC_IA64_SEGREL32MSB: howto manager. 380 * BFD_RELOC_IA64_SEGREL64LSB: howto manager. 381 * BFD_RELOC_IA64_SEGREL64MSB: howto manager. 382 * BFD_RELOC_IA64_TPREL22: howto manager. 383 * BFD_RELOC_IA64_TPREL64LSB: howto manager. 384 * BFD_RELOC_IA64_TPREL64MSB: howto manager. 385 * BFD_RELOC_LO10: howto manager. 386 * BFD_RELOC_LO16: howto manager. 387 * BFD_RELOC_LO16_BASEREL: howto manager. 388 * BFD_RELOC_LO16_GOTOFF: howto manager. 389 * BFD_RELOC_LO16_PLTOFF: howto manager. 390 * BFD_RELOC_M32R_10_PCREL: howto manager. 391 * BFD_RELOC_M32R_18_PCREL: howto manager. 392 * BFD_RELOC_M32R_24: howto manager. 393 * BFD_RELOC_M32R_26_PCREL: howto manager. 394 * BFD_RELOC_M32R_HI16_SLO: howto manager. 395 * BFD_RELOC_M32R_HI16_ULO: howto manager. 396 * BFD_RELOC_M32R_LO16: howto manager. 397 * BFD_RELOC_M32R_SDA16: howto manager. 398 * BFD_RELOC_M68HC11_3B: howto manager. 399 * BFD_RELOC_M68HC11_HI8: howto manager. 400 * BFD_RELOC_M68HC11_LO8: howto manager. 401 * BFD_RELOC_MCORE_PCREL_32: howto manager. 402 * BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. 403 * BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. 404 * BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. 405 * BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. 406 * BFD_RELOC_MCORE_RVA: howto manager. 407 * BFD_RELOC_MIPS16_GPREL: howto manager. 408 * BFD_RELOC_MIPS16_JMP: howto manager. 409 * BFD_RELOC_MIPS_CALL16: howto manager. 410 * BFD_RELOC_MIPS_CALL_HI16: howto manager. 411 * BFD_RELOC_MIPS_CALL_LO16: howto manager. 412 * BFD_RELOC_MIPS_DELETE: howto manager. 413 * BFD_RELOC_MIPS_GOT16: howto manager. 414 * BFD_RELOC_MIPS_GOT_DISP: howto manager. 415 * BFD_RELOC_MIPS_GOT_HI16: howto manager. 416 * BFD_RELOC_MIPS_GOT_LO16: howto manager. 417 * BFD_RELOC_MIPS_GOT_OFST: howto manager. 418 * BFD_RELOC_MIPS_GOT_PAGE: howto manager. 419 * BFD_RELOC_MIPS_GPREL: howto manager. 420 * BFD_RELOC_MIPS_GPREL32: howto manager. 421 * BFD_RELOC_MIPS_HIGHER: howto manager. 422 * BFD_RELOC_MIPS_HIGHEST: howto manager. 423 * BFD_RELOC_MIPS_INSERT_A: howto manager. 424 * BFD_RELOC_MIPS_INSERT_B: howto manager. 425 * BFD_RELOC_MIPS_JALR: howto manager. 426 * BFD_RELOC_MIPS_JMP: howto manager. 427 * BFD_RELOC_MIPS_LITERAL: howto manager. 428 * BFD_RELOC_MIPS_REL16: howto manager. 429 * BFD_RELOC_MIPS_RELGOT: howto manager. 430 * BFD_RELOC_MIPS_SCN_DISP: howto manager. 431 * BFD_RELOC_MIPS_SHIFT5: howto manager. 432 * BFD_RELOC_MIPS_SHIFT6: howto manager. 433 * BFD_RELOC_MIPS_SUB: howto manager. 434 * BFD_RELOC_MN10300_16_PCREL: howto manager. 435 * BFD_RELOC_MN10300_32_PCREL: howto manager. 436 * BFD_RELOC_NONE: howto manager. 437 * BFD_RELOC_NS32K_DISP_16: howto manager. 438 * BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. 439 * BFD_RELOC_NS32K_DISP_32: howto manager. 440 * BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. 441 * BFD_RELOC_NS32K_DISP_8: howto manager. 442 * BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. 443 * BFD_RELOC_NS32K_IMM_16: howto manager. 444 * BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. 445 * BFD_RELOC_NS32K_IMM_32: howto manager. 446 * BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. 447 * BFD_RELOC_NS32K_IMM_8: howto manager. 448 * BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. 449 * BFD_RELOC_PCREL_HI16_S: howto manager. 450 * BFD_RELOC_PCREL_LO16: howto manager. 451 * BFD_RELOC_PJ_CODE_DIR16: howto manager. 452 * BFD_RELOC_PJ_CODE_DIR32: howto manager. 453 * BFD_RELOC_PJ_CODE_HI16: howto manager. 454 * BFD_RELOC_PJ_CODE_LO16: howto manager. 455 * BFD_RELOC_PJ_CODE_REL16: howto manager. 456 * BFD_RELOC_PJ_CODE_REL32: howto manager. 457 * BFD_RELOC_PPC_B16: howto manager. 458 * BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. 459 * BFD_RELOC_PPC_B16_BRTAKEN: howto manager. 460 * BFD_RELOC_PPC_B26: howto manager. 461 * BFD_RELOC_PPC_BA16: howto manager. 462 * BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. 463 * BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. 464 * BFD_RELOC_PPC_BA26: howto manager. 465 * BFD_RELOC_PPC_COPY: howto manager. 466 * BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. 467 * BFD_RELOC_PPC_EMB_MRKREF: howto manager. 468 * BFD_RELOC_PPC_EMB_NADDR16: howto manager. 469 * BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. 470 * BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. 471 * BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. 472 * BFD_RELOC_PPC_EMB_NADDR32: howto manager. 473 * BFD_RELOC_PPC_EMB_RELSDA: howto manager. 474 * BFD_RELOC_PPC_EMB_RELSEC16: howto manager. 475 * BFD_RELOC_PPC_EMB_RELST_HA: howto manager. 476 * BFD_RELOC_PPC_EMB_RELST_HI: howto manager. 477 * BFD_RELOC_PPC_EMB_RELST_LO: howto manager. 478 * BFD_RELOC_PPC_EMB_SDA21: howto manager. 479 * BFD_RELOC_PPC_EMB_SDA2I16: howto manager. 480 * BFD_RELOC_PPC_EMB_SDA2REL: howto manager. 481 * BFD_RELOC_PPC_EMB_SDAI16: howto manager. 482 * BFD_RELOC_PPC_GLOB_DAT: howto manager. 483 * BFD_RELOC_PPC_JMP_SLOT: howto manager. 484 * BFD_RELOC_PPC_LOCAL24PC: howto manager. 485 * BFD_RELOC_PPC_RELATIVE: howto manager. 486 * BFD_RELOC_PPC_TOC16: howto manager. 487 * BFD_RELOC_RVA: howto manager. 488 * BFD_RELOC_SH_ALIGN: howto manager. 489 * BFD_RELOC_SH_CODE: howto manager. 490 * BFD_RELOC_SH_COPY: howto manager. 491 * BFD_RELOC_SH_COUNT: howto manager. 492 * BFD_RELOC_SH_DATA: howto manager. 493 * BFD_RELOC_SH_GLOB_DAT: howto manager. 494 * BFD_RELOC_SH_GOTPC: howto manager. 495 * BFD_RELOC_SH_IMM4: howto manager. 496 * BFD_RELOC_SH_IMM4BY2: howto manager. 497 * BFD_RELOC_SH_IMM4BY4: howto manager. 498 * BFD_RELOC_SH_IMM8: howto manager. 499 * BFD_RELOC_SH_IMM8BY2: howto manager. 500 * BFD_RELOC_SH_IMM8BY4: howto manager. 501 * BFD_RELOC_SH_JMP_SLOT: howto manager. 502 * BFD_RELOC_SH_LABEL: howto manager. 503 * BFD_RELOC_SH_LOOP_END: howto manager. 504 * BFD_RELOC_SH_LOOP_START: howto manager. 505 * BFD_RELOC_SH_PCDISP12BY2: howto manager. 506 * BFD_RELOC_SH_PCDISP8BY2: howto manager. 507 * BFD_RELOC_SH_PCRELIMM8BY2: howto manager. 508 * BFD_RELOC_SH_PCRELIMM8BY4: howto manager. 509 * BFD_RELOC_SH_RELATIVE: howto manager. 510 * BFD_RELOC_SH_SWITCH16: howto manager. 511 * BFD_RELOC_SH_SWITCH32: howto manager. 512 * BFD_RELOC_SH_USES: howto manager. 513 * BFD_RELOC_SPARC13: howto manager. 514 * BFD_RELOC_SPARC22: howto manager. 515 * BFD_RELOC_SPARC_10: howto manager. 516 * BFD_RELOC_SPARC_11: howto manager. 517 * BFD_RELOC_SPARC_5: howto manager. 518 * BFD_RELOC_SPARC_6: howto manager. 519 * BFD_RELOC_SPARC_64: howto manager. 520 * BFD_RELOC_SPARC_7: howto manager. 521 * BFD_RELOC_SPARC_BASE13: howto manager. 522 * BFD_RELOC_SPARC_BASE22: howto manager. 523 * BFD_RELOC_SPARC_COPY: howto manager. 524 * BFD_RELOC_SPARC_DISP64: howto manager. 525 * BFD_RELOC_SPARC_GLOB_DAT: howto manager. 526 * BFD_RELOC_SPARC_GOT10: howto manager. 527 * BFD_RELOC_SPARC_GOT13: howto manager. 528 * BFD_RELOC_SPARC_GOT22: howto manager. 529 * BFD_RELOC_SPARC_H44: howto manager. 530 * BFD_RELOC_SPARC_HH22: howto manager. 531 * BFD_RELOC_SPARC_HIX22: howto manager. 532 * BFD_RELOC_SPARC_HM10: howto manager. 533 * BFD_RELOC_SPARC_JMP_SLOT: howto manager. 534 * BFD_RELOC_SPARC_L44: howto manager. 535 * BFD_RELOC_SPARC_LM22: howto manager. 536 * BFD_RELOC_SPARC_LOX10: howto manager. 537 * BFD_RELOC_SPARC_M44: howto manager. 538 * BFD_RELOC_SPARC_OLO10: howto manager. 539 * BFD_RELOC_SPARC_PC10: howto manager. 540 * BFD_RELOC_SPARC_PC22: howto manager. 541 * BFD_RELOC_SPARC_PC_HH22: howto manager. 542 * BFD_RELOC_SPARC_PC_HM10: howto manager. 543 * BFD_RELOC_SPARC_PC_LM22: howto manager. 544 * BFD_RELOC_SPARC_PLT64: howto manager. 545 * BFD_RELOC_SPARC_REGISTER: howto manager. 546 * BFD_RELOC_SPARC_RELATIVE: howto manager. 547 * BFD_RELOC_SPARC_REV32: howto manager. 548 * BFD_RELOC_SPARC_UA16: howto manager. 549 * BFD_RELOC_SPARC_UA32: howto manager. 550 * BFD_RELOC_SPARC_UA64: howto manager. 551 * BFD_RELOC_SPARC_WDISP16: howto manager. 552 * BFD_RELOC_SPARC_WDISP19: howto manager. 553 * BFD_RELOC_SPARC_WDISP22: howto manager. 554 * BFD_RELOC_SPARC_WPLT30: howto manager. 555 * BFD_RELOC_THUMB_PCREL_BLX: howto manager. 556 * BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. 557 * BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. 558 * BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. 559 * BFD_RELOC_TIC30_LDP: howto manager. 560 * BFD_RELOC_TIC54X_16_OF_23: howto manager. 561 * BFD_RELOC_TIC54X_23: howto manager. 562 * BFD_RELOC_TIC54X_MS7_OF_23: howto manager. 563 * BFD_RELOC_TIC54X_PARTLS7: howto manager. 564 * BFD_RELOC_TIC54X_PARTMS9: howto manager. 565 * bfd_reloc_type_lookup: howto manager. 566 * BFD_RELOC_V850_22_PCREL: howto manager. 567 * BFD_RELOC_V850_9_PCREL: howto manager. 568 * BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. 569 * BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. 570 * BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. 571 * BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. 572 * BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. 573 * BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. 574 * BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. 575 * BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. 576 * BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. 577 * BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. 578 * BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. 579 * BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. 580 * BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. 581 * BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. 582 * BFD_RELOC_VTABLE_ENTRY: howto manager. 583 * BFD_RELOC_VTABLE_INHERIT: howto manager. 584 * BFD_RELOC_X86_64_32S: howto manager. 585 * BFD_RELOC_X86_64_COPY: howto manager. 586 * BFD_RELOC_X86_64_GLOB_DAT: howto manager. 587 * BFD_RELOC_X86_64_GOT32: howto manager. 588 * BFD_RELOC_X86_64_GOTPCREL: howto manager. 589 * BFD_RELOC_X86_64_JUMP_SLOT: howto manager. 590 * BFD_RELOC_X86_64_PLT32: howto manager. 591 * BFD_RELOC_X86_64_RELATIVE: howto manager. 592 * bfd_scan_arch: Architectures. 593 * bfd_scan_vma: BFD front end. 594 * bfd_seach_for_target: bfd_target. 595 * bfd_set_arch_info: Architectures. 596 * bfd_set_archive_head: Archives. 597 * bfd_set_default_target: bfd_target. 598 * bfd_set_error: BFD front end. 599 * bfd_set_error_handler: BFD front end. 600 * bfd_set_error_program_name: BFD front end. 601 * bfd_set_file_flags: BFD front end. 602 * bfd_set_format: Formats. 603 * bfd_set_gp_size: BFD front end. 604 * bfd_set_private_flags: BFD front end. 605 * bfd_set_reloc: BFD front end. 606 * bfd_set_section_contents: section prototypes. 607 * bfd_set_section_flags: section prototypes. 608 * bfd_set_section_size: section prototypes. 609 * bfd_set_start_address: BFD front end. 610 * bfd_set_symtab: symbol handling functions. 611 * bfd_symbol_info: symbol handling functions. 612 * bfd_target_list: bfd_target. 613 * bfd_write_bigendian_4byte_int: Internal. 614 * coff_symbol_type: coff. 615 * core_file_matches_executable_p: Core Files. 616 * GNU Free Documentation License: GNU Free Documentation License. 617 * Hash tables: Hash Tables. 618 * internal object-file format: Canonical format. 619 * Linker: Linker Functions. 620 * stuff: BFD front end. 621 * target vector (_bfd_final_link): Performing the Final Link. 622 * target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. 623 * target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table. 624 * The HOWTO Macro: typedef arelent. 625 * what is it?: Overview. 626 627 648 * File layout:: 649 * Symbol-table:: 650 * mmo section mapping:: 651 652 653 File: bfd.info, Node: File layout, Next: Symbol-table, Prev: mmo, Up: mmo 654 655 File layout 656 ----------- 657 658 The mmo file contents is not partitioned into named sections as with 659 e.g. ELF. Memory areas is formed by specifying the location of the 660 data that follows. Only the memory area `0x0000...00' to `0x01ff...ff' 661 is executable, so it is used for code (and constants) and the area 662 `0x2000...00' to `0x20ff...ff' is used for writable data. *Note mmo 663 section mapping::. 664 665 Contents is entered as 32-bit words, xor:ed over previous contents, 666 always zero-initialized. A word that starts with the byte `0x98' forms 667 a command called a `lopcode', where the next byte distinguished between 668 the thirteen lopcodes. The two remaining bytes, called the `Y' and `Z' 669 fields, or the `YZ' field (a 16-bit big-endian number), are used for 670 various purposes different for each lopcode. As documented in 671 <http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz>, the 672 lopcodes are: 673 674 There is provision for specifying "special data" of 65536 different 675 types. We use type 80 (decimal), arbitrarily chosen the same as the 676 ELF `e_machine' number for MMIX, filling it with section information 677 normally found in ELF objects. *Note mmo section mapping::. 678 679 `lop_quote' 680 0x98000001. The next word is contents, regardless of whether it 681 starts with 0x98 or not. 682 683 `lop_loc' 684 0x9801YYZZ, where `Z' is 1 or 2. This is a location directive, 685 setting the location for the next data to the next 32-bit word 686 (for Z = 1) or 64-bit word (for Z = 2), plus Y * 2^56. Normally 687 `Y' is 0 for the text segment and 2 for the data segment. 688 689 `lop_skip' 690 0x9802YYZZ. Increase the current location by `YZ' bytes. 691 692 `lop_fixo' 693 0x9803YYZZ, where `Z' is 1 or 2. Store the current location as 64 694 bits into the location pointed to by the next 32-bit (Z = 1) or 695 64-bit (Z = 2) word, plus Y * 2^56. 696 697 `lop_fixr' 698 0x9804YYZZ. `YZ' is stored into the current location plus 2 - 4 * 699 YZ. 700 701 `lop_fixrx' 702 0x980500ZZ. `Z' is 16 or 24. A value `L' derived from the 703 following 32-bit word are used in a manner similar to `YZ' in 704 lop_fixr: it is xor:ed into the current location minus 4 * L. The 705 first byte of the word is 0 or 1. If it is 1, then L = (LOWEST 24 706 BITS OF WORD) - 2^Z, if 0, then L = (LOWEST 24 BITS OF WORD). 707 708 `lop_file' 709 0x9806YYZZ. `Y' is the file number, `Z' is count of 32-bit words. 710 Set the file number to `Y' and the line counter to 0. The next Z 711 * 4 bytes contain the file name, padded with zeros if the count is 712 not a multiple of four. The same `Y' may occur multiple times, 713 but `Z' must be 0 for all but the first occurrence. 714 715 `lop_line' 716 0x9807YYZZ. `YZ' is the line number. Together with lop_file, it 717 forms the source location for the next 32-bit word. Note that for 718 each non-lopcode 32-bit word, line numbers are assumed incremented 719 by one. 720 721 `lop_spec' 722 0x9808YYZZ. `YZ' is the type number. Data until the next lopcode 723 other than lop_quote forms special data of type `YZ'. *Note mmo 724 section mapping::. 725 726 Other types than 80, (or type 80 with a content that does not 727 parse) is stored in sections named `.MMIX.spec_data.N' where N is 728 the `YZ'-type. The flags for such a sections say not to allocate 729 or load the data. The vma is 0. Contents of multiple occurrences 730 of special data N is concatenated to the data of the previous 731 lop_spec Ns. The location in data or code at which the lop_spec 732 occurred is lost. 733 734 `lop_pre' 735 0x980901ZZ. The first lopcode in a file. The `Z' field forms the 736 length of header information in 32-bit words, where the first word 737 tells the time in seconds since `00:00:00 GMT Jan 1 1970'. 738 739 `lop_post' 740 0x980a00ZZ. Z > 32. This lopcode follows after all 741 content-generating lopcodes in a program. The `Z' field denotes 742 the value of `rG' at the beginning of the program. The following 743 256 - Z big-endian 64-bit words are loaded into global registers 744 `$G' ... `$255'. 745 746 `lop_stab' 747 0x980b0000. The next-to-last lopcode in a program. Must follow 748 immediately after the lop_post lopcode and its data. After this 749 lopcode follows all symbols in a compressed format (*note 750 Symbol-table::). 751 752 `lop_end' 753 0x980cYYZZ. The last lopcode in a program. It must follow the 754 lop_stab lopcode and its data. The `YZ' field contains the number 755 of 32-bit words of symbol table information after the preceding 756 lop_stab lopcode. 757 758 Note that the lopcode "fixups"; `lop_fixr', `lop_fixrx' and 759 `lop_fixo' are not generated by BFD, but are handled. They are 760 generated by `mmixal'. 761 762 This trivial one-label, one-instruction file: 763 764 :Main TRAP 1,2,3 765 766 can be represented this way in mmo: 767 768 0x98090101 - lop_pre, one 32-bit word with timestamp. 769 <timestamp> 770 0x98010002 - lop_loc, text segment, using a 64-bit address. 771 Note that mmixal does not emit this for the file above. 772 0x00000000 - Address, high 32 bits. 773 0x00000000 - Address, low 32 bits. 774 0x98060002 - lop_file, 2 32-bit words for file-name. 775 0x74657374 - "test" 776 0x2e730000 - ".s\0\0" 777 0x98070001 - lop_line, line 1. 778 0x00010203 - TRAP 1,2,3 779 0x980a00ff - lop_post, setting $255 to 0. 780 0x00000000 781 0x00000000 782 0x980b0000 - lop_stab for ":Main" = 0, serial 1. 783 0x203a4040 *Note Symbol-table::. 784 0x10404020 785 0x4d206120 786 0x69016e00 787 0x81000000 788 0x980c0005 - lop_end; symbol table contained five 32-bit words. 789 790 791 File: bfd.info, Node: Symbol-table, Next: mmo section mapping, Prev: File layout, Up: mmo 792 793 Symbol table format 794 ------------------- 795 796 From mmixal.w (or really, the generated mmixal.tex) in 797 <http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz>): 798 "Symbols are stored and retrieved by means of a `ternary search trie', 799 following ideas of Bentley and Sedgewick. (See ACM-SIAM Symp. on 800 Discrete Algorithms `8' (1997), 360-369; R.Sedgewick, `Algorithms in C' 801 (Reading, Mass. Addison-Wesley, 1998), `15.4'.) Each trie node stores 802 a character, and there are branches to subtries for the cases where a 803 given character is less than, equal to, or greater than the character 804 in the trie. There also is a pointer to a symbol table entry if a 805 symbol ends at the current node." 806 807 So it's a tree encoded as a stream of bytes. The stream of bytes 808 acts on a single virtual global symbol, adding and removing characters 809 and signalling complete symbol points. Here, we read the stream and 810 create symbols at the completion points. 811 812 First, there's a control byte `m'. If any of the listed bits in `m' 813 is nonzero, we execute what stands at the right, in the listed order: 814 815 (MMO3_LEFT) 816 0x40 - Traverse left trie. 817 (Read a new command byte and recurse.) 818 819 (MMO3_SYMBITS) 820 0x2f - Read the next byte as a character and store it in the 821 current character position; increment character position. 822 Test the bits of `m': 823 824 (MMO3_WCHAR) 825 0x80 - The character is 16-bit (so read another byte, 826 merge into current character. 827 828 (MMO3_TYPEBITS) 829 0xf - We have a complete symbol; parse the type, value 830 and serial number and do what should be done 831 with a symbol. The type and length information 832 is in j = (m & 0xf). 833 834 (MMO3_REGQUAL_BITS) 835 j == 0xf: A register variable. The following 836 byte tells which register. 837 j <= 8: An absolute symbol. Read j bytes as the 838 big-endian number the symbol equals. 839 A j = 2 with two zero bytes denotes an 840 unknown symbol. 841 j > 8: As with j <= 8, but add (0x20 << 56) 842 to the value in the following j - 8 843 bytes. 844 845 Then comes the serial number, as a variant of 846 uleb128, but better named ubeb128: 847 Read bytes and shift the previous value left 7 848 (multiply by 128). Add in the new byte, repeat 849 until a byte has bit 7 set. The serial number 850 is the computed value minus 128. 851 852 (MMO3_MIDDLE) 853 0x20 - Traverse middle trie. (Read a new command byte 854 and recurse.) Decrement character position. 855 856 (MMO3_RIGHT) 857 0x10 - Traverse right trie. (Read a new command byte and 858 recurse.) 859 860 Let's look again at the `lop_stab' for the trivial file (*note File 861 layout::). 862 863 0x980b0000 - lop_stab for ":Main" = 0, serial 1. 864 0x203a4040 865 0x10404020 866 0x4d206120 867 0x69016e00 868 0x81000000 869 870 This forms the trivial trie (note that the path between ":" and "M" 871 is redundant): 872 873 203a ":" 874 40 / 875 40 / 876 10 \ 877 40 / 878 40 / 879 204d "M" 880 2061 "a" 881 2069 "i" 882 016e "n" is the last character in a full symbol, and 883 with a value represented in one byte. 884 00 The value is 0. 885 81 The serial number is 1. 886 887 888 File: bfd.info, Node: mmo section mapping, Prev: Symbol-table, Up: mmo 889 890 mmo section mapping 891 ------------------- 892 893 The implementation in BFD uses special data type 80 (decimal) to 894 encapsulate and describe named sections, containing e.g. debug 895 information. If needed, any datum in the encapsulation will be quoted 896 using lop_quote. First comes a 32-bit word holding the number of 897 32-bit words containing the zero-terminated zero-padded segment name. 898 After the name there's a 32-bit word holding flags describing the 899 section type. Then comes a 64-bit big-endian word with the section 900 length (in bytes), then another with the section start address. 901 Depending on the type of section, the contents might follow, 902 zero-padded to 32-bit boundary. For a loadable section (such as data 903 or code), the contents might follow at some later point, not 904 necessarily immediately, as a lop_loc with the same start address as in 905 the section description, followed by the contents. This in effect 906 forms a descriptor that must be emitted before the actual contents. 907 Sections described this way must not overlap. 908 909 For areas that don't have such descriptors, synthetic sections are 910 formed by BFD. Consecutive contents in the two memory areas 911 `0x0000...00' to `0x01ff...ff' and `0x2000...00' to `0x20ff...ff' are 912 entered in sections named `.text' and `.data' respectively. If an area 913 is not otherwise described, but would together with a neighboring lower 914 area be less than `0x40000000' bytes long, it is joined with the lower 915 area and the gap is zero-filled. For other cases, a new section is 916 formed, named `.MMIX.sec.N'. Here, N is a number, a running count 917 through the mmo file, starting at 0. 918 919 A loadable section specified as: 920 921 .section secname,"ax" 922 TETRA 1,2,3,4,-1,-2009 923 BYTE 80 924 925 and linked to address `0x4', is represented by the sequence: 926 927 0x98080050 - lop_spec 80 928 0x00000002 - two 32-bit words for the section name 929 0x7365636e - "secn" 930 0x616d6500 - "ame\0" 931 0x00000033 - flags CODE, READONLY, LOAD, ALLOC 932 0x00000000 - high 32 bits of section length 933 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits 934 0x00000000 - high 32 bits of section address 935 0x00000004 - section address is 4 936 0x98010002 - 64 bits with address of following data 937 0x00000000 - high 32 bits of address 938 0x00000004 - low 32 bits: data starts at address 4 939 0x00000001 - 1 940 0x00000002 - 2 941 0x00000003 - 3 942 0x00000004 - 4 943 0xffffffff - -1 944 0xfffff827 - -2009 945 0x50000000 - 80 as a byte, padded with zeros. 946 947 Note that the lop_spec wrapping does not include the section 948 contents. Compare this to a non-loaded section specified as: 949 950 .section thirdsec 951 TETRA 200001,100002 952 BYTE 38,40 953 954 This, when linked to address `0x200000000000001c', is represented by: 955 956 0x98080050 - lop_spec 80 957 0x00000002 - two 32-bit words for the section name 958 0x7365636e - "thir" 959 0x616d6500 - "dsec" 960 0x00000010 - flag READONLY 961 0x00000000 - high 32 bits of section length 962 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits 963 0x20000000 - high 32 bits of address 964 0x0000001c - low 32 bits of address 0x200000000000001c 965 0x00030d41 - 200001 966 0x000186a2 - 100002 967 0x26280000 - 38, 40 as bytes, padded with zeros 968 969 For the latter example, the section contents must not be loaded in 970 memory, and is therefore specified as part of the special data. The 971 address is usually unimportant but might provide information for e.g. 972 the DWARF 2 debugging format. 973 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfd.texinfo
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 1 \input texinfo.tex 2 2 @setfilename bfd.info 3 @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000 3 @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, 2003 4 4 @c Free Software Foundation, Inc. 5 5 @c … … 31 31 This file documents the BFD library. 32 32 33 Copyright (C) 1991, 2000 Free Software Foundation, Inc.33 Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. 34 34 35 35 Permission is granted to copy, distribute and/or modify this document … … 38 38 with no Invariant Sections, with no Front-Cover Texts, and with no 39 39 Back-Cover Texts. A copy of the license is included in the 40 section entitled "GNU Free Documentation License".40 section entitled ``GNU Free Documentation License''. 41 41 42 42 @ignore … … 57 57 @subtitle{The Binary File Descriptor Library} 58 58 @sp 1 59 @subtitle First Edition---BFD version < 3.0 60 @subtitle April 199159 @subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-) 60 @subtitle Original Document Created: April 1991 61 61 @author {Steve Chamberlain} 62 62 @author {Cygnus Support} … … 65 65 @tex 66 66 \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ 67 \xdef\manvers{\ $Revision: 1.2.2.1 $} % For use in headers, footers too67 \xdef\manvers{\1.5} % For use in headers, footers too 68 68 {\parskip=0pt 69 \hfill Cygnus Support\par70 \hfill sac\@ cygnus.com\par69 \hfill Free Software Foundation\par 70 \hfill sac\@www.gnu.org\par 71 71 \hfill {\it BFD}, \manvers\par 72 72 \hfill \TeX{}info \texinfoversion\par … … 76 76 77 77 @vskip 0pt plus 1filll 78 Copyright @copyright{} 1991 Free Software Foundation, Inc.78 Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. 79 79 80 80 Permission is granted to copy, distribute and/or modify this document … … 83 83 with no Invariant Sections, with no Front-Cover Texts, and with no 84 84 Back-Cover Texts. A copy of the license is included in the 85 section entitled "GNU Free Documentation License".85 section entitled ``GNU Free Documentation License''. 86 86 87 87 @end titlepage … … 171 171 @code{abfd}. 172 172 173 @ lisp173 @example 174 174 @c @cartouche 175 175 #include "bfd.h" 176 176 177 unsigned int number_of_sections (abfd)177 unsigned int number_of_sections (abfd) 178 178 bfd *abfd; 179 179 @{ 180 return bfd_count_sections (abfd);180 return bfd_count_sections (abfd); 181 181 @} 182 182 @c @end cartouche 183 @end lisp183 @end example 184 184 185 185 The abstraction used within BFD is that an object file has: … … 206 206 207 207 @node BFD front end, BFD back ends, Overview, Top 208 @chapter BFD front end208 @chapter BFD Front End 209 209 @include bfdt.texi 210 @include bfdio.texi 210 211 211 212 @menu … … 228 229 229 230 @node Memory Usage, Initialization, BFD front end, BFD front end 230 @section Memory usage231 @section Memory Usage 231 232 BFD keeps all of its internal structures in obstacks. There is one obstack 232 233 per open BFD file, into which the current state is stored. When a BFD is … … 299 300 * coff :: coff backends 300 301 * elf :: elf backends 302 * mmo :: mmo backend 301 303 @ignore 302 304 * oasys :: oasys backends … … 314 316 @include coffcode.texi 315 317 316 @node elf, , coff, BFD back ends318 @node elf, mmo, coff, BFD back ends 317 319 @include elf.texi 318 320 @c Leave this out until the file has some actual contents... 319 321 @c @include elfcode.texi 320 322 323 @node mmo, , elf, BFD back ends 324 @include mmo.texi 325 321 326 @node GNU Free Documentation License, Index, BFD back ends, Top 322 @chapter GNU Free Documentation License 323 @cindex GNU Free Documentation License 324 325 GNU Free Documentation License 326 327 Version 1.1, March 2000 328 329 Copyright (C) 2000 Free Software Foundation, Inc. 330 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 331 332 Everyone is permitted to copy and distribute verbatim copies 333 of this license document, but changing it is not allowed. 334 335 336 0. PREAMBLE 337 338 The purpose of this License is to make a manual, textbook, or other 339 written document "free" in the sense of freedom: to assure everyone 340 the effective freedom to copy and redistribute it, with or without 341 modifying it, either commercially or noncommercially. Secondarily, 342 this License preserves for the author and publisher a way to get 343 credit for their work, while not being considered responsible for 344 modifications made by others. 345 346 This License is a kind of "copyleft", which means that derivative 347 works of the document must themselves be free in the same sense. It 348 complements the GNU General Public License, which is a copyleft 349 license designed for free software. 350 351 We have designed this License in order to use it for manuals for free 352 software, because free software needs free documentation: a free 353 program should come with manuals providing the same freedoms that the 354 software does. But this License is not limited to software manuals; 355 it can be used for any textual work, regardless of subject matter or 356 whether it is published as a printed book. We recommend this License 357 principally for works whose purpose is instruction or reference. 358 359 360 1. APPLICABILITY AND DEFINITIONS 361 362 This License applies to any manual or other work that contains a 363 notice placed by the copyright holder saying it can be distributed 364 under the terms of this License. The "Document", below, refers to any 365 such manual or work. Any member of the public is a licensee, and is 366 addressed as "you". 367 368 A "Modified Version" of the Document means any work containing the 369 Document or a portion of it, either copied verbatim, or with 370 modifications and/or translated into another language. 371 372 A "Secondary Section" is a named appendix or a front-matter section of 373 the Document that deals exclusively with the relationship of the 374 publishers or authors of the Document to the Document's overall subject 375 (or to related matters) and contains nothing that could fall directly 376 within that overall subject. (For example, if the Document is in part a 377 textbook of mathematics, a Secondary Section may not explain any 378 mathematics.) The relationship could be a matter of historical 379 connection with the subject or with related matters, or of legal, 380 commercial, philosophical, ethical or political position regarding 381 them. 382 383 The "Invariant Sections" are certain Secondary Sections whose titles 384 are designated, as being those of Invariant Sections, in the notice 385 that says that the Document is released under this License. 386 387 The "Cover Texts" are certain short passages of text that are listed, 388 as Front-Cover Texts or Back-Cover Texts, in the notice that says that 389 the Document is released under this License. 390 391 A "Transparent" copy of the Document means a machine-readable copy, 392 represented in a format whose specification is available to the 393 general public, whose contents can be viewed and edited directly and 394 straightforwardly with generic text editors or (for images composed of 395 pixels) generic paint programs or (for drawings) some widely available 396 drawing editor, and that is suitable for input to text formatters or 397 for automatic translation to a variety of formats suitable for input 398 to text formatters. A copy made in an otherwise Transparent file 399 format whose markup has been designed to thwart or discourage 400 subsequent modification by readers is not Transparent. A copy that is 401 not "Transparent" is called "Opaque". 402 403 Examples of suitable formats for Transparent copies include plain 404 ASCII without markup, Texinfo input format, LaTeX input format, SGML 405 or XML using a publicly available DTD, and standard-conforming simple 406 HTML designed for human modification. Opaque formats include 407 PostScript, PDF, proprietary formats that can be read and edited only 408 by proprietary word processors, SGML or XML for which the DTD and/or 409 processing tools are not generally available, and the 410 machine-generated HTML produced by some word processors for output 411 purposes only. 412 413 The "Title Page" means, for a printed book, the title page itself, 414 plus such following pages as are needed to hold, legibly, the material 415 this License requires to appear in the title page. For works in 416 formats which do not have any title page as such, "Title Page" means 417 the text near the most prominent appearance of the work's title, 418 preceding the beginning of the body of the text. 419 420 421 2. VERBATIM COPYING 422 423 You may copy and distribute the Document in any medium, either 424 commercially or noncommercially, provided that this License, the 425 copyright notices, and the license notice saying this License applies 426 to the Document are reproduced in all copies, and that you add no other 427 conditions whatsoever to those of this License. You may not use 428 technical measures to obstruct or control the reading or further 429 copying of the copies you make or distribute. However, you may accept 430 compensation in exchange for copies. If you distribute a large enough 431 number of copies you must also follow the conditions in section 3. 432 433 You may also lend copies, under the same conditions stated above, and 434 you may publicly display copies. 435 436 437 3. COPYING IN QUANTITY 438 439 If you publish printed copies of the Document numbering more than 100, 440 and the Document's license notice requires Cover Texts, you must enclose 441 the copies in covers that carry, clearly and legibly, all these Cover 442 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 443 the back cover. Both covers must also clearly and legibly identify 444 you as the publisher of these copies. The front cover must present 445 the full title with all words of the title equally prominent and 446 visible. You may add other material on the covers in addition. 447 Copying with changes limited to the covers, as long as they preserve 448 the title of the Document and satisfy these conditions, can be treated 449 as verbatim copying in other respects. 450 451 If the required texts for either cover are too voluminous to fit 452 legibly, you should put the first ones listed (as many as fit 453 reasonably) on the actual cover, and continue the rest onto adjacent 454 pages. 455 456 If you publish or distribute Opaque copies of the Document numbering 457 more than 100, you must either include a machine-readable Transparent 458 copy along with each Opaque copy, or state in or with each Opaque copy 459 a publicly-accessible computer-network location containing a complete 460 Transparent copy of the Document, free of added material, which the 461 general network-using public has access to download anonymously at no 462 charge using public-standard network protocols. If you use the latter 463 option, you must take reasonably prudent steps, when you begin 464 distribution of Opaque copies in quantity, to ensure that this 465 Transparent copy will remain thus accessible at the stated location 466 until at least one year after the last time you distribute an Opaque 467 copy (directly or through your agents or retailers) of that edition to 468 the public. 469 470 It is requested, but not required, that you contact the authors of the 471 Document well before redistributing any large number of copies, to give 472 them a chance to provide you with an updated version of the Document. 473 474 475 4. MODIFICATIONS 476 477 You may copy and distribute a Modified Version of the Document under 478 the conditions of sections 2 and 3 above, provided that you release 479 the Modified Version under precisely this License, with the Modified 480 Version filling the role of the Document, thus licensing distribution 481 and modification of the Modified Version to whoever possesses a copy 482 of it. In addition, you must do these things in the Modified Version: 483 484 A. Use in the Title Page (and on the covers, if any) a title distinct 485 from that of the Document, and from those of previous versions 486 (which should, if there were any, be listed in the History section 487 of the Document). You may use the same title as a previous version 488 if the original publisher of that version gives permission. 489 B. List on the Title Page, as authors, one or more persons or entities 490 responsible for authorship of the modifications in the Modified 491 Version, together with at least five of the principal authors of the 492 Document (all of its principal authors, if it has less than five). 493 C. State on the Title page the name of the publisher of the 494 Modified Version, as the publisher. 495 D. Preserve all the copyright notices of the Document. 496 E. Add an appropriate copyright notice for your modifications 497 adjacent to the other copyright notices. 498 F. Include, immediately after the copyright notices, a license notice 499 giving the public permission to use the Modified Version under the 500 terms of this License, in the form shown in the Addendum below. 501 G. Preserve in that license notice the full lists of Invariant Sections 502 and required Cover Texts given in the Document's license notice. 503 H. Include an unaltered copy of this License. 504 I. Preserve the section entitled "History", and its title, and add to 505 it an item stating at least the title, year, new authors, and 506 publisher of the Modified Version as given on the Title Page. If 507 there is no section entitled "History" in the Document, create one 508 stating the title, year, authors, and publisher of the Document as 509 given on its Title Page, then add an item describing the Modified 510 Version as stated in the previous sentence. 511 J. Preserve the network location, if any, given in the Document for 512 public access to a Transparent copy of the Document, and likewise 513 the network locations given in the Document for previous versions 514 it was based on. These may be placed in the "History" section. 515 You may omit a network location for a work that was published at 516 least four years before the Document itself, or if the original 517 publisher of the version it refers to gives permission. 518 K. In any section entitled "Acknowledgements" or "Dedications", 519 preserve the section's title, and preserve in the section all the 520 substance and tone of each of the contributor acknowledgements 521 and/or dedications given therein. 522 L. Preserve all the Invariant Sections of the Document, 523 unaltered in their text and in their titles. Section numbers 524 or the equivalent are not considered part of the section titles. 525 M. Delete any section entitled "Endorsements". Such a section 526 may not be included in the Modified Version. 527 N. Do not retitle any existing section as "Endorsements" 528 or to conflict in title with any Invariant Section. 529 530 If the Modified Version includes new front-matter sections or 531 appendices that qualify as Secondary Sections and contain no material 532 copied from the Document, you may at your option designate some or all 533 of these sections as invariant. To do this, add their titles to the 534 list of Invariant Sections in the Modified Version's license notice. 535 These titles must be distinct from any other section titles. 536 537 You may add a section entitled "Endorsements", provided it contains 538 nothing but endorsements of your Modified Version by various 539 parties--for example, statements of peer review or that the text has 540 been approved by an organization as the authoritative definition of a 541 standard. 542 543 You may add a passage of up to five words as a Front-Cover Text, and a 544 passage of up to 25 words as a Back-Cover Text, to the end of the list 545 of Cover Texts in the Modified Version. Only one passage of 546 Front-Cover Text and one of Back-Cover Text may be added by (or 547 through arrangements made by) any one entity. If the Document already 548 includes a cover text for the same cover, previously added by you or 549 by arrangement made by the same entity you are acting on behalf of, 550 you may not add another; but you may replace the old one, on explicit 551 permission from the previous publisher that added the old one. 552 553 The author(s) and publisher(s) of the Document do not by this License 554 give permission to use their names for publicity for or to assert or 555 imply endorsement of any Modified Version. 556 557 558 5. COMBINING DOCUMENTS 559 560 You may combine the Document with other documents released under this 561 License, under the terms defined in section 4 above for modified 562 versions, provided that you include in the combination all of the 563 Invariant Sections of all of the original documents, unmodified, and 564 list them all as Invariant Sections of your combined work in its 565 license notice. 566 567 The combined work need only contain one copy of this License, and 568 multiple identical Invariant Sections may be replaced with a single 569 copy. If there are multiple Invariant Sections with the same name but 570 different contents, make the title of each such section unique by 571 adding at the end of it, in parentheses, the name of the original 572 author or publisher of that section if known, or else a unique number. 573 Make the same adjustment to the section titles in the list of 574 Invariant Sections in the license notice of the combined work. 575 576 In the combination, you must combine any sections entitled "History" 577 in the various original documents, forming one section entitled 578 "History"; likewise combine any sections entitled "Acknowledgements", 579 and any sections entitled "Dedications". You must delete all sections 580 entitled "Endorsements." 581 582 583 6. COLLECTIONS OF DOCUMENTS 584 585 You may make a collection consisting of the Document and other documents 586 released under this License, and replace the individual copies of this 587 License in the various documents with a single copy that is included in 588 the collection, provided that you follow the rules of this License for 589 verbatim copying of each of the documents in all other respects. 590 591 You may extract a single document from such a collection, and distribute 592 it individually under this License, provided you insert a copy of this 593 License into the extracted document, and follow this License in all 594 other respects regarding verbatim copying of that document. 595 596 597 7. AGGREGATION WITH INDEPENDENT WORKS 598 599 A compilation of the Document or its derivatives with other separate 600 and independent documents or works, in or on a volume of a storage or 601 distribution medium, does not as a whole count as a Modified Version 602 of the Document, provided no compilation copyright is claimed for the 603 compilation. Such a compilation is called an "aggregate", and this 604 License does not apply to the other self-contained works thus compiled 605 with the Document, on account of their being thus compiled, if they 606 are not themselves derivative works of the Document. 607 608 If the Cover Text requirement of section 3 is applicable to these 609 copies of the Document, then if the Document is less than one quarter 610 of the entire aggregate, the Document's Cover Texts may be placed on 611 covers that surround only the Document within the aggregate. 612 Otherwise they must appear on covers around the whole aggregate. 613 614 615 8. TRANSLATION 616 617 Translation is considered a kind of modification, so you may 618 distribute translations of the Document under the terms of section 4. 619 Replacing Invariant Sections with translations requires special 620 permission from their copyright holders, but you may include 621 translations of some or all Invariant Sections in addition to the 622 original versions of these Invariant Sections. You may include a 623 translation of this License provided that you also include the 624 original English version of this License. In case of a disagreement 625 between the translation and the original English version of this 626 License, the original English version will prevail. 627 628 629 9. TERMINATION 630 631 You may not copy, modify, sublicense, or distribute the Document except 632 as expressly provided for under this License. Any other attempt to 633 copy, modify, sublicense or distribute the Document is void, and will 634 automatically terminate your rights under this License. However, 635 parties who have received copies, or rights, from you under this 636 License will not have their licenses terminated so long as such 637 parties remain in full compliance. 638 639 640 10. FUTURE REVISIONS OF THIS LICENSE 641 642 The Free Software Foundation may publish new, revised versions 643 of the GNU Free Documentation License from time to time. Such new 644 versions will be similar in spirit to the present version, but may 645 differ in detail to address new problems or concerns. See 646 http://www.gnu.org/copyleft/. 647 648 Each version of the License is given a distinguishing version number. 649 If the Document specifies that a particular numbered version of this 650 License "or any later version" applies to it, you have the option of 651 following the terms and conditions either of that specified version or 652 of any later version that has been published (not as a draft) by the 653 Free Software Foundation. If the Document does not specify a version 654 number of this License, you may choose any version ever published (not 655 as a draft) by the Free Software Foundation. 656 657 658 ADDENDUM: How to use this License for your documents 659 660 To use this License in a document you have written, include a copy of 661 the License in the document and put the following copyright and 662 license notices just after the title page: 663 664 @smallexample 665 Copyright (c) YEAR YOUR NAME. 666 Permission is granted to copy, distribute and/or modify this document 667 under the terms of the GNU Free Documentation License, Version 1.1 668 or any later version published by the Free Software Foundation; 669 with the Invariant Sections being LIST THEIR TITLES, with the 670 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 671 A copy of the license is included in the section entitled "GNU 672 Free Documentation License". 673 @end smallexample 674 675 If you have no Invariant Sections, write "with no Invariant Sections" 676 instead of saying which ones are invariant. If you have no 677 Front-Cover Texts, write "no Front-Cover Texts" instead of 678 "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. 679 680 If your document contains nontrivial examples of program code, we 681 recommend releasing these examples in parallel under your choice of 682 free software license, such as the GNU General Public License, 683 to permit their use in free software. 684 685 @node Index, , GNU Free Documentation License , Top 327 @include fdl.texi 328 329 @node Index, , GNU Free Documentation License, Top 686 330 @unnumbered Index 687 331 @printindex cp -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfdint.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 1 \input texinfo 2 2 @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 3 @c 2000 3 @c 2000, 2001 4 4 @c Free Software Foundation, Inc. 5 5 @setfilename bfdint.info … … 336 336 @item bfd_target_evax_flavour 337 337 openVMS. 338 @item bfd_target_mmo_flavour 339 Donald Knuth's MMIXware object format. 338 340 @end table 339 341 … … 380 382 @subsection Swapping functions 381 383 382 Every target vector has fu ction pointers used for swapping information384 Every target vector has function pointers used for swapping information 383 385 in and out of the target representation. There are two sets of 384 386 functions: one for data information, and one for header information. … … 504 506 @samp{bfd_get_section_contents}. Most targets set this to 505 507 @samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek} 506 based on the section's @samp{filepos} field and a @samp{bfd_ read}. The508 based on the section's @samp{filepos} field and a @samp{bfd_bread}. The 507 509 corresponding field in the target vector is named 508 510 @samp{_bfd_get_section_contents}. … … 637 639 638 640 @item _write_armap 639 Write out the archive symbol table using calls to @samp{bfd_ write}.641 Write out the archive symbol table using calls to @samp{bfd_bwrite}. 640 642 This is normally called from the archive @samp{write_contents} routine. 641 643 The corresponding field in the target vector is named @samp{write_armap} … … 1292 1294 Using the linker to generate relocateable output in a different object 1293 1295 file format is impossible in the general case, so you generally don't 1294 have to worry about that. Linking input files of different object file 1295 formats together is quite unusual, but if you're really dedicated you 1296 may want to consider testing this case, both when the output object file 1297 format is the same as your format, and when it is different. 1296 have to worry about that. The GNU linker makes sure to stop that from 1297 happening when an input file in a different format has relocations. 1298 1299 Linking input files of different object file formats together is quite 1300 unusual, but if you're really dedicated you may want to consider testing 1301 this case, both when the output object file format is the same as your 1302 format, and when it is different. 1298 1303 @end itemize 1299 1304 … … 1541 1546 Define @samp{ELF_MACHINE_CODE} to the magic number which should appear 1542 1547 in the @samp{e_machine} field of the ELF header. As of this writing, 1543 these magic numbers are assigned by SCO; if you want to get a magic1548 these magic numbers are assigned by Caldera; if you want to get a magic 1544 1549 number for a particular processor, try sending a note to 1545 @email{registry@@ sco.com}. In the BFD sources, the magic numbers are1550 @email{registry@@caldera.com}. In the BFD sources, the magic numbers are 1546 1551 found in @file{include/elf/common.h}; they have names beginning with 1547 1552 @samp{EM_}. … … 1607 1612 it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, 1608 1613 @samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS} 1609 macros to create a table mapping the number used to i ndentify a1614 macros to create a table mapping the number used to identify a 1610 1615 relocation to a name describing that relocation. 1611 1616 … … 1784 1789 1785 1790 @item BFD 1786 The BFD library itself. Also, each object file, archive, or exec table1791 The BFD library itself. Also, each object file, archive, or executable 1787 1792 opened by the BFD library has the type @samp{bfd *}, and is sometimes 1788 1793 referred to as a bfd. -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfdsumm.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 5 5 the object file's data structures. 6 6 7 As different information from the theobject files is required,7 As different information from the object files is required, 8 8 BFD reads from different sections of the file and processes them. 9 9 For example, a very common operation for the linker is processing symbol -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/bfdt.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 11 11 @example 12 12 13 struct _bfd13 struct bfd 14 14 @{ 15 /* The filename the application opened the BFD with. */ 16 CONST char *filename; 17 18 /* A pointer to the target jump table. */ 19 const struct bfd_target *xvec; 20 21 /* To avoid dragging too many header files into every file that 22 includes `@code{bfd.h}', IOSTREAM has been declared as a "char 23 *", and MTIME as a "long". Their correct types, to which they 24 are cast when used, are "FILE *" and "time_t". The iostream 25 is the result of an fopen on the filename. However, if the 26 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 27 to a bfd_in_memory struct. */ 28 PTR iostream; 29 30 /* Is the file descriptor being cached? That is, can it be closed as 31 needed, and re-opened when accessed later? */ 32 33 boolean cacheable; 34 35 /* Marks whether there was a default target specified when the 36 BFD was opened. This is used to select which matching algorithm 37 to use to choose the back end. */ 38 39 boolean target_defaulted; 40 41 /* The caching routines use these to maintain a 42 least-recently-used list of BFDs */ 43 44 struct _bfd *lru_prev, *lru_next; 45 46 /* When a file is closed by the caching routines, BFD retains 47 state information on the file here: */ 48 49 file_ptr where; 50 51 /* and here: (``once'' means at least once) */ 52 53 boolean opened_once; 54 55 /* Set if we have a locally maintained mtime value, rather than 56 getting it from the file each time: */ 57 58 boolean mtime_set; 59 60 /* File modified time, if mtime_set is true: */ 61 62 long mtime; 63 64 /* Reserved for an unimplemented file locking extension.*/ 65 66 int ifd; 67 68 /* The format which belongs to the BFD. (object, core, etc.) */ 69 70 bfd_format format; 71 72 /* The direction the BFD was opened with*/ 73 74 enum bfd_direction @{no_direction = 0, 75 read_direction = 1, 76 write_direction = 2, 77 both_direction = 3@} direction; 78 79 /* Format_specific flags*/ 80 81 flagword flags; 82 83 /* Currently my_archive is tested before adding origin to 84 anything. I believe that this can become always an add of 85 origin, with origin set to 0 for non archive files. */ 86 87 file_ptr origin; 88 89 /* Remember when output has begun, to stop strange things 90 from happening. */ 91 boolean output_has_begun; 92 93 /* Pointer to linked list of sections*/ 94 struct sec *sections; 95 96 /* The number of sections */ 97 unsigned int section_count; 98 99 /* Stuff only useful for object files: 100 The start address. */ 101 bfd_vma start_address; 102 103 /* Used for input and output*/ 104 unsigned int symcount; 105 106 /* Symbol table for output BFD (with symcount entries) */ 107 struct symbol_cache_entry **outsymbols; 108 109 /* Pointer to structure which contains architecture information*/ 110 const struct bfd_arch_info *arch_info; 111 112 /* Stuff only useful for archives:*/ 113 PTR arelt_data; 114 struct _bfd *my_archive; /* The containing archive BFD. */ 115 struct _bfd *next; /* The next BFD in the archive. */ 116 struct _bfd *archive_head; /* The first BFD in the archive. */ 117 boolean has_armap; 118 119 /* A chain of BFD structures involved in a link. */ 120 struct _bfd *link_next; 121 122 /* A field used by _bfd_generic_link_add_archive_symbols. This will 123 be used only for archive elements. */ 124 int archive_pass; 125 126 /* Used by the back end to hold private data. */ 127 128 union 129 @{ 15 /* A unique identifier of the BFD */ 16 unsigned int id; 17 18 /* The filename the application opened the BFD with. */ 19 const char *filename; 20 21 /* A pointer to the target jump table. */ 22 const struct bfd_target *xvec; 23 24 /* To avoid dragging too many header files into every file that 25 includes `@code{bfd.h}', IOSTREAM has been declared as a "char *", 26 and MTIME as a "long". Their correct types, to which they 27 are cast when used, are "FILE *" and "time_t". The iostream 28 is the result of an fopen on the filename. However, if the 29 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 30 to a bfd_in_memory struct. */ 31 PTR iostream; 32 33 /* Is the file descriptor being cached? That is, can it be closed as 34 needed, and re-opened when accessed later? */ 35 bfd_boolean cacheable; 36 37 /* Marks whether there was a default target specified when the 38 BFD was opened. This is used to select which matching algorithm 39 to use to choose the back end. */ 40 bfd_boolean target_defaulted; 41 42 /* The caching routines use these to maintain a 43 least-recently-used list of BFDs. */ 44 struct bfd *lru_prev, *lru_next; 45 46 /* When a file is closed by the caching routines, BFD retains 47 state information on the file here... */ 48 ufile_ptr where; 49 50 /* ... and here: (``once'' means at least once). */ 51 bfd_boolean opened_once; 52 53 /* Set if we have a locally maintained mtime value, rather than 54 getting it from the file each time. */ 55 bfd_boolean mtime_set; 56 57 /* File modified time, if mtime_set is TRUE. */ 58 long mtime; 59 60 /* Reserved for an unimplemented file locking extension. */ 61 int ifd; 62 63 /* The format which belongs to the BFD. (object, core, etc.) */ 64 bfd_format format; 65 66 /* The direction with which the BFD was opened. */ 67 enum bfd_direction 68 @{ 69 no_direction = 0, 70 read_direction = 1, 71 write_direction = 2, 72 both_direction = 3 73 @} 74 direction; 75 76 /* Format_specific flags. */ 77 flagword flags; 78 79 /* Currently my_archive is tested before adding origin to 80 anything. I believe that this can become always an add of 81 origin, with origin set to 0 for non archive files. */ 82 ufile_ptr origin; 83 84 /* Remember when output has begun, to stop strange things 85 from happening. */ 86 bfd_boolean output_has_begun; 87 88 /* A hash table for section names. */ 89 struct bfd_hash_table section_htab; 90 91 /* Pointer to linked list of sections. */ 92 struct sec *sections; 93 94 /* The place where we add to the section list. */ 95 struct sec **section_tail; 96 97 /* The number of sections. */ 98 unsigned int section_count; 99 100 /* Stuff only useful for object files: 101 The start address. */ 102 bfd_vma start_address; 103 104 /* Used for input and output. */ 105 unsigned int symcount; 106 107 /* Symbol table for output BFD (with symcount entries). */ 108 struct symbol_cache_entry **outsymbols; 109 110 /* Used for slurped dynamic symbol tables. */ 111 unsigned int dynsymcount; 112 113 /* Pointer to structure which contains architecture information. */ 114 const struct bfd_arch_info *arch_info; 115 116 /* Stuff only useful for archives. */ 117 PTR arelt_data; 118 struct bfd *my_archive; /* The containing archive BFD. */ 119 struct bfd *next; /* The next BFD in the archive. */ 120 struct bfd *archive_head; /* The first BFD in the archive. */ 121 bfd_boolean has_armap; 122 123 /* A chain of BFD structures involved in a link. */ 124 struct bfd *link_next; 125 126 /* A field used by _bfd_generic_link_add_archive_symbols. This will 127 be used only for archive elements. */ 128 int archive_pass; 129 130 /* Used by the back end to hold private data. */ 131 union 132 @{ 130 133 struct aout_data_struct *aout_data; 131 134 struct artdata *aout_ar_data; … … 144 147 struct nlm_obj_tdata *nlm_obj_data; 145 148 struct bout_data_struct *bout_data; 149 struct mmo_data_struct *mmo_data; 146 150 struct sun_core_struct *sun_core_data; 147 151 struct sco5_core_struct *sco5_core_data; … … 156 160 struct versados_data_struct *versados_data; 157 161 struct netbsd_core_struct *netbsd_core_data; 162 struct mach_o_data_struct *mach_o_data; 163 struct mach_o_fat_data_struct *mach_o_fat_data; 164 struct bfd_pef_data_struct *pef_data; 165 struct bfd_pef_xlib_data_struct *pef_xlib_data; 166 struct bfd_sym_data_struct *sym_data; 158 167 PTR any; 159 @} tdata; 160 161 /* Used by the application to hold private data*/ 162 PTR usrdata; 168 @} 169 tdata; 170 171 /* Used by the application to hold private data. */ 172 PTR usrdata; 163 173 164 174 /* Where all the allocated stuff under this BFD goes. This is a 165 175 struct objalloc *, but we use PTR to avoid requiring the inclusion of 166 176 objalloc.h. */ 167 PTR memory;177 PTR memory; 168 178 @}; 169 179 … … 193 203 bfd_error_invalid_target, 194 204 bfd_error_wrong_format, 205 bfd_error_wrong_object_format, 195 206 bfd_error_invalid_operation, 196 207 bfd_error_no_memory, … … 208 219 bfd_error_file_too_big, 209 220 bfd_error_invalid_error_code 210 @} bfd_error_type; 221 @} 222 bfd_error_type; 211 223 212 224 @end example … … 233 245 @strong{Synopsis} 234 246 @example 235 CONSTchar *bfd_errmsg (bfd_error_type error_tag);247 const char *bfd_errmsg (bfd_error_type error_tag); 236 248 @end example 237 249 @strong{Description}@* … … 243 255 @strong{Synopsis} 244 256 @example 245 void bfd_perror ( CONSTchar *message);257 void bfd_perror (const char *message); 246 258 @end example 247 259 @strong{Description}@* … … 296 308 Return the BFD error handler function. 297 309 310 @findex bfd_archive_filename 311 @subsubsection @code{bfd_archive_filename} 312 @strong{Synopsis} 313 @example 314 const char *bfd_archive_filename (bfd *); 315 @end example 316 @strong{Description}@* 317 For a BFD that is a component of an archive, returns a string 318 with both the archive name and file name. For other BFDs, just 319 returns the file name. 320 298 321 @section Symbols 299 322 … … 303 326 @strong{Synopsis} 304 327 @example 305 long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);328 long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); 306 329 @end example 307 330 @strong{Description}@* … … 337 360 @example 338 361 void bfd_set_reloc 339 (bfd *abfd, asection *sec, arelent **rel, unsigned int count) 362 (bfd *abfd, asection *sec, arelent **rel, unsigned int count); 340 363 @end example 341 364 @strong{Description}@* … … 348 371 @strong{Synopsis} 349 372 @example 350 b oolean bfd_set_file_flags(bfd *abfd, flagword flags);373 bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); 351 374 @end example 352 375 @strong{Description}@* … … 404 427 @strong{Synopsis} 405 428 @example 406 b oolean bfd_set_start_address(bfd *abfd, bfd_vma vma);429 bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); 407 430 @end example 408 431 @strong{Description}@* … … 410 433 411 434 @strong{Returns}@* 412 Returns @code{true} on success, @code{false} otherwise. 413 414 @findex bfd_get_mtime 415 @subsubsection @code{bfd_get_mtime} 416 @strong{Synopsis} 417 @example 418 long bfd_get_mtime(bfd *abfd); 419 @end example 420 @strong{Description}@* 421 Return the file modification time (as read from the file system, or 422 from the archive header for archive members). 423 424 @findex bfd_get_size 425 @subsubsection @code{bfd_get_size} 426 @strong{Synopsis} 427 @example 428 long bfd_get_size(bfd *abfd); 429 @end example 430 @strong{Description}@* 431 Return the file size (as read from file system) for the file 432 associated with BFD @var{abfd}. 433 434 The initial motivation for, and use of, this routine is not 435 so we can get the exact size of the object the BFD applies to, since 436 that might not be generally possible (archive members for example). 437 It would be ideal if someone could eventually modify 438 it so that such results were guaranteed. 439 440 Instead, we want to ask questions like "is this NNN byte sized 441 object I'm about to try read from file offset YYY reasonable?" 442 As as example of where we might do this, some object formats 443 use string tables for which the first @code{sizeof (long)} bytes of the 444 table contain the size of the table itself, including the size bytes. 445 If an application tries to read what it thinks is one of these 446 string tables, without some way to validate the size, and for 447 some reason the size is wrong (byte swapping error, wrong location 448 for the string table, etc.), the only clue is likely to be a read 449 error when it tries to read the table, or a "virtual memory 450 exhausted" error when it tries to allocate 15 bazillon bytes 451 of space for the 15 bazillon byte table it is about to read. 452 This function at least allows us to answer the quesion, "is the 453 size reasonable?". 435 Returns @code{TRUE} on success, @code{FALSE} otherwise. 454 436 455 437 @findex bfd_get_gp_size … … 457 439 @strong{Synopsis} 458 440 @example 459 int bfd_get_gp_size(bfd *abfd);441 unsigned int bfd_get_gp_size (bfd *abfd); 460 442 @end example 461 443 @strong{Description}@* … … 468 450 @strong{Synopsis} 469 451 @example 470 void bfd_set_gp_size (bfd *abfd,int i);452 void bfd_set_gp_size (bfd *abfd, unsigned int i); 471 453 @end example 472 454 @strong{Description}@* … … 479 461 @strong{Synopsis} 480 462 @example 481 bfd_vma bfd_scan_vma (CONST char *string, CONSTchar **end, int base);463 bfd_vma bfd_scan_vma (const char *string, const char **end, int base); 482 464 @end example 483 465 @strong{Description}@* … … 491 473 in octal if a leading zero is found, otherwise in decimal. 492 474 493 Overflow is not detected. 475 If the value would overflow, the maximum @code{bfd_vma} value is 476 returned. 494 477 495 478 @findex bfd_copy_private_bfd_data … … 497 480 @strong{Synopsis} 498 481 @example 499 b oolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);482 bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); 500 483 @end example 501 484 @strong{Description}@* 502 485 Copy private BFD information from the BFD @var{ibfd} to the 503 the BFD @var{obfd}. Return @code{ true} on success, @code{false} on error.486 the BFD @var{obfd}. Return @code{TRUE} on success, @code{FALSE} on error. 504 487 Possible error returns are: 505 488 … … 520 503 @strong{Synopsis} 521 504 @example 522 b oolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);505 bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); 523 506 @end example 524 507 @strong{Description}@* 525 508 Merge private BFD information from the BFD @var{ibfd} to the 526 the output file BFD @var{obfd} when linking. Return @code{ true}527 on success, @code{ false} on error. Possible error returns are:509 the output file BFD @var{obfd} when linking. Return @code{TRUE} 510 on success, @code{FALSE} on error. Possible error returns are: 528 511 529 512 @itemize @bullet … … 543 526 @strong{Synopsis} 544 527 @example 545 b oolean bfd_set_private_flags(bfd *abfd, flagword flags);528 bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); 546 529 @end example 547 530 @strong{Description}@* 548 531 Set private BFD flag information in the BFD @var{abfd}. 549 Return @code{ true} on success, @code{false} on error. Possible error532 Return @code{TRUE} on success, @code{FALSE} on error. Possible error 550 533 returns are: 551 534 … … 558 541 @example 559 542 #define bfd_set_private_flags(abfd, flags) \ 560 BFD_SEND (abfd, _bfd_set_private_flags, \ 561 (abfd, flags)) 562 @end example 563 564 @findex stuff 565 @subsubsection @code{stuff} 566 @strong{Description}@* 567 Stuff which should be documented: 543 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) 544 @end example 545 546 @findex Other functions 547 @subsubsection @code{Other functions} 548 @strong{Description}@* 549 The following functions exist but have not yet been documented. 568 550 @example 569 551 #define bfd_sizeof_headers(abfd, reloc) \ 570 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))552 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) 571 553 572 554 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ 573 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))574 575 /* Do these three do anything useful at all, for any back end? */ 555 BFD_SEND (abfd, _bfd_find_nearest_line, \ 556 (abfd, sec, syms, off, file, func, line)) 557 576 558 #define bfd_debug_info_start(abfd) \ 577 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))559 BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) 578 560 579 561 #define bfd_debug_info_end(abfd) \ 580 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))562 BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) 581 563 582 564 #define bfd_debug_info_accumulate(abfd, section) \ 583 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 584 565 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 585 566 586 567 #define bfd_stat_arch_elt(abfd, stat) \ 587 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))568 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) 588 569 589 570 #define bfd_update_armap_timestamp(abfd) \ 590 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))571 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) 591 572 592 573 #define bfd_set_arch_mach(abfd, arch, mach)\ 593 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))574 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) 594 575 595 576 #define bfd_relax_section(abfd, section, link_info, again) \ … … 599 580 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) 600 581 582 #define bfd_merge_sections(abfd, link_info) \ 583 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) 584 585 #define bfd_discard_group(abfd, sec) \ 586 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) 587 601 588 #define bfd_link_hash_table_create(abfd) \ 602 589 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) 603 590 591 #define bfd_link_hash_table_free(abfd, hash) \ 592 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) 593 604 594 #define bfd_link_add_symbols(abfd, info) \ 605 595 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) 596 597 #define bfd_link_just_syms(sec, info) \ 598 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) 606 599 607 600 #define bfd_final_link(abfd, info) \ … … 629 622 PARAMS ((bfd *, struct bfd_link_info *, 630 623 struct bfd_link_order *, bfd_byte *, 631 boolean, asymbol **)); 632 633 @end example 634 624 bfd_boolean, asymbol **)); 625 626 @end example 627 628 @findex bfd_alt_mach_code 629 @subsubsection @code{bfd_alt_mach_code} 630 @strong{Synopsis} 631 @example 632 bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); 633 @end example 634 @strong{Description}@* 635 When more than one machine code number is available for the 636 same machine type, this function can be used to switch between 637 the preferred one (alternative == 0) and any others. Currently, 638 only ELF supports this feature, with up to two alternate 639 machine codes. 640 641 642 @example 643 struct bfd_preserve 644 @{ 645 PTR marker; 646 PTR tdata; 647 flagword flags; 648 const struct bfd_arch_info *arch_info; 649 struct sec *sections; 650 struct sec **section_tail; 651 unsigned int section_count; 652 struct bfd_hash_table section_htab; 653 @}; 654 655 @end example 656 @findex bfd_preserve_save 657 @subsubsection @code{bfd_preserve_save} 658 @strong{Synopsis} 659 @example 660 bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); 661 @end example 662 @strong{Description}@* 663 When testing an object for compatibility with a particular 664 target back-end, the back-end object_p function needs to set 665 up certain fields in the bfd on successfully recognizing the 666 object. This typically happens in a piecemeal fashion, with 667 failures possible at many points. On failure, the bfd is 668 supposed to be restored to its initial state, which is 669 virtually impossible. However, restoring a subset of the bfd 670 state works in practice. This function stores the subset and 671 reinitializes the bfd. 672 673 @findex bfd_preserve_restore 674 @subsubsection @code{bfd_preserve_restore} 675 @strong{Synopsis} 676 @example 677 void bfd_preserve_restore (bfd *, struct bfd_preserve *); 678 @end example 679 @strong{Description}@* 680 This function restores bfd state saved by bfd_preserve_save. 681 If MARKER is non-NULL in struct bfd_preserve then that block 682 and all subsequently bfd_alloc'd memory is freed. 683 684 @findex bfd_preserve_finish 685 @subsubsection @code{bfd_preserve_finish} 686 @strong{Synopsis} 687 @example 688 void bfd_preserve_finish (bfd *, struct bfd_preserve *); 689 @end example 690 @strong{Description}@* 691 This function should be called when the bfd state saved by 692 bfd_preserve_save is no longer needed. ie. when the back-end 693 object_p function returns with success. 694 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/cache.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 49 49 @strong{Synopsis} 50 50 @example 51 b oolean bfd_cache_init (bfd *abfd);51 bfd_boolean bfd_cache_init (bfd *abfd); 52 52 @end example 53 53 @strong{Description}@* … … 58 58 @strong{Synopsis} 59 59 @example 60 b oolean bfd_cache_close (bfd *abfd);60 bfd_boolean bfd_cache_close (bfd *abfd); 61 61 @end example 62 62 @strong{Description}@* … … 65 65 66 66 @strong{Returns}@* 67 @code{ false} is returned if closing the file fails, @code{true} is67 @code{FALSE} is returned if closing the file fails, @code{TRUE} is 68 68 returned if all is well. 69 69 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/chew.c
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 1 /* chew 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 3 2002 3 4 Free Software Foundation, Inc. 4 5 Contributed by steve chamberlain @cygnus … … 82 83 Foo. */ 83 84 84 #include <ansidecl.h>85 #include "ansidecl.h" 85 86 #include "sysdep.h" 86 87 #include <assert.h> … … 289 290 290 291 typedef struct dict_struct dict_type; 291 292 #define WORD(x) static void x()293 292 294 293 static void … … 363 362 } 364 363 365 WORD (call) 364 static void 365 call () 366 366 { 367 367 stinst_type *oldpc = pc; … … 372 372 } 373 373 374 WORD (remchar) 374 static void 375 remchar () 375 376 { 376 377 if (tos->write_idx) … … 389 390 } 390 391 391 WORD (push_number) 392 static void 393 push_number () 392 394 { 393 395 isp++; … … 398 400 } 399 401 400 WORD (push_text) 402 static void 403 push_text () 401 404 { 402 405 tos++; … … 483 486 484 487 static void 485 paramstuff ( void)488 paramstuff () 486 489 { 487 490 unsigned int openp; … … 552 555 and *} into comments */ 553 556 554 WORD (translatecomments) 557 static void 558 translatecomments () 555 559 { 556 560 unsigned int idx = 0; … … 588 592 /* turn everything not starting with a . into a comment */ 589 593 590 WORD (manglecomments) 594 static void 595 manglecomments () 591 596 { 592 597 unsigned int idx = 0; … … 622 627 /* Mod tos so that only lines with leading dots remain */ 623 628 static void 624 outputdots ( void)629 outputdots () 625 630 { 626 631 unsigned int idx = 0; … … 666 671 667 672 /* Find lines starting with . and | and put example around them on tos */ 668 WORD (courierize) 673 static void 674 courierize () 669 675 { 670 676 string_type out; … … 687 693 while (at (tos, idx) && at (tos, idx) != '\n') 688 694 { 689 if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') 695 if (command > 1) 696 { 697 /* We are inside {} parameters of some command; 698 Just pass through until matching brace. */ 699 if (at (tos, idx) == '{') 700 ++command; 701 else if (at (tos, idx) == '}') 702 --command; 703 } 704 else if (command != 0) 705 { 706 if (at (tos, idx) == '{') 707 ++command; 708 else if (!islower ((unsigned char) at (tos, idx))) 709 --command; 710 } 711 else if (at (tos, idx) == '@' 712 && islower ((unsigned char) at (tos, idx + 1))) 713 { 714 ++command; 715 } 716 else if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') 690 717 { 691 718 cattext (&out, "/*"); 692 719 idx += 2; 720 continue; 693 721 } 694 722 else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') … … 696 724 cattext (&out, "*/"); 697 725 idx += 2; 726 continue; 698 727 } 699 else if (at (tos, idx) == '{' && !command) 728 else if (at (tos, idx) == '{' 729 || at (tos, idx) == '}') 700 730 { 701 cattext (&out, "@{"); 702 idx++; 731 catchar (&out, '@'); 703 732 } 704 else if (at (tos, idx) == '}' && !command) 705 { 706 cattext (&out, "@}"); 707 idx++; 708 } 709 else 710 { 711 if (at (tos, idx) == '@') 712 command = 1; 713 else if (isspace ((unsigned char) at (tos, idx)) 714 || at (tos, idx) == '}') 715 command = 0; 716 catchar (&out, at (tos, idx)); 717 idx++; 718 } 719 733 734 catchar (&out, at (tos, idx)); 735 idx++; 720 736 } 721 737 catchar (&out, '\n'); … … 742 758 itemize, inplace at TOS*/ 743 759 744 WORD (bulletize) 760 static void 761 bulletize () 745 762 { 746 763 unsigned int idx = 0; … … 796 813 /* Turn <<foo>> into @code{foo} in place at TOS*/ 797 814 798 WORD (do_fancy_stuff) 815 static void 816 do_fancy_stuff () 799 817 { 800 818 unsigned int idx = 0; … … 892 910 } 893 911 894 WORD (icopy_past_newline) 912 static void 913 icopy_past_newline () 895 914 { 896 915 tos++; … … 904 923 Take the string at the top of the stack, do some prettying. */ 905 924 906 WORD (kill_bogus_lines) 925 static void 926 kill_bogus_lines () 907 927 { 908 928 int sl; … … 990 1010 } 991 1011 992 WORD (indent) 1012 static void 1013 indent () 993 1014 { 994 1015 string_type out; … … 1040 1061 } 1041 1062 1042 WORD (get_stuff_in_command) 1063 static void 1064 get_stuff_in_command () 1043 1065 { 1044 1066 tos++; … … 1055 1077 } 1056 1078 1057 WORD (swap) 1079 static void 1080 swap () 1058 1081 { 1059 1082 string_type t; … … 1065 1088 } 1066 1089 1067 WORD (other_dup) 1090 static void 1091 other_dup () 1068 1092 { 1069 1093 tos++; … … 1074 1098 } 1075 1099 1076 WORD (drop) 1100 static void 1101 drop () 1077 1102 { 1078 1103 tos--; … … 1081 1106 } 1082 1107 1083 WORD (idrop) 1108 static void 1109 idrop () 1084 1110 { 1085 1111 isp--; … … 1088 1114 } 1089 1115 1090 WORD (icatstr) 1116 static void 1117 icatstr () 1091 1118 { 1092 1119 tos--; … … 1097 1124 } 1098 1125 1099 WORD (skip_past_newline) 1126 static void 1127 skip_past_newline () 1100 1128 { 1101 1129 while (at (ptr, idx) … … 1106 1134 } 1107 1135 1108 WORD (internalmode) 1136 static void 1137 internalmode () 1109 1138 { 1110 1139 internal_mode = *(isp); … … 1114 1143 } 1115 1144 1116 WORD (maybecatstr) 1145 static void 1146 maybecatstr () 1117 1147 { 1118 1148 if (internal_wanted == internal_mode) … … 1232 1262 1233 1263 static void 1234 perform ( void)1264 perform () 1235 1265 { 1236 1266 tos = stack; … … 1383 1413 1384 1414 static void 1385 bang ( void)1415 bang () 1386 1416 { 1387 1417 *(long *) ((isp[0])) = isp[-1]; … … 1391 1421 } 1392 1422 1393 WORD (atsign) 1423 static void 1424 atsign () 1394 1425 { 1395 1426 isp[0] = *(long *) (isp[0]); … … 1397 1428 } 1398 1429 1399 WORD (hello) 1430 static void 1431 hello () 1400 1432 { 1401 1433 printf ("hello\n"); … … 1403 1435 } 1404 1436 1405 WORD (stdout_) 1437 static void 1438 stdout_ () 1406 1439 { 1407 1440 isp++; … … 1411 1444 } 1412 1445 1413 WORD (stderr_) 1446 static void 1447 stderr_ () 1414 1448 { 1415 1449 isp++; … … 1419 1453 } 1420 1454 1421 WORD (print) 1455 static void 1456 print () 1422 1457 { 1423 1458 if (*isp == 1) … … 1453 1488 1454 1489 static void 1455 usage ( void)1490 usage () 1456 1491 { 1457 1492 fprintf (stderr, "usage: -[d|i|g] <file >file\n"); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/coffcode.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 189 189 the offsets generated by the previous pass and the pointers 190 190 generated when the symbol table was read in to create the 191 structured hiera chy required by coff. It changes each pointer191 structured hierarchy required by coff. It changes each pointer 192 192 to a symbol into the index into the symbol table of the asymbol. 193 193 … … 212 212 typedef struct coff_ptr_struct 213 213 @{ 214 215 /* Remembers the offset from the first symbol in the file for 216 this symbol. Generated by coff_renumber_symbols. */ 217 unsigned int offset; 218 219 /* Should the value of this symbol be renumbered. Used for 220 XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ 221 unsigned int fix_value : 1; 222 223 /* Should the tag field of this symbol be renumbered. 224 Created by coff_pointerize_aux. */ 225 unsigned int fix_tag : 1; 226 227 /* Should the endidx field of this symbol be renumbered. 228 Created by coff_pointerize_aux. */ 229 unsigned int fix_end : 1; 230 231 /* Should the x_csect.x_scnlen field be renumbered. 232 Created by coff_pointerize_aux. */ 233 unsigned int fix_scnlen : 1; 234 235 /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the 236 index into the line number entries. Set by 237 coff_slurp_symbol_table. */ 238 unsigned int fix_line : 1; 239 240 /* The container for the symbol structure as read and translated 241 from the file. */ 242 243 union @{ 244 union internal_auxent auxent; 245 struct internal_syment syment; 246 @} u; 214 /* Remembers the offset from the first symbol in the file for 215 this symbol. Generated by coff_renumber_symbols. */ 216 unsigned int offset; 217 218 /* Should the value of this symbol be renumbered. Used for 219 XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ 220 unsigned int fix_value : 1; 221 222 /* Should the tag field of this symbol be renumbered. 223 Created by coff_pointerize_aux. */ 224 unsigned int fix_tag : 1; 225 226 /* Should the endidx field of this symbol be renumbered. 227 Created by coff_pointerize_aux. */ 228 unsigned int fix_end : 1; 229 230 /* Should the x_csect.x_scnlen field be renumbered. 231 Created by coff_pointerize_aux. */ 232 unsigned int fix_scnlen : 1; 233 234 /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the 235 index into the line number entries. Set by coff_slurp_symbol_table. */ 236 unsigned int fix_line : 1; 237 238 /* The container for the symbol structure as read and translated 239 from the file. */ 240 union 241 @{ 242 union internal_auxent auxent; 243 struct internal_syment syment; 244 @} u; 247 245 @} combined_entry_type; 248 246 … … 252 250 typedef struct coff_symbol_struct 253 251 @{ 254 /* The actual symbol which the rest of BFD works with */255 asymbol symbol;256 257 /* A pointer to the hidden information for this symbol */258 combined_entry_type *native;259 260 /* A pointer to the linenumber information for this symbol */261 struct lineno_cache_entry *lineno;262 263 /* Have the line numbers been relocated yet ? */264 boolean done_lineno;252 /* The actual symbol which the rest of BFD works with */ 253 asymbol symbol; 254 255 /* A pointer to the hidden information for this symbol */ 256 combined_entry_type *native; 257 258 /* A pointer to the linenumber information for this symbol */ 259 struct lineno_cache_entry *lineno; 260 261 /* Have the line numbers been relocated yet ? */ 262 bfd_boolean done_lineno; 265 263 @} coff_symbol_type; 266 264 @end example … … 290 288 typedef struct 291 289 @{ 292 void (*_bfd_coff_swap_aux_in) PARAMS (( 293 bfd *abfd, 294 PTR ext, 295 int type, 296 int class, 297 int indaux, 298 int numaux, 299 PTR in)); 300 301 void (*_bfd_coff_swap_sym_in) PARAMS (( 302 bfd *abfd , 303 PTR ext, 304 PTR in)); 305 306 void (*_bfd_coff_swap_lineno_in) PARAMS (( 307 bfd *abfd, 308 PTR ext, 309 PTR in)); 310 311 @end example 312 Special entry points for gas to swap out coff parts: 313 @example 314 unsigned int (*_bfd_coff_swap_aux_out) PARAMS (( 315 bfd *abfd, 316 PTR in, 317 int type, 318 int class, 319 int indaux, 320 int numaux, 321 PTR ext)); 322 323 unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( 324 bfd *abfd, 325 PTR in, 326 PTR ext)); 327 328 unsigned int (*_bfd_coff_swap_lineno_out) PARAMS (( 329 bfd *abfd, 330 PTR in, 331 PTR ext)); 332 333 unsigned int (*_bfd_coff_swap_reloc_out) PARAMS (( 334 bfd *abfd, 335 PTR src, 336 PTR dst)); 337 338 unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS (( 339 bfd *abfd, 340 PTR in, 341 PTR out)); 342 343 unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS (( 344 bfd *abfd, 345 PTR in, 346 PTR out)); 347 348 unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS (( 349 bfd *abfd, 350 PTR in, 351 PTR out)); 352 353 @end example 354 Special entry points for generic COFF routines to call target 355 dependent COFF routines: 356 @example 357 unsigned int _bfd_filhsz; 358 unsigned int _bfd_aoutsz; 359 unsigned int _bfd_scnhsz; 360 unsigned int _bfd_symesz; 361 unsigned int _bfd_auxesz; 362 unsigned int _bfd_relsz; 363 unsigned int _bfd_linesz; 364 unsigned int _bfd_filnmlen; 365 boolean _bfd_coff_long_filenames; 366 boolean _bfd_coff_long_section_names; 367 unsigned int _bfd_coff_default_section_alignment_power; 368 boolean _bfd_coff_force_symnames_in_strings; 369 unsigned int _bfd_coff_debug_string_prefix_length; 370 void (*_bfd_coff_swap_filehdr_in) PARAMS (( 371 bfd *abfd, 372 PTR ext, 373 PTR in)); 374 void (*_bfd_coff_swap_aouthdr_in) PARAMS (( 375 bfd *abfd, 376 PTR ext, 377 PTR in)); 378 void (*_bfd_coff_swap_scnhdr_in) PARAMS (( 379 bfd *abfd, 380 PTR ext, 381 PTR in)); 382 void (*_bfd_coff_swap_reloc_in) PARAMS (( 383 bfd *abfd, 384 PTR ext, 385 PTR in)); 386 boolean (*_bfd_coff_bad_format_hook) PARAMS (( 387 bfd *abfd, 388 PTR internal_filehdr)); 389 boolean (*_bfd_coff_set_arch_mach_hook) PARAMS (( 390 bfd *abfd, 391 PTR internal_filehdr)); 392 PTR (*_bfd_coff_mkobject_hook) PARAMS (( 393 bfd *abfd, 394 PTR internal_filehdr, 395 PTR internal_aouthdr)); 396 flagword (*_bfd_styp_to_sec_flags_hook) PARAMS (( 397 bfd *abfd, 398 PTR internal_scnhdr, 399 const char *name, 400 asection *section)); 401 void (*_bfd_set_alignment_hook) PARAMS (( 402 bfd *abfd, 403 asection *sec, 404 PTR internal_scnhdr)); 405 boolean (*_bfd_coff_slurp_symbol_table) PARAMS (( 406 bfd *abfd)); 407 boolean (*_bfd_coff_symname_in_debug) PARAMS (( 408 bfd *abfd, 409 struct internal_syment *sym)); 410 boolean (*_bfd_coff_pointerize_aux_hook) PARAMS (( 411 bfd *abfd, 412 combined_entry_type *table_base, 413 combined_entry_type *symbol, 414 unsigned int indaux, 415 combined_entry_type *aux)); 416 boolean (*_bfd_coff_print_aux) PARAMS (( 417 bfd *abfd, 418 FILE *file, 419 combined_entry_type *table_base, 420 combined_entry_type *symbol, 421 combined_entry_type *aux, 422 unsigned int indaux)); 423 void (*_bfd_coff_reloc16_extra_cases) PARAMS (( 424 bfd *abfd, 425 struct bfd_link_info *link_info, 426 struct bfd_link_order *link_order, 427 arelent *reloc, 428 bfd_byte *data, 429 unsigned int *src_ptr, 430 unsigned int *dst_ptr)); 431 int (*_bfd_coff_reloc16_estimate) PARAMS (( 432 bfd *abfd, 433 asection *input_section, 434 arelent *r, 435 unsigned int shrink, 436 struct bfd_link_info *link_info)); 437 enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS (( 438 bfd *abfd, 439 struct internal_syment *)); 440 boolean (*_bfd_coff_compute_section_file_positions) PARAMS (( 441 bfd *abfd)); 442 boolean (*_bfd_coff_start_final_link) PARAMS (( 443 bfd *output_bfd, 444 struct bfd_link_info *info)); 445 boolean (*_bfd_coff_relocate_section) PARAMS (( 446 bfd *output_bfd, 447 struct bfd_link_info *info, 448 bfd *input_bfd, 449 asection *input_section, 450 bfd_byte *contents, 451 struct internal_reloc *relocs, 452 struct internal_syment *syms, 453 asection **sections)); 454 reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS (( 455 bfd *abfd, 456 asection *sec, 457 struct internal_reloc *rel, 458 struct coff_link_hash_entry *h, 459 struct internal_syment *sym, 460 bfd_vma *addendp)); 461 boolean (*_bfd_coff_adjust_symndx) PARAMS (( 462 bfd *obfd, 463 struct bfd_link_info *info, 464 bfd *ibfd, 465 asection *sec, 466 struct internal_reloc *reloc, 467 boolean *adjustedp)); 468 boolean (*_bfd_coff_link_add_one_symbol) PARAMS (( 469 struct bfd_link_info *info, 470 bfd *abfd, 471 const char *name, 472 flagword flags, 473 asection *section, 474 bfd_vma value, 475 const char *string, 476 boolean copy, 477 boolean collect, 478 struct bfd_link_hash_entry **hashp)); 479 480 boolean (*_bfd_coff_link_output_has_begun) PARAMS (( 481 bfd * abfd, 482 struct coff_final_link_info * pfinfo)); 483 boolean (*_bfd_coff_final_link_postscript) PARAMS (( 484 bfd * abfd, 485 struct coff_final_link_info * pfinfo)); 290 void (*_bfd_coff_swap_aux_in) 291 PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 292 293 void (*_bfd_coff_swap_sym_in) 294 PARAMS ((bfd *, PTR, PTR)); 295 296 void (*_bfd_coff_swap_lineno_in) 297 PARAMS ((bfd *, PTR, PTR)); 298 299 unsigned int (*_bfd_coff_swap_aux_out) 300 PARAMS ((bfd *, PTR, int, int, int, int, PTR)); 301 302 unsigned int (*_bfd_coff_swap_sym_out) 303 PARAMS ((bfd *, PTR, PTR)); 304 305 unsigned int (*_bfd_coff_swap_lineno_out) 306 PARAMS ((bfd *, PTR, PTR)); 307 308 unsigned int (*_bfd_coff_swap_reloc_out) 309 PARAMS ((bfd *, PTR, PTR)); 310 311 unsigned int (*_bfd_coff_swap_filehdr_out) 312 PARAMS ((bfd *, PTR, PTR)); 313 314 unsigned int (*_bfd_coff_swap_aouthdr_out) 315 PARAMS ((bfd *, PTR, PTR)); 316 317 unsigned int (*_bfd_coff_swap_scnhdr_out) 318 PARAMS ((bfd *, PTR, PTR)); 319 320 unsigned int _bfd_filhsz; 321 unsigned int _bfd_aoutsz; 322 unsigned int _bfd_scnhsz; 323 unsigned int _bfd_symesz; 324 unsigned int _bfd_auxesz; 325 unsigned int _bfd_relsz; 326 unsigned int _bfd_linesz; 327 unsigned int _bfd_filnmlen; 328 bfd_boolean _bfd_coff_long_filenames; 329 bfd_boolean _bfd_coff_long_section_names; 330 unsigned int _bfd_coff_default_section_alignment_power; 331 bfd_boolean _bfd_coff_force_symnames_in_strings; 332 unsigned int _bfd_coff_debug_string_prefix_length; 333 334 void (*_bfd_coff_swap_filehdr_in) 335 PARAMS ((bfd *, PTR, PTR)); 336 337 void (*_bfd_coff_swap_aouthdr_in) 338 PARAMS ((bfd *, PTR, PTR)); 339 340 void (*_bfd_coff_swap_scnhdr_in) 341 PARAMS ((bfd *, PTR, PTR)); 342 343 void (*_bfd_coff_swap_reloc_in) 344 PARAMS ((bfd *abfd, PTR, PTR)); 345 346 bfd_boolean (*_bfd_coff_bad_format_hook) 347 PARAMS ((bfd *, PTR)); 348 349 bfd_boolean (*_bfd_coff_set_arch_mach_hook) 350 PARAMS ((bfd *, PTR)); 351 352 PTR (*_bfd_coff_mkobject_hook) 353 PARAMS ((bfd *, PTR, PTR)); 354 355 bfd_boolean (*_bfd_styp_to_sec_flags_hook) 356 PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); 357 358 void (*_bfd_set_alignment_hook) 359 PARAMS ((bfd *, asection *, PTR)); 360 361 bfd_boolean (*_bfd_coff_slurp_symbol_table) 362 PARAMS ((bfd *)); 363 364 bfd_boolean (*_bfd_coff_symname_in_debug) 365 PARAMS ((bfd *, struct internal_syment *)); 366 367 bfd_boolean (*_bfd_coff_pointerize_aux_hook) 368 PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, 369 unsigned int, combined_entry_type *)); 370 371 bfd_boolean (*_bfd_coff_print_aux) 372 PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, 373 combined_entry_type *, unsigned int)); 374 375 void (*_bfd_coff_reloc16_extra_cases) 376 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, 377 bfd_byte *, unsigned int *, unsigned int *)); 378 379 int (*_bfd_coff_reloc16_estimate) 380 PARAMS ((bfd *, asection *, arelent *, unsigned int, 381 struct bfd_link_info *)); 382 383 enum coff_symbol_classification (*_bfd_coff_classify_symbol) 384 PARAMS ((bfd *, struct internal_syment *)); 385 386 bfd_boolean (*_bfd_coff_compute_section_file_positions) 387 PARAMS ((bfd *)); 388 389 bfd_boolean (*_bfd_coff_start_final_link) 390 PARAMS ((bfd *, struct bfd_link_info *)); 391 392 bfd_boolean (*_bfd_coff_relocate_section) 393 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, 394 struct internal_reloc *, struct internal_syment *, asection **)); 395 396 reloc_howto_type *(*_bfd_coff_rtype_to_howto) 397 PARAMS ((bfd *, asection *, struct internal_reloc *, 398 struct coff_link_hash_entry *, struct internal_syment *, 399 bfd_vma *)); 400 401 bfd_boolean (*_bfd_coff_adjust_symndx) 402 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, 403 struct internal_reloc *, bfd_boolean *)); 404 405 bfd_boolean (*_bfd_coff_link_add_one_symbol) 406 PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, 407 asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, 408 struct bfd_link_hash_entry **)); 409 410 bfd_boolean (*_bfd_coff_link_output_has_begun) 411 PARAMS ((bfd *, struct coff_final_link_info *)); 412 413 bfd_boolean (*_bfd_coff_final_link_postscript) 414 PARAMS ((bfd *, struct coff_final_link_info *)); 486 415 487 416 @} bfd_coff_backend_data; 488 417 489 #define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) 418 #define coff_backend_info(abfd) \ 419 ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) 490 420 491 421 #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ 492 ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))422 ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) 493 423 494 424 #define bfd_coff_swap_sym_in(a,e,i) \ 495 ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))425 ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) 496 426 497 427 #define bfd_coff_swap_lineno_in(a,e,i) \ 498 ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))428 ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) 499 429 500 430 #define bfd_coff_swap_reloc_out(abfd, i, o) \ 501 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))431 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) 502 432 503 433 #define bfd_coff_swap_lineno_out(abfd, i, o) \ 504 ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))434 ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) 505 435 506 436 #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ 507 ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))437 ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) 508 438 509 439 #define bfd_coff_swap_sym_out(abfd, i,o) \ 510 ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))440 ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) 511 441 512 442 #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ 513 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))443 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) 514 444 515 445 #define bfd_coff_swap_filehdr_out(abfd, i,o) \ 516 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))446 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) 517 447 518 448 #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ 519 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))449 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) 520 450 521 451 #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) … … 527 457 #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) 528 458 #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) 529 #define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames) 459 #define bfd_coff_long_filenames(abfd) \ 460 (coff_backend_info (abfd)->_bfd_coff_long_filenames) 530 461 #define bfd_coff_long_section_names(abfd) \ 531 (coff_backend_info (abfd)->_bfd_coff_long_section_names)462 (coff_backend_info (abfd)->_bfd_coff_long_section_names) 532 463 #define bfd_coff_default_section_alignment_power(abfd) \ 533 (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)464 (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) 534 465 #define bfd_coff_swap_filehdr_in(abfd, i,o) \ 535 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))466 ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) 536 467 537 468 #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ 538 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))469 ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) 539 470 540 471 #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ 541 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))472 ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) 542 473 543 474 #define bfd_coff_swap_reloc_in(abfd, i, o) \ 544 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))475 ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) 545 476 546 477 #define bfd_coff_bad_format_hook(abfd, filehdr) \ 547 ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))478 ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) 548 479 549 480 #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ 550 ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))481 ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) 551 482 #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ 552 ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) 553 554 #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\ 555 ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ 556 (abfd, scnhdr, name, section)) 483 ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ 484 (abfd, filehdr, aouthdr)) 485 486 #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ 487 ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ 488 (abfd, scnhdr, name, section, flags_ptr)) 557 489 558 490 #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ 559 ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))491 ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) 560 492 561 493 #define bfd_coff_slurp_symbol_table(abfd)\ 562 ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))494 ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) 563 495 564 496 #define bfd_coff_symname_in_debug(abfd, sym)\ 565 ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))497 ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) 566 498 567 499 #define bfd_coff_force_symnames_in_strings(abfd)\ 568 (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)500 (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) 569 501 570 502 #define bfd_coff_debug_string_prefix_length(abfd)\ 571 (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)503 (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) 572 504 573 505 #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ 574 ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ 575 (abfd, file, base, symbol, aux, indaux)) 576 577 #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ 578 ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ 579 (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) 506 ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ 507 (abfd, file, base, symbol, aux, indaux)) 508 509 #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ 510 reloc, data, src_ptr, dst_ptr)\ 511 ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ 512 (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) 580 513 581 514 #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ 582 ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\583 (abfd, section, reloc, shrink, link_info))515 ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ 516 (abfd, section, reloc, shrink, link_info)) 584 517 585 518 #define bfd_coff_classify_symbol(abfd, sym)\ 586 ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\587 (abfd, sym))519 ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ 520 (abfd, sym)) 588 521 589 522 #define bfd_coff_compute_section_file_positions(abfd)\ 590 ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\591 (abfd))523 ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ 524 (abfd)) 592 525 593 526 #define bfd_coff_start_final_link(obfd, info)\ 594 ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\595 (obfd, info))527 ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ 528 (obfd, info)) 596 529 #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ 597 ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\598 (obfd, info, ibfd, o, con, rel, isyms, secs))530 ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ 531 (obfd, info, ibfd, o, con, rel, isyms, secs)) 599 532 #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ 600 ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\601 (abfd, sec, rel, h, sym, addendp))533 ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ 534 (abfd, sec, rel, h, sym, addendp)) 602 535 #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ 603 ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ 604 (obfd, info, ibfd, sec, rel, adjustedp)) 605 #define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ 606 ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ 607 (info, abfd, name, flags, section, value, string, cp, coll, hashp)) 536 ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ 537 (obfd, info, ibfd, sec, rel, adjustedp)) 538 #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ 539 value, string, cp, coll, hashp)\ 540 ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ 541 (info, abfd, name, flags, section, value, string, cp, coll, hashp)) 608 542 609 543 #define bfd_coff_link_output_has_begun(a,p) \ 610 ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p))544 ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) 611 545 #define bfd_coff_final_link_postscript(a,p) \ 612 ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))546 ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) 613 547 614 548 @end example -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/core.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 9 9 @strong{Synopsis} 10 10 @example 11 CONSTchar *bfd_core_file_failing_command(bfd *abfd);11 const char *bfd_core_file_failing_command(bfd *abfd); 12 12 @end example 13 13 @strong{Description}@* … … 29 29 @strong{Synopsis} 30 30 @example 31 b oolean core_file_matches_executable_p31 bfd_boolean core_file_matches_executable_p 32 32 (bfd *core_bfd, bfd *exec_bfd); 33 33 @end example 34 34 @strong{Description}@* 35 Return @code{ true} if the core file attached to @var{core_bfd}35 Return @code{TRUE} if the core file attached to @var{core_bfd} 36 36 was generated by a run of the executable file attached to 37 @var{exec_bfd}, @code{ false} otherwise.37 @var{exec_bfd}, @code{FALSE} otherwise. 38 38 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/elf.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 @section ELF backends 1 @section 2 ELF backends 3 2 4 BFD support for ELF formats is being worked on. 3 5 Currently, the best supported back ends are for sparc and i386 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/format.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 28 28 @strong{Synopsis} 29 29 @example 30 b oolean bfd_check_format(bfd *abfd, bfd_format format);30 bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); 31 31 @end example 32 32 @strong{Description}@* … … 43 43 the file, or an error results. 44 44 45 The function returns @code{ true} on success, otherwise @code{false}45 The function returns @code{TRUE} on success, otherwise @code{FALSE} 46 46 with one of the following error codes: 47 47 … … 71 71 @strong{Synopsis} 72 72 @example 73 boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); 73 bfd_boolean bfd_check_format_matches (bfd *abfd, bfd_format format, 74 char ***matching); 74 75 @end example 75 76 @strong{Description}@* 76 Like @code{bfd_check_format}, except when it returns falsewith77 Like @code{bfd_check_format}, except when it returns FALSE with 77 78 @code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that 78 79 case, if @var{matching} is not NULL, it will be filled in with … … 88 89 @strong{Synopsis} 89 90 @example 90 b oolean bfd_set_format(bfd *abfd, bfd_format format);91 bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); 91 92 @end example 92 93 @strong{Description}@* … … 100 101 @strong{Synopsis} 101 102 @example 102 CONST char *bfd_format_string(bfd_format format);103 const char *bfd_format_string (bfd_format format); 103 104 @end example 104 105 @strong{Description}@* -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/hash.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 36 36 entries you will need, the function @code{bfd_hash_table_init_n}, 37 37 which takes a @var{size} argument, may be used). 38 @code{bfd_hash_table_init} returns @code{ false} if some sort of38 @code{bfd_hash_table_init} returns @code{FALSE} if some sort of 39 39 error occurs. 40 40 … … 62 62 string in the hash table and to create a new entry. 63 63 64 If the @var{create} argument is @code{ false}, @code{bfd_hash_lookup}64 If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup} 65 65 will look up a string. If the string is found, it will 66 66 returns a pointer to a @code{struct bfd_hash_entry}. If the … … 69 69 the returns @code{struct bfd_hash_entry}. 70 70 71 If the @var{create} argument is @code{ true}, the string will be71 If the @var{create} argument is @code{TRUE}, the string will be 72 72 entered into the hash table if it is not already there. 73 73 Either way a pointer to a @code{struct bfd_hash_entry} will be … … 76 76 error occurred. 77 77 78 If the @var{create} argument is @code{ true}, and a new entry is78 If the @var{create} argument is @code{TRUE}, and a new entry is 79 79 created, the @var{copy} argument is used to decide whether to 80 80 copy the string onto the hash table objalloc or not. If 81 @var{copy} is passed as @code{ false}, you must be careful not to81 @var{copy} is passed as @code{FALSE}, you must be careful not to 82 82 deallocate or modify the string as long as the hash table 83 83 exists. … … 96 96 must return a @code{boolean} value, which indicates whether to 97 97 continue traversing the hash table. If the function returns 98 @code{ false}, @code{bfd_hash_traverse} will stop the traversal and98 @code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and 99 99 return immediately. 100 100 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/libbfd.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 11 11 @strong{Synopsis} 12 12 @example 13 void bfd_write_bigendian_4byte_int(bfd *abfd, int i);13 bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); 14 14 @end example 15 15 @strong{Description}@* … … 48 48 bfd_put_8 49 49 #define bfd_get_8(abfd, ptr) \ 50 (*(unsigned char *) (ptr) )50 (*(unsigned char *) (ptr) & 0xff) 51 51 #define bfd_get_signed_8(abfd, ptr) \ 52 (( *(unsigned char *) (ptr) ^ 0x80) - 0x80)52 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) 53 53 54 54 #define bfd_put_16(abfd, val, ptr) \ … … 80 80 81 81 #define bfd_get(bits, abfd, ptr) \ 82 ( (bits) == 8 ? bfd_get_8 (abfd, ptr)\82 ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ 83 83 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ 84 84 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ … … 87 87 88 88 #define bfd_put(bits, abfd, val, ptr) \ 89 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr)\89 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ 90 90 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ 91 91 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ … … 99 99 @strong{Description}@* 100 100 These macros have the same function as their @code{bfd_get_x} 101 breth eren, except that they are used for removing information101 brethren, except that they are used for removing information 102 102 for the header records of object files. Believe it or not, 103 103 some object files keep their header records in big endian … … 108 108 109 109 #define bfd_h_put_8(abfd, val, ptr) \ 110 bfd_put_8 (abfd, val, ptr)110 bfd_put_8 (abfd, val, ptr) 111 111 #define bfd_h_put_signed_8(abfd, val, ptr) \ 112 bfd_put_8 (abfd, val, ptr)112 bfd_put_8 (abfd, val, ptr) 113 113 #define bfd_h_get_8(abfd, ptr) \ 114 bfd_get_8 (abfd, ptr)114 bfd_get_8 (abfd, ptr) 115 115 #define bfd_h_get_signed_8(abfd, ptr) \ 116 bfd_get_signed_8 (abfd, ptr)116 bfd_get_signed_8 (abfd, ptr) 117 117 118 118 #define bfd_h_put_16(abfd, val, ptr) \ 119 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))119 BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) 120 120 #define bfd_h_put_signed_16 \ 121 bfd_h_put_16121 bfd_h_put_16 122 122 #define bfd_h_get_16(abfd, ptr) \ 123 BFD_SEND(abfd, bfd_h_getx16,(ptr))123 BFD_SEND (abfd, bfd_h_getx16, (ptr)) 124 124 #define bfd_h_get_signed_16(abfd, ptr) \ 125 BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))125 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) 126 126 127 127 #define bfd_h_put_32(abfd, val, ptr) \ 128 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))128 BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) 129 129 #define bfd_h_put_signed_32 \ 130 bfd_h_put_32130 bfd_h_put_32 131 131 #define bfd_h_get_32(abfd, ptr) \ 132 BFD_SEND(abfd, bfd_h_getx32,(ptr))132 BFD_SEND (abfd, bfd_h_getx32, (ptr)) 133 133 #define bfd_h_get_signed_32(abfd, ptr) \ 134 BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))134 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) 135 135 136 136 #define bfd_h_put_64(abfd, val, ptr) \ 137 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))137 BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) 138 138 #define bfd_h_put_signed_64 \ 139 bfd_h_put_64139 bfd_h_put_64 140 140 #define bfd_h_get_64(abfd, ptr) \ 141 BFD_SEND(abfd, bfd_h_getx64,(ptr))141 BFD_SEND (abfd, bfd_h_getx64, (ptr)) 142 142 #define bfd_h_get_signed_64(abfd, ptr) \ 143 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) 143 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) 144 145 /* Refinements on the above, which should eventually go away. Save 146 cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ 147 148 #define H_PUT_64(abfd, val, where) \ 149 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 150 151 #define H_PUT_32(abfd, val, where) \ 152 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 153 154 #define H_PUT_16(abfd, val, where) \ 155 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 156 157 #define H_PUT_8 bfd_h_put_8 158 159 #define H_PUT_S64(abfd, val, where) \ 160 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 161 162 #define H_PUT_S32(abfd, val, where) \ 163 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 164 165 #define H_PUT_S16(abfd, val, where) \ 166 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 167 168 #define H_PUT_S8 bfd_h_put_signed_8 169 170 #define H_GET_64(abfd, where) \ 171 bfd_h_get_64 ((abfd), (bfd_byte *) (where)) 172 173 #define H_GET_32(abfd, where) \ 174 bfd_h_get_32 ((abfd), (bfd_byte *) (where)) 175 176 #define H_GET_16(abfd, where) \ 177 bfd_h_get_16 ((abfd), (bfd_byte *) (where)) 178 179 #define H_GET_8 bfd_h_get_8 180 181 #define H_GET_S64(abfd, where) \ 182 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) 183 184 #define H_GET_S32(abfd, where) \ 185 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) 186 187 #define H_GET_S16(abfd, where) \ 188 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) 189 190 #define H_GET_S8 bfd_h_get_signed_8 191 144 192 145 193 @end example … … 149 197 @strong{Synopsis} 150 198 @example 151 unsigned int bfd_log2 (bfd_vma x);199 unsigned int bfd_log2 (bfd_vma x); 152 200 @end example 153 201 @strong{Description}@* 154 202 Return the log base 2 of the value supplied, rounded up. E.g., an 155 @var{x} of 1025 returns 11. 156 203 @var{x} of 1025 returns 11. A @var{x} of 0 returns 0. 204 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/linker.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 159 159 routine should save it somewhere attached to the object file 160 160 BFD. However, the information should only be saved if the 161 @code{keep_memory} field of the @code{info} argument is true, so161 @code{keep_memory} field of the @code{info} argument is TRUE, so 162 162 that the @code{-no-keep-memory} linker switch is effective. 163 163 … … 353 353 @strong{Synopsis} 354 354 @example 355 b oolean bfd_link_split_section(bfd *abfd, asection *sec);355 bfd_boolean bfd_link_split_section(bfd *abfd, asection *sec); 356 356 @end example 357 357 @strong{Description}@* -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/opncls.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 6 6 @strong{Synopsis} 7 7 @example 8 bfd *bfd_openr( CONST char *filename, CONSTchar *target);8 bfd *bfd_openr(const char *filename, const char *target); 9 9 @end example 10 10 @strong{Description}@* … … 16 16 17 17 If @code{NULL} is returned then an error has occured. Possible errors 18 are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or @code{system_call} error. 18 are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or 19 @code{system_call} error. 19 20 20 21 @findex bfd_fdopenr … … 22 23 @strong{Synopsis} 23 24 @example 24 bfd *bfd_fdopenr( CONST char *filename, CONSTchar *target, int fd);25 @end example 26 @strong{Description}@* 27 @code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to @code{fopen}.28 It opens a BFD on a file already described by the @var{fd} 29 supplied.30 31 When the file is later @code{bfd_close}d, the file descriptor will be closed.32 33 If the caller desires that this file descriptor be cached by BFD 34 (opened as needed, closed as needed to free descriptors for 35 other opens), with the supplied @var{fd} used as an initial 36 file descriptor (but subject to closure at any time), call 37 bfd_set_cacheable(bfd, 1) on the returned BFD. The default is to 38 assume no cacheing; the file descriptor will remain open until 39 @code{bfd_close}, and will not be affected by BFD operations on other 40 files. 41 42 Possible errors are @code{bfd_error_no_memory},@code{bfd_error_invalid_target} and @code{bfd_error_system_call}.25 bfd *bfd_fdopenr(const char *filename, const char *target, int fd); 26 @end example 27 @strong{Description}@* 28 @code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to 29 @code{fopen}. It opens a BFD on a file already described by the 30 @var{fd} supplied. 31 32 When the file is later @code{bfd_close}d, the file descriptor will 33 be closed. If the caller desires that this file descriptor be 34 cached by BFD (opened as needed, closed as needed to free 35 descriptors for other opens), with the supplied @var{fd} used as 36 an initial file descriptor (but subject to closure at any time), 37 call bfd_set_cacheable(bfd, 1) on the returned BFD. The default 38 is to assume no cacheing; the file descriptor will remain open 39 until @code{bfd_close}, and will not be affected by BFD operations 40 on other files. 41 42 Possible errors are @code{bfd_error_no_memory}, 43 @code{bfd_error_invalid_target} and @code{bfd_error_system_call}. 43 44 44 45 @findex bfd_openstreamr … … 56 57 @strong{Synopsis} 57 58 @example 58 bfd *bfd_openw( CONST char *filename, CONSTchar *target);59 bfd *bfd_openw(const char *filename, const char *target); 59 60 @end example 60 61 @strong{Description}@* … … 69 70 @strong{Synopsis} 70 71 @example 71 b oolean bfd_close(bfd *abfd);72 @end example 73 @strong{Description}@* 74 Close a BFD. If the BFD was open for writing, 75 then pending operations are completed and the file written out 76 and closed. If the created file is executable, then 77 @code{chmod} is calledto mark it as such.72 bfd_boolean bfd_close (bfd *abfd); 73 @end example 74 @strong{Description}@* 75 Close a BFD. If the BFD was open for writing, then pending 76 operations are completed and the file written out and closed. 77 If the created file is executable, then @code{chmod} is called 78 to mark it as such. 78 79 79 80 All memory attached to the BFD is released. … … 83 84 84 85 @strong{Returns}@* 85 @code{ true} is returned if all is ok, otherwise @code{false}.86 @code{TRUE} is returned if all is ok, otherwise @code{FALSE}. 86 87 87 88 @findex bfd_close_all_done … … 89 90 @strong{Synopsis} 90 91 @example 91 b oolean bfd_close_all_done(bfd *);92 @end example 93 @strong{Description}@* 94 Close a BFD. Differs from @code{bfd_close} 95 since it does not complete any pending operations. This 96 routine would be used if the application had just used BFD for 97 swapping and didn'twant to use any of the writing code.92 bfd_boolean bfd_close_all_done (bfd *); 93 @end example 94 @strong{Description}@* 95 Close a BFD. Differs from @code{bfd_close} since it does not 96 complete any pending operations. This routine would be used 97 if the application had just used BFD for swapping and didn't 98 want to use any of the writing code. 98 99 99 100 If the created file is executable, then @code{chmod} is called … … 103 104 104 105 @strong{Returns}@* 105 @code{ true} is returned if all is ok, otherwise @code{false}.106 @code{TRUE} is returned if all is ok, otherwise @code{FALSE}. 106 107 107 108 @findex bfd_create … … 109 110 @strong{Synopsis} 110 111 @example 111 bfd *bfd_create(CONST char *filename, bfd *templ); 112 @end example 113 @strong{Description}@* 114 Create a new BFD in the manner of 115 @code{bfd_openw}, but without opening a file. The new BFD 116 takes the target from the target used by @var{template}. The 117 format is always set to @code{bfd_object}. 112 bfd *bfd_create(const char *filename, bfd *templ); 113 @end example 114 @strong{Description}@* 115 Create a new BFD in the manner of @code{bfd_openw}, but without 116 opening a file. The new BFD takes the target from the target 117 used by @var{template}. The format is always set to @code{bfd_object}. 118 118 119 119 @findex bfd_make_writable … … 121 121 @strong{Synopsis} 122 122 @example 123 b oolean bfd_make_writable(bfd *abfd);123 bfd_boolean bfd_make_writable (bfd *abfd); 124 124 @end example 125 125 @strong{Description}@* … … 130 130 131 131 @strong{Returns}@* 132 @code{ true} is returned if all is ok, otherwise @code{false}.132 @code{TRUE} is returned if all is ok, otherwise @code{FALSE}. 133 133 134 134 @findex bfd_make_readable … … 136 136 @strong{Synopsis} 137 137 @example 138 b oolean bfd_make_readable(bfd *abfd);138 bfd_boolean bfd_make_readable (bfd *abfd); 139 139 @end example 140 140 @strong{Description}@* … … 146 146 147 147 @strong{Returns}@* 148 @code{ true} is returned if all is ok, otherwise @code{false}.148 @code{TRUE} is returned if all is ok, otherwise @code{FALSE}. 149 149 150 150 @findex bfd_alloc … … 158 158 @code{abfd} and return a pointer to it. 159 159 160 @findex calc_crc32 161 @subsubsection @code{calc_crc32} 162 @strong{Synopsis} 163 @example 164 unsigned long calc_crc32 (unsigned long crc, const unsigned char *buf, size_t len); 165 @end example 166 @strong{Description}@* 167 Advance the CRC32 given by @var{crc} through @var{len} 168 bytes of @var{buf}. Return the updated CRC32 value. 169 170 @findex get_debug_link_info 171 @subsubsection @code{get_debug_link_info} 172 @strong{Synopsis} 173 @example 174 char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out) 175 @end example 176 @strong{Description}@* 177 fetch the filename and CRC32 value for any separate debuginfo 178 associated with @var{abfd}. Return NULL if no such info found, 179 otherwise return filename and update @var{crc32_out}. 180 181 @findex separate_debug_file_exists 182 @subsubsection @code{separate_debug_file_exists} 183 @strong{Synopsis} 184 @example 185 bfd_boolean separate_debug_file_exists (char * name, unsigned long crc32) 186 @end example 187 @strong{Description}@* 188 Checks to see if @var{name} is a file and if its contents 189 match @var{crc32}. 190 191 @findex find_separate_debug_file 192 @subsubsection @code{find_separate_debug_file} 193 @strong{Synopsis} 194 @example 195 char * find_separate_debug_file (bfd *abfd) 196 @end example 197 @strong{Description}@* 198 Searches @var{abfd} for a reference to separate debugging 199 information, scans various locations in the filesystem, including 200 the file tree rooted at @var{debug_file_directory}, and returns a 201 filename of such debugging information if the file is found and has 202 matching CRC32. Returns NULL if no reference to debugging file 203 exists, or file cannot be found. 204 205 @findex bfd_follow_gnu_debuglink 206 @subsubsection @code{bfd_follow_gnu_debuglink} 207 @strong{Synopsis} 208 @example 209 char * bfd_follow_gnu_debuglink(bfd *abfd, const char *dir); 210 @end example 211 @strong{Description}@* 212 Takes a BFD and searches it for a .gnu_debuglink section. If this 213 section is found, examines the section for the name and checksum of 214 a '.debug' file containing auxiliary debugging 215 information. Searches filesystem for .debug file in some standard 216 locations, including the directory tree rooted at @var{dir}, and if 217 found returns the full filename. If @var{dir} is NULL, will search 218 default path configured into libbfd at build time. 219 220 @strong{Returns}@* 221 @code{NULL} on any errors or failure to locate the .debug file, 222 otherwise a pointer to a heap-allocated string containing the 223 filename. The caller is responsible for freeing this string. 224 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/proto.str
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 115 115 get_stuff_in_command 116 116 strip_trailing_newlines 117 "\n{* " swap catstr " *}\n" catstr117 "\n{* " swap catstr " *}\n" catstr 118 118 translatecomments 119 119 - discard it if we're doing internal mode -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/reloc.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 28 28 typedef enum bfd_reloc_status 29 29 @{ 30 /* No errors detected*/30 /* No errors detected. */ 31 31 bfd_reloc_ok, 32 32 33 /* The relocation was performed, but there was an overflow.*/33 /* The relocation was performed, but there was an overflow. */ 34 34 bfd_reloc_overflow, 35 35 36 /* The address to relocate was not within the section supplied.*/36 /* The address to relocate was not within the section supplied. */ 37 37 bfd_reloc_outofrange, 38 38 39 /* Used by special functions*/39 /* Used by special functions. */ 40 40 bfd_reloc_continue, 41 41 42 /* Unsupported relocation size requested.*/42 /* Unsupported relocation size requested. */ 43 43 bfd_reloc_notsupported, 44 44 45 /* Unused*/45 /* Unused. */ 46 46 bfd_reloc_other, 47 47 48 /* The symbol to relocate against was undefined.*/48 /* The symbol to relocate against was undefined. */ 49 49 bfd_reloc_undefined, 50 50 51 /* The relocation was performed, but may not be ok - presently52 generated only when linking i960 coff files with i960 b.out53 symbols. If this type is returned, the error_message argument54 to bfd_perform_relocation will be set. */51 /* The relocation was performed, but may not be ok - presently 52 generated only when linking i960 coff files with i960 b.out 53 symbols. If this type is returned, the error_message argument 54 to bfd_perform_relocation will be set. */ 55 55 bfd_reloc_dangerous 56 56 @} … … 60 60 typedef struct reloc_cache_entry 61 61 @{ 62 /* A pointer into the canonical table of pointers*/62 /* A pointer into the canonical table of pointers. */ 63 63 struct symbol_cache_entry **sym_ptr_ptr; 64 64 65 /* offset in section*/65 /* offset in section. */ 66 66 bfd_size_type address; 67 67 68 /* addend for relocation value*/68 /* addend for relocation value. */ 69 69 bfd_vma addend; 70 70 71 /* Pointer to how to perform the required relocation*/71 /* Pointer to how to perform the required relocation. */ 72 72 reloc_howto_type *howto; 73 73 74 @} arelent; 74 @} 75 arelent; 76 75 77 @end example 76 78 @strong{Description}@* … … 231 233 enum complain_overflow 232 234 @{ 233 /* Do not complain on overflow.*/235 /* Do not complain on overflow. */ 234 236 complain_overflow_dont, 235 237 236 /* Complain if the bitfield overflows, whether it is considered237 as signed or unsigned.*/238 /* Complain if the bitfield overflows, whether it is considered 239 as signed or unsigned. */ 238 240 complain_overflow_bitfield, 239 241 240 /* Complain if the value overflows when considered as signed241 number.*/242 /* Complain if the value overflows when considered as signed 243 number. */ 242 244 complain_overflow_signed, 243 245 244 /* Complain if the value overflows when considered as an245 unsigned number.*/246 /* Complain if the value overflows when considered as an 247 unsigned number. */ 246 248 complain_overflow_unsigned 247 249 @}; … … 253 255 254 256 @example 255 struct symbol_cache_entry; /* Forward declaration */257 struct symbol_cache_entry; /* Forward declaration. */ 256 258 257 259 struct reloc_howto_struct 258 260 @{ 259 /* The type field has mainly a documentary use - the back end can260 do what it wants with it, though normally the back end's261 external idea of what a reloc number is stored262 in this field.For example, a PC relative word relocation263 in a coff environment has the type 023 - because that's264 what the outside world calls a R_PCRWORD reloc.*/261 /* The type field has mainly a documentary use - the back end can 262 do what it wants with it, though normally the back end's 263 external idea of what a reloc number is stored 264 in this field. For example, a PC relative word relocation 265 in a coff environment has the type 023 - because that's 266 what the outside world calls a R_PCRWORD reloc. */ 265 267 unsigned int type; 266 268 267 /* The value the final relocation is shifted right by.This drops268 unwanted data from the relocation. */269 /* The value the final relocation is shifted right by. This drops 270 unwanted data from the relocation. */ 269 271 unsigned int rightshift; 270 272 271 /* The size of the item to be relocated. This is *not* a272 power-of-two measure. To get the number of bytes operated273 on by a type of relocation, use bfd_get_reloc_size. */273 /* The size of the item to be relocated. This is *not* a 274 power-of-two measure. To get the number of bytes operated 275 on by a type of relocation, use bfd_get_reloc_size. */ 274 276 int size; 275 277 276 /* The number of bits in the item to be relocated. This is used277 when doing overflow checking. */278 /* The number of bits in the item to be relocated. This is used 279 when doing overflow checking. */ 278 280 unsigned int bitsize; 279 281 280 /* Notes that the relocation is relative to the location in the281 data section of the addend.The relocation function will282 subtract from the relocation value the address of the location283 being relocated.*/284 b oolean pc_relative;285 286 /* The bit position of the reloc value in the destination.287 The relocated value is left shifted by this amount.*/282 /* Notes that the relocation is relative to the location in the 283 data section of the addend. The relocation function will 284 subtract from the relocation value the address of the location 285 being relocated. */ 286 bfd_boolean pc_relative; 287 288 /* The bit position of the reloc value in the destination. 289 The relocated value is left shifted by this amount. */ 288 290 unsigned int bitpos; 289 291 290 /* What type of overflow error should be checked for when291 relocating.*/292 /* What type of overflow error should be checked for when 293 relocating. */ 292 294 enum complain_overflow complain_on_overflow; 293 295 294 /* If this field is non null, then the supplied function is295 called rather than the normal function.This allows really296 strange relocation methods to be accomodated (e.g., i960 callj297 instructions).*/296 /* If this field is non null, then the supplied function is 297 called rather than the normal function. This allows really 298 strange relocation methods to be accomodated (e.g., i960 callj 299 instructions). */ 298 300 bfd_reloc_status_type (*special_function) 299 PARAMS ((bfd *abfd, 300 arelent *reloc_entry, 301 struct symbol_cache_entry *symbol, 302 PTR data, 303 asection *input_section, 304 bfd *output_bfd, 305 char **error_message)); 306 307 /* The textual name of the relocation type. */ 301 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, 302 bfd *, char **)); 303 304 /* The textual name of the relocation type. */ 308 305 char *name; 309 306 310 /* Some formats record a relocation addend in the section contents 311 rather than with the relocation. For ELF formats this is the 312 distinction between USE_REL and USE_RELA (though the code checks 313 for USE_REL == 1/0). The value of this field is TRUE if the 314 addend is recorded with the section contents; when performing a 315 partial link (ld -r) the section contents (the data) will be 316 modified. The value of this field is FALSE if addends are 317 recorded with the relocation (in arelent.addend); when performing 318 a partial link the relocation will be modified. 319 All relocations for all ELF USE_RELA targets should set this field 320 to FALSE (values of TRUE should be looked on with suspicion). 321 However, the converse is not true: not all relocations of all ELF 322 USE_REL targets set this field to TRUE. Why this is so is peculiar 323 to each particular target. For relocs that aren't used in partial 324 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 325 boolean partial_inplace; 326 327 /* The src_mask selects which parts of the read in data 328 are to be used in the relocation sum. E.g., if this was an 8 bit 329 byte of data which we read and relocated, this would be 330 0x000000ff. When we have relocs which have an addend, such as 331 sun4 extended relocs, the value in the offset part of a 332 relocating field is garbage so we never use it. In this case 333 the mask would be 0x00000000. */ 307 /* Some formats record a relocation addend in the section contents 308 rather than with the relocation. For ELF formats this is the 309 distinction between USE_REL and USE_RELA (though the code checks 310 for USE_REL == 1/0). The value of this field is TRUE if the 311 addend is recorded with the section contents; when performing a 312 partial link (ld -r) the section contents (the data) will be 313 modified. The value of this field is FALSE if addends are 314 recorded with the relocation (in arelent.addend); when performing 315 a partial link the relocation will be modified. 316 All relocations for all ELF USE_RELA targets should set this field 317 to FALSE (values of TRUE should be looked on with suspicion). 318 However, the converse is not true: not all relocations of all ELF 319 USE_REL targets set this field to TRUE. Why this is so is peculiar 320 to each particular target. For relocs that aren't used in partial 321 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 322 bfd_boolean partial_inplace; 323 324 /* src_mask selects the part of the instruction (or data) to be used 325 in the relocation sum. If the target relocations don't have an 326 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 327 dst_mask to extract the addend from the section contents. If 328 relocations do have an addend in the reloc, eg. ELF USE_RELA, this 329 field should be zero. Non-zero values for ELF USE_RELA targets are 330 bogus as in those cases the value in the dst_mask part of the 331 section contents should be treated as garbage. */ 334 332 bfd_vma src_mask; 335 333 336 /* The dst_mask selects which parts of the instruction are replaced 337 into the instruction. In most cases src_mask == dst_mask, 338 except in the above special case, where dst_mask would be 339 0x000000ff, and src_mask would be 0x00000000. */ 334 /* dst_mask selects which parts of the instruction (or data) are 335 replaced with a relocated value. */ 340 336 bfd_vma dst_mask; 341 337 342 /* When some formats create PC relative instructions, they leave 343 the value of the pc of the place being relocated in the offset 344 slot of the instruction, so that a PC relative relocation can 345 be made just by adding in an ordinary offset (e.g., sun3 a.out). 346 Some formats leave the displacement part of an instruction 347 empty (e.g., m88k bcs); this flag signals the fact.*/ 348 boolean pcrel_offset; 349 338 /* When some formats create PC relative instructions, they leave 339 the value of the pc of the place being relocated in the offset 340 slot of the instruction, so that a PC relative relocation can 341 be made just by adding in an ordinary offset (e.g., sun3 a.out). 342 Some formats leave the displacement part of an instruction 343 empty (e.g., m88k bcs); this flag signals the fact. */ 344 bfd_boolean pcrel_offset; 350 345 @}; 346 351 347 @end example 352 348 @findex The HOWTO Macro … … 355 351 The HOWTO define is horrible and will go away. 356 352 @example 357 #define HOWTO(C, R, S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \358 @{ (unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC@}353 #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 354 @{ (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC @} 359 355 @end example 360 356 … … 363 359 moment, we are compatible, so do it this way. 364 360 @example 365 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) 361 #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 362 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 363 NAME, FALSE, 0, 0, IN) 366 364 367 365 @end example … … 371 369 @example 372 370 #define EMPTY_HOWTO(C) \ 373 HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) 371 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 372 NULL, FALSE, 0, 0, FALSE) 374 373 375 374 @end example … … 378 377 Helper routine to turn a symbol into a relocation value. 379 378 @example 380 #define HOWTO_PREPARE(relocation, symbol) \ 381 @{ \ 382 if (symbol != (asymbol *)NULL) @{ \ 383 if (bfd_is_com_section (symbol->section)) @{ \ 384 relocation = 0; \ 385 @} \ 386 else @{ \ 387 relocation = symbol->value; \ 388 @} \ 389 @} \ 390 @} 379 #define HOWTO_PREPARE(relocation, symbol) \ 380 @{ \ 381 if (symbol != (asymbol *) NULL) \ 382 @{ \ 383 if (bfd_is_com_section (symbol->section)) \ 384 @{ \ 385 relocation = 0; \ 386 @} \ 387 else \ 388 @{ \ 389 relocation = symbol->value; \ 390 @} \ 391 @} \ 392 @} 393 391 394 @end example 392 395 … … 406 409 How relocs are tied together in an @code{asection}: 407 410 @example 408 typedef struct relent_chain @{ 411 typedef struct relent_chain 412 @{ 409 413 arelent relent; 410 struct relent_chain *next; 411 @} arelent_chain; 414 struct relent_chain *next; 415 @} 416 arelent_chain; 417 412 418 @end example 413 419 … … 532 538 @deffnx {} BFD_RELOC_HI16_S_GOTOFF 533 539 @deffnx {} BFD_RELOC_8_GOTOFF 540 @deffnx {} BFD_RELOC_64_PLT_PCREL 534 541 @deffnx {} BFD_RELOC_32_PLT_PCREL 535 542 @deffnx {} BFD_RELOC_24_PLT_PCREL 536 543 @deffnx {} BFD_RELOC_16_PLT_PCREL 537 544 @deffnx {} BFD_RELOC_8_PLT_PCREL 545 @deffnx {} BFD_RELOC_64_PLTOFF 538 546 @deffnx {} BFD_RELOC_32_PLTOFF 539 547 @deffnx {} BFD_RELOC_16_PLTOFF … … 626 634 @deffnx {} BFD_RELOC_SPARC_5 627 635 @deffnx {} BFD_RELOC_SPARC_DISP64 636 @deffnx {} BFD_RELOC_SPARC_PLT32 628 637 @deffnx {} BFD_RELOC_SPARC_PLT64 629 638 @deffnx {} BFD_RELOC_SPARC_HIX22 … … 638 647 SPARC little endian relocation 639 648 @end deffn 649 @deffn {} BFD_RELOC_SPARC_TLS_GD_HI22 650 @deffnx {} BFD_RELOC_SPARC_TLS_GD_LO10 651 @deffnx {} BFD_RELOC_SPARC_TLS_GD_ADD 652 @deffnx {} BFD_RELOC_SPARC_TLS_GD_CALL 653 @deffnx {} BFD_RELOC_SPARC_TLS_LDM_HI22 654 @deffnx {} BFD_RELOC_SPARC_TLS_LDM_LO10 655 @deffnx {} BFD_RELOC_SPARC_TLS_LDM_ADD 656 @deffnx {} BFD_RELOC_SPARC_TLS_LDM_CALL 657 @deffnx {} BFD_RELOC_SPARC_TLS_LDO_HIX22 658 @deffnx {} BFD_RELOC_SPARC_TLS_LDO_LOX10 659 @deffnx {} BFD_RELOC_SPARC_TLS_LDO_ADD 660 @deffnx {} BFD_RELOC_SPARC_TLS_IE_HI22 661 @deffnx {} BFD_RELOC_SPARC_TLS_IE_LO10 662 @deffnx {} BFD_RELOC_SPARC_TLS_IE_LD 663 @deffnx {} BFD_RELOC_SPARC_TLS_IE_LDX 664 @deffnx {} BFD_RELOC_SPARC_TLS_IE_ADD 665 @deffnx {} BFD_RELOC_SPARC_TLS_LE_HIX22 666 @deffnx {} BFD_RELOC_SPARC_TLS_LE_LOX10 667 @deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD32 668 @deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD64 669 @deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF32 670 @deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF64 671 @deffnx {} BFD_RELOC_SPARC_TLS_TPOFF32 672 @deffnx {} BFD_RELOC_SPARC_TLS_TPOFF64 673 SPARC TLS relocations 674 @end deffn 640 675 @deffn {} BFD_RELOC_ALPHA_GPDISP_HI16 641 676 Alpha ECOFF and ELF relocations. Some of these treat the symbol or … … 683 718 2 - byte-manipulation (byte offset reg) 684 719 3 - jsr (target of branch) 685 686 The GNU linker currently doesn't do any of this optimizing.687 @end deffn688 @deffn {} BFD_RELOC_ALPHA_USER_LITERAL689 @deffnx {} BFD_RELOC_ALPHA_USER_LITUSE_BASE690 @deffnx {} BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF691 @deffnx {} BFD_RELOC_ALPHA_USER_LITUSE_JSR692 @deffnx {} BFD_RELOC_ALPHA_USER_GPDISP693 @deffnx {} BFD_RELOC_ALPHA_USER_GPRELHIGH694 @deffnx {} BFD_RELOC_ALPHA_USER_GPRELLOW695 The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to696 process the explicit !<reloc>!sequence relocations, and are mapped697 into the normal relocations at the end of processing.698 720 @end deffn 699 721 @deffn {} BFD_RELOC_ALPHA_HINT … … 709 731 The CODEADDR relocation outputs a STO_CA in the object file, 710 732 which is filled by the linker. 733 @end deffn 734 @deffn {} BFD_RELOC_ALPHA_GPREL_HI16 735 @deffnx {} BFD_RELOC_ALPHA_GPREL_LO16 736 The GPREL_HI/LO relocations together form a 32-bit offset from the 737 GP register. 738 @end deffn 739 @deffn {} BFD_RELOC_ALPHA_BRSGP 740 Like BFD_RELOC_23_PCREL_S2, except that the source and target must 741 share a common GP, and the target address is adjusted for 742 STO_ALPHA_STD_GPLOAD. 743 @end deffn 744 @deffn {} BFD_RELOC_ALPHA_TLSGD 745 @deffnx {} BFD_RELOC_ALPHA_TLSLDM 746 @deffnx {} BFD_RELOC_ALPHA_DTPMOD64 747 @deffnx {} BFD_RELOC_ALPHA_GOTDTPREL16 748 @deffnx {} BFD_RELOC_ALPHA_DTPREL64 749 @deffnx {} BFD_RELOC_ALPHA_DTPREL_HI16 750 @deffnx {} BFD_RELOC_ALPHA_DTPREL_LO16 751 @deffnx {} BFD_RELOC_ALPHA_DTPREL16 752 @deffnx {} BFD_RELOC_ALPHA_GOTTPREL16 753 @deffnx {} BFD_RELOC_ALPHA_TPREL64 754 @deffnx {} BFD_RELOC_ALPHA_TPREL_HI16 755 @deffnx {} BFD_RELOC_ALPHA_TPREL_LO16 756 @deffnx {} BFD_RELOC_ALPHA_TPREL16 757 Alpha thread-local storage relocations. 711 758 @end deffn 712 759 @deffn {} BFD_RELOC_MIPS_JMP … … 738 785 Like BFD_RELOC_LO16, but PC relative. 739 786 @end deffn 740 @deffn {} BFD_RELOC_MIPS_GPREL741 Relocation relative to the global pointer.742 @end deffn743 787 @deffn {} BFD_RELOC_MIPS_LITERAL 744 788 Relocation against a MIPS literal section. … … 746 790 @deffn {} BFD_RELOC_MIPS_GOT16 747 791 @deffnx {} BFD_RELOC_MIPS_CALL16 748 @deffnx {} BFD_RELOC_MIPS_GPREL32749 792 @deffnx {} BFD_RELOC_MIPS_GOT_HI16 750 793 @deffnx {} BFD_RELOC_MIPS_GOT_LO16 … … 766 809 @deffnx {} BFD_RELOC_MIPS_RELGOT 767 810 @deffnx {} BFD_RELOC_MIPS_JALR 811 @deffn {} BFD_RELOC_FRV_LABEL16 812 @deffnx {} BFD_RELOC_FRV_LABEL24 813 @deffnx {} BFD_RELOC_FRV_LO16 814 @deffnx {} BFD_RELOC_FRV_HI16 815 @deffnx {} BFD_RELOC_FRV_GPREL12 816 @deffnx {} BFD_RELOC_FRV_GPRELU12 817 @deffnx {} BFD_RELOC_FRV_GPREL32 818 @deffnx {} BFD_RELOC_FRV_GPRELHI 819 @deffnx {} BFD_RELOC_FRV_GPRELLO 820 Fujitsu Frv Relocations. 821 @end deffn 768 822 MIPS ELF relocations. 769 823 @end deffn … … 776 830 @deffnx {} BFD_RELOC_386_GOTOFF 777 831 @deffnx {} BFD_RELOC_386_GOTPC 832 @deffnx {} BFD_RELOC_386_TLS_TPOFF 833 @deffnx {} BFD_RELOC_386_TLS_IE 834 @deffnx {} BFD_RELOC_386_TLS_GOTIE 835 @deffnx {} BFD_RELOC_386_TLS_LE 836 @deffnx {} BFD_RELOC_386_TLS_GD 837 @deffnx {} BFD_RELOC_386_TLS_LDM 838 @deffnx {} BFD_RELOC_386_TLS_LDO_32 839 @deffnx {} BFD_RELOC_386_TLS_IE_32 840 @deffnx {} BFD_RELOC_386_TLS_LE_32 841 @deffnx {} BFD_RELOC_386_TLS_DTPMOD32 842 @deffnx {} BFD_RELOC_386_TLS_DTPOFF32 843 @deffnx {} BFD_RELOC_386_TLS_TPOFF32 778 844 i386/elf relocations 779 845 @end deffn … … 786 852 @deffnx {} BFD_RELOC_X86_64_GOTPCREL 787 853 @deffnx {} BFD_RELOC_X86_64_32S 854 @deffnx {} BFD_RELOC_X86_64_DTPMOD64 855 @deffnx {} BFD_RELOC_X86_64_DTPOFF64 856 @deffnx {} BFD_RELOC_X86_64_TPOFF64 857 @deffnx {} BFD_RELOC_X86_64_TLSGD 858 @deffnx {} BFD_RELOC_X86_64_TLSLD 859 @deffnx {} BFD_RELOC_X86_64_DTPOFF32 860 @deffnx {} BFD_RELOC_X86_64_GOTTPOFF 861 @deffnx {} BFD_RELOC_X86_64_TPOFF32 788 862 x86-64/elf relocations 789 863 @end deffn … … 801 875 @deffnx {} BFD_RELOC_NS32K_DISP_32_PCREL 802 876 ns32k relocations 877 @end deffn 878 @deffn {} BFD_RELOC_PDP11_DISP_8_PCREL 879 @deffnx {} BFD_RELOC_PDP11_DISP_6_PCREL 880 PDP11 relocations 803 881 @end deffn 804 882 @deffn {} BFD_RELOC_PJ_CODE_HI16 … … 840 918 @deffnx {} BFD_RELOC_PPC_EMB_BIT_FLD 841 919 @deffnx {} BFD_RELOC_PPC_EMB_RELSDA 920 @deffnx {} BFD_RELOC_PPC64_HIGHER 921 @deffnx {} BFD_RELOC_PPC64_HIGHER_S 922 @deffnx {} BFD_RELOC_PPC64_HIGHEST 923 @deffnx {} BFD_RELOC_PPC64_HIGHEST_S 924 @deffnx {} BFD_RELOC_PPC64_TOC16_LO 925 @deffnx {} BFD_RELOC_PPC64_TOC16_HI 926 @deffnx {} BFD_RELOC_PPC64_TOC16_HA 927 @deffnx {} BFD_RELOC_PPC64_TOC 928 @deffnx {} BFD_RELOC_PPC64_PLTGOT16 929 @deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO 930 @deffnx {} BFD_RELOC_PPC64_PLTGOT16_HI 931 @deffnx {} BFD_RELOC_PPC64_PLTGOT16_HA 932 @deffnx {} BFD_RELOC_PPC64_ADDR16_DS 933 @deffnx {} BFD_RELOC_PPC64_ADDR16_LO_DS 934 @deffnx {} BFD_RELOC_PPC64_GOT16_DS 935 @deffnx {} BFD_RELOC_PPC64_GOT16_LO_DS 936 @deffnx {} BFD_RELOC_PPC64_PLT16_LO_DS 937 @deffnx {} BFD_RELOC_PPC64_SECTOFF_DS 938 @deffnx {} BFD_RELOC_PPC64_SECTOFF_LO_DS 939 @deffnx {} BFD_RELOC_PPC64_TOC16_DS 940 @deffnx {} BFD_RELOC_PPC64_TOC16_LO_DS 941 @deffnx {} BFD_RELOC_PPC64_PLTGOT16_DS 942 @deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO_DS 842 943 Power(rs6000) and PowerPC relocations. 944 @end deffn 945 @deffn {} BFD_RELOC_PPC_TLS 946 @deffnx {} BFD_RELOC_PPC_DTPMOD 947 @deffnx {} BFD_RELOC_PPC_TPREL16 948 @deffnx {} BFD_RELOC_PPC_TPREL16_LO 949 @deffnx {} BFD_RELOC_PPC_TPREL16_HI 950 @deffnx {} BFD_RELOC_PPC_TPREL16_HA 951 @deffnx {} BFD_RELOC_PPC_TPREL 952 @deffnx {} BFD_RELOC_PPC_DTPREL16 953 @deffnx {} BFD_RELOC_PPC_DTPREL16_LO 954 @deffnx {} BFD_RELOC_PPC_DTPREL16_HI 955 @deffnx {} BFD_RELOC_PPC_DTPREL16_HA 956 @deffnx {} BFD_RELOC_PPC_DTPREL 957 @deffnx {} BFD_RELOC_PPC_GOT_TLSGD16 958 @deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_LO 959 @deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HI 960 @deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HA 961 @deffnx {} BFD_RELOC_PPC_GOT_TLSLD16 962 @deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_LO 963 @deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HI 964 @deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HA 965 @deffnx {} BFD_RELOC_PPC_GOT_TPREL16 966 @deffnx {} BFD_RELOC_PPC_GOT_TPREL16_LO 967 @deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HI 968 @deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HA 969 @deffnx {} BFD_RELOC_PPC_GOT_DTPREL16 970 @deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_LO 971 @deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HI 972 @deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HA 973 @deffnx {} BFD_RELOC_PPC64_TPREL16_DS 974 @deffnx {} BFD_RELOC_PPC64_TPREL16_LO_DS 975 @deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHER 976 @deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHERA 977 @deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHEST 978 @deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHESTA 979 @deffnx {} BFD_RELOC_PPC64_DTPREL16_DS 980 @deffnx {} BFD_RELOC_PPC64_DTPREL16_LO_DS 981 @deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHER 982 @deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHERA 983 @deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHEST 984 @deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHESTA 985 PowerPC and PowerPC64 thread-local storage relocations. 843 986 @end deffn 844 987 @deffn {} BFD_RELOC_I370_D12 … … 871 1014 @deffnx {} BFD_RELOC_ARM_MULTI 872 1015 @deffnx {} BFD_RELOC_ARM_CP_OFF_IMM 1016 @deffnx {} BFD_RELOC_ARM_CP_OFF_IMM_S2 873 1017 @deffnx {} BFD_RELOC_ARM_ADR_IMM 874 1018 @deffnx {} BFD_RELOC_ARM_LDR_IMM … … 918 1062 @deffnx {} BFD_RELOC_SH_RELATIVE 919 1063 @deffnx {} BFD_RELOC_SH_GOTPC 920 Hitachi SH relocs. Not all of these appear in object files. 1064 @deffnx {} BFD_RELOC_SH_GOT_LOW16 1065 @deffnx {} BFD_RELOC_SH_GOT_MEDLOW16 1066 @deffnx {} BFD_RELOC_SH_GOT_MEDHI16 1067 @deffnx {} BFD_RELOC_SH_GOT_HI16 1068 @deffnx {} BFD_RELOC_SH_GOTPLT_LOW16 1069 @deffnx {} BFD_RELOC_SH_GOTPLT_MEDLOW16 1070 @deffnx {} BFD_RELOC_SH_GOTPLT_MEDHI16 1071 @deffnx {} BFD_RELOC_SH_GOTPLT_HI16 1072 @deffnx {} BFD_RELOC_SH_PLT_LOW16 1073 @deffnx {} BFD_RELOC_SH_PLT_MEDLOW16 1074 @deffnx {} BFD_RELOC_SH_PLT_MEDHI16 1075 @deffnx {} BFD_RELOC_SH_PLT_HI16 1076 @deffnx {} BFD_RELOC_SH_GOTOFF_LOW16 1077 @deffnx {} BFD_RELOC_SH_GOTOFF_MEDLOW16 1078 @deffnx {} BFD_RELOC_SH_GOTOFF_MEDHI16 1079 @deffnx {} BFD_RELOC_SH_GOTOFF_HI16 1080 @deffnx {} BFD_RELOC_SH_GOTPC_LOW16 1081 @deffnx {} BFD_RELOC_SH_GOTPC_MEDLOW16 1082 @deffnx {} BFD_RELOC_SH_GOTPC_MEDHI16 1083 @deffnx {} BFD_RELOC_SH_GOTPC_HI16 1084 @deffnx {} BFD_RELOC_SH_COPY64 1085 @deffnx {} BFD_RELOC_SH_GLOB_DAT64 1086 @deffnx {} BFD_RELOC_SH_JMP_SLOT64 1087 @deffnx {} BFD_RELOC_SH_RELATIVE64 1088 @deffnx {} BFD_RELOC_SH_GOT10BY4 1089 @deffnx {} BFD_RELOC_SH_GOT10BY8 1090 @deffnx {} BFD_RELOC_SH_GOTPLT10BY4 1091 @deffnx {} BFD_RELOC_SH_GOTPLT10BY8 1092 @deffnx {} BFD_RELOC_SH_GOTPLT32 1093 @deffnx {} BFD_RELOC_SH_SHMEDIA_CODE 1094 @deffnx {} BFD_RELOC_SH_IMMU5 1095 @deffnx {} BFD_RELOC_SH_IMMS6 1096 @deffnx {} BFD_RELOC_SH_IMMS6BY32 1097 @deffnx {} BFD_RELOC_SH_IMMU6 1098 @deffnx {} BFD_RELOC_SH_IMMS10 1099 @deffnx {} BFD_RELOC_SH_IMMS10BY2 1100 @deffnx {} BFD_RELOC_SH_IMMS10BY4 1101 @deffnx {} BFD_RELOC_SH_IMMS10BY8 1102 @deffnx {} BFD_RELOC_SH_IMMS16 1103 @deffnx {} BFD_RELOC_SH_IMMU16 1104 @deffnx {} BFD_RELOC_SH_IMM_LOW16 1105 @deffnx {} BFD_RELOC_SH_IMM_LOW16_PCREL 1106 @deffnx {} BFD_RELOC_SH_IMM_MEDLOW16 1107 @deffnx {} BFD_RELOC_SH_IMM_MEDLOW16_PCREL 1108 @deffnx {} BFD_RELOC_SH_IMM_MEDHI16 1109 @deffnx {} BFD_RELOC_SH_IMM_MEDHI16_PCREL 1110 @deffnx {} BFD_RELOC_SH_IMM_HI16 1111 @deffnx {} BFD_RELOC_SH_IMM_HI16_PCREL 1112 @deffnx {} BFD_RELOC_SH_PT_16 1113 @deffnx {} BFD_RELOC_SH_TLS_GD_32 1114 @deffnx {} BFD_RELOC_SH_TLS_LD_32 1115 @deffnx {} BFD_RELOC_SH_TLS_LDO_32 1116 @deffnx {} BFD_RELOC_SH_TLS_IE_32 1117 @deffnx {} BFD_RELOC_SH_TLS_LE_32 1118 @deffnx {} BFD_RELOC_SH_TLS_DTPMOD32 1119 @deffnx {} BFD_RELOC_SH_TLS_DTPOFF32 1120 @deffnx {} BFD_RELOC_SH_TLS_TPOFF32 1121 Renesas / SuperH SH relocs. Not all of these appear in object files. 921 1122 @end deffn 922 1123 @deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9 … … 1005 1206 This is a 32-bit pc-relative reloc. 1006 1207 @end deffn 1208 @deffn {} BFD_RELOC_DLX_HI16_S 1209 DLX relocs 1210 @end deffn 1211 @deffn {} BFD_RELOC_DLX_LO16 1212 DLX relocs 1213 @end deffn 1214 @deffn {} BFD_RELOC_DLX_JMP26 1215 DLX relocs 1216 @end deffn 1007 1217 @deffn {} BFD_RELOC_M32R_24 1008 Mitsubishi M32Rrelocs.1218 Renesas M32R (formerly Mitsubishi M32R) relocs. 1009 1219 This is a 24 bit absolute address. 1010 1220 @end deffn … … 1087 1297 @deffn {} BFD_RELOC_V850_CALLT_16_16_OFFSET 1088 1298 This is a 16 bit offset from the call table base pointer. 1299 @end deffn 1300 @deffn {} BFD_RELOC_V850_LONGCALL 1301 Used for relaxing indirect function calls. 1302 @end deffn 1303 @deffn {} BFD_RELOC_V850_LONGJUMP 1304 Used for relaxing indirect jumps. 1305 @end deffn 1306 @deffn {} BFD_RELOC_V850_ALIGN 1307 Used to maintain alignment whilst relaxing. 1089 1308 @end deffn 1090 1309 @deffn {} BFD_RELOC_MN10300_32_PCREL … … 1163 1382 Motorola Mcore relocations. 1164 1383 @end deffn 1384 @deffn {} BFD_RELOC_MMIX_GETA 1385 @deffnx {} BFD_RELOC_MMIX_GETA_1 1386 @deffnx {} BFD_RELOC_MMIX_GETA_2 1387 @deffnx {} BFD_RELOC_MMIX_GETA_3 1388 These are relocations for the GETA instruction. 1389 @end deffn 1390 @deffn {} BFD_RELOC_MMIX_CBRANCH 1391 @deffnx {} BFD_RELOC_MMIX_CBRANCH_J 1392 @deffnx {} BFD_RELOC_MMIX_CBRANCH_1 1393 @deffnx {} BFD_RELOC_MMIX_CBRANCH_2 1394 @deffnx {} BFD_RELOC_MMIX_CBRANCH_3 1395 These are relocations for a conditional branch instruction. 1396 @end deffn 1397 @deffn {} BFD_RELOC_MMIX_PUSHJ 1398 @deffnx {} BFD_RELOC_MMIX_PUSHJ_1 1399 @deffnx {} BFD_RELOC_MMIX_PUSHJ_2 1400 @deffnx {} BFD_RELOC_MMIX_PUSHJ_3 1401 These are relocations for the PUSHJ instruction. 1402 @end deffn 1403 @deffn {} BFD_RELOC_MMIX_JMP 1404 @deffnx {} BFD_RELOC_MMIX_JMP_1 1405 @deffnx {} BFD_RELOC_MMIX_JMP_2 1406 @deffnx {} BFD_RELOC_MMIX_JMP_3 1407 These are relocations for the JMP instruction. 1408 @end deffn 1409 @deffn {} BFD_RELOC_MMIX_ADDR19 1410 This is a relocation for a relative address as in a GETA instruction or 1411 a branch. 1412 @end deffn 1413 @deffn {} BFD_RELOC_MMIX_ADDR27 1414 This is a relocation for a relative address as in a JMP instruction. 1415 @end deffn 1416 @deffn {} BFD_RELOC_MMIX_REG_OR_BYTE 1417 This is a relocation for an instruction field that may be a general 1418 register or a value 0..255. 1419 @end deffn 1420 @deffn {} BFD_RELOC_MMIX_REG 1421 This is a relocation for an instruction field that may be a general 1422 register. 1423 @end deffn 1424 @deffn {} BFD_RELOC_MMIX_BASE_PLUS_OFFSET 1425 This is a relocation for two instruction fields holding a register and 1426 an offset, the equivalent of the relocation. 1427 @end deffn 1428 @deffn {} BFD_RELOC_MMIX_LOCAL 1429 This relocation is an assertion that the expression is not allocated as 1430 a global register. It does not modify contents. 1431 @end deffn 1165 1432 @deffn {} BFD_RELOC_AVR_7_PCREL 1166 1433 This is a 16 bit reloc for the AVR that stores 8 bit pc relative … … 1230 1497 This is a 32 bit reloc for the AVR that stores 23 bit value 1231 1498 into 22 bits. 1499 @end deffn 1500 @deffn {} BFD_RELOC_390_12 1501 Direct 12 bit. 1502 @end deffn 1503 @deffn {} BFD_RELOC_390_GOT12 1504 12 bit GOT offset. 1505 @end deffn 1506 @deffn {} BFD_RELOC_390_PLT32 1507 32 bit PC relative PLT address. 1508 @end deffn 1509 @deffn {} BFD_RELOC_390_COPY 1510 Copy symbol at runtime. 1511 @end deffn 1512 @deffn {} BFD_RELOC_390_GLOB_DAT 1513 Create GOT entry. 1514 @end deffn 1515 @deffn {} BFD_RELOC_390_JMP_SLOT 1516 Create PLT entry. 1517 @end deffn 1518 @deffn {} BFD_RELOC_390_RELATIVE 1519 Adjust by program base. 1520 @end deffn 1521 @deffn {} BFD_RELOC_390_GOTPC 1522 32 bit PC relative offset to GOT. 1523 @end deffn 1524 @deffn {} BFD_RELOC_390_GOT16 1525 16 bit GOT offset. 1526 @end deffn 1527 @deffn {} BFD_RELOC_390_PC16DBL 1528 PC relative 16 bit shifted by 1. 1529 @end deffn 1530 @deffn {} BFD_RELOC_390_PLT16DBL 1531 16 bit PC rel. PLT shifted by 1. 1532 @end deffn 1533 @deffn {} BFD_RELOC_390_PC32DBL 1534 PC relative 32 bit shifted by 1. 1535 @end deffn 1536 @deffn {} BFD_RELOC_390_PLT32DBL 1537 32 bit PC rel. PLT shifted by 1. 1538 @end deffn 1539 @deffn {} BFD_RELOC_390_GOTPCDBL 1540 32 bit PC rel. GOT shifted by 1. 1541 @end deffn 1542 @deffn {} BFD_RELOC_390_GOT64 1543 64 bit GOT offset. 1544 @end deffn 1545 @deffn {} BFD_RELOC_390_PLT64 1546 64 bit PC relative PLT address. 1547 @end deffn 1548 @deffn {} BFD_RELOC_390_GOTENT 1549 32 bit rel. offset to GOT entry. 1550 @end deffn 1551 @deffn {} BFD_RELOC_390_GOTOFF64 1552 64 bit offset to GOT. 1553 @end deffn 1554 @deffn {} BFD_RELOC_390_GOTPLT12 1555 12-bit offset to symbol-entry within GOT, with PLT handling. 1556 @end deffn 1557 @deffn {} BFD_RELOC_390_GOTPLT16 1558 16-bit offset to symbol-entry within GOT, with PLT handling. 1559 @end deffn 1560 @deffn {} BFD_RELOC_390_GOTPLT32 1561 32-bit offset to symbol-entry within GOT, with PLT handling. 1562 @end deffn 1563 @deffn {} BFD_RELOC_390_GOTPLT64 1564 64-bit offset to symbol-entry within GOT, with PLT handling. 1565 @end deffn 1566 @deffn {} BFD_RELOC_390_GOTPLTENT 1567 32-bit rel. offset to symbol-entry within GOT, with PLT handling. 1568 @end deffn 1569 @deffn {} BFD_RELOC_390_PLTOFF16 1570 16-bit rel. offset from the GOT to a PLT entry. 1571 @end deffn 1572 @deffn {} BFD_RELOC_390_PLTOFF32 1573 32-bit rel. offset from the GOT to a PLT entry. 1574 @end deffn 1575 @deffn {} BFD_RELOC_390_PLTOFF64 1576 64-bit rel. offset from the GOT to a PLT entry. 1577 @end deffn 1578 @deffn {} BFD_RELOC_390_TLS_LOAD 1579 @deffnx {} BFD_RELOC_390_TLS_GDCALL 1580 @deffnx {} BFD_RELOC_390_TLS_LDCALL 1581 @deffnx {} BFD_RELOC_390_TLS_GD32 1582 @deffnx {} BFD_RELOC_390_TLS_GD64 1583 @deffnx {} BFD_RELOC_390_TLS_GOTIE12 1584 @deffnx {} BFD_RELOC_390_TLS_GOTIE32 1585 @deffnx {} BFD_RELOC_390_TLS_GOTIE64 1586 @deffnx {} BFD_RELOC_390_TLS_LDM32 1587 @deffnx {} BFD_RELOC_390_TLS_LDM64 1588 @deffnx {} BFD_RELOC_390_TLS_IE32 1589 @deffnx {} BFD_RELOC_390_TLS_IE64 1590 @deffnx {} BFD_RELOC_390_TLS_IEENT 1591 @deffnx {} BFD_RELOC_390_TLS_LE32 1592 @deffnx {} BFD_RELOC_390_TLS_LE64 1593 @deffnx {} BFD_RELOC_390_TLS_LDO32 1594 @deffnx {} BFD_RELOC_390_TLS_LDO64 1595 @deffnx {} BFD_RELOC_390_TLS_DTPMOD 1596 @deffnx {} BFD_RELOC_390_TLS_DTPOFF 1597 @deffnx {} BFD_RELOC_390_TLS_TPOFF 1598 s390 tls relocations. 1599 @end deffn 1600 @deffn {} BFD_RELOC_IP2K_FR9 1601 Scenix IP2K - 9-bit register number / data address 1602 @end deffn 1603 @deffn {} BFD_RELOC_IP2K_BANK 1604 Scenix IP2K - 4-bit register/data bank number 1605 @end deffn 1606 @deffn {} BFD_RELOC_IP2K_ADDR16CJP 1607 Scenix IP2K - low 13 bits of instruction word address 1608 @end deffn 1609 @deffn {} BFD_RELOC_IP2K_PAGE3 1610 Scenix IP2K - high 3 bits of instruction word address 1611 @end deffn 1612 @deffn {} BFD_RELOC_IP2K_LO8DATA 1613 @deffnx {} BFD_RELOC_IP2K_HI8DATA 1614 @deffnx {} BFD_RELOC_IP2K_EX8DATA 1615 Scenix IP2K - ext/low/high 8 bits of data address 1616 @end deffn 1617 @deffn {} BFD_RELOC_IP2K_LO8INSN 1618 @deffnx {} BFD_RELOC_IP2K_HI8INSN 1619 Scenix IP2K - low/high 8 bits of instruction word address 1620 @end deffn 1621 @deffn {} BFD_RELOC_IP2K_PC_SKIP 1622 Scenix IP2K - even/odd PC modifier to modify snb pcl.0 1623 @end deffn 1624 @deffn {} BFD_RELOC_IP2K_TEXT 1625 Scenix IP2K - 16 bit word address in text section. 1626 @end deffn 1627 @deffn {} BFD_RELOC_IP2K_FR_OFFSET 1628 Scenix IP2K - 7-bit sp or dp offset 1629 @end deffn 1630 @deffn {} BFD_RELOC_VPE4KMATH_DATA 1631 @deffnx {} BFD_RELOC_VPE4KMATH_INSN 1632 Scenix VPE4K coprocessor - data/insn-space addressing 1232 1633 @end deffn 1233 1634 @deffn {} BFD_RELOC_VTABLE_INHERIT … … 1288 1689 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 1289 1690 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I 1691 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32MSB 1692 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32LSB 1290 1693 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB 1291 1694 @deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB … … 1309 1712 @deffnx {} BFD_RELOC_IA64_IPLTLSB 1310 1713 @deffnx {} BFD_RELOC_IA64_COPY 1714 @deffnx {} BFD_RELOC_IA64_LTOFF22X 1715 @deffnx {} BFD_RELOC_IA64_LDXMOV 1716 @deffnx {} BFD_RELOC_IA64_TPREL14 1311 1717 @deffnx {} BFD_RELOC_IA64_TPREL22 1718 @deffnx {} BFD_RELOC_IA64_TPREL64I 1312 1719 @deffnx {} BFD_RELOC_IA64_TPREL64MSB 1313 1720 @deffnx {} BFD_RELOC_IA64_TPREL64LSB 1314 @deffnx {} BFD_RELOC_IA64_LTOFF_TP22 1315 @deffnx {} BFD_RELOC_IA64_LTOFF22X 1316 @deffnx {} BFD_RELOC_IA64_LDXMOV 1721 @deffnx {} BFD_RELOC_IA64_LTOFF_TPREL22 1722 @deffnx {} BFD_RELOC_IA64_DTPMOD64MSB 1723 @deffnx {} BFD_RELOC_IA64_DTPMOD64LSB 1724 @deffnx {} BFD_RELOC_IA64_LTOFF_DTPMOD22 1725 @deffnx {} BFD_RELOC_IA64_DTPREL14 1726 @deffnx {} BFD_RELOC_IA64_DTPREL22 1727 @deffnx {} BFD_RELOC_IA64_DTPREL64I 1728 @deffnx {} BFD_RELOC_IA64_DTPREL32MSB 1729 @deffnx {} BFD_RELOC_IA64_DTPREL32LSB 1730 @deffnx {} BFD_RELOC_IA64_DTPREL64MSB 1731 @deffnx {} BFD_RELOC_IA64_DTPREL64LSB 1732 @deffnx {} BFD_RELOC_IA64_LTOFF_DTPREL22 1317 1733 Intel IA64 Relocations. 1318 1734 @end deffn 1319 1735 @deffn {} BFD_RELOC_M68HC11_HI8 1320 1736 Motorola 68HC11 reloc. 1321 This is the 8 bit shigh part of an absolute address.1737 This is the 8 bit high part of an absolute address. 1322 1738 @end deffn 1323 1739 @deffn {} BFD_RELOC_M68HC11_LO8 1324 1740 Motorola 68HC11 reloc. 1325 This is the 8 bit slow part of an absolute address.1741 This is the 8 bit low part of an absolute address. 1326 1742 @end deffn 1327 1743 @deffn {} BFD_RELOC_M68HC11_3B 1328 1744 Motorola 68HC11 reloc. 1329 This is the 3 bits of a value. 1745 This is the 3 bit of a value. 1746 @end deffn 1747 @deffn {} BFD_RELOC_M68HC11_RL_JUMP 1748 Motorola 68HC11 reloc. 1749 This reloc marks the beginning of a jump/call instruction. 1750 It is used for linker relaxation to correctly identify beginning 1751 of instruction and change some branchs to use PC-relative 1752 addressing mode. 1753 @end deffn 1754 @deffn {} BFD_RELOC_M68HC11_RL_GROUP 1755 Motorola 68HC11 reloc. 1756 This reloc marks a group of several instructions that gcc generates 1757 and for which the linker relaxation pass can modify and/or remove 1758 some of them. 1759 @end deffn 1760 @deffn {} BFD_RELOC_M68HC11_LO16 1761 Motorola 68HC11 reloc. 1762 This is the 16-bit lower part of an address. It is used for 'call' 1763 instruction to specify the symbol address without any special 1764 transformation (due to memory bank window). 1765 @end deffn 1766 @deffn {} BFD_RELOC_M68HC11_PAGE 1767 Motorola 68HC11 reloc. 1768 This is a 8-bit reloc that specifies the page number of an address. 1769 It is used by 'call' instruction to specify the page number of 1770 the symbol. 1771 @end deffn 1772 @deffn {} BFD_RELOC_M68HC11_24 1773 Motorola 68HC11 reloc. 1774 This is a 24-bit reloc that represents the address with a 16-bit 1775 value and a 8-bit page number. The symbol address is transformed 1776 to follow the 16K memory bank of 68HC12 (seen as mapped in the window). 1330 1777 @end deffn 1331 1778 @deffn {} BFD_RELOC_CRIS_BDISP8 … … 1336 1783 These relocs are only used within the CRIS assembler. They are not 1337 1784 (at present) written to any object files. 1785 @end deffn 1786 @deffn {} BFD_RELOC_CRIS_COPY 1787 @deffnx {} BFD_RELOC_CRIS_GLOB_DAT 1788 @deffnx {} BFD_RELOC_CRIS_JUMP_SLOT 1789 @deffnx {} BFD_RELOC_CRIS_RELATIVE 1790 Relocs used in ELF shared libraries for CRIS. 1791 @end deffn 1792 @deffn {} BFD_RELOC_CRIS_32_GOT 1793 32-bit offset to symbol-entry within GOT. 1794 @end deffn 1795 @deffn {} BFD_RELOC_CRIS_16_GOT 1796 16-bit offset to symbol-entry within GOT. 1797 @end deffn 1798 @deffn {} BFD_RELOC_CRIS_32_GOTPLT 1799 32-bit offset to symbol-entry within GOT, with PLT handling. 1800 @end deffn 1801 @deffn {} BFD_RELOC_CRIS_16_GOTPLT 1802 16-bit offset to symbol-entry within GOT, with PLT handling. 1803 @end deffn 1804 @deffn {} BFD_RELOC_CRIS_32_GOTREL 1805 32-bit offset to symbol, relative to GOT. 1806 @end deffn 1807 @deffn {} BFD_RELOC_CRIS_32_PLT_GOTREL 1808 32-bit offset to symbol with PLT entry, relative to GOT. 1809 @end deffn 1810 @deffn {} BFD_RELOC_CRIS_32_PLT_PCREL 1811 32-bit offset to symbol with PLT entry, relative to this relocation. 1338 1812 @end deffn 1339 1813 @deffn {} BFD_RELOC_860_COPY … … 1371 1845 Intel i860 Relocations. 1372 1846 @end deffn 1847 @deffn {} BFD_RELOC_OPENRISC_ABS_26 1848 @deffnx {} BFD_RELOC_OPENRISC_REL_26 1849 OpenRISC Relocations. 1850 @end deffn 1851 @deffn {} BFD_RELOC_H8_DIR16A8 1852 @deffnx {} BFD_RELOC_H8_DIR16R8 1853 @deffnx {} BFD_RELOC_H8_DIR24A8 1854 @deffnx {} BFD_RELOC_H8_DIR24R8 1855 @deffnx {} BFD_RELOC_H8_DIR32A16 1856 H8 elf Relocations. 1857 @end deffn 1858 @deffn {} BFD_RELOC_XSTORMY16_REL_12 1859 @deffnx {} BFD_RELOC_XSTORMY16_12 1860 @deffnx {} BFD_RELOC_XSTORMY16_24 1861 @deffnx {} BFD_RELOC_XSTORMY16_FPTR16 1862 Sony Xstormy16 Relocations. 1863 @end deffn 1864 @deffn {} BFD_RELOC_VAX_GLOB_DAT 1865 @deffnx {} BFD_RELOC_VAX_JMP_SLOT 1866 @deffnx {} BFD_RELOC_VAX_RELATIVE 1867 Relocations used by VAX ELF. 1868 @end deffn 1869 @deffn {} BFD_RELOC_MSP430_10_PCREL 1870 @deffnx {} BFD_RELOC_MSP430_16_PCREL 1871 @deffnx {} BFD_RELOC_MSP430_16 1872 @deffnx {} BFD_RELOC_MSP430_16_PCREL_BYTE 1873 @deffnx {} BFD_RELOC_MSP430_16_BYTE 1874 msp430 specific relocation codes 1875 @end deffn 1876 @deffn {} BFD_RELOC_IQ2000_OFFSET_16 1877 @deffnx {} BFD_RELOC_IQ2000_OFFSET_21 1878 @deffnx {} BFD_RELOC_IQ2000_UHI16 1879 IQ2000 Relocations. 1880 @end deffn 1881 @deffn {} BFD_RELOC_XTENSA_RTLD 1882 Special Xtensa relocation used only by PLT entries in ELF shared 1883 objects to indicate that the runtime linker should set the value 1884 to one of its own internal functions or data structures. 1885 @end deffn 1886 @deffn {} BFD_RELOC_XTENSA_GLOB_DAT 1887 @deffnx {} BFD_RELOC_XTENSA_JMP_SLOT 1888 @deffnx {} BFD_RELOC_XTENSA_RELATIVE 1889 Xtensa relocations for ELF shared objects. 1890 @end deffn 1891 @deffn {} BFD_RELOC_XTENSA_PLT 1892 Xtensa relocation used in ELF object files for symbols that may require 1893 PLT entries. Otherwise, this is just a generic 32-bit relocation. 1894 @end deffn 1895 @deffn {} BFD_RELOC_XTENSA_OP0 1896 @deffnx {} BFD_RELOC_XTENSA_OP1 1897 @deffnx {} BFD_RELOC_XTENSA_OP2 1898 Generic Xtensa relocations. Only the operand number is encoded 1899 in the relocation. The details are determined by extracting the 1900 instruction opcode. 1901 @end deffn 1902 @deffn {} BFD_RELOC_XTENSA_ASM_EXPAND 1903 Xtensa relocation to mark that the assembler expanded the 1904 instructions from an original target. The expansion size is 1905 encoded in the reloc size. 1906 @end deffn 1907 @deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY 1908 Xtensa relocation to mark that the linker should simplify 1909 assembler-expanded instructions. This is commonly used 1910 internally by the linker after analysis of a 1911 BFD_RELOC_XTENSA_ASM_EXPAND. 1912 @end deffn 1373 1913 1374 1914 @example … … 1412 1952 @strong{Synopsis} 1413 1953 @example 1414 b oolean bfd_generic_relax_section1954 bfd_boolean bfd_generic_relax_section 1415 1955 (bfd *abfd, 1416 1956 asection *section, 1417 1957 struct bfd_link_info *, 1418 b oolean *);1958 bfd_boolean *); 1419 1959 @end example 1420 1960 @strong{Description}@* … … 1426 1966 @strong{Synopsis} 1427 1967 @example 1428 b oolean bfd_generic_gc_sections1968 bfd_boolean bfd_generic_gc_sections 1429 1969 (bfd *, struct bfd_link_info *); 1430 1970 @end example … … 1432 1972 Provides default handling for relaxing for back ends which 1433 1973 don't do section gc -- i.e., does nothing. 1974 1975 @findex bfd_generic_merge_sections 1976 @subsubsection @code{bfd_generic_merge_sections} 1977 @strong{Synopsis} 1978 @example 1979 bfd_boolean bfd_generic_merge_sections 1980 (bfd *, struct bfd_link_info *); 1981 @end example 1982 @strong{Description}@* 1983 Provides default handling for SEC_MERGE section merging for back ends 1984 which don't have SEC_MERGE support -- i.e., does nothing. 1434 1985 1435 1986 @findex bfd_generic_get_relocated_section_contents … … 1442 1993 struct bfd_link_order *link_order, 1443 1994 bfd_byte *data, 1444 b oolean relocateable,1995 bfd_boolean relocateable, 1445 1996 asymbol **symbols); 1446 1997 @end example -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/section.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 129 129 /* The name of the section; the name isn't a copy, the pointer is 130 130 the same as that passed to bfd_make_section. */ 131 132 131 const char *name; 133 132 134 133 /* A unique sequence number. */ 135 136 134 int id; 137 135 138 /* Which section is it; 0..nth. */ 139 136 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ 140 137 int index; 141 138 142 139 /* The next section in the list belonging to the BFD, or NULL. */ 143 144 140 struct sec *next; 145 141 … … 147 143 flags are read in from the object file, and some are 148 144 synthesized from other information. */ 149 150 145 flagword flags; 151 146 … … 164 159 #define SEC_RELOC 0x004 165 160 166 #if 0 /* Obsolete ? */ 167 #define SEC_BALIGN 0x008 168 #endif 161 /* ELF reserves 4 processor specific bits and 8 operating system 162 specific bits in sh_flags; at present we can get away with just 163 one in communicating between the assembler and BFD, but this 164 isn't a good long-term solution. */ 165 #define SEC_ARCH_BIT_0 0x008 169 166 170 167 /* A signal to the OS that the section contains read only data. */ … … 192 189 #define SEC_CONSTRUCTOR 0x100 193 190 194 /* The section is a constructor, and should be placed at the195 end of the text, data, or bss section(?). */196 #define SEC_CONSTRUCTOR_TEXT 0x1100197 #define SEC_CONSTRUCTOR_DATA 0x2100198 #define SEC_CONSTRUCTOR_BSS 0x3100199 200 191 /* The section has contents - a data section could be 201 192 @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be … … 218 209 #define SEC_COFF_SHARED_LIBRARY 0x800 219 210 211 /* The section contains thread local data. */ 212 #define SEC_THREAD_LOCAL 0x1000 213 220 214 /* The section has GOT references. This flag is only for the 221 215 linker, and is currently only used by the elf32-hppa back end. … … 249 243 #define SEC_EXCLUDE 0x40000 250 244 251 /* The contents of this section are to be sorted by the 252 based on the address specified in the associated symbol 253 table. */ 245 /* The contents of this section are to be sorted based on the sum of 246 the symbol and addend values specified by the associated relocation 247 entries. Entries without associated relocation entries will be 248 appended to the end of the section in an unspecified order. */ 254 249 #define SEC_SORT_ENTRIES 0x80000 255 250 … … 309 304 #define SEC_CLINK 0x10000000 310 305 306 /* Attempt to merge identical entities in the section. 307 Entity size is given in the entsize field. */ 308 #define SEC_MERGE 0x20000000 309 310 /* If given with SEC_MERGE, entities to merge are zero terminated 311 strings where entsize specifies character size instead of fixed 312 size entries. */ 313 #define SEC_STRINGS 0x40000000 314 315 /* This section contains data about section groups. */ 316 #define SEC_GROUP 0x80000000 317 311 318 /* End of section flags. */ 312 319 … … 323 330 324 331 /* Another mark flag used by some of the linker backends. Set for 325 output sections that have a input section. */332 output sections that have an input section. */ 326 333 unsigned int linker_has_input : 1; 327 334 … … 329 336 unsigned int gc_mark : 1; 330 337 331 /* Used by the ELF code to mark sections which have been allocated to segments. */ 338 /* The following flags are used by the ELF linker. */ 339 340 /* Mark sections which have been allocated to segments. */ 332 341 unsigned int segment_mark : 1; 342 343 /* Type of sec_info information. */ 344 unsigned int sec_info_type:3; 345 #define ELF_INFO_TYPE_NONE 0 346 #define ELF_INFO_TYPE_STABS 1 347 #define ELF_INFO_TYPE_MERGE 2 348 #define ELF_INFO_TYPE_EH_FRAME 3 349 #define ELF_INFO_TYPE_JUST_SYMS 4 350 351 /* Nonzero if this section uses RELA relocations, rather than REL. */ 352 unsigned int use_rela_p:1; 353 354 /* Bits used by various backends. */ 355 unsigned int has_tls_reloc:1; 356 357 /* Nonzero if this section needs the relax finalize pass. */ 358 unsigned int need_finalize_relax:1; 359 360 /* Usused bits. */ 361 unsigned int flag12:1; 362 unsigned int flag13:1; 363 unsigned int flag14:1; 364 unsigned int flag15:1; 365 unsigned int flag16:4; 366 unsigned int flag20:4; 367 unsigned int flag24:8; 333 368 334 369 /* End of internal packed boolean fields. */ … … 340 375 the default address for @code{.data} is dependent on the specific 341 376 target and various flags). */ 342 343 377 bfd_vma vma; 344 378 345 379 /* The load address of the section - where it would be in a 346 380 rom image; really only used for writing section header 347 information. */ 348 381 information. */ 349 382 bfd_vma lma; 350 383 … … 352 385 Contains a value even if the section has no contents (e.g., the 353 386 size of @code{.bss}). This will be filled in after relocation. */ 354 355 387 bfd_size_type _cooked_size; 356 388 … … 358 390 value is the same as the size, but if some relaxing has 359 391 been done, then this value will be bigger. */ 360 361 392 bfd_size_type _raw_size; 362 393 … … 368 399 would be 100. However, if the target byte size is 16 bits 369 400 (bfd_octets_per_byte is "2"), this value would be 50. */ 370 371 401 bfd_vma output_offset; 372 402 373 403 /* The output section through which to map on output. */ 374 375 404 struct sec *output_section; 376 405 377 406 /* The alignment requirement of the section, as an exponent of 2 - 378 407 e.g., 3 aligns to 2^3 (or 8). */ 379 380 408 unsigned int alignment_power; 381 409 382 410 /* If an input section, a pointer to a vector of relocation 383 411 records for the data in this section. */ 384 385 412 struct reloc_cache_entry *relocation; 386 413 387 414 /* If an output section, a pointer to a vector of pointers to 388 415 relocation records for the data in this section. */ 389 390 416 struct reloc_cache_entry **orelocation; 391 417 392 /* The number of relocation records in one of the above */ 393 418 /* The number of relocation records in one of the above. */ 394 419 unsigned reloc_count; 395 420 … … 398 423 399 424 /* File position of section data. */ 400 401 425 file_ptr filepos; 402 426 403 427 /* File position of relocation info. */ 404 405 428 file_ptr rel_filepos; 406 429 407 430 /* File position of line data. */ 408 409 431 file_ptr line_filepos; 410 432 411 433 /* Pointer to data for applications. */ 412 413 434 PTR userdata; 414 435 … … 418 439 419 440 /* Attached line number information. */ 420 421 441 alent *lineno; 422 442 423 443 /* Number of line number records. */ 424 425 444 unsigned int lineno_count; 426 445 446 /* Entity size for merging purposes. */ 447 unsigned int entsize; 448 427 449 /* Optional information about a COMDAT entry; NULL if not COMDAT. */ 428 429 450 struct bfd_comdat_info *comdat; 430 431 /* Points to the kept section if this section is a link-once section,432 and is discarded. */433 struct sec *kept_section;434 451 435 452 /* When a section is being output, this value changes as more 436 453 linenumbers are written out. */ 437 438 454 file_ptr moving_line_filepos; 439 455 440 456 /* What the section number is in the target world. */ 441 442 457 int target_index; 443 458 … … 446 461 /* If this is a constructor section then here is a list of the 447 462 relocations created to relocate items within it. */ 448 449 463 struct relent_chain *constructor_chain; 450 464 451 465 /* The BFD which owns the section. */ 452 453 466 bfd *owner; 454 467 455 /* A symbol which points at this section only */468 /* A symbol which points at this section only. */ 456 469 struct symbol_cache_entry *symbol; 457 470 struct symbol_cache_entry **symbol_ptr_ptr; … … 459 472 struct bfd_link_order *link_order_head; 460 473 struct bfd_link_order *link_order_tail; 461 @} asection ;474 @} asection; 462 475 463 476 /* These sections are global, and are managed by BFD. The application … … 471 484 #define BFD_IND_SECTION_NAME "*IND*" 472 485 473 /* the absolute section*/486 /* The absolute section. */ 474 487 extern const asection bfd_abs_section; 475 488 #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) 476 489 #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) 477 /* Pointer to the undefined section */490 /* Pointer to the undefined section. */ 478 491 extern const asection bfd_und_section; 479 492 #define bfd_und_section_ptr ((asection *) &bfd_und_section) 480 493 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) 481 /* Pointer to the common section */494 /* Pointer to the common section. */ 482 495 extern const asection bfd_com_section; 483 496 #define bfd_com_section_ptr ((asection *) &bfd_com_section) 484 /* Pointer to the indirect section */497 /* Pointer to the indirect section. */ 485 498 extern const asection bfd_ind_section; 486 499 #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) 487 500 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) 501 502 #define bfd_is_const_section(SEC) \ 503 ( ((SEC) == bfd_abs_section_ptr) \ 504 || ((SEC) == bfd_und_section_ptr) \ 505 || ((SEC) == bfd_com_section_ptr) \ 506 || ((SEC) == bfd_ind_section_ptr)) 488 507 489 508 extern const struct symbol_cache_entry * const bfd_abs_symbol; … … 497 516 ((section)->reloc_done ? (section)->_cooked_size \ 498 517 : (abort (), (bfd_size_type) 1)) 518 519 /* Macros to handle insertion and deletion of a bfd's sections. These 520 only handle the list pointers, ie. do not adjust section_count, 521 target_index etc. */ 522 #define bfd_section_list_remove(ABFD, PS) \ 523 do \ 524 @{ \ 525 asection **_ps = PS; \ 526 asection *_s = *_ps; \ 527 *_ps = _s->next; \ 528 if (_s->next == NULL) \ 529 (ABFD)->section_tail = _ps; \ 530 @} \ 531 while (0) 532 #define bfd_section_list_insert(ABFD, PS, S) \ 533 do \ 534 @{ \ 535 asection **_ps = PS; \ 536 asection *_s = S; \ 537 _s->next = *_ps; \ 538 *_ps = _s; \ 539 if (_s->next == NULL) \ 540 (ABFD)->section_tail = &_s->next; \ 541 @} \ 542 while (0) 543 499 544 @end example 500 545 … … 502 547 @subsection Section prototypes 503 548 These are the functions exported by the section handling part of BFD. 549 550 @findex bfd_section_list_clear 551 @subsubsection @code{bfd_section_list_clear} 552 @strong{Synopsis} 553 @example 554 void bfd_section_list_clear (bfd *); 555 @end example 556 @strong{Description}@* 557 Clears the section list, and also resets the section count and 558 hash table entries. 504 559 505 560 @findex bfd_get_section_by_name … … 597 652 @strong{Synopsis} 598 653 @example 599 b oolean bfd_set_section_flags(bfd *abfd, asection *sec, flagword flags);654 bfd_boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags); 600 655 @end example 601 656 @strong{Description}@* 602 657 Set the attributes of the section @var{sec} in the BFD 603 @var{abfd} to the value @var{flags}. Return @code{ true} on success,604 @code{ false} on error. Possible error returns are:658 @var{abfd} to the value @var{flags}. Return @code{TRUE} on success, 659 @code{FALSE} on error. Possible error returns are: 605 660 606 661 @itemize @bullet … … 645 700 @strong{Synopsis} 646 701 @example 647 b oolean bfd_set_section_size(bfd *abfd, asection *sec, bfd_size_type val);702 bfd_boolean bfd_set_section_size (bfd *abfd, asection *sec, bfd_size_type val); 648 703 @end example 649 704 @strong{Description}@* 650 705 Set @var{sec} to the size @var{val}. If the operation is 651 ok, then @code{ true} is returned, else @code{false}.706 ok, then @code{TRUE} is returned, else @code{FALSE}. 652 707 653 708 Possible error returns: … … 663 718 @strong{Synopsis} 664 719 @example 665 boolean bfd_set_section_contents 666 (bfd *abfd, 667 asection *section, 668 PTR data, 669 file_ptr offset, 720 bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, 721 PTR data, file_ptr offset, 670 722 bfd_size_type count); 671 723 @end example … … 676 728 @var{offset} for @var{count} octets. 677 729 678 Normally @code{ true} is returned, else @code{false}. Possible error730 Normally @code{TRUE} is returned, else @code{FALSE}. Possible error 679 731 returns are: 680 732 @itemize @bullet … … 694 746 @strong{Synopsis} 695 747 @example 696 b oolean bfd_get_section_contents697 (bfd *abfd, asection *section, PTR location,698 file_ptr offset,bfd_size_type count);748 bfd_boolean bfd_get_section_contents (bfd *abfd, asection *section, 749 PTR location, file_ptr offset, 750 bfd_size_type count); 699 751 @end example 700 752 @strong{Description}@* … … 707 759 flag set are requested or if the section does not have the 708 760 @code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled 709 with zeroes. If no errors occur, @code{ true} is returned, else710 @code{ false}.761 with zeroes. If no errors occur, @code{TRUE} is returned, else 762 @code{FALSE}. 711 763 712 764 @findex bfd_copy_private_section_data … … 714 766 @strong{Synopsis} 715 767 @example 716 boolean bfd_copy_private_section_data(bfd *ibfd, asection *isec, bfd *obfd, asection *osec); 768 bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, 769 bfd *obfd, asection *osec); 717 770 @end example 718 771 @strong{Description}@* 719 772 Copy private section information from @var{isec} in the BFD 720 773 @var{ibfd} to the section @var{osec} in the BFD @var{obfd}. 721 Return @code{ true} on success, @code{false} on error. Possible error774 Return @code{TRUE} on success, @code{FALSE} on error. Possible error 722 775 returns are: 723 776 … … 743 796 @strong{Description}@* 744 797 Remove @var{section} from the output. If the output section 745 becomes empty, remove it from the output bfd. @var{info} may 746 be NULL; if it is not, it is used to decide whether the output 747 section is empty. 748 798 becomes empty, remove it from the output bfd. 799 800 This function won't actually do anything except twiddle flags 801 if called too late in the linking process, when it's not safe 802 to remove sections. 803 804 @findex bfd_generic_discard_group 805 @subsubsection @code{bfd_generic_discard_group} 806 @strong{Synopsis} 807 @example 808 bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); 809 @end example 810 @strong{Description}@* 811 Remove all members of @var{group} from the output. 812 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/syms.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 48 48 FAIL 49 49 50 if (storage_needed == 0) @{51 return;52 @}50 if (storage_needed == 0) 51 return; 52 53 53 symbol_table = (asymbol **) xmalloc (storage_needed); 54 54 ... … … 59 59 FAIL 60 60 61 for (i = 0; i < number_of_symbols; i++) @{ 62 process_symbol (symbol_table[i]); 63 @} 61 for (i = 0; i < number_of_symbols; i++) 62 process_symbol (symbol_table[i]); 64 63 @end example 65 64 … … 81 80 @example 82 81 #include "bfd.h" 83 main()82 int main (void) 84 83 @{ 85 84 bfd *abfd; … … 87 86 asymbol *new; 88 87 89 abfd = bfd_openw ("foo","a.out-sunos-big");90 bfd_set_format (abfd, bfd_object);91 new = bfd_make_empty_symbol (abfd);88 abfd = bfd_openw ("foo","a.out-sunos-big"); 89 bfd_set_format (abfd, bfd_object); 90 new = bfd_make_empty_symbol (abfd); 92 91 new->name = "dummy_symbol"; 93 new->section = bfd_make_section_old_way (abfd, ".text");92 new->section = bfd_make_section_old_way (abfd, ".text"); 94 93 new->flags = BSF_GLOBAL; 95 94 new->value = 0x12345; … … 98 97 ptrs[1] = (asymbol *)0; 99 98 100 bfd_set_symtab(abfd, ptrs, 1); 101 bfd_close(abfd); 99 bfd_set_symtab (abfd, ptrs, 1); 100 bfd_close (abfd); 101 return 0; 102 102 @} 103 103 … … 142 142 typedef struct symbol_cache_entry 143 143 @{ 144 /* A pointer to the BFD which owns the symbol. This information 145 is necessary so that a back end can work out what additional 146 information (invisible to the application writer) is carried 147 with the symbol. 148 149 This field is *almost* redundant, since you can use section->owner 150 instead, except that some symbols point to the global sections 151 bfd_@{abs,com,und@}_section. This could be fixed by making 152 these globals be per-bfd (or per-target-flavor). FIXME. */ 153 154 struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 155 156 /* The text of the symbol. The name is left alone, and not copied; the 157 application may not alter it. */ 158 CONST char *name; 159 160 /* The value of the symbol. This really should be a union of a 161 numeric value with a pointer, since some flags indicate that 162 a pointer to another symbol is stored here. */ 144 /* A pointer to the BFD which owns the symbol. This information 145 is necessary so that a back end can work out what additional 146 information (invisible to the application writer) is carried 147 with the symbol. 148 149 This field is *almost* redundant, since you can use section->owner 150 instead, except that some symbols point to the global sections 151 bfd_@{abs,com,und@}_section. This could be fixed by making 152 these globals be per-bfd (or per-target-flavor). FIXME. */ 153 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 154 155 /* The text of the symbol. The name is left alone, and not copied; the 156 application may not alter it. */ 157 const char *name; 158 159 /* The value of the symbol. This really should be a union of a 160 numeric value with a pointer, since some flags indicate that 161 a pointer to another symbol is stored here. */ 163 162 symvalue value; 164 163 165 /* Attributes of a symbol: */ 166 164 /* Attributes of a symbol. */ 167 165 #define BSF_NO_FLAGS 0x00 168 166 169 /* The symbol has local scope; @code{static} in @code{C}. The value170 is the offset into the section of the data.*/167 /* The symbol has local scope; @code{static} in @code{C}. The value 168 is the offset into the section of the data. */ 171 169 #define BSF_LOCAL 0x01 172 170 173 /* The symbol has global scope; initialized data in @code{C}. The174 value is the offset into the section of the data.*/171 /* The symbol has global scope; initialized data in @code{C}. The 172 value is the offset into the section of the data. */ 175 173 #define BSF_GLOBAL 0x02 176 174 177 /* The symbol has global scope and is exported. The value is178 the offset into the section of the data.*/179 #define BSF_EXPORT BSF_GLOBAL /* no real difference*/180 181 /* A normal C symbol would be one of:182 @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or183 @code{BSF_GLOBAL}*/184 185 /* The symbol is a debugging record. The value has an arbitary186 meaning, unless BSF_DEBUGGING_RELOC is also set. */175 /* The symbol has global scope and is exported. The value is 176 the offset into the section of the data. */ 177 #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ 178 179 /* A normal C symbol would be one of: 180 @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or 181 @code{BSF_GLOBAL}. */ 182 183 /* The symbol is a debugging record. The value has an arbitary 184 meaning, unless BSF_DEBUGGING_RELOC is also set. */ 187 185 #define BSF_DEBUGGING 0x08 188 186 189 /* The symbol denotes a function entry point. Used in ELF,190 perhaps others someday. */187 /* The symbol denotes a function entry point. Used in ELF, 188 perhaps others someday. */ 191 189 #define BSF_FUNCTION 0x10 192 190 193 /* Used by the linker.*/191 /* Used by the linker. */ 194 192 #define BSF_KEEP 0x20 195 193 #define BSF_KEEP_G 0x40 196 194 197 /* A weak global symbol, overridable without warnings by198 a regular global symbol of the same name. */195 /* A weak global symbol, overridable without warnings by 196 a regular global symbol of the same name. */ 199 197 #define BSF_WEAK 0x80 200 198 201 /* This symbol was created to point to a section, e.g. ELF's202 STT_SECTION symbols. */199 /* This symbol was created to point to a section, e.g. ELF's 200 STT_SECTION symbols. */ 203 201 #define BSF_SECTION_SYM 0x100 204 202 205 /* The symbol used to be a common symbol, but now it is206 allocated.*/203 /* The symbol used to be a common symbol, but now it is 204 allocated. */ 207 205 #define BSF_OLD_COMMON 0x200 208 206 209 /* The default value for common data.*/207 /* The default value for common data. */ 210 208 #define BFD_FORT_COMM_DEFAULT_VALUE 0 211 209 212 /* In some files the type of a symbol sometimes alters its 213 location in an output file - ie in coff a @code{ISFCN} symbol 214 which is also @code{C_EXT} symbol appears where it was 215 declared and not at the end of a section. This bit is set 216 by the target BFD part to convey this information. */ 217 210 /* In some files the type of a symbol sometimes alters its 211 location in an output file - ie in coff a @code{ISFCN} symbol 212 which is also @code{C_EXT} symbol appears where it was 213 declared and not at the end of a section. This bit is set 214 by the target BFD part to convey this information. */ 218 215 #define BSF_NOT_AT_END 0x400 219 216 220 /* Signal that the symbol is the label of constructor section.*/217 /* Signal that the symbol is the label of constructor section. */ 221 218 #define BSF_CONSTRUCTOR 0x800 222 219 223 /* Signal that the symbol is a warning symbol. The name is a224 warning. The name of the next symbol is the one to warn about;225 if a reference is made to a symbol with the same name as the next226 symbol, a warning is issued by the linker.*/220 /* Signal that the symbol is a warning symbol. The name is a 221 warning. The name of the next symbol is the one to warn about; 222 if a reference is made to a symbol with the same name as the next 223 symbol, a warning is issued by the linker. */ 227 224 #define BSF_WARNING 0x1000 228 225 229 /* Signal that the symbol is indirect. This symbol is an indirect230 pointer to the symbol with the same name as the next symbol.*/226 /* Signal that the symbol is indirect. This symbol is an indirect 227 pointer to the symbol with the same name as the next symbol. */ 231 228 #define BSF_INDIRECT 0x2000 232 229 233 /* BSF_FILE marks symbols that contain a file name. This is used234 for ELF STT_FILE symbols. */230 /* BSF_FILE marks symbols that contain a file name. This is used 231 for ELF STT_FILE symbols. */ 235 232 #define BSF_FILE 0x4000 236 233 237 /* Symbol is from dynamic linking information. */234 /* Symbol is from dynamic linking information. */ 238 235 #define BSF_DYNAMIC 0x8000 239 236 240 /* The symbol denotes a data object. Used in ELF, and perhaps241 others someday. */237 /* The symbol denotes a data object. Used in ELF, and perhaps 238 others someday. */ 242 239 #define BSF_OBJECT 0x10000 243 240 244 /* This symbol is a debugging symbol. The value is the offset245 into the section of the data. BSF_DEBUGGING should be set246 as well. */241 /* This symbol is a debugging symbol. The value is the offset 242 into the section of the data. BSF_DEBUGGING should be set 243 as well. */ 247 244 #define BSF_DEBUGGING_RELOC 0x20000 248 245 246 /* This symbol is thread local. Used in ELF. */ 247 #define BSF_THREAD_LOCAL 0x40000 248 249 249 flagword flags; 250 250 251 /* A pointer to the section to which this symbol is252 relative. This will always be non NULL, there are special253 sections for undefined and absolute symbols. */251 /* A pointer to the section to which this symbol is 252 relative. This will always be non NULL, there are special 253 sections for undefined and absolute symbols. */ 254 254 struct sec *section; 255 255 256 /* Back end special data. */256 /* Back end special data. */ 257 257 union 258 258 @{ 259 259 PTR p; 260 260 bfd_vma i; 261 @} udata; 262 263 @} asymbol; 261 @} 262 udata; 263 @} 264 asymbol; 265 264 266 @end example 265 267 … … 278 280 #define bfd_get_symtab_upper_bound(abfd) \ 279 281 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) 282 280 283 @end example 281 284 … … 284 287 @strong{Synopsis} 285 288 @example 286 b oolean bfd_is_local_label(bfd *abfd, asymbol *sym);287 @end example 288 @strong{Description}@* 289 Return trueif the given symbol @var{sym} in the BFD @var{abfd} is290 a compiler generated local label, else return false.289 bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); 290 @end example 291 @strong{Description}@* 292 Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is 293 a compiler generated local label, else return FALSE. 291 294 292 295 @findex bfd_is_local_label_name … … 294 297 @strong{Synopsis} 295 298 @example 296 b oolean bfd_is_local_label_name(bfd *abfd, const char *name);297 @end example 298 @strong{Description}@* 299 Return trueif a symbol with the name @var{name} in the BFD299 bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); 300 @end example 301 @strong{Description}@* 302 Return TRUE if a symbol with the name @var{name} in the BFD 300 303 @var{abfd} is a compiler generated local label, else return 301 false. This just checks whether the name has the form of a304 FALSE. This just checks whether the name has the form of a 302 305 local label. 303 306 @example 304 307 #define bfd_is_local_label_name(abfd, name) \ 305 308 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) 309 306 310 @end example 307 311 … … 318 322 BFD_SEND (abfd, _bfd_canonicalize_symtab,\ 319 323 (abfd, location)) 324 320 325 @end example 321 326 … … 324 329 @strong{Synopsis} 325 330 @example 326 b oolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);331 bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); 327 332 @end example 328 333 @strong{Description}@* … … 335 340 @strong{Synopsis} 336 341 @example 337 void bfd_print_symbol_vandf (PTR file, asymbol *symbol);342 void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol); 338 343 @end example 339 344 @strong{Description}@* … … 354 359 #define bfd_make_empty_symbol(abfd) \ 355 360 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 356 @end example 361 362 @end example 363 364 @findex _bfd_generic_make_empty_symbol 365 @subsubsection @code{_bfd_generic_make_empty_symbol} 366 @strong{Synopsis} 367 @example 368 asymbol * _bfd_generic_make_empty_symbol (bfd *); 369 @end example 370 @strong{Description}@* 371 Create a new @code{asymbol} structure for the BFD @var{abfd} 372 and return a pointer to it. Used by core file routines, 373 binary back-end and anywhere else where no private info 374 is needed. 357 375 358 376 @findex bfd_make_debug_symbol … … 365 383 #define bfd_make_debug_symbol(abfd,ptr,size) \ 366 384 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) 385 367 386 @end example 368 387 … … 375 394 @strong{Synopsis} 376 395 @example 377 int bfd_decode_symclass (asymbol *symbol);396 int bfd_decode_symclass (asymbol *symbol); 378 397 @end example 379 398 @findex bfd_is_undefined_symclass … … 386 405 @strong{Synopsis} 387 406 @example 388 b oolean bfd_is_undefined_symclass (int symclass);407 bfd_boolean bfd_is_undefined_symclass (int symclass); 389 408 @end example 390 409 @findex bfd_symbol_info … … 397 416 @strong{Synopsis} 398 417 @example 399 void bfd_symbol_info (asymbol *symbol, symbol_info *ret);418 void bfd_symbol_info (asymbol *symbol, symbol_info *ret); 400 419 @end example 401 420 @findex bfd_copy_private_symbol_data … … 403 422 @strong{Synopsis} 404 423 @example 405 b oolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);424 bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); 406 425 @end example 407 426 @strong{Description}@* 408 427 Copy private symbol information from @var{isym} in the BFD 409 428 @var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. 410 Return @code{ true} on success, @code{false} on error. Possible error429 Return @code{TRUE} on success, @code{FALSE} on error. Possible error 411 430 returns are: 412 431 … … 421 440 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ 422 441 (ibfd, isymbol, obfd, osymbol)) 423 @end example 424 442 443 @end example 444 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/bfd/doc/targets.texi
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 51 51 If @code{target_defaulted} has been set, each possible target 52 52 type is tried to see if it recognizes the specified format. 53 @code{bfd_check_format} returns @code{ true} when the caller guesses right.53 @code{bfd_check_format} returns @code{TRUE} when the caller guesses right. 54 54 @menu 55 55 * bfd_target:: … … 102 102 (bfd_assert (__FILE__,__LINE__), NULL)) 103 103 #endif 104 104 105 @end example 105 106 This is the structure which defines the type of BFD this is. The … … 112 113 macro to define them both! 113 114 @example 114 enum bfd_flavour @{ 115 enum bfd_flavour 116 @{ 115 117 bfd_target_unknown_flavour, 116 118 bfd_target_aout_flavour, … … 130 132 bfd_target_msdos_flavour, 131 133 bfd_target_ovax_flavour, 132 bfd_target_evax_flavour 134 bfd_target_evax_flavour, 135 bfd_target_mmo_flavour, 136 bfd_target_mach_o_flavour, 137 bfd_target_pef_flavour, 138 bfd_target_pef_xlib_flavour, 139 bfd_target_sym_flavour 133 140 @}; 134 141 … … 140 147 typedef struct bfd_target 141 148 @{ 142 @end example 143 Identifies the kind of target, e.g., SunOS4, Ultrix, etc. 144 @example 149 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ 145 150 char *name; 146 @end example 147 The "flavour" of a back end is a general indication about the contents 148 of a file. 149 @example 151 152 /* The "flavour" of a back end is a general indication about 153 the contents of a file. */ 150 154 enum bfd_flavour flavour; 151 @end example 152 The order of bytes within the data area of a file. 153 @example 155 156 /* The order of bytes within the data area of a file. */ 154 157 enum bfd_endian byteorder; 155 @end example 156 The order of bytes within the header parts of a file. 157 @example 158 159 /* The order of bytes within the header parts of a file. */ 158 160 enum bfd_endian header_byteorder; 159 @end example 160 A mask of all the flags which an executable may have set - 161 from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. 162 @example 161 162 /* A mask of all the flags which an executable may have set - 163 from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. */ 163 164 flagword object_flags; 164 @end example 165 A mask of all the flags which a section may have set - from 166 the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. 167 @example 165 166 /* A mask of all the flags which a section may have set - from 167 the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. */ 168 168 flagword section_flags; 169 @end example 170 The character normally found at the front of a symbol 171 (if any), perhaps `_'. 172 @example 169 170 /* The character normally found at the front of a symbol. 171 (if any), perhaps `_'. */ 173 172 char symbol_leading_char; 174 @end example 175 The pad character for file names within an archive header. 176 @example 173 174 /* The pad character for file names within an archive header. */ 177 175 char ar_pad_char; 178 @end example 179 The maximum number of characters in an archive header. 180 @example 176 177 /* The maximum number of characters in an archive header. */ 181 178 unsigned short ar_max_namelen; 182 @end example 183 Entries for byte swapping for data. These are different from the other 184 entry points, since they don't take a BFD asthe first argument. 185 Certain other handlers could do the same. 186 @example 187 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 179 180 /* Entries for byte swapping for data. These are different from the 181 other entry points, since they don't take a BFD asthe first argument. 182 Certain other handlers could do the same. */ 183 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 188 184 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 189 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));190 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));185 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 186 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 191 187 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 192 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));193 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));188 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 189 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 194 190 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 195 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 196 @end example 197 Byte swapping for the headers 198 @example 199 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 191 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 192 193 /* Byte swapping for the headers. */ 194 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 200 195 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 201 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));202 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));196 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 197 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 203 198 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 204 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));205 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));199 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 200 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 206 201 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 207 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 208 @end example 209 Format dependent routines: these are vectors of entry points 210 within the target vector structure, one for each format to check. 211 212 Check the format of a file being read. Return a @code{bfd_target *} or zero. 213 @example 202 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 203 204 /* Format dependent routines: these are vectors of entry points 205 within the target vector structure, one for each format to check. */ 206 207 /* Check the format of a file being read. Return a @code{bfd_target *} or zero. */ 214 208 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 215 @end example 216 Set the format of a file being written. 217 @example 218 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 219 @end example 220 Write cached information into a file being written, at @code{bfd_close}. 221 @example 222 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 209 210 /* Set the format of a file being written. */ 211 bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 212 213 /* Write cached information into a file being written, at @code{bfd_close}. */ 214 bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 215 223 216 @end example 224 217 The general target vector. These vectors are initialized using the … … 227 220 228 221 /* Generic entry points. */ 229 #define BFD_JUMP_TABLE_GENERIC(NAME)\ 230 CAT(NAME,_close_and_cleanup),\ 231 CAT(NAME,_bfd_free_cached_info),\ 232 CAT(NAME,_new_section_hook),\ 233 CAT(NAME,_get_section_contents),\ 234 CAT(NAME,_get_section_contents_in_window) 222 @end example 223 Do not "beautify" the CONCAT* macro args. Traditional C will not 224 remove whitespace added here, and thus will fail to concatenate 225 the tokens. 226 @example 227 #define BFD_JUMP_TABLE_GENERIC(NAME) \ 228 CONCAT2 (NAME,_close_and_cleanup), \ 229 CONCAT2 (NAME,_bfd_free_cached_info), \ 230 CONCAT2 (NAME,_new_section_hook), \ 231 CONCAT2 (NAME,_get_section_contents), \ 232 CONCAT2 (NAME,_get_section_contents_in_window) 235 233 236 234 /* Called when the BFD is being closed to do any necessary cleanup. */ 237 b oolean(*_close_and_cleanup) PARAMS ((bfd *));235 bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 238 236 /* Ask the BFD to free all cached information. */ 239 b oolean (*_bfd_free_cached_info) PARAMS ((bfd *));237 bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 240 238 /* Called when a new section is created. */ 241 b oolean(*_new_section_hook) PARAMS ((bfd *, sec_ptr));239 bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 242 240 /* Read the contents of a section. */ 243 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 244 file_ptr, bfd_size_type)); 245 boolean (*_bfd_get_section_contents_in_window) 246 PARAMS ((bfd *, sec_ptr, bfd_window *, 247 file_ptr, bfd_size_type)); 241 bfd_boolean (*_bfd_get_section_contents) 242 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 243 bfd_boolean (*_bfd_get_section_contents_in_window) 244 PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 248 245 249 246 /* Entry points to copy private data. */ 250 #define BFD_JUMP_TABLE_COPY(NAME) \251 C AT(NAME,_bfd_copy_private_bfd_data),\252 C AT(NAME,_bfd_merge_private_bfd_data),\253 C AT(NAME,_bfd_copy_private_section_data),\254 C AT(NAME,_bfd_copy_private_symbol_data),\255 C AT(NAME,_bfd_set_private_flags),\256 C AT(NAME,_bfd_print_private_bfd_data)\247 #define BFD_JUMP_TABLE_COPY(NAME) \ 248 CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 249 CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 250 CONCAT2 (NAME,_bfd_copy_private_section_data), \ 251 CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 252 CONCAT2 (NAME,_bfd_set_private_flags), \ 253 CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 257 254 /* Called to copy BFD general private data from one object file 258 255 to another. */ 259 b oolean(*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));256 bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 260 257 /* Called to merge BFD general private data from one object file 261 258 to a common output file when linking. */ 262 b oolean(*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));259 bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 263 260 /* Called to copy BFD private section data from one object file 264 261 to another. */ 265 b oolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,266 bfd *, sec_ptr));262 bfd_boolean (*_bfd_copy_private_section_data) 263 PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 267 264 /* Called to copy BFD private symbol data from one symbol 268 265 to another. */ 269 b oolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,270 bfd *, asymbol *));271 /* Called to set private backend flags */272 b oolean(*_bfd_set_private_flags) PARAMS ((bfd *, flagword));273 274 /* Called to print private BFD data */275 b oolean(*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));266 bfd_boolean (*_bfd_copy_private_symbol_data) 267 PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 268 /* Called to set private backend flags. */ 269 bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 270 271 /* Called to print private BFD data. */ 272 bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 276 273 277 274 /* Core file entry points. */ 278 #define BFD_JUMP_TABLE_CORE(NAME) \279 C AT(NAME,_core_file_failing_command),\280 C AT(NAME,_core_file_failing_signal),\281 C AT(NAME,_core_file_matches_executable_p)282 char * (*_core_file_failing_command) PARAMS ((bfd *));283 int (*_core_file_failing_signal) PARAMS ((bfd *));284 b oolean(*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));275 #define BFD_JUMP_TABLE_CORE(NAME) \ 276 CONCAT2 (NAME,_core_file_failing_command), \ 277 CONCAT2 (NAME,_core_file_failing_signal), \ 278 CONCAT2 (NAME,_core_file_matches_executable_p) 279 char * (*_core_file_failing_command) PARAMS ((bfd *)); 280 int (*_core_file_failing_signal) PARAMS ((bfd *)); 281 bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 285 282 286 283 /* Archive entry points. */ 287 #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ 288 CAT(NAME,_slurp_armap),\ 289 CAT(NAME,_slurp_extended_name_table),\ 290 CAT(NAME,_construct_extended_name_table),\ 291 CAT(NAME,_truncate_arname),\ 292 CAT(NAME,_write_armap),\ 293 CAT(NAME,_read_ar_hdr),\ 294 CAT(NAME,_openr_next_archived_file),\ 295 CAT(NAME,_get_elt_at_index),\ 296 CAT(NAME,_generic_stat_arch_elt),\ 297 CAT(NAME,_update_armap_timestamp) 298 boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 299 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 300 boolean (*_bfd_construct_extended_name_table) 301 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 302 void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); 303 boolean (*write_armap) PARAMS ((bfd *arch, 304 unsigned int elength, 305 struct orl *map, 306 unsigned int orl_count, 307 int stridx)); 308 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 309 bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); 284 #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 285 CONCAT2 (NAME,_slurp_armap), \ 286 CONCAT2 (NAME,_slurp_extended_name_table), \ 287 CONCAT2 (NAME,_construct_extended_name_table), \ 288 CONCAT2 (NAME,_truncate_arname), \ 289 CONCAT2 (NAME,_write_armap), \ 290 CONCAT2 (NAME,_read_ar_hdr), \ 291 CONCAT2 (NAME,_openr_next_archived_file), \ 292 CONCAT2 (NAME,_get_elt_at_index), \ 293 CONCAT2 (NAME,_generic_stat_arch_elt), \ 294 CONCAT2 (NAME,_update_armap_timestamp) 295 bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 296 bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 297 bfd_boolean (*_bfd_construct_extended_name_table) 298 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 299 void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 300 bfd_boolean (*write_armap) 301 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 302 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 303 bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 310 304 #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 311 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));312 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));313 b oolean(*_bfd_update_armap_timestamp) PARAMS ((bfd *));305 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 306 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 307 bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 314 308 315 309 /* Entry points used for symbols. */ 316 #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ 317 CAT(NAME,_get_symtab_upper_bound),\ 318 CAT(NAME,_get_symtab),\ 319 CAT(NAME,_make_empty_symbol),\ 320 CAT(NAME,_print_symbol),\ 321 CAT(NAME,_get_symbol_info),\ 322 CAT(NAME,_bfd_is_local_label_name),\ 323 CAT(NAME,_get_lineno),\ 324 CAT(NAME,_find_nearest_line),\ 325 CAT(NAME,_bfd_make_debug_symbol),\ 326 CAT(NAME,_read_minisymbols),\ 327 CAT(NAME,_minisymbol_to_symbol) 328 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 329 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 330 struct symbol_cache_entry **)); 331 struct symbol_cache_entry * 332 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 333 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, 334 struct symbol_cache_entry *, 335 bfd_print_symbol_type)); 310 #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 311 CONCAT2 (NAME,_get_symtab_upper_bound), \ 312 CONCAT2 (NAME,_get_symtab), \ 313 CONCAT2 (NAME,_make_empty_symbol), \ 314 CONCAT2 (NAME,_print_symbol), \ 315 CONCAT2 (NAME,_get_symbol_info), \ 316 CONCAT2 (NAME,_bfd_is_local_label_name), \ 317 CONCAT2 (NAME,_get_lineno), \ 318 CONCAT2 (NAME,_find_nearest_line), \ 319 CONCAT2 (NAME,_bfd_make_debug_symbol), \ 320 CONCAT2 (NAME,_read_minisymbols), \ 321 CONCAT2 (NAME,_minisymbol_to_symbol) 322 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 323 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 324 struct symbol_cache_entry **)); 325 struct symbol_cache_entry * 326 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 327 void (*_bfd_print_symbol) 328 PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 336 329 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 337 void (*_bfd_get_symbol_info) PARAMS ((bfd *, 338 struct symbol_cache_entry *, 339 symbol_info *)); 330 void (*_bfd_get_symbol_info) 331 PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 340 332 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 341 boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 342 343 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 344 boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, 345 struct sec *section, struct symbol_cache_entry **symbols, 346 bfd_vma offset, CONST char **file, CONST char **func, 347 unsigned int *line)); 333 bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 334 335 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 336 bfd_boolean (*_bfd_find_nearest_line) 337 PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 338 const char **, const char **, unsigned int *)); 348 339 /* Back-door to allow format-aware applications to create debug symbols 349 340 while using BFD for everything else. Currently used by the assembler 350 341 when creating COFF files. */ 351 asymbol * (*_bfd_make_debug_symbol) PARAMS (( 352 bfd *abfd, 353 void *ptr, 354 unsigned long size)); 342 asymbol * (*_bfd_make_debug_symbol) 343 PARAMS ((bfd *, void *, unsigned long size)); 355 344 #define bfd_read_minisymbols(b, d, m, s) \ 356 345 BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 357 long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,358 unsigned int *));346 long (*_read_minisymbols) 347 PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 359 348 #define bfd_minisymbol_to_symbol(b, d, m, f) \ 360 349 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 361 asymbol * (*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,362 asymbol *));350 asymbol * (*_minisymbol_to_symbol) 351 PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 363 352 364 353 /* Routines for relocs. */ 365 #define BFD_JUMP_TABLE_RELOCS(NAME) \366 C AT(NAME,_get_reloc_upper_bound),\367 C AT(NAME,_canonicalize_reloc),\368 C AT(NAME,_bfd_reloc_type_lookup)369 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));370 long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,371 struct symbol_cache_entry **));354 #define BFD_JUMP_TABLE_RELOCS(NAME) \ 355 CONCAT2 (NAME,_get_reloc_upper_bound), \ 356 CONCAT2 (NAME,_canonicalize_reloc), \ 357 CONCAT2 (NAME,_bfd_reloc_type_lookup) 358 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 359 long (*_bfd_canonicalize_reloc) 360 PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 372 361 /* See documentation on reloc types. */ 373 362 reloc_howto_type * 374 (*reloc_type_lookup) PARAMS ((bfd *abfd, 375 bfd_reloc_code_real_type code)); 363 (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 376 364 377 365 /* Routines used when writing an object file. */ 378 #define BFD_JUMP_TABLE_WRITE(NAME) \379 C AT(NAME,_set_arch_mach),\380 C AT(NAME,_set_section_contents)381 b oolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,382 unsigned long));383 b oolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,384 file_ptr, bfd_size_type));366 #define BFD_JUMP_TABLE_WRITE(NAME) \ 367 CONCAT2 (NAME,_set_arch_mach), \ 368 CONCAT2 (NAME,_set_section_contents) 369 bfd_boolean (*_bfd_set_arch_mach) 370 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 371 bfd_boolean (*_bfd_set_section_contents) 372 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 385 373 386 374 /* Routines used by the linker. */ 387 #define BFD_JUMP_TABLE_LINK(NAME)\ 388 CAT(NAME,_sizeof_headers),\ 389 CAT(NAME,_bfd_get_relocated_section_contents),\ 390 CAT(NAME,_bfd_relax_section),\ 391 CAT(NAME,_bfd_link_hash_table_create),\ 392 CAT(NAME,_bfd_link_add_symbols),\ 393 CAT(NAME,_bfd_final_link),\ 394 CAT(NAME,_bfd_link_split_section),\ 395 CAT(NAME,_bfd_gc_sections) 396 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); 397 bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, 398 struct bfd_link_info *, struct bfd_link_order *, 399 bfd_byte *data, boolean relocateable, 400 struct symbol_cache_entry **)); 401 402 boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, 403 struct bfd_link_info *, boolean *again)); 375 #define BFD_JUMP_TABLE_LINK(NAME) \ 376 CONCAT2 (NAME,_sizeof_headers), \ 377 CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 378 CONCAT2 (NAME,_bfd_relax_section), \ 379 CONCAT2 (NAME,_bfd_link_hash_table_create), \ 380 CONCAT2 (NAME,_bfd_link_hash_table_free), \ 381 CONCAT2 (NAME,_bfd_link_add_symbols), \ 382 CONCAT2 (NAME,_bfd_link_just_syms), \ 383 CONCAT2 (NAME,_bfd_final_link), \ 384 CONCAT2 (NAME,_bfd_link_split_section), \ 385 CONCAT2 (NAME,_bfd_gc_sections), \ 386 CONCAT2 (NAME,_bfd_merge_sections), \ 387 CONCAT2 (NAME,_bfd_discard_group) 388 int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 389 bfd_byte * (*_bfd_get_relocated_section_contents) 390 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 391 bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 392 393 bfd_boolean (*_bfd_relax_section) 394 PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 404 395 405 396 /* Create a hash table for the linker. Different backends store 406 397 different information in this table. */ 407 struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); 398 struct bfd_link_hash_table * 399 (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 400 401 /* Release the memory associated with the linker hash table. */ 402 void (*_bfd_link_hash_table_free) 403 PARAMS ((struct bfd_link_hash_table *)); 408 404 409 405 /* Add symbols from this object file into the hash table. */ 410 boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 406 bfd_boolean (*_bfd_link_add_symbols) 407 PARAMS ((bfd *, struct bfd_link_info *)); 408 409 /* Indicate that we are only retrieving symbol values from this section. */ 410 void (*_bfd_link_just_syms) 411 PARAMS ((asection *, struct bfd_link_info *)); 411 412 412 413 /* Do a link based on the link_order structures attached to each 413 414 section of the BFD. */ 414 b oolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));415 bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 415 416 416 417 /* Should this section be split up into smaller pieces during linking. */ 417 b oolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));418 bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 418 419 419 420 /* Remove sections that are not referenced from the output. */ 420 boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 421 bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 422 423 /* Attempt to merge SEC_MERGE sections. */ 424 bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 425 426 /* Discard members of a group. */ 427 bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 421 428 422 429 /* Routines to handle dynamic symbols and relocs. */ 423 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \424 C AT(NAME,_get_dynamic_symtab_upper_bound),\425 C AT(NAME,_canonicalize_dynamic_symtab),\426 C AT(NAME,_get_dynamic_reloc_upper_bound),\427 C AT(NAME,_canonicalize_dynamic_reloc)428 /* Get the amount of memory required to hold the dynamic symbols. */429 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));430 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 431 CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 432 CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 433 CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 434 CONCAT2 (NAME,_canonicalize_dynamic_reloc) 435 /* Get the amount of memory required to hold the dynamic symbols. */ 436 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 430 437 /* Read in the dynamic symbols. */ 431 long (*_bfd_canonicalize_dynamic_symtab)438 long (*_bfd_canonicalize_dynamic_symtab) 432 439 PARAMS ((bfd *, struct symbol_cache_entry **)); 433 440 /* Get the amount of memory required to hold the dynamic relocs. */ 434 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));441 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 435 442 /* Read in the dynamic relocs. */ 436 long (*_bfd_canonicalize_dynamic_reloc)443 long (*_bfd_canonicalize_dynamic_reloc) 437 444 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 438 445 … … 444 451 to find an alternative output format that is suitable. 445 452 @example 446 /* Opposite endian version of this target. */ 447 const struct bfd_target * alternative_target; 448 449 @end example 450 Data for use by back-end routines, which isn't generic enough to belong 451 in this structure. 452 @example 453 PTR backend_data; 453 /* Opposite endian version of this target. */ 454 const struct bfd_target * alternative_target; 455 456 /* Data for use by back-end routines, which isn't 457 generic enough to belong in this structure. */ 458 PTR backend_data; 454 459 455 460 @} bfd_target; 461 456 462 @end example 457 463 … … 460 466 @strong{Synopsis} 461 467 @example 462 b oolean bfd_set_default_target (const char *name);468 bfd_boolean bfd_set_default_target (const char *name); 463 469 @end example 464 470 @strong{Description}@* … … 471 477 @strong{Synopsis} 472 478 @example 473 const bfd_target *bfd_find_target (CONSTchar *target_name, bfd *abfd);479 const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); 474 480 @end example 475 481 @strong{Description}@* … … 488 494 @strong{Synopsis} 489 495 @example 490 const char ** bfd_target_list(void);496 const char ** bfd_target_list (void); 491 497 @end example 492 498 @strong{Description}@* … … 499 505 @strong{Synopsis} 500 506 @example 501 const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); 507 const bfd_target * bfd_search_for_target (int (* search_func) 508 (const bfd_target *, void *), 509 void *); 502 510 @end example 503 511 @strong{Description}@* -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
