Merge ^/vendor/binutils/dist@214571 into contrib/binutils, which brings

us up to version 2.17.50.20070703, at the last GPLv2 commit.

Amongst others, this added upstream support for some FreeBSD-specific
things that we previously had to manually hack in, such as the OSABI
label support, and so on.

There are also quite a number of new files, some for cpu's (e.g. SPU)
that we may or may not be interested in, but those can be cleaned up
later on, if needed.
This commit is contained in:
Dimitry Andric 2010-11-01 19:35:33 +00:00
commit 97d40d3d4a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/binutils-2.17/; revision=214634
611 changed files with 201963 additions and 88784 deletions

View File

@ -1,8 +1,691 @@
2007-06-29 Bernd Schmidt <bernd.schmidt@analog.com>
* configure.ac: Don't add target-libmudflap to noconfigdirs for
uclinux and linux-uclibc targets.
* configure: Regenerate.
2007-06-28 DJ Delorie <dj@redhat.com>
* configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're
not building newlib.
* configure: Regenerated.
2007-06-22 Daniel Jacobowitz <dan@codesourcery.com>
* src-release (DEVO_SUPPORT): Correct typos.
2007-06-18 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.def: Add dependency from configure-gdb to all-bfd.
* Makefile.in: Regenerated.
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile.
(distclean-stage[+id+]): Possibly delete stage_last.
* Makefile.in: Regenerate.
2007-06-07 Ben Elliston <bje@au.ibm.com>
* config.sub, config.guess: Update from upstream sources.
2007-06-07 Ben Elliston <bje@au.ibm.com>
* Makefile.tpl: Fix spelling error.
* Makefile.in: Regenerate.
2007-06-04 Paolo Bonzini <bonzini@gnu.org>
Sync with gcc:
2007-05-30 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/29382
* configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1.
* configure: Rebuilt.
2007-06-01 Steve Ellcey <sje@cup.hp.com>
* libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set
lt_cv_sys_max_cmd_len.
2007-05-31 Paolo Bonzini <bonzini@gnu.org>
* ltgcc.m4: Update from GCC.
2007-05-25 Andreas Tobler <a.tobler@schweiz.org>
* ltmain.sh: Fix Darwin verstring, remove ${wl}.
2007-05-24 Steve Ellcey <sje@cup.hp.com>
* ltmain.sh: Update from GCC.
* libtool.m4: Update from GCC.
* ltsugar.m4: New. Update from GCC.
* ltversion.m4: New. Update from GCC.
* ltoptions.m4: New. Update from GCC.
* ltconfig: Remove.
* ltcf-c.sh: Remove.
* ltcf-cxx.sh: Remove.
* ltcf-gcj.sh: Remove.
* src-release: Update with new libtool file list.
2007-05-16 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (bootstrap_stage): Replace stage_make_flags with
stage_cflags.
* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS):
Remove CFLAGS/LIBCFLAGS.
(configure-stage[+id+]-[+prefix+][+module+],
all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+].
* Makefile.in: Regenerate.
2007-04-14 Steve Ellcey <sje@cup.hp.com>
* config-ml.in: Update from GCC.
2007-04-09 Daniel Jacobowitz <dan@codesourcery.com>
* src-release (do-proto-toplev): Process the support directories before
the tool directory.
2007-03-21 Richard Sandiford <richard@codesourcery.com>
* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting
of glob. Quote arguments with single quotes too.
* configure: Regenerate.
2007-03-12 Brooks Moses <brooks.moses@codesourcery.com>
* Makefile.def (fixincludes): Remove unneeded "missing" lines.
* Makefile.in: Regenerate
2007-03-07 Andreas Schwab <schwab@suse.de>
* configure: Regenerate.
2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
* configure.ac: Add "--with-pdfdir" configure option,
which defines pdfdir variable.
* Makefile.def (target=fixincludes): Add install-pdf to
missing targets.
(recursive_targets): Add install-pdf target.
(flags_to_pass): Add pdfdir.
* Makefile.tpl: Add pdfdir handling, add do-install-pdf
target.
* configure: Regenerate
* Makefile.in: Regenerate
2007-02-28 Eric Christopher <echristo@apple.com>
Revert:
2006-12-07 Mike Stump <mrs@apple.com>
* Makefile.def (dependencies): Add dependency for
install-target-libssp and install-target-libgomp on
install-gcc.
* Makefile.in: Regenerate.
2007-02-27 Matt Kraai <kraai@ftbfs.org>
* configure: Regenerate.
* configure.ac: Move statements after variable declarations.
2007-02-19 Joseph Myers <joseph@codesourcery.com>
* configure.ac: Adjust for loop syntax.
* configure: Regenerate.
2007-02-18 Alexandre Oliva <aoliva@redhat.com>
* configure: Rebuilt.
2007-02-18 Alexandre Oliva <aoliva@redhat.com>
* configure.ac: Drop multiple occurrences of --enable-languages,
and fix its quoting.
* configure: Rebuilt.
2007-02-17 Mark Mitchell <mark@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Vladimir Prus <vladimir@codesourcery.com
Joseph Myers <joseph@codesourcery.com>
* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting.
* configure: Regenerate.
2007-02-13 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac (target_libraries): Move libgcc before libiberty.
* configure: Regenerated.
2007-02-13 Paolo Bonzini <bonzini@gnu.org>
* configure: Regenerate again?
2007-02-13 Paolo Bonzini <bonzini@gnu.org>
* configure: Reapply PR30748 fix which was lost in the previous commit.
2007-02-13 Daniel Jacobowitz <dan@codesourcery.com>
Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/30753
* configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC
unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix.
* configure: Regenerated.
2007-02-10 Paolo Bonzini <bonzini@gnu.org>
* configure: Regenerate.
2007-02-09 Daniel Jacobowitz <dan@codesourcery.com>
PR bootstrap/30748
* configure.ac: Correct syntax for Solaris ksh.
* configure: Regenerated.
2007-02-09 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def: Sync with GCC.
* Makefile.tpl: Sync with GCC.
* Makefile.in: Regenerate.
* configure: Regenerate.
2007-02-09 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.tpl (build_alias, host_alias, target_alias): Use
noncanonical equivalents.
* configure.in: Rename to...
* configure.ac: ...this. Update AC_PREREQ. Prevent error for
AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and
target_noncanonical. Use them. Rewrite removal of configure
arguments for autoconf 2.59. Discard variable settings. Force
program_transform_name for native tools.
* Makefile.in: Regenerated.
* configure: Regenerated with autoconf 2.59.
* src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac.
2007-02-08 Jeff Johnston <jjohnstn@redhat.com>
* COPYING.LIBGLOSS: Reformat default Red Hat
license to fit within 80 columns.
* COPYING.NEWLIB: Ditto.
2007-02-05 Dave Brolley <brolley@redhat.com>
* Contribute the following changes:
2006-11-28 DJ Delorie <dj@redhat.com>
* configure.in: Fix typo for mep's target_makefile_frag.
* configure: Regenerated.
2005-04-22 Richard Sandiford <rsandifo@redhat.com>
* configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET.
* configure: Regenerate.
2001-09-19 DJ Delorie <dj@redhat.com>
* configure.in (target_makefile_frag): use mt-mep
2001-06-12 Don Howard <dhoward@redhat.com>
* configure.in: Remove gdb from MeP skip list.
2001-04-05 DJ Delorie <dj@redhat.com>
* configure.in (noconfigdirs): Remove gcc from MeP skip list.
2001-03-20 Ben Elliston <bje@redhat.com>
* configure.in (noconfigdirs): Add gcc and gdb for MeP.
2001-03-19 Ben Elliston <bje@redhat.com>
* config.sub (mep, mep-*): Add.
2007-01-31 Andreas Schwab <schwab@suse.de>
* Makefile.tpl (LDFLAGS): Substitute it.
* Makefile.in: Regenerate.
2007-01-11 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Change == to = in test command.
* configure: Regenerate.
2007-01-11 Paolo Bonzini <bonzini@gnu.org>
Nick Clifton <nickc@redhat.com>
Kaveh R. Ghazi <ghazi@caip.rutgets.edu>
* configure.in (build_configargs, host_configargs, target_configargs):
Remove build/host/target parameters.
(host_libs): Add gmp and mpfr.
(GMP tests): Reorganize to allow in-tree GMP/MPFR.
* Makefile.def (gmp, mpfr): New.
(gcc): Remove target.
* Makefile.tpl (build_os, build_vendor, host_os, host_vendor,
target_os, target_vendor): New.
(configure): Add host_alias/target_alias arguments. Adjust invocations.
* configure: Regenerate.
* Makefile.in: Regenerate.
2007-01-11 Matt Fago <fago@earthlink.net>
* configure.in: Try to link to functions only in mpfr 2.2.x
to improve robustness of configure tests.
* configure: Regenerate.
2007-01-08 Kai Tietz <kai.tietz@onevision.com>
* configure.in: Add support for an x86_64-mingw* target.
* configure: Regenerate.
2007-01-05 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.tpl (all-target): Correct @if conditional for target
modules.
* configure.in: Omit libiberty if building only target libgcc.
* configure, Makefile.in: Regenerated.
2007-01-04 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Use DEV-PHASE to detect the default for --enable-werror.
* configure: Regenerate.
2007-01-03 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.def (target_modules): Add libgcc.
(lang_env_dependencies): Remove default items. Use no_c and no_gcc.
* Makefile.tpl (clean-target-libgcc): Delete.
(configure-target-[+module+]): Emit --disable-bootstrap dependencies
on gcc even for bootstrapped modules. Rewrite handling of
lang_env_dependencies to loop over target_modules.
* configure.in (target_libraries): Add target-libgcc.
* Makefile.in, configure: Regenerated.
2006-12-29 Paolo Bonzini <bonzini@gnu.org>
Sync with gcc:
2006-12-29 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Reorganize recognition of languages. Add
--enable-stage1-languages. Show supported languages for the chosen
target rather than all recognized languages.
* configure: Regenerate.
2006-12-29 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (GCC_STRAP_TARGETS, all-prebootstrap): Remove.
* Makefile.in: Regenerate.
2006-12-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in: Warn that MPFR 2.2.0 is buggy.
* configure: Regenerate.
2006-12-27 Ian Lance Taylor <iant@google.com>
* configure.in: When removing Makefiles to force a reconfigure, also
remove prev-DIR*/Makefile.
* configure: Regenerate.
2006-12-23 Kazu Hirata <kazu@codesourcery.com>
* config.bfd: Recognize fido.
2006-12-19 Paolo Bonzini <bonzini@gnu.org>
Sync with gcc:
2006-12-19 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Remove "$build" case for powerpc-*-darwin* since
it only affects bootstrap and could be tested on "$host" as well.
* configure: Regenerate.
* config/mh-ppc-darwin: Add to the stage1 cflags here.
2006-12-19 Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/29544
* Makefile.def (flags_to_pass): Add STAGE1_CHECKING.
(bootstrap_stage): Add STAGE1_CHECKING to stage1 configure flags,
move here comment from Makefile.tpl.
* Makefile.tpl: Move some definitions higher in the file.
(STAGE1_CHECKING): New.
* configure.in: Add --enable-stage1-checking.
* configure: Regenerate.
* Makefile.in: Regenerate.
2006-12-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in: Update error message for missing GMP/MPFR.
* configure: Regenerate.
2006-12-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in: Update MPFR version in error message.
* configure: Regenerate.
2006-11-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags.
(--with-mpfr-include, --with-mpfr-lib, --with-gmp-include,
--with-gmp-lib): New flags.
* configure: Regenerate.
2006-12-12 Andreas Tobler <a.tobler@schweiz.org>
PR bootstrap/30134
* configure.in: Correct x86 darwin support for libjava to powerpc
and i?86 only.
* configure: Regenerate.
2006-12-11 Alan Modra <amodra@bigpond.net.au>
* configure.in: Handle spu makefile frag.
* Makefile.tpl (MAINT): Define
(MAINTAINER_MODE_FALSE, MAINTAINER_MODE_TRUE): Define.
* configure: Regenerate.
* Makefile.in: Regenerate.
2006-12-11 Ben Elliston <bje@au.ibm.com>
* config.sub, config.guess: Update from upstream sources.
2006-12-11 Ben Elliston <bje@au.ibm.com>
* configure.in: Sync with GCC (spu-*-*).
* configure: Sync with GCC.
2006-12-07 Mike Stump <mrs@apple.com>
* Makefile.def (dependencies): Add dependency for
install-target-libssp and install-target-libgomp on
install-gcc.
* Makefile.in: Regenerate.
2006-11-16 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (clean-target-libgcc): Test for gcc Makefile presence.
(unstage): Test for stage_last presence.
PR bootstrap/29802
* Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Add HOST_SUBDIR in STAGE_PREFIX.
* Makefile.in: Regenerate.
2006-11-14 DJ Delorie <dj@redhat.com>
* Makefile.tpl (clean-stage*): Sync with GCC (clean).
* Makefile.in: Sync with GCC.
* configure.in: Sync with GCC (mpfr, gmp).
* configure: Sync with GCC.
2006-11-08 Jie Zhang <jie.zhang@analog.com>
* configure.in: Remove target-libgloss from noconfigdirs for
bfin-*-*.
* configure: Regenerated.
2006-10-27 Jeff Johnston <jjohnstn@redhat.com>
* COPYING.NEWLIB: Add spu license.
* COPYING.LIBGLOSS: Ditto.
2006-10-17 Brooks Moses <bmoses@stanford.edu>
* Makefile.def: Added pdf target handling.
* Makefile.tpl: Added pdf target handling.
* Makefile.in: Regenerated.
2006-10-11 Jeff Johnston <jjohnstn@redhat.com>
* COPYING.NEWLIB: Updated.
* COPYING.LIBGLOSS: Ditto.
2006-09-27 Dave Brolley <brolley@redhat.com>
* configure.in (RUNTEST): Look for 'runtest' in the source tree by using
$s instead of $r.
* configure: Regenerated.
2006-09-26 Ben Elliston <bje@au.ibm.com>
* config.sub, config.guess: Update from upstream sources.
2006-09-20 Thiemo Seufer <ths@mips.com>
* configure.in: Remove redundant handling of mips*-dec-bsd*. Likewise
for mipstx39-*-*. Disable libgloss for mips64*-*-linux*.
* configure: Regenerate.
2006-08-30 Corinna Vinschen <corinna@vinschen.de>
* configure.in: Never build newlib for a Mingw host.
Never build newlib as Mingw target library.
Test the existence of winsup/cygwin for building a Cygwin newlib,
rather than just winsup.
Add winsup/mingw and winsup/w32api paths to FLAGS_FOR_TARGET if
building a Mingw target.
* configure: Regenerate.
2006-08-15 Thiemo Seufer <ths@mips.com>
Nigel Stephens <nigel@mips.com>
David Ung <davidu@mips.com>
* config.sub: Add support for sde as alias of mipsisa32-sde-elf.
2006-07-25 Paolo Bonzini <bonzini@gnu.org>
Sync from GCC:
2006-07-04 Eric Botcazou <ebotcazou@libertysurf.fr>
PR bootstrap/18058
* configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1
if the bootstrap compiler is a GCC version that supports it.
* configure: Regenerate.
2006-07-22 Daniel Jacobowitz <dan@codesourcery.com>
* configure.in: Allow mingw32 and cygwin targets to build cross-gdb.
* configure: Regenerated.
2006-07-18 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir
for stages after the first.
2006-07-17 Jakub Jelinek <jakub@redhat.com>
* Makefile.def: Add dependencies for configure-opcodes
on configure-intl and all-opcodes on all-intl.
* Makefile.in: Regenerated.
2006-07-04 Peter O'Gorman <peter@pogma.com>
* ltconfig: chmod 644 before ranlib during install.
2006-07-03 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Fix thinkos in previous check-in.
* configure: Regenerate.
2006-07-03 Paolo Bonzini <bonzini@gnu.org>
Sync from gcc:
2007-07-03 Paolo Bonzini <bonzini@gnu.org>
PR other/27063
* configure.in: Test subdir_requires and give an appropriate
error message.
* configure: Regenerate.
2006-06-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR target/27540
* configure.in: Only enable libgomp on IRIX 6.
* configure: Regenerate.
2006-06-20 David Ayers <d.ayers@inode.at>
PR bootstrap/28072
* configure.in: Add target-boehm-gc to noconfigdirs depending on
whether target-libjava is being configured instead of whether the
java front end is enabled.
* configure: Regenerate.
2006-06-15 Mark Shinwell <shinwell@codesourcery.com>
* include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2}
to R_ARM_LDC_SB_G{0,1,2} respectively.
2006-06-15 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Export CFLAGS and LDFLAGS
too.
* Makefile.in: Regenerate.
2006-06-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sync from gcc:
2006-06-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* configure.in: Don't enable libgomp on hpux10.
* configure: Rebuilt.
2006-06-13 David Ayers <d.ayers@inode.at>
Sync from gcc:
2006-06-12 David Ayers <d.ayers@inode.at>
PR bootstrap/27963
PR target/19970
* configure.in: Remove target-boehm-gc from noconfigdirs where
${libgcj} is specified.
* configure: Regenerate.
2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
Sync from gcc:
2005-01-12 David Edelsohn <edelsohn@gnu.org>
Andreas Schwab <schwab@suse.de>
PR bootstrap/18033
* config-ml.in: Eval option if surrounded by single quotes.
2006-06-07 Carlos O'Donell <carlos@codesourcery.com>
Sync from gcc:
2006-06-06 David Ayers <d.ayers@inode.at>
PR libobjc/13946
* Makefile.def: Add dependencies for libobjc which boehm-gc.
* Makefile.in: Regenerate.
* configure.in: Add --enable-objc-gc at toplevel and have it
enable boehm-gc for Objective-C.
Remove target-boehm-gc from libgcj.
Add target-boehm-gc to target_libraries.
Add target-boehm-gc to noconfigdirs where ${libgcj}
is specified.
Assert that boehm-gc is supported when requested for Objective-C.
Only build boehm-gc if needed either for Java or Objective-C.
* configure: Regenerate.
2006-06-05 Paolo Bonzini <bonzini@gnu.org>
PR 27674
* Makefile.tpl (configure-[+prefix+][+module+],
all-[+prefix+][+module+]): Depend on stage_current if bootstrapping.
Remove rule to unstage bootstrapped modules.
(stage_current): New.
* Makefile.in: Regenerate.
2006-05-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Andreas Tobler <a.tobler@schweiz.ch>
* configure.in: Enable libgcj for hppa*-hp-hpux11*.
* configure: Rebuilt.
Revert
2006-01-31 Richard Guenther <rguenther@suse.de>
Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (target_modules): Add libgcc-math target module.
* configure.in (target_libraries): Add libgcc-math target library.
(--enable-libgcc-math): New configure switch.
* Makefile.in: Re-generate.
* configure: Re-generate.
2006-06-05 Jeff Johnston <jjohnstn@redhat.com>
* config-ml.in: Alter CCASFLAGS to include special
multilib options the same as is done for CFLAGS.
2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.def: Added dependencies from sim and gdb on intl, and
added configure dependencies to everything with an all dependency
on intl.
* gettext.m4: Removed.
* src-release (DEVO_SUPPORT): Don't mention gettext.m4.
(GDB_SUPPORT_DIRS): Add intl.
* Makefile.in: Regenerated.
2006-05-25 Daniel Jacobowitz <dan@codesourcery.com>
* src-release (DEVO_SUPPORT): Add config.rpath.
2006-05-25 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (bfd, opcodes): Fix lib_path.
* Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Replace ADAC with ADAFLAGS.
(restrap): Move under "@if gcc-bootstrap". Fix typo.
* Makefile.in: Regenerate.
2006-05-24 Mark Shinwell <shinwell@codesourcery.com>
* configure.in: Enable gprof for cross builds.
* configure: Regenerate.
2006-05-17 Daniel Jacobowitz <dan@codesourcery.com>
* src-release (MAKEINFOFLAGS): Define.
(do-proto-toplev): Pass MAKEINFOFLAGS to submakes.
2006-05-14 Ben Elliston <bje@au.ibm.com>
* config.sub, config.guess: Update from upstream sources.
2006-05-12 Ben Elliston <bje@au.ibm.com>
* config.sub, config.guess: Update from upstream sources.
2006-05-04 Steve Ellcey <sje@cup.hp.com>
* blt, iwidgets, mmalloc: Remove directories.
2006-05-01 DJ Delorie <dj@redhat.com>
* configure.in: Restore CFLAGS if GMP isn't present.
* configure: Regenerate.
2006-04-18 DJ Delorie <dj@redhat.com>
* configure.in (m32c): Build libstdc++-v3. Pass flags to
reference libgloss so that libssp can be built in a combined
tree.
* configure: Regenerate.
2006-04-10 Ben Elliston <bje@au.ibm.com>
* contrib: Remove directory.
@ -35,7 +718,7 @@
* configure: Regenerate.
2006-02-21 Rafael Avila de Espindola <rafael.espindola@gmail.com>
* Makefile.tpl (BUILD_CONFIGDIRS): Remove.
(TARGET_CONFIGDIRS): Remove.
* configure.in: Remove AC_SUBST(target_configdirs).
@ -105,7 +788,7 @@
2006-02-14 Paolo Bonzini <bonzini@gnu.org>
Andreas Schwab <schwab@suse.de>
* configure: Regenerate.
2006-01-16 Paolo Bonzini <bonzini@gnu.org>
@ -117,7 +800,7 @@
2006-01-16 Nick Clifton <nickc@redhat.com>
* config.sub, config.guess: Sync from config repository.
* config.sub, config.guess: Sync from config repository.
2006-01-05 Alexandre Oliva <aoliva@redhat.com>
@ -397,7 +1080,7 @@
CONFIGURED_LIPO_FOR_TARGET, CONFIGURED_STRIP_FOR_TARGET.
* Makefile.in: Regenerate.
* configure: Regenerate.
2005-09-19 David Edelsohn <edelsohn@gnu.org>
* configure.in (powerpc-*-aix*): Add target-libssp to noconfigdirs.
@ -464,7 +1147,7 @@
2005-07-27 Mark Mitchell <mark@codesourcery.com>
* Makefile.tpl (EXTRA_TARGET_FLAGS): Set LDFLAGS=LDFLAGS_FOR_TARGET.
* Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET.
* Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET.
* Makefile.in: Regenerated.
2005-07-26 Mark Mitchell <mark@codesourcery.com>
@ -489,7 +1172,7 @@
* configure.in: Add cases for Renesas m32c.
* configure: Regenerated.
2005-07-14 Kelley Cook <kcook@gcc.gnu.org>
* COPYING, compile, config-ml.in, config.guess,
@ -604,7 +1287,7 @@
2005-05-19 Paul Brook <paul@codesourcery.com>
* configure.in: Rewrite misleading error message when requested
* configure.in: Rewrite misleading error message when requested
language cannot be built.
* configure: Regenerate.

View File

@ -47,15 +47,15 @@ gdb/; readline/; sim/; GDB's part of include/
include/
See binutils/, gdb/, sid/, gcc/, libiberty/ etc.
libiberty/; libiberty's part of include/
intl/; config.rhost; libiberty/; libiberty's part of include/
gcc: http://gcc.gnu.org
Changes need to be done in tandem with the official GCC
sources or submitted to the master file maintainer and brought
in via a merge. Note: approved patches in gcc's libiberty
are automatically approved in this libiberty also; feel free
to merge them yourself if needed sooner than the next merge.
Otherwise, changes are automatically merged, usually within
a day.
in via a merge. Note: approved patches in gcc's libiberty or
intl are automatically approved in this libiberty and intl also;
feel free to merge them yourself if needed sooner than the next
merge. Otherwise, changes are automatically merged, usually
within a day.
ltconfig; ltmain.sh; ltcf-*.sh
libtool: http://www.gnu.org/software/libtool/
@ -99,7 +99,7 @@ winsup/
See also winsup/MAINTAINERS.
config-ml.in; makefile.vms; mkdep; setup.com;
etc/; intl/; utils/;
etc/; utils/;
Any global maintainer can approve changes to these
files and directories.

View File

@ -30,15 +30,14 @@ build_modules= { module= byacc; };
build_modules= { module= flex; };
build_modules= { module= m4; };
build_modules= { module= texinfo; };
build_modules= { module= fixincludes;
extra_configure_args='--target=$(target)'; };
build_modules= { module= fixincludes; };
host_modules= { module= ash; };
host_modules= { module= autoconf; };
host_modules= { module= automake; };
host_modules= { module= bash; };
host_modules= { module= bfd; lib_path=.; bootstrap=true; };
host_modules= { module= opcodes; lib_path=.; bootstrap=true; };
host_modules= { module= bfd; lib_path=.libs; bootstrap=true; };
host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; };
host_modules= { module= binutils; bootstrap=true; };
host_modules= { module= bison; no_check_cross= true; };
host_modules= { module= byacc; no_check_cross= true; };
@ -52,18 +51,23 @@ host_modules= { module= fileutils; };
host_modules= { module= findutils; };
host_modules= { module= find; };
host_modules= { module= fixincludes;
missing= info;
missing= dvi;
missing= TAGS;
missing= install-info;
missing= installcheck; };
missing= TAGS; };
host_modules= { module= flex; no_check_cross= true; };
host_modules= { module= gas; bootstrap=true; };
host_modules= { module= gcc; bootstrap=true;
target="`if [ -f stage_last ]; then echo quickstrap ; else echo all; fi`";
extra_make_flags="$(EXTRA_GCC_FLAGS)"; };
host_modules= { module= gawk; };
host_modules= { module= gettext; };
host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared';
no_install= true;
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp';
no_install= true;
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= gnuserv; };
host_modules= { module= gprof; };
host_modules= { module= gzip; };
@ -117,8 +121,8 @@ host_modules= { module= gnattools; };
target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; };
target_modules = { module= libmudflap; lib_path=.libs; };
target_modules = { module= libssp; lib_path=.libs; };
target_modules = { module= libgcc-math; lib_path=.libs; };
target_modules = { module= newlib; };
target_modules = { module= libgcc; bootstrap=true; no_check=true; };
target_modules = { module= libgfortran; };
target_modules = { module= libobjc; };
target_modules = { module= libtermcap; no_check=true;
@ -148,6 +152,8 @@ recursive_targets = { make_target= info;
depend=configure; };
recursive_targets = { make_target= dvi;
depend=configure; };
recursive_targets = { make_target= pdf;
depend=configure; };
recursive_targets = { make_target= html;
depend=configure; };
recursive_targets = { make_target= TAGS;
@ -155,6 +161,9 @@ recursive_targets = { make_target= TAGS;
recursive_targets = { make_target= install-info;
depend=configure;
depend=info; };
recursive_targets = { make_target= install-pdf;
depend=configure;
depend=pdf; };
recursive_targets = { make_target= install-html;
depend=configure;
depend=html; };
@ -178,6 +187,7 @@ flags_to_pass = { flag= includedir ; };
flags_to_pass = { flag= datarootdir ; };
flags_to_pass = { flag= docdir ; };
flags_to_pass = { flag= infodir ; };
flags_to_pass = { flag= pdfdir ; };
flags_to_pass = { flag= htmldir ; };
flags_to_pass = { flag= libdir ; };
flags_to_pass = { flag= libexecdir ; };
@ -224,7 +234,10 @@ flags_to_pass = { flag= LDFLAGS ; };
flags_to_pass = { flag= LIBCFLAGS ; };
flags_to_pass = { flag= LIBCXXFLAGS ; };
flags_to_pass = { flag= STAGE1_CFLAGS ; };
flags_to_pass = { flag= STAGE1_CHECKING ; };
flags_to_pass = { flag= STAGE1_LANGUAGES ; };
flags_to_pass = { flag= GNATBIND ; };
flags_to_pass = { flag= GNATMAKE ; };
// Target tools
flags_to_pass = { flag= AR_FOR_TARGET ; };
@ -271,7 +284,9 @@ dependencies = { module=configure-gcc; on=all-binutils; };
dependencies = { module=configure-gcc; on=all-gas; };
dependencies = { module=configure-gcc; on=all-ld; };
dependencies = { module=all-gcc; on=all-libiberty; hard=true; };
dependencies = { module=all-gcc; on=all-gmp; };
dependencies = { module=all-gcc; on=all-intl; };
dependencies = { module=all-gcc; on=all-mpfr; };
dependencies = { module=all-gcc; on=all-build-texinfo; };
dependencies = { module=all-gcc; on=all-build-bison; };
dependencies = { module=all-gcc; on=all-build-byacc; };
@ -294,11 +309,15 @@ dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=configure-mpfr; on=all-gmp; };
// Host modules specific to gdb.
dependencies = { module=configure-gdb; on=configure-intl; };
dependencies = { module=configure-gdb; on=configure-sim; };
dependencies = { module=configure-gdb; on=all-bfd; };
dependencies = { module=all-gdb; on=all-intl; };
dependencies = { module=all-gdb; on=all-libiberty; };
dependencies = { module=all-gdb; on=all-opcodes; };
dependencies = { module=all-gdb; on=all-bfd; };
dependencies = { module=all-gdb; on=all-readline; };
dependencies = { module=all-gdb; on=all-build-bison; };
dependencies = { module=all-gdb; on=all-build-byacc; };
@ -312,9 +331,11 @@ dependencies = { module=all-libgui; on=all-itcl; };
// Host modules specific to binutils.
dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
dependencies = { module=configure-bfd; on=configure-intl; };
dependencies = { module=all-bfd; on=all-libiberty; };
dependencies = { module=all-bfd; on=all-intl; };
dependencies = { module=configure-binutils; on=configure-intl; };
dependencies = { module=all-binutils; on=all-libiberty; };
dependencies = { module=all-binutils; on=all-opcodes; };
dependencies = { module=all-binutils; on=all-bfd; };
@ -331,14 +352,17 @@ dependencies = { module=install-binutils; on=install-opcodes; };
// libopcodes depends on libbfd
dependencies = { module=install-opcodes; on=install-bfd; };
dependencies = { module=configure-gas; on=configure-intl; };
dependencies = { module=all-gas; on=all-libiberty; };
dependencies = { module=all-gas; on=all-opcodes; };
dependencies = { module=all-gas; on=all-bfd; };
dependencies = { module=all-gas; on=all-intl; };
dependencies = { module=configure-gprof; on=configure-intl; };
dependencies = { module=all-gprof; on=all-libiberty; };
dependencies = { module=all-gprof; on=all-bfd; };
dependencies = { module=all-gprof; on=all-opcodes; };
dependencies = { module=all-gprof; on=all-intl; };
dependencies = { module=configure-ld; on=configure-intl; };
dependencies = { module=all-ld; on=all-libiberty; };
dependencies = { module=all-ld; on=all-bfd; };
dependencies = { module=all-ld; on=all-opcodes; };
@ -347,8 +371,10 @@ dependencies = { module=all-ld; on=all-build-byacc; };
dependencies = { module=all-ld; on=all-build-flex; };
dependencies = { module=all-ld; on=all-intl; };
dependencies = { module=configure-opcodes; on=configure-intl; };
dependencies = { module=all-opcodes; on=all-bfd; };
dependencies = { module=all-opcodes; on=all-libiberty; };
dependencies = { module=all-opcodes; on=all-intl; };
// Other host modules in the 'src' repository.
dependencies = { module=all-dejagnu; on=all-tcl; };
@ -378,6 +404,8 @@ dependencies = { module=all-sid; on=all-tk; };
dependencies = { module=install-sid; on=install-tcl; };
dependencies = { module=install-sid; on=install-tk; };
dependencies = { module=configure-sim; on=configure-intl; };
dependencies = { module=all-sim; on=all-intl; };
dependencies = { module=all-sim; on=all-libiberty; };
dependencies = { module=all-sim; on=all-bfd; };
dependencies = { module=all-sim; on=all-opcodes; };
@ -425,18 +453,17 @@ dependencies = { module=all-tar; on=all-build-texinfo; };
dependencies = { module=all-uudecode; on=all-build-texinfo; };
// Target modules. These can also have dependencies on the language
// environment (e.g. on libstdc++).
lang_env_dependencies = { module=boehm-gc; };
// environment (e.g. on libstdc++). By default target modules depend
// on libgcc and newlib/libgloss.
lang_env_dependencies = { module=gperf; cxx=true; };
lang_env_dependencies = { module=libada; };
lang_env_dependencies = { module=libgfortran; };
lang_env_dependencies = { module=libffi; };
lang_env_dependencies = { module=libjava; cxx=true; };
lang_env_dependencies = { module=libmudflap; };
lang_env_dependencies = { module=libobjc; };
lang_env_dependencies = { module=libssp; };
lang_env_dependencies = { module=libstdc++-v3; };
lang_env_dependencies = { module=zlib; };
lang_env_dependencies = { module=newlib; no_c=true; };
lang_env_dependencies = { module=libgloss; no_c=true; };
lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; };
// libiberty does not depend on newlib or libgloss because it must be
// built newlib on some targets (e.g. Cygwin). It still needs
// a dependency on libgcc for native targets to configure.
lang_env_dependencies = { module=libiberty; no_c=true; };
dependencies = { module=configure-target-boehm-gc; on=configure-target-qthreads; };
dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
@ -451,7 +478,9 @@ dependencies = { module=all-target-libjava; on=all-target-zlib; };
dependencies = { module=all-target-libjava; on=all-target-boehm-gc; };
dependencies = { module=all-target-libjava; on=all-target-qthreads; };
dependencies = { module=all-target-libjava; on=all-target-libffi; };
dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; };
dependencies = { module=all-target-libobjc; on=all-target-libiberty; };
dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; };
dependencies = { module=all-target-libstdc++-v3; on=all-target-libiberty; };
// Target modules in the 'src' repository.
@ -468,33 +497,40 @@ dependencies = { module=all-target-winsup; on=all-target-libtermcap; };
// Toplevel bootstrap
bootstrap_stage = {
id=1 ;
stage_configure_flags='--disable-intermodule \
// * We force-disable intermodule optimizations, even if
// --enable-intermodule was passed, since the installed compiler
// probably can't handle them. Luckily, autoconf always respects
// the last argument when conflicting --enable arguments are passed.
// * Likewise, we force-disable coverage flags, since the installed
// compiler probably has never heard of them.
stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)"' ; };
stage_cflags='$(STAGE1_CFLAGS)' ; };
bootstrap_stage = {
id=2 ; prev=1 ;
bootstrap_target=bootstrap2 ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; };
stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=3 ; prev=2 ; lean=1 ;
compare_target=compare ;
bootstrap_target=bootstrap ;
cleanstrap_target=cleanstrap ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; };
stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=4 ; prev=3 ; lean=2 ;
compare_target=compare3 ;
bootstrap_target=bootstrap4 ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; };
stage_cflags="$(BOOT_CFLAGS)" ; };
bootstrap_stage = {
id=profile ; prev=1 ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"' ; };
stage_cflags='$(BOOT_CFLAGS) -fprofile-generate' ; };
bootstrap_stage = {
id=feedback ; prev=profile ;
bootstrap_target=profiledbootstrap ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-use"' ; };
stage_cflags='$(BOOT_CFLAGS) -fprofile-use' ; };

File diff suppressed because it is too large Load Diff

View File

@ -28,11 +28,17 @@ in
# -------------------------------
VPATH=@srcdir@
build_alias=@build_alias@
build_alias=@build_noncanonical@
build_vendor=@build_vendor@
build_os=@build_os@
build=@build@
host_alias=@host_alias@
host_alias=@host_noncanonical@
host_vendor=@host_vendor@
host_os=@host_os@
host=@host@
target_alias=@target_alias@
target_alias=@target_noncanonical@
target_vendor=@target_vendor@
target_os=@target_os@
target=@target@
program_transform_name = @program_transform_name@
@ -55,6 +61,7 @@ oldincludedir = @oldincludedir@
infodir = @infodir@
datarootdir = @datarootdir@
docdir = @docdir@
pdfdir = @pdfdir@
htmldir = @htmldir@
mandir = @mandir@
man1dir = $(mandir)/man1
@ -73,6 +80,9 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
LN = @LN@
LN_S = @LN_S@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
# -------------------------------------------------
# Miscellaneous non-standard autoconf-set variables
@ -180,7 +190,8 @@ POSTSTAGE1_HOST_EXPORTS = \
CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
$$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
-B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
# Target libraries are put under this directory:
TARGET_SUBDIR = @target_subdir@
@ -288,13 +299,26 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
WINDRES = @WINDRES@
GNATBIND = @GNATBIND@
GNATMAKE = @GNATMAKE@
CFLAGS = @CFLAGS@
LDFLAGS =
LDFLAGS = @LDFLAGS@
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
PICFLAG =
# Only build the C compiler for stage1, because that is the only one that
# we can guarantee will build with the native compiler, and also it is the
# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
# overrideable (for a bootstrap build stage1 also builds gcc.info).
STAGE1_CFLAGS=@stage1_cflags@
STAGE1_CHECKING=@stage1_checking@
STAGE1_LANGUAGES=@stage1_languages@
# -----------------------------------------------
# Programs producing files for the TARGET machine
# -----------------------------------------------
@ -426,6 +450,14 @@ X11_FLAGS_TO_PASS = \
'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
# Flags to pass to stage2 and later makes.
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
LDFLAGS="$(BOOT_LDFLAGS)" \
"`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
# Flags to pass down to makes which are built with the target environment.
# The double $ decreases the length of the command line; those variables
# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
@ -506,9 +538,10 @@ all-host: maybe-all-[+module+][+ IF bootstrap +]
.PHONY: all-target
[+ FOR target_modules +][+ IF bootstrap +]
@if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
all-target: maybe-all-target-[+module+][+ IF bootstrap +]
@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR target_modules +]
@endif target-[+module+]-no-bootstrap[+
ENDIF bootstrap +][+ ENDFOR target_modules +]
# Do a target for all the subdirectories. A ``make do-X'' will do a
# ``make X'' in all subdirectories (because, in general, there is a
@ -535,12 +568,14 @@ do-[+make_target+]:
# Here are the targets which correspond to the do-X targets.
.PHONY: info installcheck dvi html install-info install-html
.PHONY: info installcheck dvi pdf html
.PHONY: install-info install-pdf install-html
.PHONY: clean distclean mostlyclean maintainer-clean realclean
.PHONY: local-clean local-distclean local-maintainer-clean
info: do-info
installcheck: do-installcheck
dvi: do-dvi
pdf: do-pdf
html: do-html
# Make sure makeinfo is built before we do a `make info', if we're
@ -553,6 +588,8 @@ install-info: do-install-info dir.info
$(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
else true ; fi
install-pdf: do-install-pdf
install-html: do-install-html
local-clean:
@ -585,11 +622,6 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
maintainer-clean: local-distclean
realclean: maintainer-clean
# Extra dependency for clean-target, owing to the mixed nature of gcc.
clean-target: clean-target-libgcc
clean-target-libgcc:
test ! -d gcc || (cd gcc && $(MAKE) $@)
# Check target.
.PHONY: check do-check
@ -720,14 +752,12 @@ TAGS: do-TAGS
[+ DEFINE configure +]
.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
maybe-configure-[+prefix+][+module+]:
@if gcc-bootstrap
configure-[+prefix+][+module+]: stage_current
@endif gcc-bootstrap
@if [+prefix+][+module+]
maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
configure-[+prefix+][+module+]: [+ IF bootstrap +]
@endif [+prefix+][+module+]
@if [+prefix+][+module+]-bootstrap
@if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
@endif [+prefix+][+module+]-bootstrap
@if [+prefix+][+module+][+ ELSE bootstrap +]
configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
@: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@ -759,7 +789,8 @@ configure-[+prefix+][+module+]: [+ IF bootstrap +]
libsrcdir="$$s/[+module+]"; \
[+ IF no-config-site +]rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \
[+args+] $${srcdiroption} [+extra_configure_flags+] \
[+args+] --build=${build_alias} --host=[+host_alias+] \
--target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \
|| exit 1
@endif [+prefix+][+module+]
@ -790,6 +821,8 @@ configure-stage[+id+]-[+prefix+][+module+]:
[+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
[+exports+][+ IF prev +] \
[+poststage1_exports+][+ ENDIF prev +] \
CFLAGS="[+stage_cflags+]"; export CFLAGS; \
LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \
echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
cd [+subdir+]/[+module+] || exit 1; \
@ -801,7 +834,9 @@ configure-stage[+id+]-[+prefix+][+module+]:
srcdiroption="--srcdir=$${topdir}/[+module+]"; \
libsrcdir="$$s/[+module+]"; \
$(SHELL) $${libsrcdir}/configure \
[+args+] $${srcdiroption} \
[+args+] --build=${build_alias} --host=[+host_alias+] \
--target=[+target_alias+] $${srcdiroption} \
[+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
[+stage_configure_flags+] [+extra_configure_flags+]
@endif [+prefix+][+module+]-bootstrap
[+ ENDFOR bootstrap_stage +]
@ -811,16 +846,14 @@ configure-stage[+id+]-[+prefix+][+module+]:
[+ DEFINE all +]
.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
maybe-all-[+prefix+][+module+]:
@if gcc-bootstrap
all-[+prefix+][+module+]: stage_current
@endif gcc-bootstrap
@if [+prefix+][+module+]
TARGET-[+prefix+][+module+]=[+
IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +]
@endif [+prefix+][+module+]
@if [+prefix+][+module+]-bootstrap
@if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
@endif [+prefix+][+module+]-bootstrap
@if [+prefix+][+module+][+ ELSE bootstrap +]
all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
@: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@ -846,21 +879,25 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
[+exports+][+ IF prev +] \
[+poststage1_exports+][+ ENDIF prev +] \
cd [+subdir+]/[+module+] && \
$(MAKE) [+args+] [+ IF prev
+][+poststage1_args+][+ ENDIF prev
+] [+stage_make_flags+] [+extra_make_flags+] \
$(MAKE) [+args+] \
CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+
IF prev +][+poststage1_args+][+ ENDIF prev
+] [+extra_make_flags+] \
$(TARGET-stage[+id+]-[+prefix+][+module+])
maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
clean-stage[+id+]-[+prefix+][+module+]:
@[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \
|| exit 0 ; \
[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start; \
@if [ $(current_stage) = stage[+id+] ]; then \
[ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
else \
[ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
$(MAKE) stage[+id+]-start; \
fi; \
cd [+subdir+]/[+module+] && \
$(MAKE) [+args+] [+ IF prev +] \
[+poststage1_args+] [+ ENDIF prev +] \
[+stage_make_flags+] [+extra_make_flags+] clean
[+extra_make_flags+] clean
@endif [+prefix+][+module+]-bootstrap
[+ ENDFOR bootstrap_stage +]
@ -872,6 +909,8 @@ clean-stage[+id+]-[+prefix+][+module+]:
# --------------------------------------
[+ FOR build_modules +]
[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
host_alias=(get "host" "${build_alias}")
target_alias=(get "target" "${target_alias}")
args="$(BUILD_CONFIGARGS)" no-config-site=true +]
[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +]
@ -884,6 +923,8 @@ clean-stage[+id+]-[+prefix+][+module+]:
[+ configure prefix="" subdir="$(HOST_SUBDIR)"
exports="$(HOST_EXPORTS)"
poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
host_alias=(get "host" "${host_alias}")
target_alias=(get "target" "${target_alias}")
args="$(HOST_CONFIGARGS)" +]
[+ all prefix="" subdir="$(HOST_SUBDIR)"
@ -937,7 +978,7 @@ install-[+module+]: installdirs
[+ ENDIF no_install +]
@endif [+module+]
# Other targets (info, dvi, etc.)
# Other targets (info, dvi, pdf, etc.)
[+ FOR recursive_targets +]
.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
maybe-[+make_target+]-[+module+]:
@ -981,6 +1022,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
check_multilibs=true
exports="$(RAW_CXX_TARGET_EXPORTS)"
host_alias=(get "host" "${target_alias}")
target_alias=(get "target" "${target_alias}")
args="$(TARGET_CONFIGARGS)" no-config-site=true +]
[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
@ -990,6 +1033,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
check_multilibs=true
exports="$(NORMAL_TARGET_EXPORTS)"
host_alias=(get "host" "${target_alias}")
target_alias=(get "target" "${target_alias}")
args="$(TARGET_CONFIGARGS)" no-config-site=true +]
[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
@ -1045,7 +1090,7 @@ ENDIF raw_cxx +]
[+ ENDIF no_install +]
@endif target-[+module+]
# Other targets (info, dvi, etc.)
# Other targets (info, dvi, pdf, etc.)
[+ FOR recursive_targets +]
.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
maybe-[+make_target+]-target-[+module+]:
@ -1089,60 +1134,6 @@ ENDIF raw_cxx +]
# ----------
@if gcc-no-bootstrap
# GCC has some more recursive targets, which trigger the old
# (but still current, until the toplevel bootstrap project
# is finished) compiler bootstrapping rules.
GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
.PHONY: $(GCC_STRAP_TARGETS)
$(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
echo "Bootstrapping the compiler"; \
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
case "$@" in \
*bootstrap4-lean ) \
msg="Comparing stage3 and stage4 of the compiler"; \
compare=compare3-lean ;; \
*bootstrap4 ) \
msg="Comparing stage3 and stage4 of the compiler"; \
compare=compare3 ;; \
*-lean ) \
msg="Comparing stage2 and stage3 of the compiler"; \
compare=compare-lean ;; \
* ) \
msg="Comparing stage2 and stage3 of the compiler"; \
compare=compare ;; \
esac; \
$(HOST_EXPORTS) \
echo "$$msg"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
echo "Building runtime libraries"; \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
profiledbootstrap: all-prebootstrap configure-gcc
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
echo "Bootstrapping training compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
echo "Building feedback based compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
echo "Building runtime libraries"; \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
.PHONY: cross
cross: all-build all-gas all-ld
@r=`${PWD_COMMAND}`; export r; \
@ -1212,7 +1203,7 @@ stage = :
current_stage = ""
@if gcc-bootstrap
unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start
unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
current_stage = "`cat stage_current 2> /dev/null`"
@endif gcc-bootstrap
@ -1240,36 +1231,9 @@ LEAN = false
# 'touch' doesn't work right on some platforms.
STAMP = echo timestamp >
# Only build the C compiler for stage1, because that is the only one that
# we can guarantee will build with the native compiler, and also it is the
# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
# overrideable (for a bootstrap build stage1 also builds gcc.info).
STAGE1_CFLAGS=@stage1_cflags@
STAGE1_LANGUAGES=@stage1_languages@
# We only want to compare .o files, so set this!
objext = .o
# Flags to pass to stage2 and later makes.
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
STAGE_PREFIX=$$r/prev-gcc/ \
CFLAGS="$(BOOT_CFLAGS)" \
LIBCFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
ADAC="\$$(CC)"
# For stage 1:
# * We force-disable intermodule optimizations, even if
# --enable-intermodule was passed, since the installed compiler probably
# can't handle them. Luckily, autoconf always respects
# the last argument when conflicting --enable arguments are passed.
# * Likewise, we force-disable coverage flags, since the installed compiler
# probably has never heard of them.
# * We build only C (and possibly Ada).
[+ FOR bootstrap-stage +]
.PHONY: stage[+id+]-start stage[+id+]-end
@ -1303,7 +1267,7 @@ stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
fi
rm -f stage_current
# Bubble a bugfix through all the stages up to stage [+id+]. They are
# Bubble a bug fix through all the stages up to stage [+id+]. They are
# remade, but not reconfigured. The next stage (if any) will not be
# reconfigured as well.
.PHONY: stage[+id+]-bubble
@ -1397,12 +1361,21 @@ do-clean: clean-stage[+id+]
.PHONY: distclean-stage[+id+]
distclean-stage[+id+]::
@: $(MAKE); $(stage)
@test "`cat stage_last`" != stage[+id+] || rm -f stage_last
rm -rf stage[+id+]-* [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
[+ IF cleanstrap-target +]
.PHONY: [+cleanstrap-target+]
[+cleanstrap-target+]: distclean [+bootstrap-target+]
[+cleanstrap-target+]: do-distclean local-clean
echo stage[+id+] > stage_final
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
[+ ENDIF cleanstrap-target +]
@endif gcc-bootstrap
@ -1428,14 +1401,19 @@ do-distclean: distclean-stage1
# not work as a dependency, just as the minimum necessary to avoid errors.
stage_last:
$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
@endif gcc-bootstrap
# Same as unstage, but not phony and defaulting to stage1-start. We place
# it in the dependency so that for example `make -j3 all-gcc' works.
stage_current:
@if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
.PHONY: restrap
restrap:
@: $(MAKE); $(stage)
rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev
+]stage[+id+] [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
+]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
@endif gcc-bootstrap
# --------------------------------------
# Dependencies between different modules
@ -1450,18 +1428,12 @@ configure-target-[+module+]: stage_last[+
ENDIF bootstrap +][+ ENDFOR target_modules +]
@endif gcc-bootstrap
@if gcc-no-bootstrap[+ FOR target_modules +][+ IF bootstrap
+][+ ELSE +]
@if gcc-no-bootstrap[+ FOR target_modules +]
configure-target-[+module+]: maybe-all-gcc[+
ENDIF bootstrap +][+ ENDFOR target_modules +]
ENDFOR target_modules +]
@endif gcc-no-bootstrap
[+ FOR lang_env_dependencies +]
configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss
[+ IF cxx +]configure-target-[+module+]: maybe-all-target-libstdc++-v3
[+ ENDIF cxx +][+ ENDFOR lang_env_dependencies +]
# There are two types of dependencies here: 'hard' dependencies, where one
# module simply won't build without the other; and 'soft' dependencies, where
# if the depended-on module is missing, the depending module will do without
@ -1550,7 +1522,6 @@ configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss
+][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) "") +][+
ENDFOR bootstrap_stage +]
all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +]
[+ == "bootstrap"
+][+ FOR bootstrap_stage +]
[+ (make-dep (dep-stage) (dep-stage)) +][+
@ -1558,17 +1529,48 @@ all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +]
[+ ESAC +][+
ENDFOR dependencies +]
# Non-toplevel bootstrap rules must depend on several packages, to be built
# before gcc. Another wart that will go away, hopefully soon.
@if gcc-no-bootstrap
[+ FOR host_modules +][+
IF (and (not (= (get "module") "gcc"))
(hash-ref boot-modules (get "module"))) +]
all-prebootstrap: maybe-all-[+module+][+
ENDIF +][+
ENDFOR host_modules +]
# Dependencies for target modules on other target modules are
# described by lang_env_dependencies; the defaults apply to anything
# not mentioned there.
[+
;; Predicate for whether LANG was specified in lang_env_dependencies.
(define lang-dep (lambda (lang)
(hash-ref lang-env-deps (string-append (get "module") "-" lang))))
;; Build the hash table we will need.
(define lang-env-deps (make-hash-table 7))
+][+ FOR lang_env_dependencies +][+
(if (exist? "cxx")
(hash-create-handle! lang-env-deps
(string-append (get "module") "-" "cxx") #t))
(if (exist? "no_c")
(hash-create-handle! lang-env-deps
(string-append (get "module") "-" "no_c") #t))
(if (exist? "no_gcc")
(hash-create-handle! lang-env-deps
(string-append (get "module") "-" "no_gcc") #t))
"" +][+ ENDFOR lang_env_dependencies +]
@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
+][+ IF bootstrap +][+ FOR bootstrap_stage +]
configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
@endif gcc-bootstrap
@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
configure-target-[+module+]: maybe-all-target-libgcc[+
ENDIF +][+ ENDFOR target_modules +]
@endif gcc-no-bootstrap
[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
ENDIF +][+ IF (lang-dep "cxx") +]
configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
ENDIF +]
[+ ENDFOR target_modules +]
CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
GDB_TK = @GDB_TK@
INSTALL_GDB_TK = @INSTALL_GDB_TK@
@ -1599,7 +1601,7 @@ config.status: configure
# Rebuilding configure.
AUTOCONF = autoconf
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4
cd $(srcdir) && $(AUTOCONF)
# ------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -858,7 +858,7 @@
Bernardo Innocenti <bernie@develer.com>
* archures.c: Add MCF528x (MCFv4) support.
* bfd/cpu-m68k.c (arch_info_struct): Likewise.
* cpu-m68k.c (arch_info_struct): Likewise.
* bfd-in2.h: Regenerate.
2003-10-20 Andrew Cagney <cagney@redhat.com>
@ -1953,10 +1953,10 @@
2003-07-12 Jeff Baker <jbaker@qnx.com>
* bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
* bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
* bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
* bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
* config.bfd (__QNXTARGET__): Define for Neutrino architectures.
* elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
* elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
* elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
2003-07-12 Jeff Muizelaar <muizelaar@rogers.com>
@ -2196,13 +2196,13 @@
2003-07-09 Richard Sandiford <rsandifo@redhat.com>
* bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
* elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
forced-local symbols like other locals. Don't create relocations
against STN_UNDEF in irix objects.
2003-07-09 Richard Sandiford <rsandifo@redhat.com>
* bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
* elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
compatible objects, add the values of defined external symbols
to the addend.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
## Process this file with automake to generate Makefile.in
AUTOMAKE_OPTIONS = 1.9 cygnus
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
# Uncomment the following line when doing a release.
# RELEASE=y
@ -63,6 +64,7 @@ ALL_MACHINES = \
cpu-arm.lo \
cpu-avr.lo \
cpu-bfin.lo \
cpu-cr16.lo \
cpu-cr16c.lo \
cpu-cris.lo \
cpu-crx.lo \
@ -91,6 +93,7 @@ ALL_MACHINES = \
cpu-m10300.lo \
cpu-maxq.lo \
cpu-mcore.lo \
cpu-mep.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-mt.lo \
@ -103,8 +106,10 @@ ALL_MACHINES = \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-s390.lo \
cpu-score.lo \
cpu-sh.lo \
cpu-sparc.lo \
cpu-spu.lo \
cpu-tic30.lo \
cpu-tic4x.lo \
cpu-tic54x.lo \
@ -125,6 +130,7 @@ ALL_MACHINES_CFILES = \
cpu-arm.c \
cpu-avr.c \
cpu-bfin.c \
cpu-cr16.c \
cpu-cris.c \
cpu-cr16c.c \
cpu-crx.c \
@ -153,6 +159,7 @@ ALL_MACHINES_CFILES = \
cpu-m10300.c \
cpu-maxq.c \
cpu-mcore.c \
cpu-mep.c \
cpu-mips.c \
cpu-mmix.c \
cpu-mt.c \
@ -165,8 +172,10 @@ ALL_MACHINES_CFILES = \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-s390.c \
cpu-score.c \
cpu-sh.c \
cpu-sparc.c \
cpu-spu.c \
cpu-tic30.c \
cpu-tic4x.c \
cpu-tic54x.c \
@ -235,6 +244,7 @@ BFD32_BACKENDS = \
elf32-arm.lo \
elf32-avr.lo \
elf32-bfin.lo \
elf32-cr16.lo \
elf32-cr16c.lo \
elf32-cris.lo \
elf32-crx.lo \
@ -262,6 +272,7 @@ BFD32_BACKENDS = \
elf-m10200.lo \
elf-m10300.lo \
elf32-mcore.lo \
elf32-mep.lo \
elfxx-mips.lo \
elf32-mips.lo \
elf32-mt.lo \
@ -271,12 +282,14 @@ BFD32_BACKENDS = \
elf32-pj.lo \
elf32-ppc.lo \
elf32-s390.lo \
elf32-score.lo \
elf32-sh.lo \
elf32-sh-symbian.lo \
elf32-sh64.lo \
elf32-sh64-com.lo \
elfxx-sparc.lo \
elf32-sparc.lo \
elf32-spu.lo \
elf32-v850.lo \
elf32-vax.lo \
elf32-xstormy16.lo \
@ -284,6 +297,7 @@ BFD32_BACKENDS = \
elf32-xc16x.lo \
elf32.lo \
elflink.lo \
elf-attrs.lo \
elf-strtab.lo \
elf-eh-frame.lo \
elf-vxworks.lo \
@ -323,6 +337,8 @@ BFD32_BACKENDS = \
pef.lo \
pe-arm.lo \
pei-arm.lo \
pe-arm-wince.lo \
pei-arm-wince.lo \
pe-i386.lo \
pei-i386.lo \
pe-mcore.lo \
@ -407,6 +423,7 @@ BFD32_BACKENDS_CFILES = \
elf32-arm.c \
elf32-avr.c \
elf32-bfin.c \
elf32-cr16.c \
elf32-cr16c.c \
elf32-cris.c \
elf32-crx.c \
@ -434,6 +451,7 @@ BFD32_BACKENDS_CFILES = \
elf-m10200.c \
elf-m10300.c \
elf32-mcore.c \
elf32-mep.c \
elfxx-mips.c \
elf32-mips.c \
elf32-mt.c \
@ -445,10 +463,12 @@ BFD32_BACKENDS_CFILES = \
elf32-sh64.c \
elf32-sh64-com.c \
elf32-s390.c \
elf32-score.c \
elf32-sh.c \
elf32-sh-symbian.c \
elfxx-sparc.c \
elf32-sparc.c \
elf32-spu.c \
elf32-v850.c \
elf32-vax.c \
elf32-xstormy16.c \
@ -456,6 +476,7 @@ BFD32_BACKENDS_CFILES = \
elf32-xc16x.c \
elf32.c \
elflink.c \
elf-attrs.c \
elf-strtab.c \
elf-eh-frame.c \
elf-vxworks.c \
@ -495,6 +516,8 @@ BFD32_BACKENDS_CFILES = \
pef.c \
pe-arm.c \
pei-arm.c \
pe-arm-wince.c \
pei-arm-wince.c \
pe-i386.c \
pei-i386.c \
pe-mcore.c \
@ -538,6 +561,7 @@ BFD64_BACKENDS = \
coff64-rs6000.lo \
demo64.lo \
efi-app-ia64.lo \
efi-app-x86_64.lo \
elf64-x86-64.lo \
elf64-alpha.lo \
elf64-hppa.lo \
@ -555,7 +579,11 @@ BFD64_BACKENDS = \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pepigen.lo
coff-x86_64.lo \
pe-x86_64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo
BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
@ -564,6 +592,7 @@ BFD64_BACKENDS_CFILES = \
coff64-rs6000.c \
demo64.c \
efi-app-ia64.c \
efi-app-x86_64.c \
elf64-x86-64.c \
elf64-alpha.c \
elf64-hppa.c \
@ -578,7 +607,10 @@ BFD64_BACKENDS_CFILES = \
elf64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c
nlm64.c \
coff-x86_64.c \
pe-x86_64.c \
pei-x86_64.c
OPTIONAL_BACKENDS = \
aix386-core.lo \
@ -612,11 +644,10 @@ CONFIG_STATUS_DEPENDENCIES = \
WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
BFD_LIBS = @bfd_libs@
BFD_MACHINES = @bfd_machines@
TDEFAULTS = @tdefaults@
INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@
# C source files that correspond to .o's.
SOURCE_CFILES = \
@ -628,7 +659,7 @@ SOURCE_CFILES = \
$(OPTIONAL_BACKENDS_CFILES)
BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
@ -698,7 +729,8 @@ install-html-recursive:
# BFD_BACKENDS Routines the configured targets need.
# BFD_MACHINES Architecture-specific routines the configured targets need.
# COREFILE Core file routines for a native configuration
OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
# bfd64_libs Routines for 64bit support
OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
stamp-ofiles: Makefile
rm -f tofiles
@ -715,10 +747,12 @@ stamp-ofiles: Makefile
ofiles: stamp-ofiles ; @true
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
# Since BFD64_LIBS is optional and we can't have substitution in
# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
# directory so that we don't have to convert all the programs that use
@ -756,6 +790,9 @@ targets.lo: targets.c Makefile
archures.lo: archures.c Makefile
$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
dwarf2.lo: dwarf2.c Makefile
$(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
elf32-target.h : elfxx-target.h
rm -f elf32-target.h
sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
@ -786,6 +823,11 @@ pepigen.c : peXXigen.c
sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
mv -f pepigen.new pepigen.c
pex64igen.c: peXXigen.c
rm -f pex64igen.c
sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
mv -f pex64igen.new pex64igen.c
BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
LOCAL_H_DEPS= libbfd.h sysdep.h config.h
$(BFD32_LIBS) \
@ -929,17 +971,26 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
bfd_version_string="\"$(VERSION)\"" ;\
bfd_soversion="$(VERSION)" ;\
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
if test "x$(RELEASE)" = x ; then \
bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\
bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
fi ;\
sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@
sed -e "s,@bfd_version@,$$bfd_version," \
-e "s,@bfd_version_string@,$$bfd_version_string," \
-e "s,@bfd_version_package@,$$bfd_version_package," \
-e "s,@report_bugs_to@,$$report_bugs_to," \
< $(srcdir)/version.h > $@; \
echo "$${bfd_soversion}" > libtool-soversion
# What appears below is generated by a hacked mkdep using gcc -MM.
@ -950,11 +1001,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/safe-ctype.h
bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \
libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \
$(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h
bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1008,6 +1060,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h
cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1040,6 +1093,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1055,9 +1109,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(srcdir)/../opcodes/sh-opc.h
cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1127,7 +1183,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1197,7 +1254,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \
$(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \
coffcode.h coffswap.h
coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \
@ -1260,11 +1317,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h
elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \
elf32-target.h
elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \
$(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
@ -1378,19 +1440,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
elf32-target.h
elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
ecoffswap.h elf32-target.h elf-vxworks.h
ecoffswap.h elf32-target.h
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@ -1422,9 +1489,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@ -1434,27 +1501,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
$(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf-vxworks.h
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf32-target.h elf-vxworks.h
elfxx-sparc.h elf-vxworks.h elf32-target.h
elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \
$(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
@ -1486,6 +1562,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/libiberty.h $(INCDIR)/objalloc.h
elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h
@ -1570,7 +1649,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \
mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c
mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
@ -1610,8 +1689,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
$(INCDIR)/safe-ctype.h
pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \
$(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
@ -1620,6 +1699,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \
coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \
coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
@ -1662,7 +1751,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \
ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/hashtab.h
reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \
@ -1703,7 +1792,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h vms.h
vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h vms.h
vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \
vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \
$(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \
vms.h
vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
@ -1713,12 +1802,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
libcoff.h libxcoff.h
xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h
xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h
xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \
$(INCDIR)/xtensa-isa-internal.h
aix5ppc-core.lo: aix5ppc-core.c
aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@ -1740,6 +1829,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \
coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
coffcode.h peicode.h libpei.h
elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \
@ -1808,6 +1902,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h
coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
coffswap.h
pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
peicode.h libpei.h
pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
peicode.h libpei.h
aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h
@ -1824,16 +1933,19 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf32-target.h
$(INCDIR)/hashtab.h elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf64-target.h
$(INCDIR)/hashtab.h elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -15,8 +15,6 @@
@SET_MAKE@
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@ -49,10 +47,17 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \
$(srcdir)/../config.sub
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \
$(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gettext-sister.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \
$(top_srcdir)/../config/progtest.m4 \
$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \
$(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@ -80,19 +85,18 @@ am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \
linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \
stab-syms.lo merge.lo dwarf2.lo simple.lo
am__objects_2 = archive64.lo
am_libbfd_la_OBJECTS = $(am__objects_1) $(am__objects_2)
am_libbfd_la_OBJECTS = $(am__objects_1)
libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp =
am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@ -105,7 +109,6 @@ ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
@ -131,20 +134,24 @@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEBUGDIR = @DEBUGDIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GMOFILES = @GMOFILES@
FGREP = @FGREP@
GENCAT = @GENCAT@
GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
GREP = @GREP@
HDEFINES = @HDEFINES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INCINTL = @INCINTL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@
INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@
@ -152,10 +159,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBINTL = @LIBINTL@
LIBINTL_DEP = @LIBINTL_DEP@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@ -167,6 +174,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NM = @NM@
NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@ -176,14 +185,16 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POFILES = @POFILES@
PKGVERSION = @PKGVERSION@
POSUB = @POSUB@
RANLIB = @RANLIB@
REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
REPORT_BUGS_TO = @REPORT_BUGS_TO@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TDEFINES = @TDEFINES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
@ -192,6 +203,7 @@ WIN32LIBADD = @WIN32LIBADD@
XGETTEXT = @XGETTEXT@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
all_backends = @all_backends@
@ -202,10 +214,10 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bfd64_libs = @bfd64_libs@
bfd_backends = @bfd_backends@
bfd_default_target_size = @bfd_default_target_size@
bfd_file_ptr = @bfd_file_ptr@
bfd_libs = @bfd_libs@
bfd_machines = @bfd_machines@
bfd_ufile_ptr = @bfd_ufile_ptr@
bfdincludedir = @bfdincludedir@
@ -230,10 +242,10 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
l = @l@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@ -251,6 +263,7 @@ target_vendor = @target_vendor@
tdefaults = @tdefaults@
wordsize = @wordsize@
AUTOMAKE_OPTIONS = 1.9 cygnus
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
# Uncomment the following line when doing a release.
# RELEASE=y
@ -299,6 +312,7 @@ ALL_MACHINES = \
cpu-arm.lo \
cpu-avr.lo \
cpu-bfin.lo \
cpu-cr16.lo \
cpu-cr16c.lo \
cpu-cris.lo \
cpu-crx.lo \
@ -327,6 +341,7 @@ ALL_MACHINES = \
cpu-m10300.lo \
cpu-maxq.lo \
cpu-mcore.lo \
cpu-mep.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-mt.lo \
@ -339,8 +354,10 @@ ALL_MACHINES = \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-s390.lo \
cpu-score.lo \
cpu-sh.lo \
cpu-sparc.lo \
cpu-spu.lo \
cpu-tic30.lo \
cpu-tic4x.lo \
cpu-tic54x.lo \
@ -361,6 +378,7 @@ ALL_MACHINES_CFILES = \
cpu-arm.c \
cpu-avr.c \
cpu-bfin.c \
cpu-cr16.c \
cpu-cris.c \
cpu-cr16c.c \
cpu-crx.c \
@ -389,6 +407,7 @@ ALL_MACHINES_CFILES = \
cpu-m10300.c \
cpu-maxq.c \
cpu-mcore.c \
cpu-mep.c \
cpu-mips.c \
cpu-mmix.c \
cpu-mt.c \
@ -401,8 +420,10 @@ ALL_MACHINES_CFILES = \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-s390.c \
cpu-score.c \
cpu-sh.c \
cpu-sparc.c \
cpu-spu.c \
cpu-tic30.c \
cpu-tic4x.c \
cpu-tic54x.c \
@ -472,6 +493,7 @@ BFD32_BACKENDS = \
elf32-arm.lo \
elf32-avr.lo \
elf32-bfin.lo \
elf32-cr16.lo \
elf32-cr16c.lo \
elf32-cris.lo \
elf32-crx.lo \
@ -499,6 +521,7 @@ BFD32_BACKENDS = \
elf-m10200.lo \
elf-m10300.lo \
elf32-mcore.lo \
elf32-mep.lo \
elfxx-mips.lo \
elf32-mips.lo \
elf32-mt.lo \
@ -508,12 +531,14 @@ BFD32_BACKENDS = \
elf32-pj.lo \
elf32-ppc.lo \
elf32-s390.lo \
elf32-score.lo \
elf32-sh.lo \
elf32-sh-symbian.lo \
elf32-sh64.lo \
elf32-sh64-com.lo \
elfxx-sparc.lo \
elf32-sparc.lo \
elf32-spu.lo \
elf32-v850.lo \
elf32-vax.lo \
elf32-xstormy16.lo \
@ -521,6 +546,7 @@ BFD32_BACKENDS = \
elf32-xc16x.lo \
elf32.lo \
elflink.lo \
elf-attrs.lo \
elf-strtab.lo \
elf-eh-frame.lo \
elf-vxworks.lo \
@ -560,6 +586,8 @@ BFD32_BACKENDS = \
pef.lo \
pe-arm.lo \
pei-arm.lo \
pe-arm-wince.lo \
pei-arm-wince.lo \
pe-i386.lo \
pei-i386.lo \
pe-mcore.lo \
@ -644,6 +672,7 @@ BFD32_BACKENDS_CFILES = \
elf32-arm.c \
elf32-avr.c \
elf32-bfin.c \
elf32-cr16.c \
elf32-cr16c.c \
elf32-cris.c \
elf32-crx.c \
@ -671,6 +700,7 @@ BFD32_BACKENDS_CFILES = \
elf-m10200.c \
elf-m10300.c \
elf32-mcore.c \
elf32-mep.c \
elfxx-mips.c \
elf32-mips.c \
elf32-mt.c \
@ -682,10 +712,12 @@ BFD32_BACKENDS_CFILES = \
elf32-sh64.c \
elf32-sh64-com.c \
elf32-s390.c \
elf32-score.c \
elf32-sh.c \
elf32-sh-symbian.c \
elfxx-sparc.c \
elf32-sparc.c \
elf32-spu.c \
elf32-v850.c \
elf32-vax.c \
elf32-xstormy16.c \
@ -693,6 +725,7 @@ BFD32_BACKENDS_CFILES = \
elf32-xc16x.c \
elf32.c \
elflink.c \
elf-attrs.c \
elf-strtab.c \
elf-eh-frame.c \
elf-vxworks.c \
@ -732,6 +765,8 @@ BFD32_BACKENDS_CFILES = \
pef.c \
pe-arm.c \
pei-arm.c \
pe-arm-wince.c \
pei-arm-wince.c \
pe-i386.c \
pei-i386.c \
pe-mcore.c \
@ -776,6 +811,7 @@ BFD64_BACKENDS = \
coff64-rs6000.lo \
demo64.lo \
efi-app-ia64.lo \
efi-app-x86_64.lo \
elf64-x86-64.lo \
elf64-alpha.lo \
elf64-hppa.lo \
@ -793,7 +829,11 @@ BFD64_BACKENDS = \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pepigen.lo
coff-x86_64.lo \
pe-x86_64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo
BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
@ -802,6 +842,7 @@ BFD64_BACKENDS_CFILES = \
coff64-rs6000.c \
demo64.c \
efi-app-ia64.c \
efi-app-x86_64.c \
elf64-x86-64.c \
elf64-alpha.c \
elf64-hppa.c \
@ -816,7 +857,10 @@ BFD64_BACKENDS_CFILES = \
elf64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c
nlm64.c \
coff-x86_64.c \
pe-x86_64.c \
pei-x86_64.c
OPTIONAL_BACKENDS = \
aix386-core.lo \
@ -852,10 +896,9 @@ CONFIG_STATUS_DEPENDENCIES = \
WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
BFD_LIBS = @bfd_libs@
BFD_MACHINES = @bfd_machines@
TDEFAULTS = @tdefaults@
INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@
# C source files that correspond to .o's.
SOURCE_CFILES = \
@ -867,7 +910,7 @@ SOURCE_CFILES = \
$(OPTIONAL_BACKENDS_CFILES)
BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
SOURCE_HFILES = \
@ -892,11 +935,15 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
# BFD_BACKENDS Routines the configured targets need.
# BFD_MACHINES Architecture-specific routines the configured targets need.
# COREFILE Core file routines for a native configuration
OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
# bfd64_libs Routines for 64bit support
OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
# Since BFD64_LIBS is optional and we can't have substitution in
# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
# directory so that we don't have to convert all the programs that use
@ -919,7 +966,7 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -931,15 +978,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
cd $(srcdir) && $(AUTOMAKE) --cygnus \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
$(AUTOMAKE) --cygnus Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -1340,6 +1387,9 @@ targets.lo: targets.c Makefile
archures.lo: archures.c Makefile
$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
dwarf2.lo: dwarf2.c Makefile
$(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c
elf32-target.h : elfxx-target.h
rm -f elf32-target.h
sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
@ -1369,6 +1419,11 @@ pepigen.c : peXXigen.c
rm -f pepigen.c
sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
mv -f pepigen.new pepigen.c
pex64igen.c: peXXigen.c
rm -f pex64igen.c
sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
mv -f pex64igen.new pex64igen.c
$(BFD32_LIBS) \
$(BFD64_LIBS) \
$(ALL_MACHINES) \
@ -1501,11 +1556,20 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
bfd_version_string="\"$(VERSION)\"" ;\
bfd_soversion="$(VERSION)" ;\
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
if test "x$(RELEASE)" = x ; then \
bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\
bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
fi ;\
sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@
sed -e "s,@bfd_version@,$$bfd_version," \
-e "s,@bfd_version_string@,$$bfd_version_string," \
-e "s,@bfd_version_package@,$$bfd_version_package," \
-e "s,@report_bugs_to@,$$report_bugs_to," \
< $(srcdir)/version.h > $@; \
echo "$${bfd_soversion}" > libtool-soversion
# What appears below is generated by a hacked mkdep using gcc -MM.
@ -1516,11 +1580,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/safe-ctype.h
bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \
libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \
$(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h
bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
@ -1574,6 +1639,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h
cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1606,6 +1672,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1621,9 +1688,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(srcdir)/../opcodes/sh-opc.h
cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
@ -1693,7 +1762,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \
coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \
@ -1763,7 +1833,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \
$(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \
coffcode.h coffswap.h
coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \
@ -1826,11 +1896,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h
elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \
elf32-target.h
elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \
$(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
@ -1944,19 +2019,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
elf32-target.h
elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
ecoffswap.h elf32-target.h elf-vxworks.h
ecoffswap.h elf32-target.h
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@ -1988,9 +2068,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@ -2000,27 +2080,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-target.h
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
elf32-target.h
$(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
$(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h
elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf-vxworks.h
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
elfxx-sparc.h elf32-target.h elf-vxworks.h
elfxx-sparc.h elf-vxworks.h elf32-target.h
elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \
$(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
@ -2052,6 +2141,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/libiberty.h $(INCDIR)/objalloc.h
elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h
@ -2136,7 +2228,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \
mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \
$(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c
mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
@ -2176,8 +2268,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
$(INCDIR)/safe-ctype.h
pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \
$(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
@ -2186,6 +2278,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \
coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \
coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
@ -2228,7 +2330,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \
ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/hashtab.h
reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \
@ -2269,7 +2371,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h vms.h
vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h vms.h
vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \
vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \
$(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \
vms.h
vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
@ -2279,12 +2381,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
libcoff.h libxcoff.h
xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h
xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h
xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \
$(INCDIR)/xtensa-isa-internal.h
aix5ppc-core.lo: aix5ppc-core.c
aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@ -2306,6 +2408,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
peicode.h libpei.h
efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \
coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
coffcode.h peicode.h libpei.h
elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \
@ -2374,6 +2481,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h
coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
coffswap.h
pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
peicode.h libpei.h
pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \
$(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \
peicode.h libpei.h
aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h
@ -2390,18 +2512,21 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf32-target.h
$(INCDIR)/hashtab.h elf32-target.h
elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \
$(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \
elf64-target.h
$(INCDIR)/hashtab.h elf64-target.h
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,7 +1,3 @@
sinclude(../config/acx.m4)
sinclude(../bfd/bfd.m4)
sinclude(../bfd/warning.m4)
dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
AC_DEFUN([BFD_BINARY_FOPEN],
[AC_REQUIRE([AC_CANONICAL_TARGET])
@ -45,22 +41,6 @@ else
fi
AC_SUBST(EXEEXT_FOR_BUILD)])dnl
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring libtool.m4
dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
dnl to add a definition of LIBTOOL to Makefile.in.
ifelse(yes,no,[
AC_DEFUN([AM_PROG_LIBTOOL],)
AC_DEFUN([AM_DISABLE_SHARED],)
AC_SUBST(LIBTOOL)
])
sinclude(../gettext.m4)
ifelse(yes,no,[
AC_DEFUN([CY_WITH_NLS],)
AC_SUBST(INTLLIBS)
])
AC_DEFUN([AM_INSTALL_LIBBFD],
[AC_MSG_CHECKING([whether to install libbfd])
AC_ARG_ENABLE(install-libbfd,

View File

@ -1,4 +1,4 @@
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
@ -28,7 +28,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.5])])
[AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@ -480,27 +480,6 @@ AC_DEFUN([AM_PROG_INSTALL_SH],
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
@ -889,4 +868,18 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([../config/acx.m4])
m4_include([../config/depstand.m4])
m4_include([../config/gettext-sister.m4])
m4_include([../config/lead-dot.m4])
m4_include([../config/nls.m4])
m4_include([../config/po.m4])
m4_include([../config/progtest.m4])
m4_include([../config/stdint.m4])
m4_include([../libtool.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
m4_include([../ltversion.m4])
m4_include([bfd.m4])
m4_include([warning.m4])
m4_include([acinclude.m4])

View File

@ -1,6 +1,6 @@
/* BFD back-end for raw ARM a.out binaries.
Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005,
2007 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
This file is part of BFD, the Binary File Descriptor library.
@ -19,8 +19,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
/* Avoid multiple definitions from aoutx if supporting standard a.out
as well as our own. */
@ -50,6 +50,7 @@
#define N_MAGIC(x) ((x).a_info & ~07200)
#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup
#include "libaout.h"
#include "aout/aout64.h"
@ -317,6 +318,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd,
}
}
static reloc_howto_type *
MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]);
i++)
if (MY (howto_table)[i].name != NULL
&& strcasecmp (MY (howto_table)[i].name, r_name) == 0)
return &MY (howto_table)[i];
return NULL;
}
#define MY_swap_std_reloc_in MY (swap_std_reloc_in)
#define MY_swap_std_reloc_out MY (swap_std_reloc_out)
#define MY_get_section_contents _bfd_generic_get_section_contents

View File

@ -1,6 +1,6 @@
/* Define a target vector and some small routines for a variant of a.out.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -29,6 +29,7 @@
#endif
extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
extern reloc_howto_type * NAME (aout, reloc_name_lookup) (bfd *, const char *);
/* Set parameters about this a.out file that are machine-dependent.
This routine is called from some_aout_object_p just before it returns. */
@ -494,6 +495,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#ifndef MY_bfd_reloc_type_lookup
#define MY_bfd_reloc_type_lookup NAME (aout, reloc_type_lookup)
#endif
#ifndef MY_bfd_reloc_name_lookup
#define MY_bfd_reloc_name_lookup NAME (aout, reloc_name_lookup)
#endif
#ifndef MY_bfd_make_debug_symbol
#define MY_bfd_make_debug_symbol 0
#endif

View File

@ -1,6 +1,6 @@
/* A.out "format 1" file handling code for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
2001, 2002, 2003, 2004, 2005, 2006
2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "aout/sun4.h"
@ -566,6 +566,7 @@ sunos4_core_file_p (bfd *abfd)
struct internal_sunos_core internal_sunos_core;
char external_core[1];
} *mergem;
flagword flags;
if (bfd_bread ((void *) longbuf, (bfd_size_type) sizeof (longbuf), abfd)
!= sizeof (longbuf))
@ -627,28 +628,31 @@ sunos4_core_file_p (bfd *abfd)
abfd->tdata.sun_core_data->hdr = core;
/* Create the sections. */
core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack");
flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack",
flags);
if (core_stacksec (abfd) == NULL)
/* bfd_release frees everything allocated after it's arg. */
goto loser;
core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data");
flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data",
flags);
if (core_datasec (abfd) == NULL)
goto loser;
core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg");
flags = SEC_HAS_CONTENTS;
core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg",
flags);
if (core_regsec (abfd) == NULL)
goto loser;
core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2");
flags = SEC_HAS_CONTENTS;
core_reg2sec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg2",
flags);
if (core_reg2sec (abfd) == NULL)
goto loser;
core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS;
core_stacksec (abfd)->size = core->c_ssize;
core_datasec (abfd)->size = core->c_dsize;
core_regsec (abfd)->size = core->c_regs_size;

View File

@ -1,6 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -118,8 +118,8 @@ DESCRIPTION
#define KEEPIT udata.i
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "safe-ctype.h"
#include "bfdlink.h"
@ -129,8 +129,6 @@ DESCRIPTION
#include "aout/stab_gnu.h"
#include "aout/ar.h"
reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
/*
SUBSECTION
Relocations
@ -319,6 +317,31 @@ NAME (aout, reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code)
}
}
reloc_howto_type *
NAME (aout, reloc_name_lookup) (bfd *abfd, const char *r_name)
{
unsigned int i, size;
reloc_howto_type *howto_table;
if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE)
{
howto_table = howto_table_ext;
size = sizeof (howto_table_ext) / sizeof (howto_table_ext[0]);
}
else
{
howto_table = howto_table_std;
size = sizeof (howto_table_std) / sizeof (howto_table_std[0]);
}
for (i = 0; i < size; i++)
if (howto_table[i].name != NULL
&& strcasecmp (howto_table[i].name, r_name) == 0)
return &howto_table[i];
return NULL;
}
/*
SUBSECTION
Internal entry points
@ -1193,26 +1216,21 @@ NAME (aout, new_section_hook) (bfd *abfd, asection *newsect)
{
obj_textsec (abfd)= newsect;
newsect->target_index = N_TEXT;
return TRUE;
}
if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
else if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
{
obj_datasec (abfd) = newsect;
newsect->target_index = N_DATA;
return TRUE;
}
if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
else if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
{
obj_bsssec (abfd) = newsect;
newsect->target_index = N_BSS;
return TRUE;
}
}
/* We allow more than three sections internally. */
return TRUE;
return _bfd_generic_new_section_hook (abfd, newsect);
}
bfd_boolean
@ -1934,7 +1952,10 @@ NAME (aout, swap_std_reloc_out) (bfd *abfd,
if (bfd_is_com_section (output_section)
|| bfd_is_abs_section (output_section)
|| bfd_is_und_section (output_section))
|| bfd_is_und_section (output_section)
/* PR gas/3041 a.out relocs against weak symbols
must be treated as if they were against externs. */
|| (sym->flags & BSF_WEAK))
{
if (bfd_abs_section_ptr->symbol == sym)
{
@ -2785,7 +2806,8 @@ NAME (aout, find_nearest_line) (bfd *abfd,
}
int
NAME (aout, sizeof_headers) (bfd *abfd, bfd_boolean execable ATTRIBUTE_UNUSED)
NAME (aout, sizeof_headers) (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return adata (abfd).exec_bytes_size;
}

View File

@ -1,6 +1,6 @@
/* BFD back-end for archive files (libraries).
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
@ -129,8 +129,8 @@ SUBSECTION
" 18 " - Long name 18 characters long, extended pseudo-BSD.
*/
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libiberty.h"
#include "libbfd.h"
#include "aout/ar.h"
@ -666,10 +666,7 @@ bfd_generic_archive_p (bfd *abfd)
first = bfd_openr_next_archived_file (abfd, NULL);
if (first != NULL)
{
bfd_boolean fail;
first->target_defaulted = FALSE;
fail = FALSE;
if (bfd_check_format (first, bfd_object)
&& first->xvec != abfd->xvec)
{
@ -915,12 +912,12 @@ bfd_slurp_armap (bfd *abfd)
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return FALSE;
if (!strncmp (nextname, "__.SYMDEF ", 16)
|| !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */
if (CONST_STRNEQ (nextname, "__.SYMDEF ")
|| CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */
return do_slurp_bsd_armap (abfd);
else if (!strncmp (nextname, "/ ", 16))
else if (CONST_STRNEQ (nextname, "/ "))
return do_slurp_coff_armap (abfd);
else if (!strncmp (nextname, "/SYM64/ ", 16))
else if (CONST_STRNEQ (nextname, "/SYM64/ "))
{
/* 64bit ELF (Irix 6) archive. */
#ifdef BFD64
@ -966,11 +963,11 @@ bfd_slurp_bsd_armap_f2 (bfd *abfd)
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return FALSE;
if (!strncmp (nextname, "__.SYMDEF ", 16)
|| !strncmp (nextname, "__.SYMDEF/ ", 16)) /* Old Linux archives. */
if (CONST_STRNEQ (nextname, "__.SYMDEF ")
|| CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */
return do_slurp_bsd_armap (abfd);
if (strncmp (nextname, "/ ", 16))
if (! CONST_STRNEQ (nextname, "/ "))
{
bfd_has_map (abfd) = FALSE;
return TRUE;
@ -1066,8 +1063,8 @@ _bfd_slurp_extended_name_table (bfd *abfd)
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return FALSE;
if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 &&
strncmp (nextname, "// ", 16) != 0)
if (! CONST_STRNEQ (nextname, "ARFILENAMES/ ")
&& ! CONST_STRNEQ (nextname, "// "))
{
bfd_ardata (abfd)->extended_names = NULL;
bfd_ardata (abfd)->extended_names_size = 0;
@ -1237,7 +1234,9 @@ _bfd_construct_extended_name_table (bfd *abfd,
*tablen = 0;
/* Figure out how long the table should be. */
for (current = abfd->archive_head; current != NULL; current = current->next)
for (current = abfd->archive_head;
current != NULL;
current = current->archive_next)
{
const char *normal;
unsigned int thislen;
@ -1289,8 +1288,9 @@ _bfd_construct_extended_name_table (bfd *abfd,
*tablen = total_namelen;
strptr = *tabloc;
for (current = abfd->archive_head; current != NULL; current =
current->next)
for (current = abfd->archive_head;
current != NULL;
current = current->archive_next)
{
const char *normal;
unsigned int thislen;
@ -1339,7 +1339,7 @@ hpux_uid_gid_encode (char str[6], long int id)
str[5] = '@' + (id & 3);
id >>= 2;
for (cnt = 4; cnt >= 0; ++cnt, id >>= 6)
for (cnt = 4; cnt >= 0; --cnt, id >>= 6)
str[cnt] = ' ' + (id & 0x3f);
}
#endif /* HPUX_LARGE_AR_IDS */
@ -1640,7 +1640,9 @@ _bfd_write_archive_contents (bfd *arch)
/* Verify the viability of all entries; if any of them live in the
filesystem (as opposed to living in an archive open for input)
then construct a fresh ar_hdr for them. */
for (current = arch->archive_head; current; current = current->next)
for (current = arch->archive_head;
current != NULL;
current = current->archive_next)
{
/* This check is checking the bfds for the objects we're reading
from (which are usually either an object file or archive on
@ -1650,14 +1652,14 @@ _bfd_write_archive_contents (bfd *arch)
if (bfd_write_p (current))
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
goto input_err;
}
if (!current->arelt_data)
{
current->arelt_data =
bfd_ar_hdr_from_filesystem (arch, current->filename, current);
if (!current->arelt_data)
return FALSE;
goto input_err;
/* Put in the file name. */
BFD_SEND (arch, _bfd_truncate_arname,
@ -1708,7 +1710,9 @@ _bfd_write_archive_contents (bfd *arch)
}
}
for (current = arch->archive_head; current; current = current->next)
for (current = arch->archive_head;
current != NULL;
current = current->archive_next)
{
char buffer[DEFAULT_BUFFERSIZE];
unsigned int remaining = arelt_size (current);
@ -1719,7 +1723,7 @@ _bfd_write_archive_contents (bfd *arch)
!= sizeof (*hdr))
return FALSE;
if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
return FALSE;
goto input_err;
while (remaining)
{
unsigned int amt = DEFAULT_BUFFERSIZE;
@ -1729,8 +1733,8 @@ _bfd_write_archive_contents (bfd *arch)
if (bfd_bread (buffer, amt, current) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_malformed_archive);
return FALSE;
bfd_set_error (bfd_error_file_truncated);
goto input_err;
}
if (bfd_bwrite (buffer, amt, arch) != amt)
return FALSE;
@ -1763,6 +1767,10 @@ _bfd_write_archive_contents (bfd *arch)
}
return TRUE;
input_err:
bfd_set_error (bfd_error_on_input, current, bfd_get_error ());
return FALSE;
}
/* Note that the namidx for the first symbol is 0. */
@ -1801,12 +1809,12 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
/* Drop all the files called __.SYMDEF, we're going to make our own. */
while (arch->archive_head &&
strcmp (arch->archive_head->filename, "__.SYMDEF") == 0)
arch->archive_head = arch->archive_head->next;
arch->archive_head = arch->archive_head->archive_next;
/* Map over each element. */
for (current = arch->archive_head;
current != NULL;
current = current->next, elt_no++)
current = current->archive_next, elt_no++)
{
if (bfd_check_format (current, bfd_object)
&& (bfd_get_file_flags (current) & HAS_SYMS) != 0)
@ -1963,7 +1971,7 @@ bsd_write_armap (bfd *arch,
{
firstreal += arelt_size (current) + sizeof (struct ar_hdr);
firstreal += firstreal % 2;
current = current->next;
current = current->archive_next;
}
while (current != map[count].u.abfd);
}
@ -2133,7 +2141,7 @@ coff_write_armap (bfd *arch,
archive_member_file_ptr += arelt_size (current) + sizeof (struct ar_hdr);
/* Remember aboout the even alignment. */
archive_member_file_ptr += archive_member_file_ptr % 2;
current = current->next;
current = current->archive_next;
}
/* Now write the strings themselves. */

View File

@ -1,30 +1,30 @@
/* MIPS-specific support for 64-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007
Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
<mark@codesourcery.com>
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file supports the 64-bit (MIPS) ELF archives. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "aout/ar.h"
@ -65,10 +65,10 @@ bfd_elf64_archive_slurp_armap (bfd *abfd)
return FALSE;
/* Archives with traditional armaps are still permitted. */
if (strncmp (nextname, "/ ", 16) == 0)
if (CONST_STRNEQ (nextname, "/ "))
return bfd_slurp_armap (abfd);
if (strncmp (nextname, "/SYM64/ ", 16) != 0)
if (! CONST_STRNEQ (nextname, "/SYM64/ "))
{
bfd_has_map (abfd) = FALSE;
return TRUE;
@ -215,7 +215,7 @@ bfd_elf64_archive_write_armap (bfd *arch,
+ sizeof (struct ar_hdr));
/* remember about the even alignment */
archive_member_file_ptr += archive_member_file_ptr % 2;
current = current->next;
current = current->archive_next;
}
/* now write the strings themselves */

View File

@ -1,6 +1,6 @@
/* BFD library support routines for architectures.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "safe-ctype.h"
@ -80,22 +80,26 @@ DESCRIPTION
.#define bfd_mach_m68040 6
.#define bfd_mach_m68060 7
.#define bfd_mach_cpu32 8
.#define bfd_mach_mcf_isa_a_nodiv 9
.#define bfd_mach_mcf_isa_a 10
.#define bfd_mach_mcf_isa_a_mac 11
.#define bfd_mach_mcf_isa_a_emac 12
.#define bfd_mach_mcf_isa_aplus 13
.#define bfd_mach_mcf_isa_aplus_mac 14
.#define bfd_mach_mcf_isa_aplus_emac 15
.#define bfd_mach_mcf_isa_b_nousp 16
.#define bfd_mach_mcf_isa_b_nousp_mac 17
.#define bfd_mach_mcf_isa_b_nousp_emac 18
.#define bfd_mach_mcf_isa_b 19
.#define bfd_mach_mcf_isa_b_mac 20
.#define bfd_mach_mcf_isa_b_emac 21
.#define bfd_mach_mcf_isa_b_float 22
.#define bfd_mach_mcf_isa_b_float_mac 23
.#define bfd_mach_mcf_isa_b_float_emac 24
.#define bfd_mach_fido 9
.#define bfd_mach_mcf_isa_a_nodiv 10
.#define bfd_mach_mcf_isa_a 11
.#define bfd_mach_mcf_isa_a_mac 12
.#define bfd_mach_mcf_isa_a_emac 13
.#define bfd_mach_mcf_isa_aplus 14
.#define bfd_mach_mcf_isa_aplus_mac 15
.#define bfd_mach_mcf_isa_aplus_emac 16
.#define bfd_mach_mcf_isa_b_nousp 17
.#define bfd_mach_mcf_isa_b_nousp_mac 18
.#define bfd_mach_mcf_isa_b_nousp_emac 19
.#define bfd_mach_mcf_isa_b 20
.#define bfd_mach_mcf_isa_b_mac 21
.#define bfd_mach_mcf_isa_b_emac 22
.#define bfd_mach_mcf_isa_b_float 23
.#define bfd_mach_mcf_isa_b_float_mac 24
.#define bfd_mach_mcf_isa_b_float_emac 25
.#define bfd_mach_mcf_isa_c 26
.#define bfd_mach_mcf_isa_c_mac 27
.#define bfd_mach_mcf_isa_c_emac 28
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
@ -136,6 +140,8 @@ DESCRIPTION
.{* Nonzero if MACH is a 64 bit sparc architecture. *}
.#define bfd_mach_sparc_64bit_p(mach) \
. ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
. bfd_arch_spu, {* PowerPC SPU *}
.#define bfd_mach_spu 256
. bfd_arch_mips, {* MIPS Rxxxx *}
.#define bfd_mach_mips3000 3000
.#define bfd_mach_mips3900 3900
@ -274,6 +280,7 @@ DESCRIPTION
.#define bfd_mach_arm_XScale 10
.#define bfd_mach_arm_ep9312 11
.#define bfd_mach_arm_iWMMXt 12
.#define bfd_mach_arm_iWMMXt2 13
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_w65, {* WDC 65816 *}
. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
@ -315,6 +322,9 @@ DESCRIPTION
.#define bfd_mach_fr500 500
.#define bfd_mach_fr550 550
. bfd_arch_mcore,
. bfd_arch_mep,
.#define bfd_mach_mep 1
.#define bfd_mach_mep_h1 0x6831
. bfd_arch_ia64, {* HP/Intel ia64 *}
.#define bfd_mach_ia64_elf64 64
.#define bfd_mach_ia64_elf32 32
@ -335,8 +345,11 @@ DESCRIPTION
.#define bfd_mach_avr3 3
.#define bfd_mach_avr4 4
.#define bfd_mach_avr5 5
.#define bfd_mach_avr6 6
. bfd_arch_bfin, {* ADI Blackfin *}
.#define bfd_mach_bfin 1
. bfd_arch_cr16, {* National Semiconductor CompactRISC (ie CR16). *}
.#define bfd_mach_cr16 1
. bfd_arch_cr16c, {* National Semiconductor CompactRISC. *}
.#define bfd_mach_cr16c 1
. bfd_arch_crx, {* National Semiconductor CRX. *}
@ -348,6 +361,7 @@ DESCRIPTION
. bfd_arch_s390, {* IBM s390 *}
.#define bfd_mach_s390_31 31
.#define bfd_mach_s390_64 64
. bfd_arch_score, {* Sunplus score *}
. bfd_arch_openrisc, {* OpenRISC *}
. bfd_arch_mmix, {* Donald Knuth's educational processor. *}
. bfd_arch_xstormy16,
@ -425,6 +439,7 @@ extern const bfd_arch_info_type bfd_arc_arch;
extern const bfd_arch_info_type bfd_arm_arch;
extern const bfd_arch_info_type bfd_avr_arch;
extern const bfd_arch_info_type bfd_bfin_arch;
extern const bfd_arch_info_type bfd_cr16_arch;
extern const bfd_arch_info_type bfd_cr16c_arch;
extern const bfd_arch_info_type bfd_cris_arch;
extern const bfd_arch_info_type bfd_crx_arch;
@ -451,6 +466,7 @@ extern const bfd_arch_info_type bfd_m68k_arch;
extern const bfd_arch_info_type bfd_m88k_arch;
extern const bfd_arch_info_type bfd_maxq_arch;
extern const bfd_arch_info_type bfd_mcore_arch;
extern const bfd_arch_info_type bfd_mep_arch;
extern const bfd_arch_info_type bfd_mips_arch;
extern const bfd_arch_info_type bfd_mmix_arch;
extern const bfd_arch_info_type bfd_mn10200_arch;
@ -466,8 +482,10 @@ extern const bfd_arch_info_type bfd_powerpc_archs[];
#define bfd_powerpc_arch bfd_powerpc_archs[0]
extern const bfd_arch_info_type bfd_rs6000_arch;
extern const bfd_arch_info_type bfd_s390_arch;
extern const bfd_arch_info_type bfd_score_arch;
extern const bfd_arch_info_type bfd_sh_arch;
extern const bfd_arch_info_type bfd_sparc_arch;
extern const bfd_arch_info_type bfd_spu_arch;
extern const bfd_arch_info_type bfd_tic30_arch;
extern const bfd_arch_info_type bfd_tic4x_arch;
extern const bfd_arch_info_type bfd_tic54x_arch;
@ -492,6 +510,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_arm_arch,
&bfd_avr_arch,
&bfd_bfin_arch,
&bfd_cr16_arch,
&bfd_cr16c_arch,
&bfd_cris_arch,
&bfd_crx_arch,
@ -518,6 +537,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_m88k_arch,
&bfd_maxq_arch,
&bfd_mcore_arch,
&bfd_mep_arch,
&bfd_mips_arch,
&bfd_mmix_arch,
&bfd_mn10200_arch,
@ -531,8 +551,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_powerpc_arch,
&bfd_rs6000_arch,
&bfd_s390_arch,
&bfd_score_arch,
&bfd_sh_arch,
&bfd_sparc_arch,
&bfd_spu_arch,
&bfd_tic30_arch,
&bfd_tic4x_arch,
&bfd_tic54x_arch,

View File

@ -1,7 +1,7 @@
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@ -43,6 +43,30 @@ extern "C" {
#endif
#endif
/* This is a utility macro to handle the situation where the code
wants to place a constant string into the code, followed by a
comma and then the length of the string. Doing this by hand
is error prone, so using this macro is safer. The macro will
also safely handle the case where a NULL is passed as the arg. */
#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
to create the arguments to another macro, since the preprocessor
will mis-count the number of arguments to the outer macro (by not
evaluating STRING_COMMA_LEN and so missing the comma). This is a
problem for example when trying to use STRING_COMMA_LEN to build
the arguments to the strncmp() macro. Hence this alternative
definition of strncmp is provided here.
Note - these macros do NOT work if STR2 is not a constant string. */
#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
/* strcpy() can have a similar problem, but since we know we are
copying a constant string, we can use memcpy which will be faster
since there is no need to check for a NUL byte inside STR. We
can also save time if we do not need to copy the terminating NUL. */
#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
/* The word size used by BFD on the host. This may be 64 with a 32
bit target if the host is 64 bit, or if other 64 bit targets have
been selected with --enable-targets, or if --enable-64-bit-bfd. */
@ -326,7 +350,15 @@ typedef struct bfd_section *sec_ptr;
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
/ bfd_octets_per_byte (bfd))
typedef struct stat stat_type;
/* Return TRUE if section has been discarded. */
#define elf_discarded_section(sec) \
(!bfd_is_abs_section (sec) \
&& bfd_is_abs_section ((sec)->output_section) \
&& (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
&& (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
/* Forward define. */
struct stat;
typedef enum bfd_print_symbol
{
@ -374,10 +406,6 @@ struct bfd_hash_table
{
/* The hash array. */
struct bfd_hash_entry **table;
/* The number of slots in the hash table. */
unsigned int size;
/* The size of elements. */
unsigned int entsize;
/* A function used to create new elements in the hash table. The
first entry is itself a pointer to an element. When this
function is first invoked, this pointer will be NULL. However,
@ -390,6 +418,14 @@ struct bfd_hash_table
/* An objalloc for this hash table. This is a struct objalloc *,
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
/* The number of slots in the hash table. */
unsigned int size;
/* The number of entries in the hash table. */
unsigned int count;
/* The size of elements. */
unsigned int entsize;
/* If non-zero, don't grow the hash table. */
unsigned int frozen:1;
};
/* Initialize a hash table. */
@ -660,7 +696,7 @@ extern void bfd_elf_set_dt_needed_name
extern const char *bfd_elf_get_dt_soname
(bfd *);
extern void bfd_elf_set_dyn_lib_class
(bfd *, int);
(bfd *, enum dynamic_lib_link_class);
extern int bfd_elf_get_dyn_lib_class
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
@ -817,6 +853,27 @@ extern bfd_boolean bfd_coff_set_symbol_class
extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
/* ARM VFP11 erratum workaround support. */
typedef enum
{
BFD_ARM_VFP11_FIX_DEFAULT,
BFD_ARM_VFP11_FIX_NONE,
BFD_ARM_VFP11_FIX_SCALAR,
BFD_ARM_VFP11_FIX_VECTOR
} bfd_arm_vfp11_fix;
extern void bfd_elf32_arm_init_maps
(bfd *);
extern void bfd_elf32_arm_set_vfp11_fix
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
(bfd *, struct bfd_link_info *);
extern void bfd_elf32_arm_vfp11_fix_veneer_locations
(bfd *, struct bfd_link_info *);
/* ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_allocate_interworking_sections
(struct bfd_link_info *);
@ -842,10 +899,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
(bfd *, struct bfd_link_info *, int);
(bfd *, struct bfd_link_info *);
void bfd_elf32_arm_set_target_relocs
(struct bfd_link_info *, int, char *, int, int);
(bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
@ -854,8 +912,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
(bfd *, struct bfd_link_info *);
/* ELF ARM mapping symbol support */
extern bfd_boolean bfd_is_arm_mapping_symbol_name
(const char * name);
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
extern bfd_boolean bfd_is_arm_special_symbol_name
(const char * name, int type);
extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines

View File

@ -8,7 +8,7 @@
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@ -50,6 +50,30 @@ extern "C" {
#endif
#endif
/* This is a utility macro to handle the situation where the code
wants to place a constant string into the code, followed by a
comma and then the length of the string. Doing this by hand
is error prone, so using this macro is safer. The macro will
also safely handle the case where a NULL is passed as the arg. */
#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
to create the arguments to another macro, since the preprocessor
will mis-count the number of arguments to the outer macro (by not
evaluating STRING_COMMA_LEN and so missing the comma). This is a
problem for example when trying to use STRING_COMMA_LEN to build
the arguments to the strncmp() macro. Hence this alternative
definition of strncmp is provided here.
Note - these macros do NOT work if STR2 is not a constant string. */
#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
/* strcpy() can have a similar problem, but since we know we are
copying a constant string, we can use memcpy which will be faster
since there is no need to check for a NUL byte inside STR. We
can also save time if we do not need to copy the terminating NUL. */
#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
/* The word size used by BFD on the host. This may be 64 with a 32
bit target if the host is 64 bit, or if other 64 bit targets have
been selected with --enable-targets, or if --enable-64-bit-bfd. */
@ -333,7 +357,15 @@ typedef struct bfd_section *sec_ptr;
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
/ bfd_octets_per_byte (bfd))
typedef struct stat stat_type;
/* Return TRUE if section has been discarded. */
#define elf_discarded_section(sec) \
(!bfd_is_abs_section (sec) \
&& bfd_is_abs_section ((sec)->output_section) \
&& (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
&& (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
/* Forward define. */
struct stat;
typedef enum bfd_print_symbol
{
@ -381,10 +413,6 @@ struct bfd_hash_table
{
/* The hash array. */
struct bfd_hash_entry **table;
/* The number of slots in the hash table. */
unsigned int size;
/* The size of elements. */
unsigned int entsize;
/* A function used to create new elements in the hash table. The
first entry is itself a pointer to an element. When this
function is first invoked, this pointer will be NULL. However,
@ -397,6 +425,14 @@ struct bfd_hash_table
/* An objalloc for this hash table. This is a struct objalloc *,
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
/* The number of slots in the hash table. */
unsigned int size;
/* The number of entries in the hash table. */
unsigned int count;
/* The size of elements. */
unsigned int entsize;
/* If non-zero, don't grow the hash table. */
unsigned int frozen:1;
};
/* Initialize a hash table. */
@ -667,7 +703,7 @@ extern void bfd_elf_set_dt_needed_name
extern const char *bfd_elf_get_dt_soname
(bfd *);
extern void bfd_elf_set_dyn_lib_class
(bfd *, int);
(bfd *, enum dynamic_lib_link_class);
extern int bfd_elf_get_dyn_lib_class
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
@ -824,6 +860,27 @@ extern bfd_boolean bfd_coff_set_symbol_class
extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
/* ARM VFP11 erratum workaround support. */
typedef enum
{
BFD_ARM_VFP11_FIX_DEFAULT,
BFD_ARM_VFP11_FIX_NONE,
BFD_ARM_VFP11_FIX_SCALAR,
BFD_ARM_VFP11_FIX_VECTOR
} bfd_arm_vfp11_fix;
extern void bfd_elf32_arm_init_maps
(bfd *);
extern void bfd_elf32_arm_set_vfp11_fix
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
(bfd *, struct bfd_link_info *);
extern void bfd_elf32_arm_vfp11_fix_veneer_locations
(bfd *, struct bfd_link_info *);
/* ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_allocate_interworking_sections
(struct bfd_link_info *);
@ -849,10 +906,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
(bfd *, struct bfd_link_info *, int);
(bfd *, struct bfd_link_info *);
void bfd_elf32_arm_set_target_relocs
(struct bfd_link_info *, int, char *, int, int);
(bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
@ -861,8 +919,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
(bfd *, struct bfd_link_info *);
/* ELF ARM mapping symbol support */
extern bfd_boolean bfd_is_arm_mapping_symbol_name
(const char * name);
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
extern bfd_boolean bfd_is_arm_special_symbol_name
(const char * name, int type);
extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines
@ -935,7 +999,10 @@ bfd *bfd_openr_iovec (const char *filename, const char *target,
file_ptr nbytes,
file_ptr offset),
int (*close) (struct bfd *nbfd,
void *stream));
void *stream),
int (*stat) (struct bfd *abfd,
void *stream,
struct stat *sb));
bfd *bfd_openw (const char *filename, const char *target);
@ -1076,7 +1143,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section
/* Extracted from bfdio.c. */
long bfd_get_mtime (bfd *abfd);
long bfd_get_size (bfd *abfd);
file_ptr bfd_get_size (bfd *abfd);
/* Extracted from bfdwin.c. */
/* Extracted from section.c. */
@ -1225,7 +1292,9 @@ typedef struct bfd_section
else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x200000
/* This section should not be subject to garbage collection. */
/* This section should not be subject to garbage collection.
Also set to inform the linker that this section should not be
listed in the link map as discarded. */
#define SEC_KEEP 0x400000
/* This section contains "short" data, and should be placed
@ -1471,11 +1540,6 @@ extern asection bfd_ind_section;
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct bfd_symbol * const bfd_abs_symbol;
extern const struct bfd_symbol * const bfd_com_symbol;
extern const struct bfd_symbol * const bfd_und_symbol;
extern const struct bfd_symbol * const bfd_ind_symbol;
/* Macros to handle insertion and deletion of a bfd's sections. These
only handle the list pointers, ie. do not adjust section_count,
target_index etc. */
@ -1566,7 +1630,7 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
#define bfd_section_removed_from_list(ABFD, S) \
((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
/* name, id, index, next, prev, flags, user_set_vma, */ \
{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
@ -1597,11 +1661,8 @@ extern const struct bfd_symbol * const bfd_ind_symbol;
/* target_index, used_by_bfd, constructor_chain, owner, */ \
0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct bfd_symbol *) SYM, \
\
/* symbol_ptr_ptr, */ \
(struct bfd_symbol **) SYM_PTR, \
/* symbol, symbol_ptr_ptr, */ \
(struct bfd_symbol *) SYM, &SEC.symbol, \
\
/* map_head, map_tail */ \
{ NULL }, { NULL } \
@ -1683,22 +1744,26 @@ enum bfd_architecture
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf_isa_a_nodiv 9
#define bfd_mach_mcf_isa_a 10
#define bfd_mach_mcf_isa_a_mac 11
#define bfd_mach_mcf_isa_a_emac 12
#define bfd_mach_mcf_isa_aplus 13
#define bfd_mach_mcf_isa_aplus_mac 14
#define bfd_mach_mcf_isa_aplus_emac 15
#define bfd_mach_mcf_isa_b_nousp 16
#define bfd_mach_mcf_isa_b_nousp_mac 17
#define bfd_mach_mcf_isa_b_nousp_emac 18
#define bfd_mach_mcf_isa_b 19
#define bfd_mach_mcf_isa_b_mac 20
#define bfd_mach_mcf_isa_b_emac 21
#define bfd_mach_mcf_isa_b_float 22
#define bfd_mach_mcf_isa_b_float_mac 23
#define bfd_mach_mcf_isa_b_float_emac 24
#define bfd_mach_fido 9
#define bfd_mach_mcf_isa_a_nodiv 10
#define bfd_mach_mcf_isa_a 11
#define bfd_mach_mcf_isa_a_mac 12
#define bfd_mach_mcf_isa_a_emac 13
#define bfd_mach_mcf_isa_aplus 14
#define bfd_mach_mcf_isa_aplus_mac 15
#define bfd_mach_mcf_isa_aplus_emac 16
#define bfd_mach_mcf_isa_b_nousp 17
#define bfd_mach_mcf_isa_b_nousp_mac 18
#define bfd_mach_mcf_isa_b_nousp_emac 19
#define bfd_mach_mcf_isa_b 20
#define bfd_mach_mcf_isa_b_mac 21
#define bfd_mach_mcf_isa_b_emac 22
#define bfd_mach_mcf_isa_b_float 23
#define bfd_mach_mcf_isa_b_float_mac 24
#define bfd_mach_mcf_isa_b_float_emac 25
#define bfd_mach_mcf_isa_c 26
#define bfd_mach_mcf_isa_c_mac 27
#define bfd_mach_mcf_isa_c_emac 28
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@ -1739,6 +1804,8 @@ enum bfd_architecture
/* Nonzero if MACH is a 64 bit sparc architecture. */
#define bfd_mach_sparc_64bit_p(mach) \
((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
bfd_arch_spu, /* PowerPC SPU */
#define bfd_mach_spu 256
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
@ -1876,6 +1943,7 @@ enum bfd_architecture
#define bfd_mach_arm_XScale 10
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
#define bfd_mach_arm_iWMMXt2 13
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
@ -1917,6 +1985,9 @@ enum bfd_architecture
#define bfd_mach_fr500 500
#define bfd_mach_fr550 550
bfd_arch_mcore,
bfd_arch_mep,
#define bfd_mach_mep 1
#define bfd_mach_mep_h1 0x6831
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 64
#define bfd_mach_ia64_elf32 32
@ -1937,8 +2008,11 @@ enum bfd_architecture
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
#define bfd_mach_avr5 5
#define bfd_mach_avr6 6
bfd_arch_bfin, /* ADI Blackfin */
#define bfd_mach_bfin 1
bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
#define bfd_mach_cr16 1
bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
#define bfd_mach_cr16c 1
bfd_arch_crx, /* National Semiconductor CRX. */
@ -1950,6 +2024,7 @@ enum bfd_architecture
bfd_arch_s390, /* IBM s390 */
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
bfd_arch_score, /* Sunplus score */
bfd_arch_openrisc, /* OpenRISC */
bfd_arch_mmix, /* Donald Knuth's educational processor. */
bfd_arch_xstormy16,
@ -2427,6 +2502,22 @@ relocation types already defined. */
BFD_RELOC_SPARC_TLS_TPOFF32,
BFD_RELOC_SPARC_TLS_TPOFF64,
/* SPU Relocations. */
BFD_RELOC_SPU_IMM7,
BFD_RELOC_SPU_IMM8,
BFD_RELOC_SPU_IMM10,
BFD_RELOC_SPU_IMM10W,
BFD_RELOC_SPU_IMM16,
BFD_RELOC_SPU_IMM16W,
BFD_RELOC_SPU_IMM18,
BFD_RELOC_SPU_PCREL9a,
BFD_RELOC_SPU_PCREL9b,
BFD_RELOC_SPU_PCREL16,
BFD_RELOC_SPU_LO16,
BFD_RELOC_SPU_HI16,
BFD_RELOC_SPU_PPU32,
BFD_RELOC_SPU_PPU64,
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
@ -2909,6 +3000,16 @@ pc-relative or some form of GOT-indirect relocation. */
/* 31-bit PC relative address. */
BFD_RELOC_ARM_PREL31,
/* Low and High halfword relocations for MOVW and MOVT instructions. */
BFD_RELOC_ARM_MOVW,
BFD_RELOC_ARM_MOVT,
BFD_RELOC_ARM_MOVW_PCREL,
BFD_RELOC_ARM_MOVT_PCREL,
BFD_RELOC_ARM_THUMB_MOVW,
BFD_RELOC_ARM_THUMB_MOVT,
BFD_RELOC_ARM_THUMB_MOVW_PCREL,
BFD_RELOC_ARM_THUMB_MOVT_PCREL,
/* Relocations for setting up GOTs and PLTs for shared libraries. */
BFD_RELOC_ARM_JUMP_SLOT,
BFD_RELOC_ARM_GLOB_DAT,
@ -2928,11 +3029,42 @@ pc-relative or some form of GOT-indirect relocation. */
BFD_RELOC_ARM_TLS_IE32,
BFD_RELOC_ARM_TLS_LE32,
/* ARM group relocations. */
BFD_RELOC_ARM_ALU_PC_G0_NC,
BFD_RELOC_ARM_ALU_PC_G0,
BFD_RELOC_ARM_ALU_PC_G1_NC,
BFD_RELOC_ARM_ALU_PC_G1,
BFD_RELOC_ARM_ALU_PC_G2,
BFD_RELOC_ARM_LDR_PC_G0,
BFD_RELOC_ARM_LDR_PC_G1,
BFD_RELOC_ARM_LDR_PC_G2,
BFD_RELOC_ARM_LDRS_PC_G0,
BFD_RELOC_ARM_LDRS_PC_G1,
BFD_RELOC_ARM_LDRS_PC_G2,
BFD_RELOC_ARM_LDC_PC_G0,
BFD_RELOC_ARM_LDC_PC_G1,
BFD_RELOC_ARM_LDC_PC_G2,
BFD_RELOC_ARM_ALU_SB_G0_NC,
BFD_RELOC_ARM_ALU_SB_G0,
BFD_RELOC_ARM_ALU_SB_G1_NC,
BFD_RELOC_ARM_ALU_SB_G1,
BFD_RELOC_ARM_ALU_SB_G2,
BFD_RELOC_ARM_LDR_SB_G0,
BFD_RELOC_ARM_LDR_SB_G1,
BFD_RELOC_ARM_LDR_SB_G2,
BFD_RELOC_ARM_LDRS_SB_G0,
BFD_RELOC_ARM_LDRS_SB_G1,
BFD_RELOC_ARM_LDRS_SB_G2,
BFD_RELOC_ARM_LDC_SB_G0,
BFD_RELOC_ARM_LDC_SB_G1,
BFD_RELOC_ARM_LDC_SB_G2,
/* These relocs are only used within the ARM assembler. They are not
(at present) written to any object files. */
BFD_RELOC_ARM_IMMEDIATE,
BFD_RELOC_ARM_ADRL_IMMEDIATE,
BFD_RELOC_ARM_T32_IMMEDIATE,
BFD_RELOC_ARM_T32_ADD_IMM,
BFD_RELOC_ARM_T32_IMM12,
BFD_RELOC_ARM_T32_ADD_PC12,
BFD_RELOC_ARM_SHIFT_IMM,
@ -3446,6 +3578,29 @@ short offset into 11 bits. */
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
BFD_RELOC_MCORE_RVA,
/* Toshiba Media Processor Relocations. */
BFD_RELOC_MEP_8,
BFD_RELOC_MEP_16,
BFD_RELOC_MEP_32,
BFD_RELOC_MEP_PCREL8A2,
BFD_RELOC_MEP_PCREL12A2,
BFD_RELOC_MEP_PCREL17A2,
BFD_RELOC_MEP_PCREL24A2,
BFD_RELOC_MEP_PCABS24A2,
BFD_RELOC_MEP_LOW16,
BFD_RELOC_MEP_HI16U,
BFD_RELOC_MEP_HI16S,
BFD_RELOC_MEP_GPREL,
BFD_RELOC_MEP_TPREL,
BFD_RELOC_MEP_TPREL7,
BFD_RELOC_MEP_TPREL7A2,
BFD_RELOC_MEP_TPREL7A4,
BFD_RELOC_MEP_UIMM24,
BFD_RELOC_MEP_ADDR24A4,
BFD_RELOC_MEP_GNU_VTINHERIT,
BFD_RELOC_MEP_GNU_VTENTRY,
/* These are relocations for the GETA instruction. */
BFD_RELOC_MMIX_GETA,
BFD_RELOC_MMIX_GETA_1,
@ -3545,10 +3700,22 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */
command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_LO8_LDI_PM,
/* This is a 16 bit reloc for the AVR that stores 8 bit value
(command address) into 8 bit immediate value of LDI insn. If the address
is beyond the 128k boundary, the linker inserts a jump stub for this reloc
in the lower 128k. */
BFD_RELOC_AVR_LO8_LDI_GS,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
of command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HI8_LDI_PM,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
of command address) into 8 bit immediate value of LDI insn. If the address
is beyond the 128k boundary, the linker inserts a jump stub for this reloc
below 128k. */
BFD_RELOC_AVR_HI8_LDI_GS,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HH8_LDI_PM,
@ -3689,6 +3856,31 @@ instructions */
BFD_RELOC_390_GOTPLT20,
BFD_RELOC_390_TLS_GOTIE20,
/* Score relocations */
BFD_RELOC_SCORE_DUMMY1,
/* Low 16 bit for load/store */
BFD_RELOC_SCORE_GPREL15,
/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
BFD_RELOC_SCORE_DUMMY2,
BFD_RELOC_SCORE_JMP,
/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
BFD_RELOC_SCORE_BRANCH,
/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
BFD_RELOC_SCORE16_JMP,
/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
BFD_RELOC_SCORE16_BRANCH,
/* Undocumented Score relocs */
BFD_RELOC_SCORE_GOT15,
BFD_RELOC_SCORE_GOT_LO16,
BFD_RELOC_SCORE_CALL15,
BFD_RELOC_SCORE_DUMMY_HI16,
/* Scenix IP2K - 9-bit register number / data address */
BFD_RELOC_IP2K_FR9,
@ -3913,6 +4105,35 @@ This is the 5 bits of a value. */
BFD_RELOC_16C_IMM32,
BFD_RELOC_16C_IMM32_C,
/* NS CR16 Relocations. */
BFD_RELOC_CR16_NUM8,
BFD_RELOC_CR16_NUM16,
BFD_RELOC_CR16_NUM32,
BFD_RELOC_CR16_NUM32a,
BFD_RELOC_CR16_REGREL0,
BFD_RELOC_CR16_REGREL4,
BFD_RELOC_CR16_REGREL4a,
BFD_RELOC_CR16_REGREL14,
BFD_RELOC_CR16_REGREL14a,
BFD_RELOC_CR16_REGREL16,
BFD_RELOC_CR16_REGREL20,
BFD_RELOC_CR16_REGREL20a,
BFD_RELOC_CR16_ABS20,
BFD_RELOC_CR16_ABS24,
BFD_RELOC_CR16_IMM4,
BFD_RELOC_CR16_IMM8,
BFD_RELOC_CR16_IMM16,
BFD_RELOC_CR16_IMM20,
BFD_RELOC_CR16_IMM24,
BFD_RELOC_CR16_IMM32,
BFD_RELOC_CR16_IMM32a,
BFD_RELOC_CR16_DISP4,
BFD_RELOC_CR16_DISP8,
BFD_RELOC_CR16_DISP16,
BFD_RELOC_CR16_DISP20,
BFD_RELOC_CR16_DISP24,
BFD_RELOC_CR16_DISP24a,
/* NS CRX Relocations. */
BFD_RELOC_CRX_REL4,
BFD_RELOC_CRX_REL8,
@ -4026,6 +4247,10 @@ This is the 5 bits of a value. */
BFD_RELOC_XSTORMY16_24,
BFD_RELOC_XSTORMY16_FPTR16,
/* Self-describing complex relocations. */
BFD_RELOC_RELC,
/* Infineon Relocations. */
BFD_RELOC_XC16X_PAG,
BFD_RELOC_XC16X_POF,
@ -4163,6 +4388,8 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
reloc_howto_type *bfd_reloc_name_lookup
(bfd *abfd, const char *reloc_name);
const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
@ -4275,6 +4502,14 @@ typedef struct bfd_symbol
/* This symbol is thread local. Used in ELF. */
#define BSF_THREAD_LOCAL 0x40000
/* This symbol represents a complex relocation expression,
with the expression tree serialized in the symbol name. */
#define BSF_RELC 0x80000
/* This symbol represents a signed complex relocation expression,
with the expression tree serialized in the symbol name. */
#define BSF_SRELC 0x100000
flagword flags;
/* A pointer to the section to which this symbol is
@ -4442,7 +4677,7 @@ struct bfd
/* Stuff only useful for archives. */
void *arelt_data;
struct bfd *my_archive; /* The containing archive BFD. */
struct bfd *next; /* The next BFD in the archive. */
struct bfd *archive_next; /* The next BFD in the archive. */
struct bfd *archive_head; /* The first BFD in the archive. */
bfd_boolean has_armap;
@ -4524,13 +4759,14 @@ typedef enum bfd_error
bfd_error_bad_value,
bfd_error_file_truncated,
bfd_error_file_too_big,
bfd_error_on_input,
bfd_error_invalid_error_code
}
bfd_error_type;
bfd_error_type bfd_get_error (void);
void bfd_set_error (bfd_error_type error_tag);
void bfd_set_error (bfd_error_type error_tag, ...);
const char *bfd_errmsg (bfd_error_type error_tag);
@ -4585,8 +4821,8 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
#define bfd_set_private_flags(abfd, flags) \
BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
#define bfd_sizeof_headers(abfd, info) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
BFD_SEND (abfd, _bfd_find_nearest_line, \
@ -4694,6 +4930,16 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
bfd_vma bfd_emul_get_maxpagesize (const char *);
void bfd_emul_set_maxpagesize (const char *, bfd_vma);
bfd_vma bfd_emul_get_commonpagesize (const char *);
void bfd_emul_set_commonpagesize (const char *, bfd_vma);
char *bfd_demangle (bfd *, const char *, int);
/* Extracted from archive.c. */
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
@ -4992,7 +5238,8 @@ typedef struct bfd_target
#define BFD_JUMP_TABLE_RELOCS(NAME) \
NAME##_get_reloc_upper_bound, \
NAME##_canonicalize_reloc, \
NAME##_bfd_reloc_type_lookup
NAME##_bfd_reloc_type_lookup, \
NAME##_bfd_reloc_name_lookup
long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
long (*_bfd_canonicalize_reloc)
@ -5000,6 +5247,9 @@ typedef struct bfd_target
/* See documentation on reloc types. */
reloc_howto_type *
(*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
reloc_howto_type *
(*reloc_name_lookup) (bfd *, const char *);
/* Routines used when writing an object file. */
#define BFD_JUMP_TABLE_WRITE(NAME) \
@ -5028,7 +5278,7 @@ typedef struct bfd_target
NAME##_bfd_discard_group, \
NAME##_section_already_linked \
int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
bfd_byte * (*_bfd_get_relocated_section_contents)
(bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, bfd_boolean, struct bfd_symbol **);
@ -5071,7 +5321,8 @@ typedef struct bfd_target
/* Check if SEC has been already linked during a reloceatable or
final link. */
void (*_section_already_linked) (bfd *, struct bfd_section *);
void (*_section_already_linked) (bfd *, struct bfd_section *,
struct bfd_link_info *);
/* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
@ -5131,10 +5382,11 @@ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
#define bfd_link_split_section(abfd, sec) \
BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
void bfd_section_already_linked (bfd *abfd, asection *sec);
void bfd_section_already_linked (bfd *abfd, asection *sec,
struct bfd_link_info *info);
#define bfd_section_already_linked(abfd, sec) \
BFD_SEND (abfd, _section_already_linked, (abfd, sec))
#define bfd_section_already_linked(abfd, sec, info) \
BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
/* Extracted from simple.c. */
bfd_byte *bfd_simple_get_relocated_section_contents

View File

@ -1,6 +1,6 @@
/* Generic BFD library interface and support routines.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -139,7 +139,7 @@ CODE_FRAGMENT
. {* Stuff only useful for archives. *}
. void *arelt_data;
. struct bfd *my_archive; {* The containing archive BFD. *}
. struct bfd *next; {* The next BFD in the archive. *}
. struct bfd *archive_next; {* The next BFD in the archive. *}
. struct bfd *archive_head; {* The first BFD in the archive. *}
. bfd_boolean has_armap;
.
@ -202,11 +202,12 @@ CODE_FRAGMENT
.
*/
#include "bfd.h"
#include "bfdver.h"
#include "sysdep.h"
#include <stdarg.h>
#include "bfd.h"
#include "bfdver.h"
#include "libiberty.h"
#include "demangle.h"
#include "safe-ctype.h"
#include "bfdlink.h"
#include "libbfd.h"
@ -271,6 +272,7 @@ CODE_FRAGMENT
. bfd_error_bad_value,
. bfd_error_file_truncated,
. bfd_error_file_too_big,
. bfd_error_on_input,
. bfd_error_invalid_error_code
.}
.bfd_error_type;
@ -278,6 +280,8 @@ CODE_FRAGMENT
*/
static bfd_error_type bfd_error = bfd_error_no_error;
static bfd *input_bfd = NULL;
static bfd_error_type input_error = bfd_error_no_error;
const char *const bfd_errmsgs[] =
{
@ -300,6 +304,7 @@ const char *const bfd_errmsgs[] =
N_("Bad value"),
N_("File truncated"),
N_("File too big"),
N_("Error reading %s: %s"),
N_("#<Invalid error code>")
};
@ -325,16 +330,32 @@ FUNCTION
bfd_set_error
SYNOPSIS
void bfd_set_error (bfd_error_type error_tag);
void bfd_set_error (bfd_error_type error_tag, ...);
DESCRIPTION
Set the BFD error condition to be @var{error_tag}.
If @var{error_tag} is bfd_error_on_input, then this function
takes two more parameters, the input bfd where the error
occurred, and the bfd_error_type error.
*/
void
bfd_set_error (bfd_error_type error_tag)
bfd_set_error (bfd_error_type error_tag, ...)
{
bfd_error = error_tag;
if (error_tag == bfd_error_on_input)
{
/* This is an error that occurred during bfd_close when
writing an archive, but on one of the input files. */
va_list ap;
va_start (ap, error_tag);
input_bfd = va_arg (ap, bfd *);
input_error = va_arg (ap, int);
if (input_error >= bfd_error_on_input)
abort ();
va_end (ap);
}
}
/*
@ -355,6 +376,19 @@ bfd_errmsg (bfd_error_type error_tag)
#ifndef errno
extern int errno;
#endif
if (error_tag == bfd_error_on_input)
{
char *buf;
const char *msg = bfd_errmsg (input_error);
if (asprintf (&buf, _(bfd_errmsgs [error_tag]), input_bfd->filename, msg)
!= -1)
return buf;
/* Ick, what to do on out of memory? */
return msg;
}
if (error_tag == bfd_error_system_call)
return xstrerror (errno);
@ -382,16 +416,10 @@ DESCRIPTION
void
bfd_perror (const char *message)
{
if (bfd_get_error () == bfd_error_system_call)
/* Must be a system error then. */
perror ((char *) message);
if (message == NULL || *message == '\0')
fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ()));
else
{
if (message == NULL || *message == '\0')
fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ()));
else
fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ()));
}
fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ()));
}
/*
@ -419,6 +447,23 @@ static const char *_bfd_error_program_name;
%A section name from section. For group components, print group name too.
%B file name from bfd. For archive components, prints archive too.
Note - because these two extra format specifiers require special handling
they are scanned for and processed in this function, before calling
vfprintf. This means that the *arguments* for these format specifiers
must be the first ones in the variable argument list, regardless of where
the specifiers appear in the format string. Thus for example calling
this function with a format string of:
"blah %s blah %A blah %d blah %B"
would involve passing the arguments as:
"blah %s blah %A blah %d blah %B",
asection_for_the_%A,
bfd_for_the_%B,
string_for_the_%s,
integer_for_the_%d);
*/
void
@ -483,7 +528,11 @@ _bfd_default_error_handler (const char *fmt, ...)
if (p[1] == 'B')
{
bfd *abfd = va_arg (ap, bfd *);
if (abfd->my_archive)
if (abfd == NULL)
/* Invoking %B with a null bfd pointer is an internal error. */
abort ();
else if (abfd->my_archive)
snprintf (bufp, avail, "%s(%s)",
abfd->my_archive->filename, abfd->filename);
else
@ -492,10 +541,14 @@ _bfd_default_error_handler (const char *fmt, ...)
else
{
asection *sec = va_arg (ap, asection *);
bfd *abfd = sec->owner;
bfd *abfd;
const char *group = NULL;
struct coff_comdat_info *ci;
if (sec == NULL)
/* Invoking %A with a null section pointer is an internal error. */
abort ();
abfd = sec->owner;
if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& elf_next_in_group (sec) != NULL
@ -851,14 +904,16 @@ bfd_get_sign_extend_vma (bfd *abfd)
name = bfd_get_target (abfd);
/* Return a proper value for DJGPP & PE COFF (x86 COFF variants).
/* Return a proper value for DJGPP & PE COFF.
This function is required for DWARF2 support, but there is
no place to store this information in the COFF back end.
Should enough other COFF targets add support for DWARF2,
a place will have to be found. Until then, this hack will do. */
if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0
if (CONST_STRNEQ (name, "coff-go32")
|| strcmp (name, "pe-i386") == 0
|| strcmp (name, "pei-i386") == 0)
|| strcmp (name, "pei-i386") == 0
|| strcmp (name, "pe-arm-wince-little") == 0
|| strcmp (name, "pei-arm-wince-little") == 0)
return 1;
bfd_set_error (bfd_error_wrong_format);
@ -1158,8 +1213,8 @@ FUNCTION
DESCRIPTION
The following functions exist but have not yet been documented.
.#define bfd_sizeof_headers(abfd, reloc) \
. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
.#define bfd_sizeof_headers(abfd, info) \
. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
.
.#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
. BFD_SEND (abfd, _bfd_find_nearest_line, \
@ -1298,11 +1353,10 @@ bfd_record_phdr (bfd *abfd,
amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) count - 1) * sizeof (asection *);
m = bfd_alloc (abfd, amt);
m = bfd_zalloc (abfd, amt);
if (m == NULL)
return FALSE;
m->next = NULL;
m->p_type = type;
m->p_flags = flags;
m->p_paddr = at;
@ -1335,6 +1389,15 @@ bfd_fprintf_vma (bfd *abfd, void *stream, bfd_vma value)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value);
#ifdef BFD64
/* fprintf_vma() on a 64-bit enabled host will always print a 64-bit
value, but really we want to display the address in the target's
address size. Since we do not have a field in the bfd structure
to tell us this, we take a guess, based on the target's name. */
else if (strstr (bfd_get_target (abfd), "64") == NULL
&& strcmp (bfd_get_target (abfd), "mmo") != 0)
fprintf ((FILE *) stream, "%08lx", (unsigned long) (value & 0xffffffff));
#endif
else
fprintf_vma ((FILE *) stream, value);
}
@ -1513,3 +1576,212 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
objalloc. */
bfd_hash_table_free (&preserve->section_htab);
}
/*
FUNCTION
bfd_emul_get_maxpagesize
SYNOPSIS
bfd_vma bfd_emul_get_maxpagesize (const char *);
DESCRIPTION
Returns the maximum page size, in bytes, as determined by
emulation.
RETURNS
Returns the maximum page size in bytes for ELF, abort
otherwise.
*/
bfd_vma
bfd_emul_get_maxpagesize (const char *emul)
{
const bfd_target *target;
target = bfd_find_target (emul, NULL);
if (target != NULL
&& target->flavour == bfd_target_elf_flavour)
return xvec_get_elf_backend_data (target)->maxpagesize;
abort ();
return 0;
}
static void
bfd_elf_set_pagesize (const bfd_target *target, bfd_vma size,
int offset, const bfd_target *orig_target)
{
if (target->flavour == bfd_target_elf_flavour)
{
const struct elf_backend_data *bed;
bed = xvec_get_elf_backend_data (target);
*((bfd_vma *) ((char *) bed + offset)) = size;
}
if (target->alternative_target
&& target->alternative_target != orig_target)
bfd_elf_set_pagesize (target->alternative_target, size, offset,
orig_target);
}
/*
FUNCTION
bfd_emul_set_maxpagesize
SYNOPSIS
void bfd_emul_set_maxpagesize (const char *, bfd_vma);
DESCRIPTION
For ELF, set the maximum page size for the emulation. It is
a no-op for other formats.
*/
void
bfd_emul_set_maxpagesize (const char *emul, bfd_vma size)
{
const bfd_target *target;
target = bfd_find_target (emul, NULL);
if (target)
bfd_elf_set_pagesize (target, size,
offsetof (struct elf_backend_data,
maxpagesize), target);
}
/*
FUNCTION
bfd_emul_get_commonpagesize
SYNOPSIS
bfd_vma bfd_emul_get_commonpagesize (const char *);
DESCRIPTION
Returns the common page size, in bytes, as determined by
emulation.
RETURNS
Returns the common page size in bytes for ELF, abort otherwise.
*/
bfd_vma
bfd_emul_get_commonpagesize (const char *emul)
{
const bfd_target *target;
target = bfd_find_target (emul, NULL);
if (target != NULL
&& target->flavour == bfd_target_elf_flavour)
return xvec_get_elf_backend_data (target)->commonpagesize;
abort ();
return 0;
}
/*
FUNCTION
bfd_emul_set_commonpagesize
SYNOPSIS
void bfd_emul_set_commonpagesize (const char *, bfd_vma);
DESCRIPTION
For ELF, set the common page size for the emulation. It is
a no-op for other formats.
*/
void
bfd_emul_set_commonpagesize (const char *emul, bfd_vma size)
{
const bfd_target *target;
target = bfd_find_target (emul, NULL);
if (target)
bfd_elf_set_pagesize (target, size,
offsetof (struct elf_backend_data,
commonpagesize), target);
}
/*
FUNCTION
bfd_demangle
SYNOPSIS
char *bfd_demangle (bfd *, const char *, int);
DESCRIPTION
Wrapper around cplus_demangle. Strips leading underscores and
other such chars that would otherwise confuse the demangler.
If passed a g++ v3 ABI mangled name, returns a buffer allocated
with malloc holding the demangled name. Returns NULL otherwise
and on memory alloc failure.
*/
char *
bfd_demangle (bfd *abfd, const char *name, int options)
{
char *res, *alloc;
const char *pre, *suf;
size_t pre_len;
if (abfd != NULL
&& *name != '\0'
&& bfd_get_symbol_leading_char (abfd) == *name)
++name;
/* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
or the MS PE format. These formats have a number of leading '.'s
on at least some symbols, so we remove all dots to avoid
confusing the demangler. */
pre = name;
while (*name == '.' || *name == '$')
++name;
pre_len = name - pre;
/* Strip off @plt and suchlike too. */
alloc = NULL;
suf = strchr (name, '@');
if (suf != NULL)
{
alloc = bfd_malloc (suf - name + 1);
if (alloc == NULL)
return NULL;
memcpy (alloc, name, suf - name);
alloc[suf - name] = '\0';
name = alloc;
}
res = cplus_demangle (name, options);
if (alloc != NULL)
free (alloc);
if (res == NULL)
return NULL;
/* Put back any prefix or suffix. */
if (pre_len != 0 || suf != NULL)
{
size_t len;
size_t suf_len;
char *final;
len = strlen (res);
if (suf == NULL)
suf = res + len;
suf_len = strlen (suf) + 1;
final = bfd_malloc (pre_len + len + suf_len);
if (final != NULL)
{
memcpy (final, pre, pre_len);
memcpy (final + pre_len, res, len);
memcpy (final + pre_len + len, suf, suf_len);
}
free (res);
res = final;
}
return res;
}

View File

@ -1,7 +1,7 @@
/* Low-level I/O routines for BFDs.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -23,12 +23,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include <limits.h>
#include "bfd.h"
#include "libbfd.h"
#include <limits.h>
#ifndef S_IXUSR
#define S_IXUSR 0100 /* Execute by owner. */
#endif
@ -116,6 +114,15 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
{
size_t nread;
/* If this is an archive element, don't read past the end of
this element. */
if (abfd->arelt_data != NULL)
{
size_t maxbytes = ((struct areltdata *) abfd->arelt_data)->parsed_size;
if (size > maxbytes)
size = maxbytes;
}
if ((abfd->flags & BFD_IN_MEMORY) != 0)
{
struct bfd_in_memory *bim;
@ -401,7 +408,7 @@ FUNCTION
bfd_get_size
SYNOPSIS
long bfd_get_size (bfd *abfd);
file_ptr bfd_get_size (bfd *abfd);
DESCRIPTION
Return the file size (as read from file system) for the file
@ -429,7 +436,7 @@ DESCRIPTION
size reasonable?".
*/
long
file_ptr
bfd_get_size (bfd *abfd)
{
struct stat buf;

View File

@ -1,6 +1,6 @@
/* BFD back-end for binary objects.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc.
2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@ -32,8 +32,8 @@
the file. objcopy cooperates by specially setting the start
address to zero by default. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "safe-ctype.h"
#include "libbfd.h"
@ -63,6 +63,7 @@ binary_object_p (bfd *abfd)
{
struct stat statbuf;
asection *sec;
flagword flags;
if (abfd->target_defaulted)
{
@ -80,10 +81,10 @@ binary_object_p (bfd *abfd)
}
/* One data section. */
sec = bfd_make_section (abfd, ".data");
flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS;
sec = bfd_make_section_with_flags (abfd, ".data", flags);
if (sec == NULL)
return NULL;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS;
sec->vma = 0;
sec->size = statbuf.st_size;
sec->filepos = 0;
@ -220,9 +221,6 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define binary_read_minisymbols _bfd_generic_read_minisymbols
#define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define binary_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
#define binary_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l)
#define binary_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l)
#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
/* Set the architecture of a binary file. */
@ -305,7 +303,7 @@ binary_set_section_contents (bfd *abfd,
static int
binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
bfd_boolean exec ATTRIBUTE_UNUSED)
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return 0;
}
@ -367,7 +365,7 @@ const bfd_target binary_vec =
BFD_JUMP_TABLE_CORE (_bfd_nocore),
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
BFD_JUMP_TABLE_SYMBOLS (binary),
BFD_JUMP_TABLE_RELOCS (binary),
BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
BFD_JUMP_TABLE_WRITE (binary),
BFD_JUMP_TABLE_LINK (binary),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),

View File

@ -1,6 +1,6 @@
/* BFD back-end for Intel 960 b.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "bfdlink.h"
#include "genlink.h"
@ -635,7 +635,8 @@ callj_callback (bfd *abfd,
}
static reloc_howto_type *
b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
switch (code)
{
@ -651,6 +652,20 @@ b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_typ
}
}
static reloc_howto_type *
b_out_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
if (strcasecmp (howto_reloc_callj.name, r_name) == 0)
return &howto_reloc_callj;
if (strcasecmp (howto_reloc_abs32.name, r_name) == 0)
return &howto_reloc_abs32;
if (strcasecmp (howto_reloc_pcrel24.name, r_name) == 0)
return &howto_reloc_pcrel24;
return NULL;
}
/* Allocate enough room for all the reloc entries, plus pointers to them all. */
static bfd_boolean
@ -990,7 +1005,8 @@ b_out_set_arch_mach (bfd *abfd,
}
static int
b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, bfd_boolean ignore ATTRIBUTE_UNUSED)
b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return sizeof (struct external_exec);
}

View File

@ -1,7 +1,7 @@
/* BFD library -- caching of file descriptors.
Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002,
2003, 2004, 2005 Free Software Foundation, Inc.
2003, 2004, 2005, 2007 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
@ -40,8 +40,8 @@ SUBSECTION
Caching functions
*/
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "libiberty.h"

View File

@ -1,6 +1,6 @@
/* BFD back-end for ALPHA Extended-Coff files.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005 Free Software Foundation, Inc.
2003, 2004, 2005, 2007 Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
@ -20,8 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@ -1244,6 +1244,22 @@ alpha_bfd_reloc_type_lookup (abfd, code)
return &alpha_howto_table[alpha_type];
}
static reloc_howto_type *
alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]);
i++)
if (alpha_howto_table[i].name != NULL
&& strcasecmp (alpha_howto_table[i].name, r_name) == 0)
return &alpha_howto_table[i];
return NULL;
}
/* A helper routine for alpha_relocate_section which converts an
external reloc when generating relocatable output. Returns the
@ -2361,6 +2377,8 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
/* Looking up a reloc type is Alpha specific. */
#define _bfd_ecoff_bfd_reloc_type_lookup alpha_bfd_reloc_type_lookup
#define _bfd_ecoff_bfd_reloc_name_lookup \
alpha_bfd_reloc_name_lookup
/* So is getting relocated section contents. */
#define _bfd_ecoff_bfd_get_relocated_section_contents \

View File

@ -1,6 +1,6 @@
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/arm.h"
#include "coff/internal.h"
@ -163,6 +163,19 @@ coff_arm_reloc (bfd *abfd,
/* These most certainly belong somewhere else. Just had to get rid of
the manifest constants in the code. */
#ifdef ARM_WINCE
#define ARM_26D 0
#define ARM_32 1
#define ARM_RVA32 2
#define ARM_26 3
#define ARM_THUMB12 4
#define ARM_SECTION 14
#define ARM_SECREL 15
#else
#define ARM_8 0
#define ARM_16 1
#define ARM_32 2
@ -179,20 +192,6 @@ coff_arm_reloc (bfd *abfd,
#define ARM_THUMB12 13
#define ARM_THUMB23 14
#ifdef ARM_WINCE
#undef ARM_32
#undef ARM_RVA32
#undef ARM_26
#undef ARM_THUMB12
#undef ARM_26D
#define ARM_26D 0
#define ARM_32 1
#define ARM_RVA32 2
#define ARM_26 3
#define ARM_THUMB12 4
#define ARM_SECTION 14
#define ARM_SECREL 15
#endif
static bfd_reloc_status_type aoutarm_fix_pcrel_26_done
@ -220,7 +219,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_dont,
aoutarm_fix_pcrel_26_done,
"ARM_26D",
FALSE,
TRUE, /* partial_inplace. */
0x00ffffff,
0x0,
PCRELOFFSET),
@ -233,7 +232,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_32",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -246,7 +245,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_RVA32",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -294,7 +293,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECTION",
FALSE,
TRUE, /* partial_inplace. */
0x0000ffff,
0x0000ffff,
PCRELOFFSET),
@ -307,7 +306,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECREL",
FALSE,
TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
@ -539,6 +538,32 @@ coff_arm_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
if (rel->r_type == ARM_RVA32)
*addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
#if defined COFF_WITH_PE && defined ARM_WINCE
if (rel->r_type == ARM_SECREL)
{
bfd_vma osect_vma;
if (h && (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak))
osect_vma = h->root.u.def.section->output_section->vma;
else
{
asection *sec;
int i;
/* Sigh, the only way to get the section to offset against
is to find it the hard way. */
for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++)
sec = sec->next;
osect_vma = sec->output_section->vma;
}
*addendp -= osect_vma;
}
#endif
return howto;
}
@ -808,6 +833,7 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code)
ASTD (BFD_RELOC_RVA, ARM_RVA32);
ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
ASTD (BFD_RELOC_32_SECREL, ARM_SECREL);
#else
ASTD (BFD_RELOC_8, ARM_8);
ASTD (BFD_RELOC_16, ARM_16);
@ -827,6 +853,23 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code)
}
}
static reloc_howto_type *
coff_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < (sizeof (aoutarm_std_reloc_howto)
/ sizeof (aoutarm_std_reloc_howto[0]));
i++)
if (aoutarm_std_reloc_howto[i].name != NULL
&& strcasecmp (aoutarm_std_reloc_howto[i].name, r_name) == 0)
return &aoutarm_std_reloc_howto[i];
return NULL;
}
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2
#define COFF_PAGE_SIZE 0x1000
@ -1209,12 +1252,14 @@ coff_arm_relocate_section (bfd *output_bfd,
generation of bl's instruction offset. */
addend -= 8;
#endif
howto = &fake_arm26_reloc;
howto = & fake_arm26_reloc;
}
#ifdef ARM_WINCE
/* MS ARM-CE makes the reloc relative to the opcode's pc, not
the next opcode's pc, so is off by one. */
if (howto->pc_relative && !info->relocatable)
addend -= 8;
#endif
/* If we are doing a relocatable link, then we can just ignore
@ -1938,12 +1983,11 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd,
if (sec == NULL)
{
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_CODE | SEC_READONLY);
sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME,
flags);
if (sec == NULL
|| ! bfd_set_section_flags (abfd, sec, flags)
|| ! bfd_set_section_alignment (abfd, sec, 2))
return FALSE;
}
@ -1952,12 +1996,12 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd,
if (sec == NULL)
{
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_CODE | SEC_READONLY);
sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME,
flags);
if (sec == NULL
|| ! bfd_set_section_flags (abfd, sec, flags)
|| ! bfd_set_section_alignment (abfd, sec, 2))
return FALSE;
}
@ -2085,6 +2129,7 @@ bfd_arm_process_before_allocation (bfd * abfd,
#endif /* ! defined (COFF_IMAGE_WITH_PE) */
#define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_arm_reloc_name_lookup
#define coff_relocate_section coff_arm_relocate_section
#define coff_bfd_is_local_label_name coff_arm_is_local_label_name
#define coff_adjust_symndx coff_arm_adjust_symndx
@ -2397,7 +2442,9 @@ Warning: Clearing the interworking flag of %B because non-interworking code in %
/* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX
*must* match the definitions in gcc/config/arm/{coff|semi|aout}.h. */
#ifndef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ""
#endif
#ifndef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
#endif

View File

@ -1,5 +1,5 @@
/* BFD back-end for Apple M68K COFF A/UX 3.x files.
Copyright 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Copyright 1996, 1997, 2000, 2002, 2007 Free Software Foundation, Inc.
Written by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@ -37,8 +37,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#define COFF_COMMON_ADDEND
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
static bfd_boolean coff_m68k_aux_link_add_one_symbol
PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,

View File

@ -1,6 +1,6 @@
/* BFD back-end for Intel 386 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004
2000, 2001, 2002, 2003, 2004, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/i386.h"
@ -546,6 +546,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
}
#define coff_bfd_reloc_type_lookup coff_i386_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup
static reloc_howto_type *
coff_i386_reloc_type_lookup (abfd, code)
@ -578,6 +579,20 @@ coff_i386_reloc_type_lookup (abfd, code)
}
}
static reloc_howto_type *
coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
if (howto_table[i].name != NULL
&& strcasecmp (howto_table[i].name, r_name) == 0)
return &howto_table[i];
return NULL;
}
#define coff_rtype_to_howto coff_i386_rtype_to_howto
#ifdef TARGET_UNDERSCORE

View File

@ -1,5 +1,5 @@
/* BFD back-end for HP/Intel IA-64 COFF files.
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/ia64.h"
#include "coff/internal.h"

View File

@ -1,6 +1,6 @@
/* BFD back-end for MIPS Extended-Coff files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004
2000, 2001, 2002, 2003, 2004, 2007
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@ -21,8 +21,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@ -769,6 +769,22 @@ mips_bfd_reloc_type_lookup (abfd, code)
return &mips_howto_table[mips_type];
}
static reloc_howto_type *
mips_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (mips_howto_table) / sizeof (mips_howto_table[0]);
i++)
if (mips_howto_table[i].name != NULL
&& strcasecmp (mips_howto_table[i].name, r_name) == 0)
return &mips_howto_table[i];
return NULL;
}
/* A helper routine for mips_relocate_section which handles the REFHI
relocations. The REFHI relocation must be followed by a REFLO
@ -1375,6 +1391,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
/* Looking up a reloc type is MIPS specific. */
#define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup
#define _bfd_ecoff_bfd_reloc_name_lookup mips_bfd_reloc_name_lookup
/* Getting relocated section contents is generic. */
#define _bfd_ecoff_bfd_get_relocated_section_contents \

View File

@ -1,6 +1,6 @@
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
@ -33,9 +33,8 @@
- dlltool will not produce correct output in some .reloc cases, and will
not produce the right glue code for dll function calls. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/powerpc.h"
@ -1332,7 +1331,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
DUMP_RELOC2 (howto->name, rel);
if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0)
if (CONST_STRNEQ (input_section->name, ".idata$2") && first_thunk_address == 0)
{
/* Set magic values. */
int idata5offset;
@ -1961,8 +1960,23 @@ ppc_coff_reloc_type_lookup (abfd, code)
return NULL;
}
}
#undef HOW2MAP
static reloc_howto_type *
ppc_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]);
i++)
if (ppc_coff_howto_table[i].name != NULL
&& strcasecmp (ppc_coff_howto_table[i].name, r_name) == 0)
return &ppc_coff_howto_table[i];
return NULL;
}
/* Tailor coffcode.h -- macro heaven. */
@ -1971,6 +1985,7 @@ ppc_coff_reloc_type_lookup (abfd, code)
/* We use the special COFF backend linker, with our own special touch. */
#define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup
#define coff_bfd_reloc_name_lookup ppc_coff_reloc_name_lookup
#define coff_rtype_to_howto coff_ppc_rtype_to_howto
#define coff_relocate_section coff_ppc_relocate_section
#define coff_bfd_final_link ppc_bfd_coff_final_link

View File

@ -1,12 +1,7 @@
/* BFD back-end for IBM RS/6000 "XCOFF" files.
Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
them with octal escapes), and isn't useful without an understanding of what
character set it is.
Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365,
and John Gilmore.
Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore.
Archive support from Damon A. Permezel.
Contributed by IBM Corporation and Cygnus Support.
@ -26,8 +21,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@ -59,7 +54,7 @@ extern bfd_boolean _bfd_xcoff_write_armap
extern bfd_boolean _bfd_xcoff_write_archive_contents
PARAMS ((bfd *));
extern int _bfd_xcoff_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
PARAMS ((bfd *, struct bfd_link_info *));
extern void _bfd_xcoff_swap_sym_in
PARAMS ((bfd *, PTR, PTR));
extern unsigned int _bfd_xcoff_swap_sym_out
@ -98,6 +93,7 @@ void xcoff_rtype2howto
#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
#define coff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup
#ifdef AIX_CORE
extern const bfd_target * rs6000coff_core_p
PARAMS ((bfd *abfd));
@ -1051,6 +1047,21 @@ _bfd_xcoff_reloc_type_lookup (abfd, code)
}
}
static reloc_howto_type *
_bfd_xcoff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (xcoff_howto_table) / sizeof (xcoff_howto_table[0]);
i++)
if (xcoff_howto_table[i].name != NULL
&& strcasecmp (xcoff_howto_table[i].name, r_name) == 0)
return &xcoff_howto_table[i];
return NULL;
}
/* XCOFF archive support. The original version of this code was by
Damon A. Permezel. It was enhanced to permit cross support, and
@ -1638,7 +1649,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx)
+ SXCOFFARFMAG
+ arelt_size (sub));
fileoff = (fileoff + 1) &~ 1;
sub = sub->next;
sub = sub->archive_next;
}
for (i = 0; i < orl_count; i++)
@ -1809,7 +1820,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
}
i++;
}
current_bfd = current_bfd->next;
current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
@ -1913,7 +1924,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
+ SXCOFFARFMAG
+ arelt_size (current_bfd));
fileoff += fileoff & 1;
current_bfd = current_bfd->next;
current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
@ -1934,7 +1945,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
}
i++;
}
current_bfd = current_bfd->next;
current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
@ -2009,7 +2020,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
+ SXCOFFARFMAG
+ arelt_size (current_bfd));
fileoff += fileoff & 1;
current_bfd = current_bfd->next;
current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
@ -2030,7 +2041,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
}
i++;
}
current_bfd = current_bfd->next;
current_bfd = current_bfd->archive_next;
if (current_bfd != NULL)
arch_info = bfd_get_arch_info (current_bfd);
}
@ -2089,7 +2100,7 @@ xcoff_write_archive_contents_old (abfd)
count = 0;
total_namlen = 0;
for (sub = abfd->archive_head; sub != NULL; sub = sub->next)
for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next)
{
++count;
total_namlen += strlen (normalize_filename (sub)) + 1;
@ -2105,7 +2116,9 @@ xcoff_write_archive_contents_old (abfd)
hasobjects = FALSE;
prevoff = 0;
nextoff = SIZEOF_AR_FILE_HDR;
for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++)
for (sub = abfd->archive_head, i = 0;
sub != NULL;
sub = sub->archive_next, i++)
{
const char *name;
bfd_size_type namlen;
@ -2253,7 +2266,7 @@ xcoff_write_archive_contents_old (abfd)
abfd) != XCOFFARMAG_ELEMENT_SIZE)
return FALSE;
}
for (sub = abfd->archive_head; sub != NULL; sub = sub->next)
for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next)
{
const char *name;
bfd_size_type namlen;
@ -2323,7 +2336,7 @@ xcoff_write_archive_contents_big (abfd)
hasobjects = FALSE;
for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0;
current_bfd != NULL;
current_bfd = current_bfd->next, count++)
current_bfd = current_bfd->archive_next, count++)
{
total_namlen += strlen (normalize_filename (current_bfd)) + 1;
@ -2345,7 +2358,7 @@ xcoff_write_archive_contents_big (abfd)
nextoff = SIZEOF_AR_FILE_HDR_BIG;
for (current_bfd = abfd->archive_head, i = 0;
current_bfd != NULL;
current_bfd = current_bfd->next, i++)
current_bfd = current_bfd->archive_next, i++)
{
const char *name;
bfd_size_type namlen;
@ -2512,8 +2525,9 @@ xcoff_write_archive_contents_big (abfd)
offsets = NULL;
}
for (current_bfd = abfd->archive_head; current_bfd != NULL;
current_bfd = current_bfd->next)
for (current_bfd = abfd->archive_head;
current_bfd != NULL;
current_bfd = current_bfd->archive_next)
{
const char *name;
size_t namlen;
@ -2573,9 +2587,8 @@ _bfd_xcoff_write_archive_contents (abfd)
always uses an a.out header. */
int
_bfd_xcoff_sizeof_headers (abfd, reloc)
bfd *abfd;
bfd_boolean reloc ATTRIBUTE_UNUSED;
_bfd_xcoff_sizeof_headers (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
int size;
@ -4179,6 +4192,7 @@ const bfd_target rs6000coff_vec =
coff_get_reloc_upper_bound,
coff_canonicalize_reloc,
_bfd_xcoff_reloc_type_lookup,
_bfd_xcoff_reloc_name_lookup,
/* Write */
coff_set_arch_mach,
@ -4429,6 +4443,7 @@ const bfd_target pmac_xcoff_vec =
coff_get_reloc_upper_bound,
coff_canonicalize_reloc,
_bfd_xcoff_reloc_type_lookup,
_bfd_xcoff_reloc_name_lookup,
/* Write */
coff_set_arch_mach,

View File

@ -1,6 +1,6 @@
/* BFD back-end for Sparc COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
2002, 2003, 2005 Free Software Foundation, Inc.
2002, 2003, 2005, 2007 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/sparc.h"
#include "coff/internal.h"
@ -158,6 +158,24 @@ coff_sparc_reloc_type_lookup (abfd, code)
}
#define coff_bfd_reloc_type_lookup coff_sparc_reloc_type_lookup
static reloc_howto_type *
coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < (sizeof (coff_sparc_howto_table)
/ sizeof (coff_sparc_howto_table[0]));
i++)
if (coff_sparc_howto_table[i].name != NULL
&& strcasecmp (coff_sparc_howto_table[i].name, r_name) == 0)
return &coff_sparc_howto_table[i];
return NULL;
}
#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup
static void
rtype2howto (cache_ptr, dst)
arelent *cache_ptr;

View File

@ -1,5 +1,5 @@
/* BFD back-end for IBM RS/6000 "XCOFF64" files.
Copyright 2000, 2001, 2002, 2003, 2004, 2005
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written Clinton Popetz.
Contributed by Cygnus Support.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@ -127,7 +127,7 @@ extern bfd_boolean _bfd_xcoff_write_armap
extern bfd_boolean _bfd_xcoff_write_archive_contents
PARAMS ((bfd *));
extern int _bfd_xcoff_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
PARAMS ((bfd *, struct bfd_link_info *));
extern void _bfd_xcoff_swap_sym_in
PARAMS ((bfd *, PTR, PTR));
extern unsigned int _bfd_xcoff_swap_sym_out
@ -161,7 +161,7 @@ static const bfd_target *xcoff64_archive_p
static bfd *xcoff64_openr_next_archived_file
PARAMS ((bfd *, bfd *));
static int xcoff64_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
PARAMS ((bfd *, struct bfd_link_info *));
static asection *xcoff64_create_csect_from_smclas
PARAMS ((bfd *, union internal_auxent *, const char *));
static bfd_boolean xcoff64_is_lineno_count_overflow
@ -237,6 +237,7 @@ bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION])
#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
#define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup
#define coff_bfd_reloc_name_lookup xcoff64_reloc_name_lookup
#ifdef AIX_CORE
extern const bfd_target * rs6000coff_core_p
PARAMS ((bfd *abfd));
@ -1843,6 +1844,22 @@ xcoff64_reloc_type_lookup (abfd, code)
}
}
static reloc_howto_type *
xcoff64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (xcoff64_howto_table) / sizeof (xcoff64_howto_table[0]);
i++)
if (xcoff64_howto_table[i].name != NULL
&& strcasecmp (xcoff64_howto_table[i].name, r_name) == 0)
return &xcoff64_howto_table[i];
return NULL;
}
/* Read in the armap of an XCOFF archive. */
static bfd_boolean
@ -2056,9 +2073,8 @@ xcoff64_openr_next_archived_file (archive, last_file)
always uses an a.out header. */
static int
xcoff64_sizeof_headers (abfd, reloc)
bfd *abfd;
bfd_boolean reloc ATTRIBUTE_UNUSED;
xcoff64_sizeof_headers (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
int size;
@ -2726,6 +2742,7 @@ const bfd_target rs6000coff64_vec =
coff_get_reloc_upper_bound,
coff_canonicalize_reloc,
xcoff64_reloc_type_lookup,
xcoff64_reloc_name_lookup,
/* Write */
coff_set_arch_mach,
@ -2977,6 +2994,7 @@ const bfd_target aix5coff64_vec =
coff_get_reloc_upper_bound,
coff_canonicalize_reloc,
xcoff64_reloc_type_lookup,
xcoff64_reloc_name_lookup,
/* Write */
coff_set_arch_mach,

View File

@ -1,6 +1,6 @@
/* Support for the generic parts of most COFF variants, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -427,7 +427,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
styp_flags = STYP_LIT;
#endif /* _LIT */
}
else if (!strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1))
else if (CONST_STRNEQ (sec_name, DOT_DEBUG))
{
/* Handle the XCOFF debug section and DWARF2 debug sections. */
if (!sec_name[6])
@ -435,12 +435,12 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
else
styp_flags = STYP_DEBUG_INFO;
}
else if (!strncmp (sec_name, ".stab", 5))
else if (CONST_STRNEQ (sec_name, ".stab"))
{
styp_flags = STYP_DEBUG_INFO;
}
#ifdef COFF_LONG_SECTION_NAMES
else if (!strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1))
else if (CONST_STRNEQ (sec_name, GNU_LINKONCE_WI))
{
styp_flags = STYP_DEBUG_INFO;
}
@ -529,8 +529,8 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
but there are more IMAGE_SCN_* flags. */
/* FIXME: There is no gas syntax to specify the debug section flag. */
if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
|| strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0)
if (CONST_STRNEQ (sec_name, DOT_DEBUG)
|| CONST_STRNEQ (sec_name, GNU_LINKONCE_WI))
sec_flags = SEC_DEBUGGING;
/* skip LOAD */
@ -674,14 +674,14 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED,
#endif
sec_flags |= SEC_ALLOC;
}
else if (strncmp (name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
else if (CONST_STRNEQ (name, DOT_DEBUG)
#ifdef _COMMENT
|| strcmp (name, _COMMENT) == 0
#endif
#ifdef COFF_LONG_SECTION_NAMES
|| strncmp (name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0
|| CONST_STRNEQ (name, GNU_LINKONCE_WI)
#endif
|| strncmp (name, ".stab", 5) == 0)
|| CONST_STRNEQ (name, ".stab"))
{
#ifdef COFF_PAGE_SIZE
sec_flags |= SEC_DEBUGGING;
@ -715,7 +715,7 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED,
The symbols will be defined as weak, so that multiple definitions
are permitted. The GNU linker extension is to actually discard
all but one of the sections. */
if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
if (CONST_STRNEQ (name, ".gnu.linkonce"))
sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
#endif
@ -1071,7 +1071,7 @@ styp_to_sec_flags (bfd *abfd,
/* The MS PE spec sets the DISCARDABLE flag on .reloc sections
but we do not want them to be labelled as debug section, since
then strip would remove them. */
if (strncmp (name, ".reloc", sizeof ".reloc" - 1) != 0)
if (! CONST_STRNEQ (name, ".reloc"))
sec_flags |= SEC_DEBUGGING;
break;
case IMAGE_SCN_MEM_SHARED:
@ -1126,7 +1126,7 @@ styp_to_sec_flags (bfd *abfd,
The symbols will be defined as weak, so that multiple definitions
are permitted. The GNU linker extension is to actually discard
all but one of the sections. */
if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
if (CONST_STRNEQ (name, ".gnu.linkonce"))
sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
#endif
@ -1546,6 +1546,9 @@ static const unsigned int coff_section_alignment_table_size =
static bfd_boolean
coff_new_section_hook (bfd * abfd, asection * section)
{
combined_entry_type *native;
bfd_size_type amt;
section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
#ifdef RS6000COFF_C
@ -1557,34 +1560,31 @@ coff_new_section_hook (bfd * abfd, asection * section)
section->alignment_power = bfd_xcoff_data_align_power (abfd);
#endif
/* PR binutils/2724: Only real sections have a symbol that
has the coff_symbol_type structure allocated for it. */
if (! bfd_is_const_section (section))
{
combined_entry_type *native;
bfd_size_type amt;
/* Set up the section symbol. */
if (!_bfd_generic_new_section_hook (abfd, section))
return FALSE;
/* Allocate aux records for section symbols, to store size and
related info.
/* Allocate aux records for section symbols, to store size and
related info.
@@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */
amt = sizeof (combined_entry_type) * 10;
native = bfd_zalloc (abfd, amt);
if (native == NULL)
return FALSE;
@@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */
amt = sizeof (combined_entry_type) * 10;
native = bfd_zalloc (abfd, amt);
if (native == NULL)
return FALSE;
/* We don't need to set up n_name, n_value, or n_scnum in the native
symbol information, since they'll be overridden by the BFD symbol
anyhow. However, we do need to set the type and storage class,
in case this symbol winds up getting written out. The value 0
for n_numaux is already correct. */
native->u.syment.n_type = T_NULL;
native->u.syment.n_sclass = C_STAT;
/* We don't need to set up n_name, n_value, or n_scnum in the native
symbol information, since they'll be overridden by the BFD symbol
anyhow. However, we do need to set the type and storage class,
in case this symbol winds up getting written out. The value 0
for n_numaux is already correct. */
native->u.syment.n_type = T_NULL;
native->u.syment.n_sclass = C_STAT;
coffsymbol (section->symbol)->native = native;
coffsymbol (section->symbol)->native = native;
}
coff_set_custom_section_alignment (abfd, section,
coff_section_alignment_table,
coff_section_alignment_table_size);
@ -1882,11 +1882,17 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
#ifdef I386MAGIC
case I386MAGIC:
case I386PTXMAGIC:
case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler */
case LYNXCOFFMAGIC: /* shadows the m68k Lynx number below, sigh */
case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler. */
case LYNXCOFFMAGIC: /* Shadows the m68k Lynx number below, sigh. */
arch = bfd_arch_i386;
break;
#endif
#ifdef AMD64MAGIC
case AMD64MAGIC:
arch = bfd_arch_i386;
machine = bfd_mach_x86_64;
break;
#endif
#ifdef IA64MAGIC
case IA64MAGIC:
arch = bfd_arch_ia64;
@ -2532,11 +2538,15 @@ coff_write_relocs (bfd * abfd, int first_undef)
else
{
n.r_symndx = get_index ((*(q->sym_ptr_ptr)));
/* Take notice if the symbol reloc points to a symbol
we don't have in our symbol table. What should we
do for this?? */
/* Check to see if the symbol reloc points to a symbol
we don't have in our symbol table. */
if (n.r_symndx > obj_conv_table_size (abfd))
abort ();
{
bfd_set_error (bfd_error_bad_value);
_bfd_error_handler (_("%B: reloc against a non-existant symbol index: %ld"),
abfd, n.r_symndx);
return FALSE;
}
}
}
@ -2717,12 +2727,17 @@ coff_set_flags (bfd * abfd,
return TRUE;
#endif
#ifdef I386MAGIC
#if defined(I386MAGIC) || defined(AMD64MAGIC)
case bfd_arch_i386:
#if defined(I386MAGIC)
*magicp = I386MAGIC;
#ifdef LYNXOS
#endif
#if defined LYNXOS
/* Just overwrite the usual value if we're doing Lynx. */
*magicp = LYNXCOFFMAGIC;
#endif
#if defined AMD64MAGIC
*magicp = AMD64MAGIC;
#endif
return TRUE;
#endif
@ -3755,6 +3770,7 @@ coff_write_object_contents (bfd * abfd)
internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
#endif
#ifndef COFF_WITH_pex64
#ifdef COFF_WITH_PE
internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE;
#else
@ -3763,6 +3779,7 @@ coff_write_object_contents (bfd * abfd)
else
internal_f.f_flags |= F_AR32W;
#endif
#endif
#ifdef TI_TARGET_ID
/* Target id is used in TI COFF v1 and later; COFF0 won't use this field,
@ -3856,16 +3873,18 @@ coff_write_object_contents (bfd * abfd)
#if defined(I386)
#define __A_MAGIC_SET__
#if defined(LYNXOS)
#if defined LYNXOS
internal_a.magic = LYNXCOFFMAGIC;
#else /* LYNXOS */
#elif defined AMD64
internal_a.magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC;
#else
internal_a.magic = ZMAGIC;
#endif /* LYNXOS */
#endif
#endif /* I386 */
#if defined(IA64)
#define __A_MAGIC_SET__
internal_a.magic = ZMAGIC;
internal_a.magic = PE32PMAGIC;
#endif /* IA64 */
#if defined(SPARC)
@ -4851,6 +4870,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
cache_ptr = reloc_cache + idx;
src = native_relocs + idx;
dst.r_offset = 0;
coff_swap_reloc_in (abfd, src, &dst);
#ifdef RELOC_PROCESSING
@ -4931,6 +4951,7 @@ coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
{
arelent genrel;
genrel.howto = NULL;
RTYPE2HOWTO (&genrel, rel);
return genrel.howto;
}
@ -5314,6 +5335,9 @@ static const bfd_coff_backend_data ticoff1_swap_table =
#ifndef coff_bfd_reloc_type_lookup
#define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
#endif
#ifndef coff_bfd_reloc_name_lookup
#define coff_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
#endif
#ifndef coff_bfd_get_relocated_section_contents
#define coff_bfd_get_relocated_section_contents \

View File

@ -1,6 +1,6 @@
/* Support for the generic parts of COFF, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005
2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -37,8 +37,8 @@
Those functions may not use any COFF specific information, such as
coff_data (abfd). */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/internal.h"
#include "libcoff.h"
@ -1901,7 +1901,16 @@ coff_print_symbol (bfd *abfd,
combined->u.syment.n_type,
combined->u.syment.n_sclass,
combined->u.syment.n_numaux);
fprintf_vma (file, val);
#ifdef BFD64
/* fprintf_vma() on a 64-bit enabled host will always print a 64-bit
value, but really we want to display the address in the target's
address size. Since we do not have a field in the bfd structure
to tell us this, we take a guess, based on the target's name. */
if (strstr (bfd_get_target (abfd), "64") == NULL)
fprintf (file, "%08lx", (unsigned long) (val & 0xffffffff));
else
#endif
fprintf_vma (file, val);
fprintf (file, " %s", symbol->name);
for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
@ -2238,11 +2247,11 @@ coff_find_inliner_info (bfd *abfd,
}
int
coff_sizeof_headers (bfd *abfd, bfd_boolean reloc)
coff_sizeof_headers (bfd *abfd, struct bfd_link_info *info)
{
size_t size;
if (! reloc)
if (!info->relocatable)
size = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd);
else
size = bfd_coff_filhsz (abfd);

View File

@ -1,6 +1,6 @@
/* COFF specific linker code.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006 Free Software Foundation, Inc.
2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -21,8 +21,8 @@
/* This file contains the COFF backend linker code. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@ -232,7 +232,7 @@ coff_link_check_ar_symbols (bfd *abfd,
/* Auto import. */
if (!h
&& info->pei386_auto_import
&& !strncmp (name,"__imp_", 6))
&& CONST_STRNEQ (name, "__imp_"))
h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE);
/* We are only interested in symbols that are currently
@ -439,7 +439,7 @@ coff_link_add_symbols (bfd *abfd,
|| classification == COFF_SYMBOL_PE_SECTION)
&& coff_section_data (abfd, section) != NULL
&& coff_section_data (abfd, section)->comdat != NULL
&& strncmp (name, "??_", 3) == 0
&& CONST_STRNEQ (name, "??_")
&& strcmp (name, coff_section_data (abfd, section)->comdat->name) == 0)
{
if (*sym_hash == NULL)
@ -583,7 +583,7 @@ coff_link_add_symbols (bfd *abfd,
asection *stab;
for (stab = abfd->sections; stab; stab = stab->next)
if (strncmp (".stab", stab->name, 5) == 0
if (CONST_STRNEQ (stab->name, ".stab")
&& (!stab->name[5]
|| (stab->name[5] == '.' && ISDIGIT (stab->name[6]))))
{
@ -1232,16 +1232,14 @@ process_embedded_commands (bfd *output_bfd,
s++;
continue;
}
if (strncmp (s, "-attr", 5) == 0)
if (CONST_STRNEQ (s, "-attr"))
{
char *name;
char *attribs;
asection *asec;
int loop = 1;
int had_write = 0;
int had_read = 0;
int had_exec= 0;
int had_shared= 0;
s += 5;
s = get_name (s, &name);
@ -1255,10 +1253,8 @@ process_embedded_commands (bfd *output_bfd,
had_write = 1;
break;
case 'R':
had_read = 1;
break;
case 'S':
had_shared = 1;
break;
case 'X':
had_exec = 1;
@ -1276,11 +1272,11 @@ process_embedded_commands (bfd *output_bfd,
asec->flags |= SEC_READONLY;
}
}
else if (strncmp (s,"-heap", 5) == 0)
s = dores_com (s+5, output_bfd, 1);
else if (CONST_STRNEQ (s, "-heap"))
s = dores_com (s + 5, output_bfd, 1);
else if (strncmp (s,"-stack", 6) == 0)
s = dores_com (s+6, output_bfd, 0);
else if (CONST_STRNEQ (s, "-stack"))
s = dores_com (s + 6, output_bfd, 0);
else
s++;
@ -1925,6 +1921,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd)
generate two symbols with the same name, but only one
will have aux entries. */
BFD_ASSERT (isymp->n_numaux == 0
|| h->numaux == 0
|| h->numaux == isymp->n_numaux);
}
@ -1940,7 +1937,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd)
union internal_auxent aux;
union internal_auxent *auxp;
if (h != NULL)
if (h != NULL && h->aux != NULL && (h->numaux > i))
auxp = h->aux + i;
else
{

View File

@ -31,12 +31,7 @@ targ_underscore=no
# Catch obsolete configurations.
case $targ in
m68*-apple-aux* | \
m68*-apollo-* | \
m68*-bull-sysv* | \
m68*-*-rtemscoff* | \
i960-*-rtems* | \
or32-*-rtems* | \
maxq-*-coff | \
null)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration $targ is obsolete." >&2
@ -48,6 +43,12 @@ case $targ in
esac
case $targ in
m68*-apple-aux* | \
m68*-apollo-* | \
m68*-bull-sysv* | \
m68*-*-rtemscoff* | \
i960-*-rtems* | \
or32-*-rtems* | \
m68*-*-lynxos* | \
sparc-*-lynxos* | \
vax-*-vms* | \
@ -75,9 +76,11 @@ bfin*) targ_archs=bfd_bfin_arch ;;
c30*) targ_archs=bfd_tic30_arch ;;
c4x*) targ_archs=bfd_tic4x_arch ;;
c54x*) targ_archs=bfd_tic54x_arch ;;
cr16*) targ_archs=bfd_cr16_arch ;;
crisv32) targ_archs=bfd_cris_arch ;;
crx*) targ_archs=bfd_crx_arch ;;
dlx*) targ_archs=bfd_dlx_arch ;;
fido*) targ_archs=bfd_m68k_arch ;;
hppa*) targ_archs=bfd_hppa_arch ;;
i[3-7]86) targ_archs=bfd_i386_arch ;;
i370) targ_archs=bfd_i370_arch ;;
@ -95,10 +98,11 @@ rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
s390*) targ_archs=bfd_s390_arch ;;
sh*) targ_archs=bfd_sh_arch ;;
sparc*) targ_archs=bfd_sparc_arch ;;
spu*) targ_archs=bfd_spu_arch ;;
strongarm*) targ_archs=bfd_arm_arch ;;
thumb*) targ_archs=bfd_arm_arch ;;
v850*) targ_archs=bfd_v850_arch ;;
x86_64) targ_archs=bfd_i386_arch ;;
x86_64*) targ_archs=bfd_i386_arch ;;
xscale*) targ_archs=bfd_arm_arch ;;
xtensa*) targ_archs=bfd_xtensa_arch ;;
z80|r800) targ_archs=bfd_z80_arch ;;
@ -137,6 +141,7 @@ case "${targ}" in
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_alpha_freebsd_vec
targ_selvecs=ecoffalpha_little_vec
want64=true
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
case "${targ}" in
alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*)
@ -146,36 +151,49 @@ case "${targ}" in
alpha*-*-netbsd* | alpha*-*-openbsd*)
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
want64=true
;;
alpha*-*-netware*)
targ_defvec=ecoffalpha_little_vec
targ_selvecs=nlm32_alpha_vec
want64=true
;;
alpha*-*-linuxecoff*)
targ_defvec=ecoffalpha_little_vec
targ_selvecs=bfd_elf64_alpha_vec
want64=true
;;
alpha*-*-linux-* | alpha*-*-elf*)
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
want64=true
;;
alpha*-*-*vms*)
targ_defvec=vms_alpha_vec
want64=true
;;
alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
want64=true
;;
ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_ia64_little_vec
targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
want64=true
;;
ia64*-*-hpux*)
targ_defvec=bfd_elf32_ia64_hpux_big_vec
targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
want64=true
;;
sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu)
sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_sparc_freebsd_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
;;
sparc64-*-netbsd* | sparc64-*-openbsd*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
want64=true
;;
#endif /* BFD64 */
@ -215,8 +233,8 @@ case "${targ}" in
targ_cflags=-DARM_COFF_BUGFIX
;;
arm-wince-pe | arm-*-wince)
targ_defvec=armpe_little_vec
targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
targ_defvec=arm_wince_pe_little_vec
targ_selvecs="arm_wince_pe_little_vec arm_wince_pe_big_vec arm_wince_pei_little_vec arm_wince_pei_big_vec"
targ_underscore=no
targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX"
;;
@ -340,6 +358,11 @@ case "${targ}" in
targ_underscore=yes
;;
cr16-*-elf*)
targ_defvec=bfd_elf32_cr16_vec
targ_underscore=yes
;;
cr16c-*-elf*)
targ_defvec=bfd_elf32_cr16c_vec
targ_underscore=yes
@ -369,6 +392,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_d30v_vec
;;
fido-*-elf* )
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec ieee_vec"
;;
fr30-*-elf)
targ_defvec=bfd_elf32_fr30_vec
;;
@ -407,11 +435,13 @@ case "${targ}" in
hppa*64*-*-linux-*)
targ_defvec=bfd_elf64_hppa_linux_vec
targ_selvecs=bfd_elf64_hppa_vec
want64=true
;;
hppa*64*-*-hpux11*)
targ_defvec=bfd_elf64_hppa_vec
targ_selvecs=bfd_elf64_hppa_linux_vec
targ_cflags=-DHPUX_LARGE_AR_IDS
want64=true
;;
#endif
@ -553,18 +583,28 @@ case "${targ}" in
x86_64-*-elf*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec"
want64=true
;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
targ_defvec=bfd_elf64_x86_64_freebsd_vec
targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec"
want64=true
;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec"
want64=true
;;
x86_64-*-linux-*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec"
want64=true
;;
x86_64-*-mingw*)
targ_defvec=x86_64pe_vec
targ_selvecs="x86_64pe_vec x86_64pei_vec x86_64coff_vec bfd_elf64_x86_64_vec"
want64=true
targ_underscore=yes
;;
#endif
i[3-7]86-*-lynxos*)
@ -644,7 +684,7 @@ case "${targ}" in
targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
targ_underscore=yes
;;
i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*)
i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv*)
targ_defvec=icoff_little_vec
targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec"
targ_underscore=yes
@ -675,17 +715,14 @@ case "${targ}" in
targ_defvec=bfd_elf32_m32rlelin_vec
targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec"
;;
m32r*-*-linux*)
targ_defvec=bfd_elf32_m32rlin_vec
targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec"
;;
m32r*le-*-*)
targ_defvec=bfd_elf32_m32rle_vec
targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec"
;;
m32r-*-*)
targ_defvec=bfd_elf32_m32r_vec
;;
@ -699,13 +736,6 @@ case "${targ}" in
targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec"
;;
m68*-apollo-*)
targ_defvec=apollocoff_vec
;;
m68*-bull-sysv*)
targ_defvec=m68kcoffun_vec
targ_underscore=yes
;;
m68*-motorola-sysv*)
targ_defvec=m68ksysvcoff_vec
;;
@ -721,10 +751,6 @@ case "${targ}" in
targ_selvecs="cisco_core_big_vec ieee_vec"
targ_underscore=yes
;;
m68*-*-rtemscoff*)
targ_defvec=m68kcoff_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
;;
m68*-*-elf* | m68*-*-sysv4* | m68*-*-uclinux*)
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec ieee_vec"
@ -788,9 +814,6 @@ case "${targ}" in
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs=m68kcoff_vec
;;
m68*-apple-aux*)
targ_defvec=m68kaux_coff_vec
;;
m68*-*-psos*)
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs=ieee_vec
@ -827,6 +850,11 @@ case "${targ}" in
targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec"
;;
mep-*-elf)
targ_defvec=bfd_elf32_mep_vec
targ_selvecs=bfd_elf32_mep_little_vec
;;
mips*-big-*)
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
@ -855,6 +883,7 @@ case "${targ}" in
mips*-*-irix6*)
targ_defvec=bfd_elf32_nbigmips_vec
targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
want64=true
;;
#endif
mips*-*-irix5*)
@ -881,12 +910,24 @@ case "${targ}" in
mips*el-*-vxworks*)
targ_defvec=bfd_elf32_littlemips_vxworks_vec
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
want64=true
;;
mips*-*-vxworks*)
targ_defvec=bfd_elf32_bigmips_vxworks_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
want64=true
;;
#endif
mips*el-sde-elf*)
targ_defvec=bfd_elf32_tradlittlemips_vec
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
want64=true
;;
mips*-sde-elf*)
targ_defvec=bfd_elf32_tradbigmips_vec
targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
want64=true
;;
mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
@ -903,6 +944,7 @@ case "${targ}" in
mips64*-*-openbsd*)
targ_defvec=bfd_elf64_tradbigmips_vec
targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
want64=true
;;
#endif
mips*el-*-openbsd*)
@ -917,10 +959,12 @@ case "${targ}" in
mips64*el-*-linux*)
targ_defvec=bfd_elf32_ntradlittlemips_vec
targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
want64=true
;;
mips64*-*-linux*)
targ_defvec=bfd_elf32_ntradbigmips_vec
targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
want64=true
;;
#endif
mips*el-*-linux*)
@ -937,6 +981,7 @@ case "${targ}" in
mmix-*-*)
targ_defvec=bfd_elf64_mmix_vec
targ_selvecs=bfd_mmo_vec
want64=true
;;
#endif
mn10200-*-*)
@ -969,7 +1014,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_openrisc_vec
;;
or32-*-coff | or32-*-rtems* )
or32-*-coff)
targ_defvec=or32coff_big_vec
targ_underscore=yes
;;
@ -1034,15 +1079,18 @@ case "${targ}" in
powerpc64-*-aix*)
targ_defvec=rs6000coff64_vec
targ_selvecs=rs6000coff_vec
want64=true
;;
powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
powerpc64-*-*bsd*)
targ_defvec=bfd_elf64_powerpc_vec
targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec"
want64=true
;;
powerpc64le-*-elf* | powerpcle-*-elf64*)
targ_defvec=bfd_elf64_powerpcle_vec
targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec"
want64=true
;;
#endif
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
@ -1107,40 +1155,49 @@ case "${targ}" in
s390x-*-linux*)
targ_defvec=bfd_elf64_s390_vec
targ_selvecs=bfd_elf32_s390_vec
want64=true
;;
s390x-*-tpf*)
targ_defvec=bfd_elf64_s390_vec
want64=true
;;
#endif
score*-*-elf*)
targ_defvec=bfd_elf32_bigscore_vec
targ_selvecs=bfd_elf32_littlescore_vec
;;
#ifdef BFD64
sh64l*-*-elf*)
targ_defvec=bfd_elf32_sh64l_vec
targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec"
targ_underscore=yes
want64=true
;;
sh64-*-elf*)
targ_defvec=bfd_elf32_sh64_vec
targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec"
targ_underscore=yes
want64=true
;;
sh64eb-*-linux*)
targ_defvec=bfd_elf32_sh64blin_vec
targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
want64=true
;;
sh64-*-linux*)
targ_defvec=bfd_elf32_sh64lin_vec
targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
want64=true
;;
sh-*-linux*)
targ_defvec=bfd_elf32_shblin_vec
targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
want64=true
;;
#endif /* BFD64 */
sh-*-linux*)
targ_defvec=bfd_elf32_shblin_vec
targ_selvecs=bfd_elf32_shlin_vec
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
#endif
;;
sh*eb-*-linux*)
targ_defvec=bfd_elf32_shblin_vec
targ_selvecs=bfd_elf32_shlin_vec
@ -1150,40 +1207,49 @@ case "${targ}" in
targ_selvecs=bfd_elf32_shblin_vec
;;
sh-*-uclinux* | sh[12]-*-uclinux*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
#endif
;;
#ifdef BFD64
sh5le-*-netbsd*)
targ_defvec=bfd_elf32_sh64lnbsd_vec
targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
want64=true
;;
sh5-*-netbsd*)
targ_defvec=bfd_elf32_sh64nbsd_vec
targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
want64=true
;;
sh64le-*-netbsd*)
targ_defvec=bfd_elf64_sh64lnbsd_vec
targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
want64=true
;;
sh64-*-netbsd*)
targ_defvec=bfd_elf64_sh64nbsd_vec
targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
want64=true
;;
#endif
sh*l*-*-netbsdelf*)
targ_defvec=bfd_elf32_shlnbsd_vec
targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
#endif
targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
want64=true
;;
sh-*-netbsdelf*)
targ_defvec=bfd_elf32_shnbsd_vec
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
#endif
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
want64=true
;;
#endif
sh*-*-netbsdelf*)
targ_defvec=bfd_elf32_shnbsd_vec
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
@ -1193,40 +1259,48 @@ case "${targ}" in
targ_selvecs="shlcoff_vec shlcoff_small_vec"
targ_underscore=yes
;;
#ifdef BFD64
shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
targ_defvec=bfd_elf32_shl_vec
targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
#endif
targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
targ_underscore=yes
want64=true
;;
#endif
sh-*-rtemscoff*)
targ_defvec=shcoff_vec
targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
;;
#ifdef BFD64
sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
#endif
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
targ_underscore=yes
want64=true
;;
#endif
sh-*-nto*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
;;
sh*-*-openbsd*)
targ_defvec=bfd_elf32_shlnbsd_vec
targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
;;
sh-*-pe)
targ_defvec=shlpe_vec
targ_selvecs="shlpe_vec shlpei_vec"
targ_underscore=yes
;;
sh-*-vxworks)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec"
targ_defvec=bfd_elf32_shvxworks_vec
targ_selvecs="bfd_elf32_shlvxworks_vec"
# FIXME None of the following are actually used on this target, but
# they're necessary for coff-sh.c (which is unconditionally used) to be
# compiled correctly.
@ -1287,6 +1361,7 @@ case "${targ}" in
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec"
want64=true
;;
#endif
sparc-*-sysv4*)
@ -1304,14 +1379,17 @@ case "${targ}" in
sparc64-*-aout*)
targ_defvec=sunos_big_vec
targ_underscore=yes
want64=true
;;
sparc64-*-linux-*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
want64=true
;;
sparc64-*-elf*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs=bfd_elf32_sparc_vec
want64=true
;;
#endif /* BFD64 */
sparc*-*-coff*)
@ -1326,6 +1404,10 @@ case "${targ}" in
targ_underscore=yes
;;
spu-*-elf)
targ_defvec=bfd_elf32_spu_vec
;;
#if HAVE_host_aout_vec
tahoe-*-*)
targ_defvec=host_aout_vec

View File

@ -1,29 +1,9 @@
/* config.in. Generated from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if NLS is requested */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to 1 if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `basename', and to 0 if you
don't. */
#undef HAVE_DECL_BASENAME
@ -83,6 +63,9 @@
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
@ -107,33 +90,18 @@
/* Define to 1 if you have the `ftello64' function. */
#undef HAVE_FTELLO64
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if <sys/procfs.h> has lwpstatus_t. */
#undef HAVE_LWPSTATUS_T
@ -149,9 +117,6 @@
/* Define to 1 if you have the `madvise' function. */
#undef HAVE_MADVISE
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@ -161,15 +126,9 @@
/* Define to 1 if you have the `mprotect' function. */
#undef HAVE_MPROTECT
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if <sys/procfs.h> has prpsinfo32_t. */
#undef HAVE_PRPSINFO32_T
@ -200,21 +159,12 @@
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
/* Define if <sys/procfs.h> has pxstatus_t. */
#undef HAVE_PXSTATUS_T
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define to 1 if you have the `setitimer' function. */
#undef HAVE_SETITIMER
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
@ -224,15 +174,6 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the stpcpy function */
#undef HAVE_STPCPY
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@ -259,9 +200,6 @@
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
@ -280,20 +218,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if <sys/procfs.h> has win32_pstatus_t. */
#undef HAVE_WIN32_PSTATUS_T
/* Define to 1 if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
/* Define to 1 if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
/* Define to 1 if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
@ -313,6 +243,12 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
@ -322,13 +258,11 @@
/* The size of a `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of a `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@ -358,18 +292,3 @@
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
AC_CANONICAL_TARGET
AC_ISC_POSIX
AM_INIT_AUTOMAKE(bfd, 2.17)
AM_INIT_AUTOMAKE(bfd, 2.17.50)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@ -19,7 +19,10 @@ dnl Default to a non shared library. This may be overridden by the
dnl configure option --enable-shared.
AM_DISABLE_SHARED
AM_PROG_LIBTOOL
AC_PROG_CC
AC_GNU_SOURCE
AC_PROG_LIBTOOL
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
@ -63,6 +66,17 @@ if test $use_secureplt = true; then
[Define if we should default to creating read-only plt entries])
fi
DEBUGDIR=${libdir}/debug
AC_ARG_WITH(separate-debug-dir,
AS_HELP_STRING([--with-separate-debug-dir=DIR],
[Look for global separate debug info in DIR [[default=LIBDIR/debug]]]),
[DEBUGDIR="${withval}"])
AC_SUBST(DEBUGDIR)
ACX_PKGVERSION([GNU Binutils])
ACX_BUGURL([http://www.sourceware.org/bugzilla/])
AM_BINUTILS_WARNINGS
AM_CONFIG_HEADER(config.h:config.in)
@ -72,6 +86,7 @@ if test -z "$target" ; then
fi
AM_MAINTAINER_MODE
AM_CONDITIONAL(GENINSRC_NEVER, false)
AM_INSTALL_LIBBFD
AC_EXEEXT
@ -81,11 +96,9 @@ bfd_default_target_size=32
# host stuff:
AC_PROG_CC
AC_GNU_SOURCE
ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi"
CY_GNU_GETTEXT
ZW_GNU_GETTEXT_SISTER_DIR
AM_PO_SUBDIRS
# Permit host specific settings.
. ${srcdir}/configure.host
@ -135,6 +148,7 @@ BFD_CC_FOR_BUILD
AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
GCC_HEADER_STDINT(bfd_stdint.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
ACX_HEADER_STRING
@ -178,7 +192,9 @@ if test "${target}" = "${host}"; then
alpha*-*-*) COREFILE=osf-core.lo ;;
arm-*-freebsd* | arm-*-kfreebsd*-gnu)
COREFILE='' ;;
arm-*-netbsd*) COREFILE=netbsd-core.lo ;;
arm-*-netbsd* | arm-*-openbsd*)
COREFILE=netbsd-core.lo
;;
arm-*-riscix) COREFILE=trad-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
@ -361,7 +377,9 @@ changequote([,])dnl
powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
s390*-*-*) COREFILE=trad-core.lo ;;
sh*-*-netbsd*) COREFILE=netbsd-core.lo ;;
sh*-*-netbsd* | sh*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
sparc-*-netbsd* | sparc*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
@ -551,7 +569,7 @@ selarchs="$f"
# Target backend .o files.
tb=
elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo"
elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo"
for vec in $selvecs
do
@ -570,6 +588,10 @@ do
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
@ -580,6 +602,7 @@ do
b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
bfd_efi_app_x86_64_vec) tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
@ -595,6 +618,7 @@ do
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_bigmips_vxworks_vec)
tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
@ -640,6 +664,8 @@ do
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
@ -656,24 +682,29 @@ do
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;;
bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;;
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
@ -705,8 +736,10 @@ do
bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
@ -729,6 +762,7 @@ do
i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
@ -740,6 +774,8 @@ do
i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
@ -890,7 +926,7 @@ fi # all_targets is true
case ${host64}-${target64}-${want64} in
*true*)
wordsize=64
bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)'
bfd64_libs='$(BFD64_LIBS)'
all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
if test $BFD_HOST_64_BIT_DEFINED = 0; then
AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
@ -911,13 +947,12 @@ case ${host64}-${target64}-${want64} in
;;
false-false-false)
wordsize=32
bfd_libs='$(BFD32_LIBS)'
all_backends='$(BFD32_BACKENDS)'
;;
esac
AC_SUBST(wordsize)
AC_SUBST(bfd_libs)
AC_SUBST(bfd64_libs)
AC_SUBST(all_backends)
AC_SUBST(bfd_backends)
AC_SUBST(bfd_machines)
@ -962,7 +997,28 @@ esac
rm -f doc/config.status
AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
AC_CONFIG_COMMANDS([default],[[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]],[[]])
dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of
dnl our two separate POTFILES. Yuck.
AC_CONFIG_COMMANDS([default],
[[
case "$srcdir" in
.) srcdirpre= ;;
*) srcdirpre='$(srcdir)/' ;;
esac
POFILES=
GMOFILES=
for lang in dummy $OBSOLETE_ALL_LINGUAS; do
if test $lang != dummy; then
POFILES="$POFILES $srcdirpre$lang.po"
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
fi
done
sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \
-e '/BLD-POTFILES =/r po/BLD-POTFILES' \
-e "s,@POFILES@,$POFILES," \
-e "s,@GMOFILES@,$GMOFILES," \
po/Makefile.in > po/Makefile]],[[]])
dnl Required by html and install-html
AC_SUBST(datarootdir)

View File

@ -1,6 +1,6 @@
/* Core file generic interface routines for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005,
2007 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -30,8 +30,8 @@ DESCRIPTION
These are functions pertaining to core files.
*/
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
/*

View File

@ -1,5 +1,5 @@
/* BFD support for the Alpha architecture.
Copyright 1992, 1993, 1998, 2000, 2002, 2003
Copyright 1992, 1993, 1998, 2000, 2002, 2003, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \

View File

@ -1,5 +1,6 @@
/* BFD support for the ARC processor
Copyright 1994, 1995, 1997, 2001, 2002 Free Software Foundation, Inc.
Copyright 1994, 1995, 1997, 2001, 2002, 2007
Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define ARC(mach, print_name, default_p, next) \

View File

@ -1,5 +1,5 @@
/* BFD support for the ARM processor
Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005
Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
@ -19,8 +19,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "libiberty.h"
@ -92,7 +92,8 @@ processors[] =
{ bfd_mach_arm_4, "strongarm1100" },
{ bfd_mach_arm_XScale, "xscale" },
{ bfd_mach_arm_ep9312, "ep9312" },
{ bfd_mach_arm_iWMMXt, "iwmmxt" }
{ bfd_mach_arm_iWMMXt, "iwmmxt" },
{ bfd_mach_arm_iWMMXt2, "iwmmxt2" }
};
static bfd_boolean
@ -137,7 +138,8 @@ static const bfd_arch_info_type arch_info_struct[] =
N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]),
N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]),
N (bfd_mach_arm_ep9312, "ep9312", FALSE, & arch_info_struct[11]),
N (bfd_mach_arm_iWMMXt,"iwmmxt", FALSE, NULL)
N (bfd_mach_arm_iWMMXt, "iwmmxt", FALSE, & arch_info_struct[12]),
N (bfd_mach_arm_iWMMXt2, "iwmmxt2", FALSE, NULL)
};
const bfd_arch_info_type bfd_arm_arch =
@ -179,7 +181,9 @@ bfd_arm_merge_machines (bfd *ibfd, bfd *obfd)
Intel XScale binary, since these architecture have co-processors which
will not both be present on the same physical hardware. */
else if (in == bfd_mach_arm_ep9312
&& (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt))
&& (out == bfd_mach_arm_XScale
|| out == bfd_mach_arm_iWMMXt
|| out == bfd_mach_arm_iWMMXt2))
{
_bfd_error_handler (_("\
ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
@ -188,7 +192,9 @@ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
return FALSE;
}
else if (out == bfd_mach_arm_ep9312
&& (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt))
&& (in == bfd_mach_arm_XScale
|| in == bfd_mach_arm_iWMMXt
|| in == bfd_mach_arm_iWMMXt2))
{
_bfd_error_handler (_("\
ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
@ -309,6 +315,7 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section)
case bfd_mach_arm_XScale: expected = "XScale"; break;
case bfd_mach_arm_ep9312: expected = "ep9312"; break;
case bfd_mach_arm_iWMMXt: expected = "iWMMXt"; break;
case bfd_mach_arm_iWMMXt2: expected = "iWMMXt2"; break;
}
if (strcmp (arch_string, expected) != 0)
@ -355,7 +362,8 @@ architectures[] =
{ "armv5te", bfd_mach_arm_5TE },
{ "XScale", bfd_mach_arm_XScale },
{ "ep9312", bfd_mach_arm_ep9312 },
{ "iWMMXt", bfd_mach_arm_iWMMXt }
{ "iWMMXt", bfd_mach_arm_iWMMXt },
{ "iWMMXt2", bfd_mach_arm_iWMMXt2 }
};
/* Extract the machine number stored in a note section. */
@ -402,14 +410,22 @@ bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section)
}
bfd_boolean
bfd_is_arm_mapping_symbol_name (const char * name)
bfd_is_arm_special_symbol_name (const char * name, int type)
{
/* The ARM compiler outputs several obsolete forms. Recognize them
in addition to the standard $a, $t and $d. */
return (name != NULL)
&& (name[0] == '$')
&& ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd')
|| (name[1] == 'm') || (name[1] == 'f') || (name[1] == 'p'))
&& (name[2] == 0 || name[2] == '.');
in addition to the standard $a, $t and $d. We are somewhat loose
in what we accept here, since the full set is not documented. */
if (!name || name[0] != '$')
return FALSE;
if (name[1] == 'a' || name[1] == 't' || name[1] == 'd')
type &= BFD_ARM_SPECIAL_SYM_TYPE_MAP;
else if (name[1] == 'm' || name[1] == 'f' || name[1] == 'p')
type &= BFD_ARM_SPECIAL_SYM_TYPE_TAG;
else if (name[1] >= 'a' && name[1] <= 'z')
type &= BFD_ARM_SPECIAL_SYM_TYPE_OTHER;
else
return FALSE;
return (type != 0 && (name[2] == 0 || name[2] == '.'));
}

View File

@ -0,0 +1,40 @@
/* BFD support for the CR16 processor.
Copyright 2007 Free Software Foundation, Inc.
Written by M R Swami Reddy
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_cr16_arch =
{
16, /* 16 bits in a word. */
32, /* 32 bits in an address. */
8, /* 8 bits in a byte. */
bfd_arch_cr16, /* enum bfd_architecture arch. */
bfd_mach_cr16,
"cr16", /* Arch name. */
"cr16", /* Printable name. */
1, /* Unsigned int section alignment power. */
TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan ,
0,
};

View File

@ -1,5 +1,5 @@
/* BFD support for the Intel 386 architecture.
Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004
Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =

View File

@ -1,5 +1,5 @@
/* BFD support for the ia64 architecture.
Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000, 2002, 2007 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_ia64_elf32_arch =

View File

@ -0,0 +1,28 @@
/* BFD support for the Toshiba Media Engine Processor.
Copyright (C) 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define MA(x, n, def, y) { 32, 32, 8, bfd_arch_mep, x, "mep", n, \
2, def, bfd_default_compatible, bfd_default_scan, y }
static const bfd_arch_info_type bfd_h1_arch = MA (bfd_mach_mep_h1, "h1", FALSE, NULL);
const bfd_arch_info_type bfd_mep_arch = MA (bfd_mach_mep, "mep", TRUE, & bfd_h1_arch);

View File

@ -1,6 +1,6 @@
/* bfd back-end for mips support
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
2002, 2003, 2004 Free Software Foundation, Inc.
2002, 2003, 2004, 2007 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
static const bfd_arch_info_type *mips_compatible

View File

@ -1,5 +1,5 @@
/* BFD PowerPC CPU definition
Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003
Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2007
Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
/* The common PowerPC architecture is compatible with the RS/6000. */

View File

@ -1,11 +1,7 @@
/* BFD back-end for rs6000 support
Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003
Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2007
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
them with octal escapes), and isn't useful without an understanding of what
character set it is.
Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM
Written by Mimi Phuong-Thao Vo of IBM
and John Gilmore of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -24,8 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
/* The RS/6000 architecture is compatible with the PowerPC common

View File

@ -1,5 +1,5 @@
/* BFD support for the s390 processor.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
@ -19,8 +19,8 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_s390_64_arch =

View File

@ -0,0 +1,51 @@
/* BFD support for the score processor
Copyright 2006, 2007 Free Software Foundation, Inc.
Contributed by
Mei Ligang (ligang@sunnorth.com.cn)
Pei-Lin Tsai (pltsai@sunplus.com)
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
const bfd_arch_info_type
bfd_score_arch =
{
32, /* There's 32 bits_per_word. */
32, /* There's 32 bits_per_address. */
8, /* There's 8 bits_per_byte. */
bfd_arch_score, /* One of enum bfd_architecture, defined
in archures.c and provided in
generated header files. */
0, /* Only 1 machine, but #255 for
historical reasons. */
"score", /* The arch_name. */
"score", /* The printable name is the same. */
4, /* Section alignment power; each section
is aligned to (only) 2^4 bytes. */
TRUE, /* This is the default "machine", since
there's only one. */
bfd_default_compatible, /* A default function for testing
"machine" compatibility of two
bfd_arch_info_type. */
bfd_default_scan, /* Check if an bfd_arch_info_type is a
match. */
NULL /* Pointer to next bfd_arch_info_type in
the same family. */
};

View File

@ -1,5 +1,5 @@
/* BFD support for the SPARC architecture.
Copyright 1992, 1995, 1996, 1998, 2000, 2002
Copyright 1992, 1995, 1996, 1998, 2000, 2002, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
static const bfd_arch_info_type arch_info_struct[] =

View File

@ -0,0 +1,54 @@
/* Copyright 2006, 2007 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
static const bfd_arch_info_type *
spu_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
{
BFD_ASSERT (a->arch == bfd_arch_spu);
switch (b->arch)
{
default:
return NULL;
case bfd_arch_spu:
return bfd_default_compatible (a, b);
}
/*NOTREACHED*/
}
const bfd_arch_info_type bfd_spu_arch[] =
{
{
32, /* 32 bits in a word */
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_spu, /* architecture */
bfd_mach_spu, /* machine */
"spu", /* architecture name */
"spu:256K", /* printable name */
3, /* aligned power */
TRUE, /* the default machine for the architecture */
spu_compatible, /* the spu is only compatible with itself, see above */
bfd_default_scan,
0, /* next -- there are none! */
}
};

View File

@ -1,7 +1,56 @@
2007-07-02 Alan Modra <amodra@bigpond.net.au>
* Makefile.in: Regenerate.
2007-06-30 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Likewise.
2007-06-14 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Regenerated.
2007-05-22 Nick Clifton <nickc@redhat.com>
* bfd.texinfo: Use @copying around the copyright notice.
* bfdint.texi: Likewise.
2007-05-21 Nick Clifton <nickc@redhat.com>
* bfdint.texi: Add GNU Free Documentation License notice.
2007-04-24 Alan Modra <amodra@bigpond.net.au>
* Makefile.in: Regenerate.
2007-02-17 Mark Mitchell <mark@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Vladimir Prus <vladimir@codesourcery.com
Joseph Myers <joseph@codesourcery.com>
* Makefile.in: Regenerate.
2006-07-24 Ralk Wildenhues <Ralf.Wildenhues@gmx.de>
* bfd..texinfo: Fix spelling mistakes.
* bfdint.texinfo: Likewise.
2006-07-18 Nigel Stephens <nigel@mips.com>
* bfd.texinfo: Add @section for "What to Put Where".
2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
* bfd.texinfo: Remove local @tex code.
2006-06-05 Alan Modra <amodra@bigpond.net.au>
* Makefile.in: Regenerate.
2006-05-11 Carlos O'Donell <carlos@codesourcery.com>
* bfd.texinfo: Rename "Index" to "BFD Index"
2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.am: Add install-html and install-html-am targets.

View File

@ -8,7 +8,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
libbfd.texi bfdwin.texi bfdio.texi \
opncls.texi reloc.texi section.texi \
syms.texi targets.texi init.texi hash.texi linker.texi \
mmo.texi
mmo.texi \
bfdver.texi
PROTOS = archive.p archures.p bfd.p \
core.p format.p \
@ -51,6 +52,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
TEXIDIR = $(srcdir)/../../texinfo/fsf
info_TEXINFOS = bfd.texinfo
bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi
MKDOC = chew$(EXEEXT_FOR_BUILD)
@ -68,8 +70,6 @@ chew.o: chew.c
protos: libbfd.h libcoff.h bfd.h
$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo
# We can't replace these rules with an implicit rule, because
# makes without VPATH support couldn't find the .h files in `..'.
@ -274,6 +274,17 @@ bfd.h: $(BFD_H_DEP)
echo "#endif" >> $@
echo "#endif" >> $@
bfdver.texi: $(srcdir)/Makefile.in
@echo "creating $@"; \
echo "@set VERSION $(VERSION)" > bfdver.texi; \
if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
fi; \
echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
if [ -n "$(REPORT_BUGS_TEXI)" ]; then \
echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
fi
noinst_TEXINFOS = bfdint.texi
MOSTLYCLEANFILES = $(MKDOC) *.o
@ -309,6 +320,11 @@ install-html-am: $(HTMLS)
fi; \
done
MAINTAINERCLEANFILES += bfd.info
# Automake 1.9 will only build info files in the objdir if they are
# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
# though, so we use a bogus condition.
if GENINSRC_NEVER
DISTCLEANFILES += bfd.info
endif

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -36,13 +36,26 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
# Automake 1.9 will only build info files in the objdir if they are
# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
# though, so we use a bogus condition.
@GENINSRC_NEVER_TRUE@am__append_1 = bfd.info
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(bfd_TEXINFOS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \
$(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gettext-sister.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \
$(top_srcdir)/../config/progtest.m4 \
$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \
$(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
@ -51,7 +64,7 @@ CONFIG_CLEAN_FILES =
depcomp =
am__depfiles_maybe =
SOURCES =
INFO_DEPS = $(srcdir)/bfd.info
INFO_DEPS = bfd.info
TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
DVIS = bfd.dvi
@ -69,7 +82,6 @@ MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
@ -95,20 +107,24 @@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEBUGDIR = @DEBUGDIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GMOFILES = @GMOFILES@
FGREP = @FGREP@
GENCAT = @GENCAT@
GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
GREP = @GREP@
HDEFINES = @HDEFINES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INCINTL = @INCINTL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@
INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@
@ -116,10 +132,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBINTL = @LIBINTL@
LIBINTL_DEP = @LIBINTL_DEP@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@ -131,6 +147,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NM = @NM@
NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@ -140,14 +158,16 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POFILES = @POFILES@
PKGVERSION = @PKGVERSION@
POSUB = @POSUB@
RANLIB = @RANLIB@
REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
REPORT_BUGS_TO = @REPORT_BUGS_TO@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TDEFINES = @TDEFINES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
@ -156,6 +176,7 @@ WIN32LIBADD = @WIN32LIBADD@
XGETTEXT = @XGETTEXT@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
all_backends = @all_backends@
@ -166,10 +187,10 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bfd64_libs = @bfd64_libs@
bfd_backends = @bfd_backends@
bfd_default_target_size = @bfd_default_target_size@
bfd_file_ptr = @bfd_file_ptr@
bfd_libs = @bfd_libs@
bfd_machines = @bfd_machines@
bfd_ufile_ptr = @bfd_ufile_ptr@
bfdincludedir = @bfdincludedir@
@ -194,10 +215,10 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
l = @l@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@ -221,7 +242,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
libbfd.texi bfdwin.texi bfdio.texi \
opncls.texi reloc.texi section.texi \
syms.texi targets.texi init.texi hash.texi linker.texi \
mmo.texi
mmo.texi \
bfdver.texi
PROTOS = archive.p archures.p bfd.p \
core.p format.p \
@ -263,6 +285,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
TEXIDIR = $(srcdir)/../../texinfo/fsf
info_TEXINFOS = bfd.texinfo
bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi
MKDOC = chew$(EXEEXT_FOR_BUILD)
INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \
-I$(srcdir)/../../intl -I../../intl
@ -314,13 +337,14 @@ BFD_H_DEP = \
noinst_TEXINFOS = bfdint.texi
MOSTLYCLEANFILES = $(MKDOC) *.o
CLEANFILES = *.p *.ip
DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
MAINTAINERCLEANFILES = $(DOCFILES)
DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log \
$(am__append_1)
MAINTAINERCLEANFILES = $(DOCFILES) bfd.info
html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
all: all-am
.SUFFIXES:
.SUFFIXES: .dvi .html .info .pdf .ps .texinfo
.SUFFIXES: .dvi .ps
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@ -330,9 +354,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign doc/Makefile
$(AUTOMAKE) --cygnus doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -360,40 +384,38 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
.texinfo.info:
bfd.info: bfd.texinfo $(bfd_TEXINFOS)
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && cd $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
cd "$$am__cwd"; \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $@ $<; \
-o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \
then \
rc=0; \
cd $(srcdir); \
else \
rc=$$?; \
cd $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
.texinfo.dvi:
bfd.dvi: bfd.texinfo $(bfd_TEXINFOS)
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) $<
$(TEXI2DVI) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo
.texinfo.pdf:
bfd.pdf: bfd.texinfo $(bfd_TEXINFOS)
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2PDF) $<
$(TEXI2PDF) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo
.texinfo.html:
bfd.html: bfd.texinfo $(bfd_TEXINFOS)
rm -rf $(@:.html=.htp)
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
-o $(@:.html=.htp) `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \
then \
rm -rf $@; \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
@ -403,11 +425,8 @@ distclean-libtool:
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
$(srcdir)/bfd.info: bfd.texinfo
bfd.dvi: bfd.texinfo
bfd.pdf: bfd.texinfo
bfd.html: bfd.texinfo
.dvi.ps:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) -o $@ $<
uninstall-info-am:
@ -600,8 +619,6 @@ chew.o: chew.c
protos: libbfd.h libcoff.h bfd.h
$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo
# We can't replace these rules with an implicit rule, because
# makes without VPATH support couldn't find the .h files in `..'.
@ -762,6 +779,17 @@ bfd.h: $(BFD_H_DEP)
echo "#endif" >> $@
echo "#endif" >> $@
bfdver.texi: $(srcdir)/Makefile.in
@echo "creating $@"; \
echo "@set VERSION $(VERSION)" > bfdver.texi; \
if [ -n "$(PKGVERSION)" ]; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
fi; \
echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
if [ -n "$(REPORT_BUGS_TEXI)" ]; then \
echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
fi
# We want install to imply install-info as per GNU standards, despite the
# cygnus option.
install: install-info

View File

@ -1,213 +0,0 @@
@section a.out backends
@strong{Description}@*
BFD supports a number of different flavours of a.out format,
though the major differences are only the sizes of the
structures on disk, and the shape of the relocation
information.
The support is split into a basic support file @file{aoutx.h}
and other files which derive functions from the base. One
derivation file is @file{aoutf1.h} (for a.out flavour 1), and
adds to the basic a.out functions support for sun3, sun4, 386
and 29k a.out files, to create a target jump vector for a
specific target.
This information is further split out into more specific files
for each machine, including @file{sunos.c} for sun3 and sun4,
@file{newsos3.c} for the Sony NEWS, and @file{demo64.c} for a
demonstration of a 64 bit a.out format.
The base file @file{aoutx.h} defines general mechanisms for
reading and writing records to and from disk and various
other methods which BFD requires. It is included by
@file{aout32.c} and @file{aout64.c} to form the names
@code{aout_32_swap_exec_header_in}, @code{aout_64_swap_exec_header_in}, etc.
As an example, this is what goes on to make the back end for a
sun4, from @file{aout32.c}:
@example
#define ARCH_SIZE 32
#include "aoutx.h"
@end example
Which exports names:
@example
...
aout_32_canonicalize_reloc
aout_32_find_nearest_line
aout_32_get_lineno
aout_32_get_reloc_upper_bound
...
@end example
from @file{sunos.c}:
@example
#define TARGET_NAME "a.out-sunos-big"
#define VECNAME sunos_big_vec
#include "aoutf1.h"
@end example
requires all the names from @file{aout32.c}, and produces the jump vector
@example
sunos_big_vec
@end example
The file @file{host-aout.c} is a special case. It is for a large set
of hosts that use ``more or less standard'' a.out files, and
for which cross-debugging is not interesting. It uses the
standard 32-bit a.out support routines, but determines the
file offsets and addresses of the text, data, and BSS
sections, the machine architecture and machine type, and the
entry point address, in a host-dependent manner. Once these
values have been determined, generic code is used to handle
the object file.
When porting it to run on a new system, you must supply:
@example
HOST_PAGE_SIZE
HOST_SEGMENT_SIZE
HOST_MACHINE_ARCH (optional)
HOST_MACHINE_MACHINE (optional)
HOST_TEXT_START_ADDR
HOST_STACK_END_ADDR
@end example
in the file @file{../include/sys/h-@var{XXX}.h} (for your host). These
values, plus the structures and macros defined in @file{a.out.h} on
your host system, will produce a BFD target that will access
ordinary a.out files on your host. To configure a new machine
to use @file{host-aout.c}, specify:
@example
TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
TDEPFILES= host-aout.o trad-core.o
@end example
in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in}
to use the
@file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your
configuration is selected.
@subsection Relocations
@strong{Description}@*
The file @file{aoutx.h} provides for both the @emph{standard}
and @emph{extended} forms of a.out relocation records.
The standard records contain only an
address, a symbol index, and a type field. The extended records
(used on 29ks and sparcs) also have a full integer for an
addend.
@subsection Internal entry points
@strong{Description}@*
@file{aoutx.h} exports several routines for accessing the
contents of an a.out file, which are gathered and exported in
turn by various format specific files (eg sunos.c).
@findex aout_@var{size}_swap_exec_header_in
@subsubsection @code{aout_@var{size}_swap_exec_header_in}
@strong{Synopsis}
@example
void aout_@var{size}_swap_exec_header_in,
(bfd *abfd,
struct external_exec *bytes,
struct internal_exec *execp);
@end example
@strong{Description}@*
Swap the information in an executable header @var{raw_bytes} taken
from a raw byte stream memory image into the internal exec header
structure @var{execp}.
@findex aout_@var{size}_swap_exec_header_out
@subsubsection @code{aout_@var{size}_swap_exec_header_out}
@strong{Synopsis}
@example
void aout_@var{size}_swap_exec_header_out
(bfd *abfd,
struct internal_exec *execp,
struct external_exec *raw_bytes);
@end example
@strong{Description}@*
Swap the information in an internal exec header structure
@var{execp} into the buffer @var{raw_bytes} ready for writing to disk.
@findex aout_@var{size}_some_aout_object_p
@subsubsection @code{aout_@var{size}_some_aout_object_p}
@strong{Synopsis}
@example
const bfd_target *aout_@var{size}_some_aout_object_p
(bfd *abfd,
struct internal_exec *execp,
const bfd_target *(*callback_to_real_object_p) (bfd *));
@end example
@strong{Description}@*
Some a.out variant thinks that the file open in @var{abfd}
checking is an a.out file. Do some more checking, and set up
for access if it really is. Call back to the calling
environment's "finish up" function just before returning, to
handle any last-minute setup.
@findex aout_@var{size}_mkobject
@subsubsection @code{aout_@var{size}_mkobject}
@strong{Synopsis}
@example
bfd_boolean aout_@var{size}_mkobject, (bfd *abfd);
@end example
@strong{Description}@*
Initialize BFD @var{abfd} for use with a.out files.
@findex aout_@var{size}_machine_type
@subsubsection @code{aout_@var{size}_machine_type}
@strong{Synopsis}
@example
enum machine_type aout_@var{size}_machine_type
(enum bfd_architecture arch,
unsigned long machine,
bfd_boolean *unknown);
@end example
@strong{Description}@*
Keep track of machine architecture and machine type for
a.out's. Return the @code{machine_type} for a particular
architecture and machine, or @code{M_UNKNOWN} if that exact architecture
and machine can't be represented in a.out format.
If the architecture is understood, machine type 0 (default)
is always understood.
@findex aout_@var{size}_set_arch_mach
@subsubsection @code{aout_@var{size}_set_arch_mach}
@strong{Synopsis}
@example
bfd_boolean aout_@var{size}_set_arch_mach,
(bfd *,
enum bfd_architecture arch,
unsigned long machine);
@end example
@strong{Description}@*
Set the architecture and the machine of the BFD @var{abfd} to the
values @var{arch} and @var{machine}. Verify that @var{abfd}'s format
can support the architecture required.
@findex aout_@var{size}_new_section_hook
@subsubsection @code{aout_@var{size}_new_section_hook}
@strong{Synopsis}
@example
bfd_boolean aout_@var{size}_new_section_hook,
(bfd *abfd,
asection *newsect);
@end example
@strong{Description}@*
Called by the BFD in response to a @code{bfd_make_section}
request.

View File

@ -1,99 +0,0 @@
@section Archives
@strong{Description}@*
An archive (or library) is just another BFD. It has a symbol
table, although there's not much a user program will do with it.
The big difference between an archive BFD and an ordinary BFD
is that the archive doesn't have sections. Instead it has a
chain of BFDs that are considered its contents. These BFDs can
be manipulated like any other. The BFDs contained in an
archive opened for reading will all be opened for reading. You
may put either input or output BFDs into an archive opened for
output; they will be handled correctly when the archive is closed.
Use @code{bfd_openr_next_archived_file} to step through
the contents of an archive opened for input. You don't
have to read the entire archive if you don't want
to! Read it until you find what you want.
Archive contents of output BFDs are chained through the
@code{next} pointer in a BFD. The first one is findable through
the @code{archive_head} slot of the archive. Set it with
@code{bfd_set_archive_head} (q.v.). A given BFD may be in only one
open output archive at a time.
As expected, the BFD archive code is more general than the
archive code of any given environment. BFD archives may
contain files of different formats (e.g., a.out and coff) and
even different architectures. You may even place archives
recursively into archives!
This can cause unexpected confusion, since some archive
formats are more expressive than others. For instance, Intel
COFF archives can preserve long filenames; SunOS a.out archives
cannot. If you move a file from the first to the second
format and back again, the filename may be truncated.
Likewise, different a.out environments have different
conventions as to how they truncate filenames, whether they
preserve directory names in filenames, etc. When
interoperating with native tools, be sure your files are
homogeneous.
Beware: most of these formats do not react well to the
presence of spaces in filenames. We do the best we can, but
can't always handle this case due to restrictions in the format of
archives. Many Unix utilities are braindead in regards to
spaces and such in filenames anyway, so this shouldn't be much
of a restriction.
Archives are supported in BFD in @code{archive.c}.
@subsection Archive functions
@findex bfd_get_next_mapent
@subsubsection @code{bfd_get_next_mapent}
@strong{Synopsis}
@example
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
@end example
@strong{Description}@*
Step through archive @var{abfd}'s symbol table (if it
has one). Successively update @var{sym} with the next symbol's
information, returning that symbol's (internal) index into the
symbol table.
Supply @code{BFD_NO_MORE_SYMBOLS} as the @var{previous} entry to get
the first one; returns @code{BFD_NO_MORE_SYMBOLS} when you've already
got the last one.
A @code{carsym} is a canonical archive symbol. The only
user-visible element is its name, a null-terminated string.
@findex bfd_set_archive_head
@subsubsection @code{bfd_set_archive_head}
@strong{Synopsis}
@example
bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
@end example
@strong{Description}@*
Set the head of the chain of
BFDs contained in the archive @var{output} to @var{new_head}.
@findex bfd_openr_next_archived_file
@subsubsection @code{bfd_openr_next_archived_file}
@strong{Synopsis}
@example
bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
@end example
@strong{Description}@*
Provided a BFD, @var{archive}, containing an archive and NULL, open
an input BFD on the first contained element and returns that.
Subsequent calls should pass
the archive and the previous return value to return a created
BFD to the next contained element. NULL is returned when there
are no more.

View File

@ -1,585 +0,0 @@
@section Architectures
BFD keeps one atom in a BFD describing the
architecture of the data attached to the BFD: a pointer to a
@code{bfd_arch_info_type}.
Pointers to structures can be requested independently of a BFD
so that an architecture's information can be interrogated
without access to an open BFD.
The architecture information is provided by each architecture package.
The set of default architectures is selected by the macro
@code{SELECT_ARCHITECTURES}. This is normally set up in the
@file{config/@var{target}.mt} file of your choice. If the name is not
defined, then all the architectures supported are included.
When BFD starts up, all the architectures are called with an
initialize method. It is up to the architecture back end to
insert as many items into the list of architectures as it wants to;
generally this would be one for each machine and one for the
default case (an item with a machine field of 0).
BFD's idea of an architecture is implemented in @file{archures.c}.
@subsection bfd_architecture
@strong{Description}@*
This enum gives the object file's CPU architecture, in a
global sense---i.e., what processor family does it belong to?
Another field indicates which processor within
the family is in use. The machine gives a number which
distinguishes different versions of the architecture,
containing, for example, 2 and 3 for Intel i960 KA and i960 KB,
and 68020 and 68030 for Motorola 68020 and 68030.
@example
enum bfd_architecture
@{
bfd_arch_unknown, /* File arch not known. */
bfd_arch_obscure, /* Arch known, not one of these. */
bfd_arch_m68k, /* Motorola 68xxx */
#define bfd_mach_m68000 1
#define bfd_mach_m68008 2
#define bfd_mach_m68010 3
#define bfd_mach_m68020 4
#define bfd_mach_m68030 5
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf_isa_a_nodiv 9
#define bfd_mach_mcf_isa_a 10
#define bfd_mach_mcf_isa_a_mac 11
#define bfd_mach_mcf_isa_a_emac 12
#define bfd_mach_mcf_isa_aplus 13
#define bfd_mach_mcf_isa_aplus_mac 14
#define bfd_mach_mcf_isa_aplus_emac 15
#define bfd_mach_mcf_isa_b_nousp 16
#define bfd_mach_mcf_isa_b_nousp_mac 17
#define bfd_mach_mcf_isa_b_nousp_emac 18
#define bfd_mach_mcf_isa_b 19
#define bfd_mach_mcf_isa_b_mac 20
#define bfd_mach_mcf_isa_b_emac 21
#define bfd_mach_mcf_isa_b_float 22
#define bfd_mach_mcf_isa_b_float_mac 23
#define bfd_mach_mcf_isa_b_float_emac 24
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
lower number indicates a machine type that
only accepts a subset of the instructions
available to machines with higher numbers.
The exception is the "ca", which is
incompatible with all other machines except
"core". */
#define bfd_mach_i960_core 1
#define bfd_mach_i960_ka_sa 2
#define bfd_mach_i960_kb_sb 3
#define bfd_mach_i960_mc 4
#define bfd_mach_i960_xa 5
#define bfd_mach_i960_ca 6
#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
bfd_arch_or32, /* OpenRISC 32 */
bfd_arch_sparc, /* SPARC */
#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
#define bfd_mach_sparc_sparclet 2
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
&& (mach) != bfd_mach_sparc_sparclite_le)
/* Nonzero if MACH is a 64 bit sparc architecture. */
#define bfd_mach_sparc_64bit_p(mach) \
((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
#define bfd_mach_mips4000 4000
#define bfd_mach_mips4010 4010
#define bfd_mach_mips4100 4100
#define bfd_mach_mips4111 4111
#define bfd_mach_mips4120 4120
#define bfd_mach_mips4300 4300
#define bfd_mach_mips4400 4400
#define bfd_mach_mips4600 4600
#define bfd_mach_mips4650 4650
#define bfd_mach_mips5000 5000
#define bfd_mach_mips5400 5400
#define bfd_mach_mips5500 5500
#define bfd_mach_mips6000 6000
#define bfd_mach_mips7000 7000
#define bfd_mach_mips8000 8000
#define bfd_mach_mips9000 9000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips12000 12000
#define bfd_mach_mips16 16
#define bfd_mach_mips5 5
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
#define bfd_mach_mipsisa32 32
#define bfd_mach_mipsisa32r2 33
#define bfd_mach_mipsisa64 64
#define bfd_mach_mipsisa64r2 65
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 1
#define bfd_mach_i386_i8086 2
#define bfd_mach_i386_i386_intel_syntax 3
#define bfd_mach_x86_64 64
#define bfd_mach_x86_64_intel_syntax 65
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
bfd_arch_i370, /* IBM 360/370 Mainframes */
bfd_arch_romp, /* IBM ROMP PC/RT */
bfd_arch_convex, /* Convex */
bfd_arch_m88k, /* Motorola 88xxx */
bfd_arch_m98k, /* Motorola 98xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
#define bfd_mach_h8300 1
#define bfd_mach_h8300h 2
#define bfd_mach_h8300s 3
#define bfd_mach_h8300hn 4
#define bfd_mach_h8300sn 5
#define bfd_mach_h8300sx 6
#define bfd_mach_h8300sxn 7
bfd_arch_pdp11, /* DEC PDP-11 */
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 32
#define bfd_mach_ppc64 64
#define bfd_mach_ppc_403 403
#define bfd_mach_ppc_403gc 4030
#define bfd_mach_ppc_505 505
#define bfd_mach_ppc_601 601
#define bfd_mach_ppc_602 602
#define bfd_mach_ppc_603 603
#define bfd_mach_ppc_ec603e 6031
#define bfd_mach_ppc_604 604
#define bfd_mach_ppc_620 620
#define bfd_mach_ppc_630 630
#define bfd_mach_ppc_750 750
#define bfd_mach_ppc_860 860
#define bfd_mach_ppc_a35 35
#define bfd_mach_ppc_rs64ii 642
#define bfd_mach_ppc_rs64iii 643
#define bfd_mach_ppc_7400 7400
#define bfd_mach_ppc_e500 500
bfd_arch_rs6000, /* IBM RS/6000 */
#define bfd_mach_rs6k 6000
#define bfd_mach_rs6k_rs1 6001
#define bfd_mach_rs6k_rsc 6003
#define bfd_mach_rs6k_rs2 6002
bfd_arch_hppa, /* HP PA RISC */
#define bfd_mach_hppa10 10
#define bfd_mach_hppa11 11
#define bfd_mach_hppa20 20
#define bfd_mach_hppa20w 25
bfd_arch_d10v, /* Mitsubishi D10V */
#define bfd_mach_d10v 1
#define bfd_mach_d10v_ts2 2
#define bfd_mach_d10v_ts3 3
bfd_arch_d30v, /* Mitsubishi D30V */
bfd_arch_dlx, /* DLX */
bfd_arch_m68hc11, /* Motorola 68HC11 */
bfd_arch_m68hc12, /* Motorola 68HC12 */
#define bfd_mach_m6812_default 0
#define bfd_mach_m6812 1
#define bfd_mach_m6812s 2
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
#define bfd_mach_sh 1
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
#define bfd_mach_sh2a 0x2a
#define bfd_mach_sh2a_nofpu 0x2b
#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
#define bfd_mach_sh2a_or_sh4 0x2a3
#define bfd_mach_sh2a_or_sh3e 0x2a4
#define bfd_mach_sh2e 0x2e
#define bfd_mach_sh3 0x30
#define bfd_mach_sh3_nommu 0x31
#define bfd_mach_sh3_dsp 0x3d
#define bfd_mach_sh3e 0x3e
#define bfd_mach_sh4 0x40
#define bfd_mach_sh4_nofpu 0x41
#define bfd_mach_sh4_nommu_nofpu 0x42
#define bfd_mach_sh4a 0x4a
#define bfd_mach_sh4a_nofpu 0x4b
#define bfd_mach_sh4al_dsp 0x4d
#define bfd_mach_sh5 0x50
bfd_arch_alpha, /* Dec Alpha */
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_alpha_ev6 0x30
bfd_arch_arm, /* Advanced Risc Machines ARM. */
#define bfd_mach_arm_unknown 0
#define bfd_mach_arm_2 1
#define bfd_mach_arm_2a 2
#define bfd_mach_arm_3 3
#define bfd_mach_arm_3M 4
#define bfd_mach_arm_4 5
#define bfd_mach_arm_4T 6
#define bfd_mach_arm_5 7
#define bfd_mach_arm_5T 8
#define bfd_mach_arm_5TE 9
#define bfd_mach_arm_XScale 10
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
#define bfd_mach_tic3x 30
#define bfd_mach_tic4x 40
bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
bfd_arch_tic80, /* TI TMS320c80 (MVP) */
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 1
#define bfd_mach_v850e 'E'
#define bfd_mach_v850e1 '1'
bfd_arch_arc, /* ARC Cores */
#define bfd_mach_arc_5 5
#define bfd_mach_arc_6 6
#define bfd_mach_arc_7 7
#define bfd_mach_arc_8 8
bfd_arch_m32c, /* Renesas M16C/M32C. */
#define bfd_mach_m16c 0x75
#define bfd_mach_m32c 0x78
bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
#define bfd_mach_m32r 1 /* For backwards compatibility. */
#define bfd_mach_m32rx 'x'
#define bfd_mach_m32r2 '2'
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
#define bfd_mach_mn10300 300
#define bfd_mach_am33 330
#define bfd_mach_am33_2 332
bfd_arch_fr30,
#define bfd_mach_fr30 0x46523330
bfd_arch_frv,
#define bfd_mach_frv 1
#define bfd_mach_frvsimple 2
#define bfd_mach_fr300 300
#define bfd_mach_fr400 400
#define bfd_mach_fr450 450
#define bfd_mach_frvtomcat 499 /* fr500 prototype */
#define bfd_mach_fr500 500
#define bfd_mach_fr550 550
bfd_arch_mcore,
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 64
#define bfd_mach_ia64_elf32 32
bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
#define bfd_mach_ip2022 1
#define bfd_mach_ip2022ext 2
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
bfd_arch_mt,
#define bfd_mach_ms1 1
#define bfd_mach_mrisc2 2
#define bfd_mach_ms2 3
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
#define bfd_mach_avr2 2
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
#define bfd_mach_avr5 5
bfd_arch_bfin, /* ADI Blackfin */
#define bfd_mach_bfin 1
bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
#define bfd_mach_cr16c 1
bfd_arch_crx, /* National Semiconductor CRX. */
#define bfd_mach_crx 1
bfd_arch_cris, /* Axis CRIS */
#define bfd_mach_cris_v0_v10 255
#define bfd_mach_cris_v32 32
#define bfd_mach_cris_v10_v32 1032
bfd_arch_s390, /* IBM s390 */
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
bfd_arch_openrisc, /* OpenRISC */
bfd_arch_mmix, /* Donald Knuth's educational processor. */
bfd_arch_xstormy16,
#define bfd_mach_xstormy16 1
bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
#define bfd_mach_msp11 11
#define bfd_mach_msp110 110
#define bfd_mach_msp12 12
#define bfd_mach_msp13 13
#define bfd_mach_msp14 14
#define bfd_mach_msp15 15
#define bfd_mach_msp16 16
#define bfd_mach_msp21 21
#define bfd_mach_msp31 31
#define bfd_mach_msp32 32
#define bfd_mach_msp33 33
#define bfd_mach_msp41 41
#define bfd_mach_msp42 42
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
bfd_arch_xc16x, /* Infineon's XC16X Series. */
#define bfd_mach_xc16x 1
#define bfd_mach_xc16xl 2
#define bfd_mach_xc16xs 3
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_maxq, /* Dallas MAXQ 10/20 */
#define bfd_mach_maxq10 10
#define bfd_mach_maxq20 20
bfd_arch_z80,
#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
#define bfd_mach_z80full 7 /* All undocumented instructions. */
#define bfd_mach_r800 11 /* R800: successor with multiplication. */
bfd_arch_last
@};
@end example
@subsection bfd_arch_info
@strong{Description}@*
This structure contains information on architectures for use
within BFD.
@example
typedef struct bfd_arch_info
@{
int bits_per_word;
int bits_per_address;
int bits_per_byte;
enum bfd_architecture arch;
unsigned long mach;
const char *arch_name;
const char *printable_name;
unsigned int section_align_power;
/* TRUE if this is the default machine for the architecture.
The default arch should be the first entry for an arch so that
all the entries for that arch can be accessed via @code{next}. */
bfd_boolean the_default;
const struct bfd_arch_info * (*compatible)
(const struct bfd_arch_info *a, const struct bfd_arch_info *b);
bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
const struct bfd_arch_info *next;
@}
bfd_arch_info_type;
@end example
@findex bfd_printable_name
@subsubsection @code{bfd_printable_name}
@strong{Synopsis}
@example
const char *bfd_printable_name (bfd *abfd);
@end example
@strong{Description}@*
Return a printable string representing the architecture and machine
from the pointer to the architecture info structure.
@findex bfd_scan_arch
@subsubsection @code{bfd_scan_arch}
@strong{Synopsis}
@example
const bfd_arch_info_type *bfd_scan_arch (const char *string);
@end example
@strong{Description}@*
Figure out if BFD supports any cpu which could be described with
the name @var{string}. Return a pointer to an @code{arch_info}
structure if a machine is found, otherwise NULL.
@findex bfd_arch_list
@subsubsection @code{bfd_arch_list}
@strong{Synopsis}
@example
const char **bfd_arch_list (void);
@end example
@strong{Description}@*
Return a freshly malloced NULL-terminated vector of the names
of all the valid BFD architectures. Do not modify the names.
@findex bfd_arch_get_compatible
@subsubsection @code{bfd_arch_get_compatible}
@strong{Synopsis}
@example
const bfd_arch_info_type *bfd_arch_get_compatible
(const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
@end example
@strong{Description}@*
Determine whether two BFDs' architectures and machine types
are compatible. Calculates the lowest common denominator
between the two architectures and machine types implied by
the BFDs and returns a pointer to an @code{arch_info} structure
describing the compatible machine.
@findex bfd_default_arch_struct
@subsubsection @code{bfd_default_arch_struct}
@strong{Description}@*
The @code{bfd_default_arch_struct} is an item of
@code{bfd_arch_info_type} which has been initialized to a fairly
generic state. A BFD starts life by pointing to this
structure, until the correct back end has determined the real
architecture of the file.
@example
extern const bfd_arch_info_type bfd_default_arch_struct;
@end example
@findex bfd_set_arch_info
@subsubsection @code{bfd_set_arch_info}
@strong{Synopsis}
@example
void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
@end example
@strong{Description}@*
Set the architecture info of @var{abfd} to @var{arg}.
@findex bfd_default_set_arch_mach
@subsubsection @code{bfd_default_set_arch_mach}
@strong{Synopsis}
@example
bfd_boolean bfd_default_set_arch_mach
(bfd *abfd, enum bfd_architecture arch, unsigned long mach);
@end example
@strong{Description}@*
Set the architecture and machine type in BFD @var{abfd}
to @var{arch} and @var{mach}. Find the correct
pointer to a structure and insert it into the @code{arch_info}
pointer.
@findex bfd_get_arch
@subsubsection @code{bfd_get_arch}
@strong{Synopsis}
@example
enum bfd_architecture bfd_get_arch (bfd *abfd);
@end example
@strong{Description}@*
Return the enumerated type which describes the BFD @var{abfd}'s
architecture.
@findex bfd_get_mach
@subsubsection @code{bfd_get_mach}
@strong{Synopsis}
@example
unsigned long bfd_get_mach (bfd *abfd);
@end example
@strong{Description}@*
Return the long type which describes the BFD @var{abfd}'s
machine.
@findex bfd_arch_bits_per_byte
@subsubsection @code{bfd_arch_bits_per_byte}
@strong{Synopsis}
@example
unsigned int bfd_arch_bits_per_byte (bfd *abfd);
@end example
@strong{Description}@*
Return the number of bits in one of the BFD @var{abfd}'s
architecture's bytes.
@findex bfd_arch_bits_per_address
@subsubsection @code{bfd_arch_bits_per_address}
@strong{Synopsis}
@example
unsigned int bfd_arch_bits_per_address (bfd *abfd);
@end example
@strong{Description}@*
Return the number of bits in one of the BFD @var{abfd}'s
architecture's addresses.
@findex bfd_default_compatible
@subsubsection @code{bfd_default_compatible}
@strong{Synopsis}
@example
const bfd_arch_info_type *bfd_default_compatible
(const bfd_arch_info_type *a, const bfd_arch_info_type *b);
@end example
@strong{Description}@*
The default function for testing for compatibility.
@findex bfd_default_scan
@subsubsection @code{bfd_default_scan}
@strong{Synopsis}
@example
bfd_boolean bfd_default_scan
(const struct bfd_arch_info *info, const char *string);
@end example
@strong{Description}@*
The default function for working out whether this is an
architecture hit and a machine hit.
@findex bfd_get_arch_info
@subsubsection @code{bfd_get_arch_info}
@strong{Synopsis}
@example
const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
@end example
@strong{Description}@*
Return the architecture info struct in @var{abfd}.
@findex bfd_lookup_arch
@subsubsection @code{bfd_lookup_arch}
@strong{Synopsis}
@example
const bfd_arch_info_type *bfd_lookup_arch
(enum bfd_architecture arch, unsigned long machine);
@end example
@strong{Description}@*
Look for the architecture info structure which matches the
arguments @var{arch} and @var{machine}. A machine of 0 matches the
machine/architecture structure which marks itself as the
default.
@findex bfd_printable_arch_mach
@subsubsection @code{bfd_printable_arch_mach}
@strong{Synopsis}
@example
const char *bfd_printable_arch_mach
(enum bfd_architecture arch, unsigned long machine);
@end example
@strong{Description}@*
Return a printable string representing the architecture and
machine type.
This routine is depreciated.
@findex bfd_octets_per_byte
@subsubsection @code{bfd_octets_per_byte}
@strong{Synopsis}
@example
unsigned int bfd_octets_per_byte (bfd *abfd);
@end example
@strong{Description}@*
Return the number of octets (8-bit quantities) per target byte
(minimum addressable unit). In most cases, this will be one, but some
DSP targets have 16, 32, or even 48 bits per byte.
@findex bfd_arch_mach_octets_per_byte
@subsubsection @code{bfd_arch_mach_octets_per_byte}
@strong{Synopsis}
@example
unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);
@end example
@strong{Description}@*
See bfd_octets_per_byte.
This routine is provided for those cases where a bfd * is not
available

View File

@ -1,7 +1,7 @@
\input texinfo.tex
@setfilename bfd.info
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000,
@c 2001, 2002, 2003
@c 2001, 2002, 2003, 2006, 2007
@c Free Software Foundation, Inc.
@c
@synindex fn cp
@ -14,26 +14,29 @@ END-INFO-DIR-ENTRY
@end format
@end ifinfo
@ifinfo
@copying
This file documents the BFD library.
Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc.
Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below). A copy of the license is
included in the section entitled ``GNU Free Documentation License''.
@ignore
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
(a) The FSF's Front-Cover Text is:
@end ignore
@end ifinfo
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
@end copying
@iftex
@c@finalout
@setchapternewpage on
@ -43,7 +46,7 @@ notice identical to this one except for the removal of this paragraph
@title{libbfd}
@subtitle{The Binary File Descriptor Library}
@sp 1
@subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-)
@subtitle First Edition---BFD version < 3.0 % Since no product is stable before version 3.0 :-)
@subtitle Original Document Created: April 1991
@author {Steve Chamberlain}
@author {Cygnus Support}
@ -62,7 +65,7 @@ notice identical to this one except for the removal of this paragraph
@end tex
@vskip 0pt plus 1filll
Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc.
Copyright @copyright{} 1991, 2001, 2003, 2006 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
@ -73,6 +76,7 @@ Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc.
@end titlepage
@end iftex
@contents
@node Top, Overview, (dir), (dir)
@ifinfo
@ -84,7 +88,7 @@ This file documents the binary file descriptor library libbfd.
* BFD front end:: BFD front end
* BFD back ends:: BFD back ends
* GNU Free Documentation License:: GNU Free Documentation License
* Index:: Index
* BFD Index:: BFD Index
@end menu
@node Overview, BFD front end, Top, Top
@ -144,7 +148,7 @@ To use the library, include @file{bfd.h} and link with @file{libbfd.a}.
BFD provides a common interface to the parts of an object file
for a calling application.
When an application sucessfully opens a target file (object, archive, or
When an application successfully opens a target file (object, archive, or
whatever), a pointer to an internal structure is returned. This pointer
points to a structure called @code{bfd}, described in
@file{bfd.h}. Our convention is to call this pointer a BFD, and
@ -294,6 +298,7 @@ structures.
@end ignore
@end menu
@node What to Put Where, aout, BFD back ends, BFD back ends
@section What to Put Where
All of BFD lives in one directory.
@node aout, coff, What to Put Where, BFD back ends
@ -310,11 +315,11 @@ All of BFD lives in one directory.
@node mmo, , elf, BFD back ends
@include mmo.texi
@node GNU Free Documentation License, Index, BFD back ends, Top
@node GNU Free Documentation License, BFD Index, BFD back ends, Top
@include fdl.texi
@node Index, , GNU Free Documentation License, Top
@unnumbered Index
@node BFD Index, , GNU Free Documentation License, Top
@unnumbered BFD Index
@printindex cp
@tex
@ -332,5 +337,4 @@ All of BFD lives in one directory.
% Blame: doc@cygnus.com, 28mar91.
@end tex
@contents
@bye

View File

@ -1,6 +1,6 @@
\input texinfo
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
@c 2000, 2001, 2002, 2003, 2004
@c 2000, 2001, 2002, 2003, 2004, 2006, 2007
@c Free Software Foundation, Inc.
@setfilename bfdint.info
@ -13,6 +13,33 @@
@page
@end iftex
@copying
This file documents the internals of the BFD library.
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1998, 2000, 2001, 2002, 2003, 2004, 2006, 2007
Free Software Foundation, Inc.
Contributed by Cygnus Support.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below). A copy of the license is
included in the section entitled ``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
@end copying
@node Top
@top BFD Internals
@raisesections
@ -189,7 +216,7 @@ and handle it using the special hooks.
In some cases there is also implicit information which BFD can not
represent. For example, the MIPS processor distinguishes small and
large symbols, and requires that all small symbls be within 32K of the
large symbols, and requires that all small symbols be within 32K of the
GP register. This means that the MIPS assembler must be able to mark
variables as either small or large, and the MIPS linker must know to put
small symbols within range of the GP register. Since BFD can not
@ -230,7 +257,7 @@ Follow the GNU coding standards.
Avoid global variables. We ideally want BFD to be fully reentrant, so
that it can be used in multiple threads. All uses of global or static
variables interfere with that. Initialized constant variables are OK,
and they should be explicitly marked with const. Instead of global
and they should be explicitly marked with @samp{const}. Instead of global
variables, use data attached to a BFD or to a linker hash table.
@item
@ -1391,7 +1418,7 @@ constants used by the generic support.
@subsection ELF sections and segments
The ELF ABI permits a file to have either sections or segments or both.
Relocateable object files conventionally have only sections.
Relocatable object files conventionally have only sections.
Executables conventionally have both. Core files conventionally have
only program segments.
@ -1744,23 +1771,6 @@ support.
The processor function hooks and constants are ad hoc and need better
documentation.
When a linker script uses @samp{SIZEOF_HEADERS}, the ELF backend must
guess at the number of program segments which will be required, in
@samp{get_program_header_size}. This is because the linker calls
@samp{bfd_sizeof_headers} before it knows all the section addresses and
sizes. The ELF backend may later discover, when creating program
segments, that more program segments are required. This is currently
reported as an error in @samp{assign_file_positions_for_segments}.
In practice this makes it difficult to use @samp{SIZEOF_HEADERS} except
with a carefully defined linker script. Unfortunately,
@samp{SIZEOF_HEADERS} is required for fast program loading on a native
system, since it permits the initial code section to appear on the same
page as the program segments, saving a page read when the program starts
running. Fortunately, native systems permit careful definition of the
linker script. Still, ideally it would be possible to use relaxation to
compute the number of program segments.
@node BFD glossary
@section BFD glossary
@cindex glossary for bfd

View File

@ -1,72 +0,0 @@
@findex struct bfd_iovec
@subsubsection @code{struct bfd_iovec}
@strong{Description}@*
The @code{struct bfd_iovec} contains the internal file I/O class.
Each @code{BFD} has an instance of this class and all file I/O is
routed through it (it is assumed that the instance implements
all methods listed below).
@example
struct bfd_iovec
@{
/* To avoid problems with macros, a "b" rather than "f"
prefix is prepended to each method name. */
/* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching
bytes starting at PTR. Return the number of bytes actually
transfered (a read past end-of-file returns less than NBYTES),
or -1 (setting @code{bfd_error}) if an error occurs. */
file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes);
file_ptr (*bwrite) (struct bfd *abfd, const void *ptr,
file_ptr nbytes);
/* Return the current IOSTREAM file offset, or -1 (setting @code{bfd_error}
if an error occurs. */
file_ptr (*btell) (struct bfd *abfd);
/* For the following, on successful completion a value of 0 is returned.
Otherwise, a value of -1 is returned (and @code{bfd_error} is set). */
int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
int (*bclose) (struct bfd *abfd);
int (*bflush) (struct bfd *abfd);
int (*bstat) (struct bfd *abfd, struct stat *sb);
@};
@end example
@findex bfd_get_mtime
@subsubsection @code{bfd_get_mtime}
@strong{Synopsis}
@example
long bfd_get_mtime (bfd *abfd);
@end example
@strong{Description}@*
Return the file modification time (as read from the file system, or
from the archive header for archive members).
@findex bfd_get_size
@subsubsection @code{bfd_get_size}
@strong{Synopsis}
@example
long bfd_get_size (bfd *abfd);
@end example
@strong{Description}@*
Return the file size (as read from file system) for the file
associated with BFD @var{abfd}.
The initial motivation for, and use of, this routine is not
so we can get the exact size of the object the BFD applies to, since
that might not be generally possible (archive members for example).
It would be ideal if someone could eventually modify
it so that such results were guaranteed.
Instead, we want to ask questions like "is this NNN byte sized
object I'm about to try read from file offset YYY reasonable?"
As as example of where we might do this, some object formats
use string tables for which the first @code{sizeof (long)} bytes of the
table contain the size of the table itself, including the size bytes.
If an application tries to read what it thinks is one of these
string tables, without some way to validate the size, and for
some reason the size is wrong (byte swapping error, wrong location
for the string table, etc.), the only clue is likely to be a read
error when it tries to read the table, or a "virtual memory
exhausted" error when it tries to allocate 15 bazillon bytes
of space for the 15 bazillon byte table it is about to read.
This function at least allows us to answer the question, "is the
size reasonable?".

View File

@ -1,721 +0,0 @@
@section @code{typedef bfd}
A BFD has type @code{bfd}; objects of this type are the
cornerstone of any application using BFD. Using BFD
consists of making references though the BFD and to data in the BFD.
Here is the structure that defines the type @code{bfd}. It
contains the major data about the file and pointers
to the rest of the data.
@example
struct bfd
@{
/* A unique identifier of the BFD */
unsigned int id;
/* The filename the application opened the BFD with. */
const char *filename;
/* A pointer to the target jump table. */
const struct bfd_target *xvec;
/* The IOSTREAM, and corresponding IO vector that provide access
to the file backing the BFD. */
void *iostream;
const struct bfd_iovec *iovec;
/* Is the file descriptor being cached? That is, can it be closed as
needed, and re-opened when accessed later? */
bfd_boolean cacheable;
/* Marks whether there was a default target specified when the
BFD was opened. This is used to select which matching algorithm
to use to choose the back end. */
bfd_boolean target_defaulted;
/* The caching routines use these to maintain a
least-recently-used list of BFDs. */
struct bfd *lru_prev, *lru_next;
/* When a file is closed by the caching routines, BFD retains
state information on the file here... */
ufile_ptr where;
/* ... and here: (``once'' means at least once). */
bfd_boolean opened_once;
/* Set if we have a locally maintained mtime value, rather than
getting it from the file each time. */
bfd_boolean mtime_set;
/* File modified time, if mtime_set is TRUE. */
long mtime;
/* Reserved for an unimplemented file locking extension. */
int ifd;
/* The format which belongs to the BFD. (object, core, etc.) */
bfd_format format;
/* The direction with which the BFD was opened. */
enum bfd_direction
@{
no_direction = 0,
read_direction = 1,
write_direction = 2,
both_direction = 3
@}
direction;
/* Format_specific flags. */
flagword flags;
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
origin, with origin set to 0 for non archive files. */
ufile_ptr origin;
/* Remember when output has begun, to stop strange things
from happening. */
bfd_boolean output_has_begun;
/* A hash table for section names. */
struct bfd_hash_table section_htab;
/* Pointer to linked list of sections. */
struct bfd_section *sections;
/* The last section on the section list. */
struct bfd_section *section_last;
/* The number of sections. */
unsigned int section_count;
/* Stuff only useful for object files:
The start address. */
bfd_vma start_address;
/* Used for input and output. */
unsigned int symcount;
/* Symbol table for output BFD (with symcount entries). */
struct bfd_symbol **outsymbols;
/* Used for slurped dynamic symbol tables. */
unsigned int dynsymcount;
/* Pointer to structure which contains architecture information. */
const struct bfd_arch_info *arch_info;
/* Flag set if symbols from this BFD should not be exported. */
bfd_boolean no_export;
/* Stuff only useful for archives. */
void *arelt_data;
struct bfd *my_archive; /* The containing archive BFD. */
struct bfd *next; /* The next BFD in the archive. */
struct bfd *archive_head; /* The first BFD in the archive. */
bfd_boolean has_armap;
/* A chain of BFD structures involved in a link. */
struct bfd *link_next;
/* A field used by _bfd_generic_link_add_archive_symbols. This will
be used only for archive elements. */
int archive_pass;
/* Used by the back end to hold private data. */
union
@{
struct aout_data_struct *aout_data;
struct artdata *aout_ar_data;
struct _oasys_data *oasys_obj_data;
struct _oasys_ar_data *oasys_ar_data;
struct coff_tdata *coff_obj_data;
struct pe_tdata *pe_obj_data;
struct xcoff_tdata *xcoff_obj_data;
struct ecoff_tdata *ecoff_obj_data;
struct ieee_data_struct *ieee_data;
struct ieee_ar_data_struct *ieee_ar_data;
struct srec_data_struct *srec_data;
struct ihex_data_struct *ihex_data;
struct tekhex_data_struct *tekhex_data;
struct elf_obj_tdata *elf_obj_data;
struct nlm_obj_tdata *nlm_obj_data;
struct bout_data_struct *bout_data;
struct mmo_data_struct *mmo_data;
struct sun_core_struct *sun_core_data;
struct sco5_core_struct *sco5_core_data;
struct trad_core_struct *trad_core_data;
struct som_data_struct *som_data;
struct hpux_core_struct *hpux_core_data;
struct hppabsd_core_struct *hppabsd_core_data;
struct sgi_core_struct *sgi_core_data;
struct lynx_core_struct *lynx_core_data;
struct osf_core_struct *osf_core_data;
struct cisco_core_struct *cisco_core_data;
struct versados_data_struct *versados_data;
struct netbsd_core_struct *netbsd_core_data;
struct mach_o_data_struct *mach_o_data;
struct mach_o_fat_data_struct *mach_o_fat_data;
struct bfd_pef_data_struct *pef_data;
struct bfd_pef_xlib_data_struct *pef_xlib_data;
struct bfd_sym_data_struct *sym_data;
void *any;
@}
tdata;
/* Used by the application to hold private data. */
void *usrdata;
/* Where all the allocated stuff under this BFD goes. This is a
struct objalloc *, but we use void * to avoid requiring the inclusion
of objalloc.h. */
void *memory;
@};
@end example
@section Error reporting
Most BFD functions return nonzero on success (check their
individual documentation for precise semantics). On an error,
they call @code{bfd_set_error} to set an error condition that callers
can check by calling @code{bfd_get_error}.
If that returns @code{bfd_error_system_call}, then check
@code{errno}.
The easiest way to report a BFD error to the user is to
use @code{bfd_perror}.
@subsection Type @code{bfd_error_type}
The values returned by @code{bfd_get_error} are defined by the
enumerated type @code{bfd_error_type}.
@example
typedef enum bfd_error
@{
bfd_error_no_error = 0,
bfd_error_system_call,
bfd_error_invalid_target,
bfd_error_wrong_format,
bfd_error_wrong_object_format,
bfd_error_invalid_operation,
bfd_error_no_memory,
bfd_error_no_symbols,
bfd_error_no_armap,
bfd_error_no_more_archived_files,
bfd_error_malformed_archive,
bfd_error_file_not_recognized,
bfd_error_file_ambiguously_recognized,
bfd_error_no_contents,
bfd_error_nonrepresentable_section,
bfd_error_no_debug_section,
bfd_error_bad_value,
bfd_error_file_truncated,
bfd_error_file_too_big,
bfd_error_invalid_error_code
@}
bfd_error_type;
@end example
@findex bfd_get_error
@subsubsection @code{bfd_get_error}
@strong{Synopsis}
@example
bfd_error_type bfd_get_error (void);
@end example
@strong{Description}@*
Return the current BFD error condition.
@findex bfd_set_error
@subsubsection @code{bfd_set_error}
@strong{Synopsis}
@example
void bfd_set_error (bfd_error_type error_tag);
@end example
@strong{Description}@*
Set the BFD error condition to be @var{error_tag}.
@findex bfd_errmsg
@subsubsection @code{bfd_errmsg}
@strong{Synopsis}
@example
const char *bfd_errmsg (bfd_error_type error_tag);
@end example
@strong{Description}@*
Return a string describing the error @var{error_tag}, or
the system error if @var{error_tag} is @code{bfd_error_system_call}.
@findex bfd_perror
@subsubsection @code{bfd_perror}
@strong{Synopsis}
@example
void bfd_perror (const char *message);
@end example
@strong{Description}@*
Print to the standard error stream a string describing the
last BFD error that occurred, or the last system error if
the last BFD error was a system call failure. If @var{message}
is non-NULL and non-empty, the error string printed is preceded
by @var{message}, a colon, and a space. It is followed by a newline.
@subsection BFD error handler
Some BFD functions want to print messages describing the
problem. They call a BFD error handler function. This
function may be overridden by the program.
The BFD error handler acts like printf.
@example
typedef void (*bfd_error_handler_type) (const char *, ...);
@end example
@findex bfd_set_error_handler
@subsubsection @code{bfd_set_error_handler}
@strong{Synopsis}
@example
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
@end example
@strong{Description}@*
Set the BFD error handler function. Returns the previous
function.
@findex bfd_set_error_program_name
@subsubsection @code{bfd_set_error_program_name}
@strong{Synopsis}
@example
void bfd_set_error_program_name (const char *);
@end example
@strong{Description}@*
Set the program name to use when printing a BFD error. This
is printed before the error message followed by a colon and
space. The string must not be changed after it is passed to
this function.
@findex bfd_get_error_handler
@subsubsection @code{bfd_get_error_handler}
@strong{Synopsis}
@example
bfd_error_handler_type bfd_get_error_handler (void);
@end example
@strong{Description}@*
Return the BFD error handler function.
@section Miscellaneous
@subsection Miscellaneous functions
@findex bfd_get_reloc_upper_bound
@subsubsection @code{bfd_get_reloc_upper_bound}
@strong{Synopsis}
@example
long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
@end example
@strong{Description}@*
Return the number of bytes required to store the
relocation information associated with section @var{sect}
attached to bfd @var{abfd}. If an error occurs, return -1.
@findex bfd_canonicalize_reloc
@subsubsection @code{bfd_canonicalize_reloc}
@strong{Synopsis}
@example
long bfd_canonicalize_reloc
(bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
@end example
@strong{Description}@*
Call the back end associated with the open BFD
@var{abfd} and translate the external form of the relocation
information attached to @var{sec} into the internal canonical
form. Place the table into memory at @var{loc}, which has
been preallocated, usually by a call to
@code{bfd_get_reloc_upper_bound}. Returns the number of relocs, or
-1 on error.
The @var{syms} table is also needed for horrible internal magic
reasons.
@findex bfd_set_reloc
@subsubsection @code{bfd_set_reloc}
@strong{Synopsis}
@example
void bfd_set_reloc
(bfd *abfd, asection *sec, arelent **rel, unsigned int count);
@end example
@strong{Description}@*
Set the relocation pointer and count within
section @var{sec} to the values @var{rel} and @var{count}.
The argument @var{abfd} is ignored.
@findex bfd_set_file_flags
@subsubsection @code{bfd_set_file_flags}
@strong{Synopsis}
@example
bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
@end example
@strong{Description}@*
Set the flag word in the BFD @var{abfd} to the value @var{flags}.
Possible errors are:
@itemize @bullet
@item
@code{bfd_error_wrong_format} - The target bfd was not of object format.
@item
@code{bfd_error_invalid_operation} - The target bfd was open for reading.
@item
@code{bfd_error_invalid_operation} -
The flag word contained a bit which was not applicable to the
type of file. E.g., an attempt was made to set the @code{D_PAGED} bit
on a BFD format which does not support demand paging.
@end itemize
@findex bfd_get_arch_size
@subsubsection @code{bfd_get_arch_size}
@strong{Synopsis}
@example
int bfd_get_arch_size (bfd *abfd);
@end example
@strong{Description}@*
Returns the architecture address size, in bits, as determined
by the object file's format. For ELF, this information is
included in the header.
@strong{Returns}@*
Returns the arch size in bits if known, @code{-1} otherwise.
@findex bfd_get_sign_extend_vma
@subsubsection @code{bfd_get_sign_extend_vma}
@strong{Synopsis}
@example
int bfd_get_sign_extend_vma (bfd *abfd);
@end example
@strong{Description}@*
Indicates if the target architecture "naturally" sign extends
an address. Some architectures implicitly sign extend address
values when they are converted to types larger than the size
of an address. For instance, bfd_get_start_address() will
return an address sign extended to fill a bfd_vma when this is
the case.
@strong{Returns}@*
Returns @code{1} if the target architecture is known to sign
extend addresses, @code{0} if the target architecture is known to
not sign extend addresses, and @code{-1} otherwise.
@findex bfd_set_start_address
@subsubsection @code{bfd_set_start_address}
@strong{Synopsis}
@example
bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
@end example
@strong{Description}@*
Make @var{vma} the entry point of output BFD @var{abfd}.
@strong{Returns}@*
Returns @code{TRUE} on success, @code{FALSE} otherwise.
@findex bfd_get_gp_size
@subsubsection @code{bfd_get_gp_size}
@strong{Synopsis}
@example
unsigned int bfd_get_gp_size (bfd *abfd);
@end example
@strong{Description}@*
Return the maximum size of objects to be optimized using the GP
register under MIPS ECOFF. This is typically set by the @code{-G}
argument to the compiler, assembler or linker.
@findex bfd_set_gp_size
@subsubsection @code{bfd_set_gp_size}
@strong{Synopsis}
@example
void bfd_set_gp_size (bfd *abfd, unsigned int i);
@end example
@strong{Description}@*
Set the maximum size of objects to be optimized using the GP
register under ECOFF or MIPS ELF. This is typically set by
the @code{-G} argument to the compiler, assembler or linker.
@findex bfd_scan_vma
@subsubsection @code{bfd_scan_vma}
@strong{Synopsis}
@example
bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
@end example
@strong{Description}@*
Convert, like @code{strtoul}, a numerical expression
@var{string} into a @code{bfd_vma} integer, and return that integer.
(Though without as many bells and whistles as @code{strtoul}.)
The expression is assumed to be unsigned (i.e., positive).
If given a @var{base}, it is used as the base for conversion.
A base of 0 causes the function to interpret the string
in hex if a leading "0x" or "0X" is found, otherwise
in octal if a leading zero is found, otherwise in decimal.
If the value would overflow, the maximum @code{bfd_vma} value is
returned.
@findex bfd_copy_private_header_data
@subsubsection @code{bfd_copy_private_header_data}
@strong{Synopsis}
@example
bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
@end example
@strong{Description}@*
Copy private BFD header information from the BFD @var{ibfd} to the
the BFD @var{obfd}. This copies information that may require
sections to exist, but does not require symbol tables. Return
@code{true} on success, @code{false} on error.
Possible error returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{obfd}.
@end itemize
@example
#define bfd_copy_private_header_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_copy_private_header_data, \
(ibfd, obfd))
@end example
@findex bfd_copy_private_bfd_data
@subsubsection @code{bfd_copy_private_bfd_data}
@strong{Synopsis}
@example
bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
@end example
@strong{Description}@*
Copy private BFD information from the BFD @var{ibfd} to the
the BFD @var{obfd}. Return @code{TRUE} on success, @code{FALSE} on error.
Possible error returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{obfd}.
@end itemize
@example
#define bfd_copy_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
(ibfd, obfd))
@end example
@findex bfd_merge_private_bfd_data
@subsubsection @code{bfd_merge_private_bfd_data}
@strong{Synopsis}
@example
bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
@end example
@strong{Description}@*
Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return @code{TRUE}
on success, @code{FALSE} on error. Possible error returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{obfd}.
@end itemize
@example
#define bfd_merge_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
(ibfd, obfd))
@end example
@findex bfd_set_private_flags
@subsubsection @code{bfd_set_private_flags}
@strong{Synopsis}
@example
bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
@end example
@strong{Description}@*
Set private BFD flag information in the BFD @var{abfd}.
Return @code{TRUE} on success, @code{FALSE} on error. Possible error
returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{obfd}.
@end itemize
@example
#define bfd_set_private_flags(abfd, flags) \
BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
@end example
@findex Other functions
@subsubsection @code{Other functions}
@strong{Description}@*
The following functions exist but have not yet been documented.
@example
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
BFD_SEND (abfd, _bfd_find_nearest_line, \
(abfd, sec, syms, off, file, func, line))
#define bfd_find_line(abfd, syms, sym, file, line) \
BFD_SEND (abfd, _bfd_find_line, \
(abfd, syms, sym, file, line))
#define bfd_find_inliner_info(abfd, file, func, line) \
BFD_SEND (abfd, _bfd_find_inliner_info, \
(abfd, file, func, line))
#define bfd_debug_info_start(abfd) \
BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
#define bfd_debug_info_end(abfd) \
BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
#define bfd_debug_info_accumulate(abfd, section) \
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
#define bfd_stat_arch_elt(abfd, stat) \
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
#define bfd_update_armap_timestamp(abfd) \
BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
#define bfd_set_arch_mach(abfd, arch, mach)\
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
#define bfd_relax_section(abfd, section, link_info, again) \
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
#define bfd_gc_sections(abfd, link_info) \
BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
#define bfd_merge_sections(abfd, link_info) \
BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
#define bfd_is_group_section(abfd, sec) \
BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
#define bfd_discard_group(abfd, sec) \
BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
#define bfd_link_hash_table_create(abfd) \
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
#define bfd_link_hash_table_free(abfd, hash) \
BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
#define bfd_link_add_symbols(abfd, info) \
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
#define bfd_link_just_syms(abfd, sec, info) \
BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
#define bfd_final_link(abfd, info) \
BFD_SEND (abfd, _bfd_final_link, (abfd, info))
#define bfd_free_cached_info(abfd) \
BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
#define bfd_print_private_bfd_data(abfd, file)\
BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
dyncount, dynsyms, ret))
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
extern bfd_byte *bfd_get_relocated_section_contents
(bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
bfd_boolean, asymbol **);
@end example
@findex bfd_alt_mach_code
@subsubsection @code{bfd_alt_mach_code}
@strong{Synopsis}
@example
bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
@end example
@strong{Description}@*
When more than one machine code number is available for the
same machine type, this function can be used to switch between
the preferred one (alternative == 0) and any others. Currently,
only ELF supports this feature, with up to two alternate
machine codes.
@example
struct bfd_preserve
@{
void *marker;
void *tdata;
flagword flags;
const struct bfd_arch_info *arch_info;
struct bfd_section *sections;
struct bfd_section *section_last;
unsigned int section_count;
struct bfd_hash_table section_htab;
@};
@end example
@findex bfd_preserve_save
@subsubsection @code{bfd_preserve_save}
@strong{Synopsis}
@example
bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
@end example
@strong{Description}@*
When testing an object for compatibility with a particular
target back-end, the back-end object_p function needs to set
up certain fields in the bfd on successfully recognizing the
object. This typically happens in a piecemeal fashion, with
failures possible at many points. On failure, the bfd is
supposed to be restored to its initial state, which is
virtually impossible. However, restoring a subset of the bfd
state works in practice. This function stores the subset and
reinitializes the bfd.
@findex bfd_preserve_restore
@subsubsection @code{bfd_preserve_restore}
@strong{Synopsis}
@example
void bfd_preserve_restore (bfd *, struct bfd_preserve *);
@end example
@strong{Description}@*
This function restores bfd state saved by bfd_preserve_save.
If MARKER is non-NULL in struct bfd_preserve then that block
and all subsequently bfd_alloc'd memory is freed.
@findex bfd_preserve_finish
@subsubsection @code{bfd_preserve_finish}
@strong{Synopsis}
@example
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
@end example
@strong{Description}@*
This function should be called when the bfd state saved by
bfd_preserve_save is no longer needed. ie. when the back-end
object_p function returns with success.

View File

@ -1,2 +0,0 @@
@findex
@subsubsection @code{}

View File

@ -1,65 +0,0 @@
@section File caching
The file caching mechanism is embedded within BFD and allows
the application to open as many BFDs as it wants without
regard to the underlying operating system's file descriptor
limit (often as low as 20 open files). The module in
@code{cache.c} maintains a least recently used list of
@code{BFD_CACHE_MAX_OPEN} files, and exports the name
@code{bfd_cache_lookup}, which runs around and makes sure that
the required BFD is open. If not, then it chooses a file to
close, closes it and opens the one wanted, returning its file
handle.
@subsection Caching functions
@findex bfd_cache_init
@subsubsection @code{bfd_cache_init}
@strong{Synopsis}
@example
bfd_boolean bfd_cache_init (bfd *abfd);
@end example
@strong{Description}@*
Add a newly opened BFD to the cache.
@findex bfd_cache_close
@subsubsection @code{bfd_cache_close}
@strong{Synopsis}
@example
bfd_boolean bfd_cache_close (bfd *abfd);
@end example
@strong{Description}@*
Remove the BFD @var{abfd} from the cache. If the attached file is open,
then close it too.
@strong{Returns}@*
@code{FALSE} is returned if closing the file fails, @code{TRUE} is
returned if all is well.
@findex bfd_cache_close_all
@subsubsection @code{bfd_cache_close_all}
@strong{Synopsis}
@example
bfd_boolean bfd_cache_close_all (void);
@end example
@strong{Description}@*
Remove all BFDs from the cache. If the attached file is open,
then close it too.
@strong{Returns}@*
@code{FALSE} is returned if closing one of the file fails, @code{TRUE} is
returned if all is well.
@findex bfd_open_file
@subsubsection @code{bfd_open_file}
@strong{Synopsis}
@example
FILE* bfd_open_file (bfd *abfd);
@end example
@strong{Description}@*
Call the OS to open a file for @var{abfd}. Return the @code{FILE *}
(possibly @code{NULL}) that results from this operation. Set up the
BFD so that future accesses know the file is open. If the @code{FILE *}
returned is @code{NULL}, then it won't have been put in the
cache, so it won't have to be removed from it.

View File

@ -1,608 +0,0 @@
@section coff backends
BFD supports a number of different flavours of coff format.
The major differences between formats are the sizes and
alignments of fields in structures on disk, and the occasional
extra field.
Coff in all its varieties is implemented with a few common
files and a number of implementation specific files. For
example, The 88k bcs coff format is implemented in the file
@file{coff-m88k.c}. This file @code{#include}s
@file{coff/m88k.h} which defines the external structure of the
coff format for the 88k, and @file{coff/internal.h} which
defines the internal structure. @file{coff-m88k.c} also
defines the relocations used by the 88k format
@xref{Relocations}.
The Intel i960 processor version of coff is implemented in
@file{coff-i960.c}. This file has the same structure as
@file{coff-m88k.c}, except that it includes @file{coff/i960.h}
rather than @file{coff-m88k.h}.
@subsection Porting to a new version of coff
The recommended method is to select from the existing
implementations the version of coff which is most like the one
you want to use. For example, we'll say that i386 coff is
the one you select, and that your coff flavour is called foo.
Copy @file{i386coff.c} to @file{foocoff.c}, copy
@file{../include/coff/i386.h} to @file{../include/coff/foo.h},
and add the lines to @file{targets.c} and @file{Makefile.in}
so that your new back end is used. Alter the shapes of the
structures in @file{../include/coff/foo.h} so that they match
what you need. You will probably also have to add
@code{#ifdef}s to the code in @file{coff/internal.h} and
@file{coffcode.h} if your version of coff is too wild.
You can verify that your new BFD backend works quite simply by
building @file{objdump} from the @file{binutils} directory,
and making sure that its version of what's going on and your
host system's idea (assuming it has the pretty standard coff
dump utility, usually called @code{att-dump} or just
@code{dump}) are the same. Then clean up your code, and send
what you've done to Cygnus. Then your stuff will be in the
next release, and you won't have to keep integrating it.
@subsection How the coff backend works
@subsubsection File layout
The Coff backend is split into generic routines that are
applicable to any Coff target and routines that are specific
to a particular target. The target-specific routines are
further split into ones which are basically the same for all
Coff targets except that they use the external symbol format
or use different values for certain constants.
The generic routines are in @file{coffgen.c}. These routines
work for any Coff target. They use some hooks into the target
specific code; the hooks are in a @code{bfd_coff_backend_data}
structure, one of which exists for each target.
The essentially similar target-specific routines are in
@file{coffcode.h}. This header file includes executable C code.
The various Coff targets first include the appropriate Coff
header file, make any special defines that are needed, and
then include @file{coffcode.h}.
Some of the Coff targets then also have additional routines in
the target source file itself.
For example, @file{coff-i960.c} includes
@file{coff/internal.h} and @file{coff/i960.h}. It then
defines a few constants, such as @code{I960}, and includes
@file{coffcode.h}. Since the i960 has complex relocation
types, @file{coff-i960.c} also includes some code to
manipulate the i960 relocs. This code is not in
@file{coffcode.h} because it would not be used by any other
target.
@subsubsection Bit twiddling
Each flavour of coff supported in BFD has its own header file
describing the external layout of the structures. There is also
an internal description of the coff layout, in
@file{coff/internal.h}. A major function of the
coff backend is swapping the bytes and twiddling the bits to
translate the external form of the structures into the normal
internal form. This is all performed in the
@code{bfd_swap}_@i{thing}_@i{direction} routines. Some
elements are different sizes between different versions of
coff; it is the duty of the coff version specific include file
to override the definitions of various packing routines in
@file{coffcode.h}. E.g., the size of line number entry in coff is
sometimes 16 bits, and sometimes 32 bits. @code{#define}ing
@code{PUT_LNSZ_LNNO} and @code{GET_LNSZ_LNNO} will select the
correct one. No doubt, some day someone will find a version of
coff which has a varying field size not catered to at the
moment. To port BFD, that person will have to add more @code{#defines}.
Three of the bit twiddling routines are exported to
@code{gdb}; @code{coff_swap_aux_in}, @code{coff_swap_sym_in}
and @code{coff_swap_lineno_in}. @code{GDB} reads the symbol
table on its own, but uses BFD to fix things up. More of the
bit twiddlers are exported for @code{gas};
@code{coff_swap_aux_out}, @code{coff_swap_sym_out},
@code{coff_swap_lineno_out}, @code{coff_swap_reloc_out},
@code{coff_swap_filehdr_out}, @code{coff_swap_aouthdr_out},
@code{coff_swap_scnhdr_out}. @code{Gas} currently keeps track
of all the symbol table and reloc drudgery itself, thereby
saving the internal BFD overhead, but uses BFD to swap things
on the way out, making cross ports much safer. Doing so also
allows BFD (and thus the linker) to use the same header files
as @code{gas}, which makes one avenue to disaster disappear.
@subsubsection Symbol reading
The simple canonical form for symbols used by BFD is not rich
enough to keep all the information available in a coff symbol
table. The back end gets around this problem by keeping the original
symbol table around, "behind the scenes".
When a symbol table is requested (through a call to
@code{bfd_canonicalize_symtab}), a request gets through to
@code{coff_get_normalized_symtab}. This reads the symbol table from
the coff file and swaps all the structures inside into the
internal form. It also fixes up all the pointers in the table
(represented in the file by offsets from the first symbol in
the table) into physical pointers to elements in the new
internal table. This involves some work since the meanings of
fields change depending upon context: a field that is a
pointer to another structure in the symbol table at one moment
may be the size in bytes of a structure at the next. Another
pass is made over the table. All symbols which mark file names
(@code{C_FILE} symbols) are modified so that the internal
string points to the value in the auxent (the real filename)
rather than the normal text associated with the symbol
(@code{".file"}).
At this time the symbol names are moved around. Coff stores
all symbols less than nine characters long physically
within the symbol table; longer strings are kept at the end of
the file in the string table. This pass moves all strings
into memory and replaces them with pointers to the strings.
The symbol table is massaged once again, this time to create
the canonical table used by the BFD application. Each symbol
is inspected in turn, and a decision made (using the
@code{sclass} field) about the various flags to set in the
@code{asymbol}. @xref{Symbols}. The generated canonical table
shares strings with the hidden internal symbol table.
Any linenumbers are read from the coff file too, and attached
to the symbols which own the functions the linenumbers belong to.
@subsubsection Symbol writing
Writing a symbol to a coff file which didn't come from a coff
file will lose any debugging information. The @code{asymbol}
structure remembers the BFD from which the symbol was taken, and on
output the back end makes sure that the same destination target as
source target is present.
When the symbols have come from a coff file then all the
debugging information is preserved.
Symbol tables are provided for writing to the back end in a
vector of pointers to pointers. This allows applications like
the linker to accumulate and output large symbol tables
without having to do too much byte copying.
This function runs through the provided symbol table and
patches each symbol marked as a file place holder
(@code{C_FILE}) to point to the next file place holder in the
list. It also marks each @code{offset} field in the list with
the offset from the first symbol of the current symbol.
Another function of this procedure is to turn the canonical
value form of BFD into the form used by coff. Internally, BFD
expects symbol values to be offsets from a section base; so a
symbol physically at 0x120, but in a section starting at
0x100, would have the value 0x20. Coff expects symbols to
contain their final value, so symbols have their values
changed at this point to reflect their sum with their owning
section. This transformation uses the
@code{output_section} field of the @code{asymbol}'s
@code{asection} @xref{Sections}.
@itemize @bullet
@item
@code{coff_mangle_symbols}
@end itemize
This routine runs though the provided symbol table and uses
the offsets generated by the previous pass and the pointers
generated when the symbol table was read in to create the
structured hierarchy required by coff. It changes each pointer
to a symbol into the index into the symbol table of the asymbol.
@itemize @bullet
@item
@code{coff_write_symbols}
@end itemize
This routine runs through the symbol table and patches up the
symbols from their internal form into the coff way, calls the
bit twiddlers, and writes out the table to the file.
@findex coff_symbol_type
@subsubsection @code{coff_symbol_type}
@strong{Description}@*
The hidden information for an @code{asymbol} is described in a
@code{combined_entry_type}:
@example
typedef struct coff_ptr_struct
@{
/* Remembers the offset from the first symbol in the file for
this symbol. Generated by coff_renumber_symbols. */
unsigned int offset;
/* Should the value of this symbol be renumbered. Used for
XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */
unsigned int fix_value : 1;
/* Should the tag field of this symbol be renumbered.
Created by coff_pointerize_aux. */
unsigned int fix_tag : 1;
/* Should the endidx field of this symbol be renumbered.
Created by coff_pointerize_aux. */
unsigned int fix_end : 1;
/* Should the x_csect.x_scnlen field be renumbered.
Created by coff_pointerize_aux. */
unsigned int fix_scnlen : 1;
/* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the
index into the line number entries. Set by coff_slurp_symbol_table. */
unsigned int fix_line : 1;
/* The container for the symbol structure as read and translated
from the file. */
union
@{
union internal_auxent auxent;
struct internal_syment syment;
@} u;
@} combined_entry_type;
/* Each canonical asymbol really looks like this: */
typedef struct coff_symbol_struct
@{
/* The actual symbol which the rest of BFD works with */
asymbol symbol;
/* A pointer to the hidden information for this symbol */
combined_entry_type *native;
/* A pointer to the linenumber information for this symbol */
struct lineno_cache_entry *lineno;
/* Have the line numbers been relocated yet ? */
bfd_boolean done_lineno;
@} coff_symbol_type;
@end example
@findex bfd_coff_backend_data
@subsubsection @code{bfd_coff_backend_data}
@example
/* COFF symbol classifications. */
enum coff_symbol_classification
@{
/* Global symbol. */
COFF_SYMBOL_GLOBAL,
/* Common symbol. */
COFF_SYMBOL_COMMON,
/* Undefined symbol. */
COFF_SYMBOL_UNDEFINED,
/* Local symbol. */
COFF_SYMBOL_LOCAL,
/* PE section symbol. */
COFF_SYMBOL_PE_SECTION
@};
@end example
Special entry points for gdb to swap in coff symbol table parts:
@example
typedef struct
@{
void (*_bfd_coff_swap_aux_in)
(bfd *, void *, int, int, int, int, void *);
void (*_bfd_coff_swap_sym_in)
(bfd *, void *, void *);
void (*_bfd_coff_swap_lineno_in)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_aux_out)
(bfd *, void *, int, int, int, int, void *);
unsigned int (*_bfd_coff_swap_sym_out)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_lineno_out)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_reloc_out)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_filehdr_out)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_aouthdr_out)
(bfd *, void *, void *);
unsigned int (*_bfd_coff_swap_scnhdr_out)
(bfd *, void *, void *);
unsigned int _bfd_filhsz;
unsigned int _bfd_aoutsz;
unsigned int _bfd_scnhsz;
unsigned int _bfd_symesz;
unsigned int _bfd_auxesz;
unsigned int _bfd_relsz;
unsigned int _bfd_linesz;
unsigned int _bfd_filnmlen;
bfd_boolean _bfd_coff_long_filenames;
bfd_boolean _bfd_coff_long_section_names;
unsigned int _bfd_coff_default_section_alignment_power;
bfd_boolean _bfd_coff_force_symnames_in_strings;
unsigned int _bfd_coff_debug_string_prefix_length;
void (*_bfd_coff_swap_filehdr_in)
(bfd *, void *, void *);
void (*_bfd_coff_swap_aouthdr_in)
(bfd *, void *, void *);
void (*_bfd_coff_swap_scnhdr_in)
(bfd *, void *, void *);
void (*_bfd_coff_swap_reloc_in)
(bfd *abfd, void *, void *);
bfd_boolean (*_bfd_coff_bad_format_hook)
(bfd *, void *);
bfd_boolean (*_bfd_coff_set_arch_mach_hook)
(bfd *, void *);
void * (*_bfd_coff_mkobject_hook)
(bfd *, void *, void *);
bfd_boolean (*_bfd_styp_to_sec_flags_hook)
(bfd *, void *, const char *, asection *, flagword *);
void (*_bfd_set_alignment_hook)
(bfd *, asection *, void *);
bfd_boolean (*_bfd_coff_slurp_symbol_table)
(bfd *);
bfd_boolean (*_bfd_coff_symname_in_debug)
(bfd *, struct internal_syment *);
bfd_boolean (*_bfd_coff_pointerize_aux_hook)
(bfd *, combined_entry_type *, combined_entry_type *,
unsigned int, combined_entry_type *);
bfd_boolean (*_bfd_coff_print_aux)
(bfd *, FILE *, combined_entry_type *, combined_entry_type *,
combined_entry_type *, unsigned int);
void (*_bfd_coff_reloc16_extra_cases)
(bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
bfd_byte *, unsigned int *, unsigned int *);
int (*_bfd_coff_reloc16_estimate)
(bfd *, asection *, arelent *, unsigned int,
struct bfd_link_info *);
enum coff_symbol_classification (*_bfd_coff_classify_symbol)
(bfd *, struct internal_syment *);
bfd_boolean (*_bfd_coff_compute_section_file_positions)
(bfd *);
bfd_boolean (*_bfd_coff_start_final_link)
(bfd *, struct bfd_link_info *);
bfd_boolean (*_bfd_coff_relocate_section)
(bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **);
reloc_howto_type *(*_bfd_coff_rtype_to_howto)
(bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *,
bfd_vma *);
bfd_boolean (*_bfd_coff_adjust_symndx)
(bfd *, struct bfd_link_info *, bfd *, asection *,
struct internal_reloc *, bfd_boolean *);
bfd_boolean (*_bfd_coff_link_add_one_symbol)
(struct bfd_link_info *, bfd *, const char *, flagword,
asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
struct bfd_link_hash_entry **);
bfd_boolean (*_bfd_coff_link_output_has_begun)
(bfd *, struct coff_final_link_info *);
bfd_boolean (*_bfd_coff_final_link_postscript)
(bfd *, struct coff_final_link_info *);
@} bfd_coff_backend_data;
#define coff_backend_info(abfd) \
((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \
((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
#define bfd_coff_swap_sym_in(a,e,i) \
((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
#define bfd_coff_swap_lineno_in(a,e,i) \
((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
#define bfd_coff_swap_reloc_out(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
#define bfd_coff_swap_lineno_out(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \
((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
#define bfd_coff_swap_sym_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
#define bfd_coff_swap_scnhdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
#define bfd_coff_swap_filehdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
#define bfd_coff_swap_aouthdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz)
#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz)
#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz)
#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz)
#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz)
#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
#define bfd_coff_long_filenames(abfd) \
(coff_backend_info (abfd)->_bfd_coff_long_filenames)
#define bfd_coff_long_section_names(abfd) \
(coff_backend_info (abfd)->_bfd_coff_long_section_names)
#define bfd_coff_default_section_alignment_power(abfd) \
(coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
#define bfd_coff_swap_filehdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
#define bfd_coff_swap_aouthdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
#define bfd_coff_swap_scnhdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
#define bfd_coff_swap_reloc_in(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
#define bfd_coff_bad_format_hook(abfd, filehdr) \
((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
(abfd, filehdr, aouthdr))
#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
(abfd, scnhdr, name, section, flags_ptr))
#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
#define bfd_coff_slurp_symbol_table(abfd)\
((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
#define bfd_coff_symname_in_debug(abfd, sym)\
((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
#define bfd_coff_force_symnames_in_strings(abfd)\
(coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
#define bfd_coff_debug_string_prefix_length(abfd)\
(coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
((coff_backend_info (abfd)->_bfd_coff_print_aux)\
(abfd, file, base, symbol, aux, indaux))
#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
reloc, data, src_ptr, dst_ptr)\
((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\
((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
(abfd, section, reloc, shrink, link_info))
#define bfd_coff_classify_symbol(abfd, sym)\
((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
(abfd, sym))
#define bfd_coff_compute_section_file_positions(abfd)\
((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
(abfd))
#define bfd_coff_start_final_link(obfd, info)\
((coff_backend_info (obfd)->_bfd_coff_start_final_link)\
(obfd, info))
#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\
((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
(obfd, info, ibfd, o, con, rel, isyms, secs))
#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\
((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\
(abfd, sec, rel, h, sym, addendp))
#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
(obfd, info, ibfd, sec, rel, adjustedp))
#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
value, string, cp, coll, hashp)\
((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
(info, abfd, name, flags, section, value, string, cp, coll, hashp))
#define bfd_coff_link_output_has_begun(a,p) \
((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p))
#define bfd_coff_final_link_postscript(a,p) \
((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p))
@end example
@subsubsection Writing relocations
To write relocations, the back end steps though the
canonical relocation table and create an
@code{internal_reloc}. The symbol index to use is removed from
the @code{offset} field in the symbol table supplied. The
address comes directly from the sum of the section base
address and the relocation offset; the type is dug directly
from the howto field. Then the @code{internal_reloc} is
swapped into the shape of an @code{external_reloc} and written
out to disk.
@subsubsection Reading linenumbers
Creating the linenumber table is done by reading in the entire
coff linenumber table, and creating another table for internal use.
A coff linenumber table is structured so that each function
is marked as having a line number of 0. Each line within the
function is an offset from the first line in the function. The
base of the line number information for the table is stored in
the symbol associated with the function.
Note: The PE format uses line number 0 for a flag indicating a
new source file.
The information is copied from the external to the internal
table, and each symbol which marks a function is marked by
pointing its...
How does this work ?
@subsubsection Reading relocations
Coff relocations are easily transformed into the internal BFD form
(@code{arelent}).
Reading a coff relocation table is done in the following stages:
@itemize @bullet
@item
Read the entire coff relocation table into memory.
@item
Process each relocation in turn; first swap it from the
external to the internal form.
@item
Turn the symbol referenced in the relocation's symbol index
into a pointer into the canonical symbol table.
This table is the same as the one returned by a call to
@code{bfd_canonicalize_symtab}. The back end will call that
routine and save the result if a canonicalization hasn't been done.
@item
The reloc index is turned into a pointer to a howto
structure, in a back end specific way. For instance, the 386
and 960 use the @code{r_type} to directly produce an index
into a howto table vector; the 88k subtracts a number from the
@code{r_type} field and creates an addend field.
@end itemize

View File

@ -1,60 +0,0 @@
@section Core files
@subsection Core file functions
@strong{Description}@*
These are functions pertaining to core files.
@findex bfd_core_file_failing_command
@subsubsection @code{bfd_core_file_failing_command}
@strong{Synopsis}
@example
const char *bfd_core_file_failing_command (bfd *abfd);
@end example
@strong{Description}@*
Return a read-only string explaining which program was running
when it failed and produced the core file @var{abfd}.
@findex bfd_core_file_failing_signal
@subsubsection @code{bfd_core_file_failing_signal}
@strong{Synopsis}
@example
int bfd_core_file_failing_signal (bfd *abfd);
@end example
@strong{Description}@*
Returns the signal number which caused the core dump which
generated the file the BFD @var{abfd} is attached to.
@findex core_file_matches_executable_p
@subsubsection @code{core_file_matches_executable_p}
@strong{Synopsis}
@example
bfd_boolean core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
@end example
@strong{Description}@*
Return @code{TRUE} if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached to
@var{exec_bfd}, @code{FALSE} otherwise.
@findex generic_core_file_matches_executable_p
@subsubsection @code{generic_core_file_matches_executable_p}
@strong{Synopsis}
@example
bfd_boolean generic_core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
@end example
@strong{Description}@*
Return TRUE if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached
to @var{exec_bfd}. The match is based on executable
basenames only.
Note: When not able to determine the core file failing
command or the executable name, we still return TRUE even
though we're not sure that core file and executable match.
This is to avoid generating a false warning in situations
where we really don't know whether they match or not.

View File

@ -1,22 +0,0 @@
@section ELF backends
BFD support for ELF formats is being worked on.
Currently, the best supported back ends are for sparc and i386
(running svr4 or Solaris 2).
Documentation of the internals of the support code still needs
to be written. The code is changing quickly enough that we
haven't bothered yet.
@findex bfd_elf_find_section
@subsubsection @code{bfd_elf_find_section}
@strong{Synopsis}
@example
struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name);
@end example
@strong{Description}@*
Helper functions for GDB to locate the string tables.
Since BFD hides string tables from callers, GDB needs to use an
internal hook to find them. Sun's .stabstr, in particular,
isn't even pointed to by the .stab section, so ordinary
mechanisms wouldn't work to find it, even if we had some.

View File

@ -1,112 +0,0 @@
@section File formats
A format is a BFD concept of high level file contents type. The
formats supported by BFD are:
@itemize @bullet
@item
@code{bfd_object}
@end itemize
The BFD may contain data, symbols, relocations and debug info.
@itemize @bullet
@item
@code{bfd_archive}
@end itemize
The BFD contains other BFDs and an optional index.
@itemize @bullet
@item
@code{bfd_core}
@end itemize
The BFD contains the result of an executable core dump.
@subsection File format functions
@findex bfd_check_format
@subsubsection @code{bfd_check_format}
@strong{Synopsis}
@example
bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
@end example
@strong{Description}@*
Verify if the file attached to the BFD @var{abfd} is compatible
with the format @var{format} (i.e., one of @code{bfd_object},
@code{bfd_archive} or @code{bfd_core}).
If the BFD has been set to a specific target before the
call, only the named target and format combination is
checked. If the target has not been set, or has been set to
@code{default}, then all the known target backends is
interrogated to determine a match. If the default target
matches, it is used. If not, exactly one target must recognize
the file, or an error results.
The function returns @code{TRUE} on success, otherwise @code{FALSE}
with one of the following error codes:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} -
if @code{format} is not one of @code{bfd_object}, @code{bfd_archive} or
@code{bfd_core}.
@item
@code{bfd_error_system_call} -
if an error occured during a read - even some file mismatches
can cause bfd_error_system_calls.
@item
@code{file_not_recognised} -
none of the backends recognised the file format.
@item
@code{bfd_error_file_ambiguously_recognized} -
more than one backend recognised the file format.
@end itemize
@findex bfd_check_format_matches
@subsubsection @code{bfd_check_format_matches}
@strong{Synopsis}
@example
bfd_boolean bfd_check_format_matches
(bfd *abfd, bfd_format format, char ***matching);
@end example
@strong{Description}@*
Like @code{bfd_check_format}, except when it returns FALSE with
@code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that
case, if @var{matching} is not NULL, it will be filled in with
a NULL-terminated list of the names of the formats that matched,
allocated with @code{malloc}.
Then the user may choose a format and try again.
When done with the list that @var{matching} points to, the caller
should free it.
@findex bfd_set_format
@subsubsection @code{bfd_set_format}
@strong{Synopsis}
@example
bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
@end example
@strong{Description}@*
This function sets the file format of the BFD @var{abfd} to the
format @var{format}. If the target set in the BFD does not
support the format requested, the format is invalid, or the BFD
is not open for writing, then an error occurs.
@findex bfd_format_string
@subsubsection @code{bfd_format_string}
@strong{Synopsis}
@example
const char *bfd_format_string (bfd_format format);
@end example
@strong{Description}@*
Return a pointer to a const string
@code{invalid}, @code{object}, @code{archive}, @code{core}, or @code{unknown},
depending upon the value of @var{format}.

View File

@ -1,247 +0,0 @@
@section Hash Tables
@cindex Hash tables
BFD provides a simple set of hash table functions. Routines
are provided to initialize a hash table, to free a hash table,
to look up a string in a hash table and optionally create an
entry for it, and to traverse a hash table. There is
currently no routine to delete an string from a hash table.
The basic hash table does not permit any data to be stored
with a string. However, a hash table is designed to present a
base class from which other types of hash tables may be
derived. These derived types may store additional information
with the string. Hash tables were implemented in this way,
rather than simply providing a data pointer in a hash table
entry, because they were designed for use by the linker back
ends. The linker may create thousands of hash table entries,
and the overhead of allocating private data and storing and
following pointers becomes noticeable.
The basic hash table code is in @code{hash.c}.
@menu
* Creating and Freeing a Hash Table::
* Looking Up or Entering a String::
* Traversing a Hash Table::
* Deriving a New Hash Table Type::
@end menu
@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables
@subsection Creating and freeing a hash table
@findex bfd_hash_table_init
@findex bfd_hash_table_init_n
To create a hash table, create an instance of a @code{struct
bfd_hash_table} (defined in @code{bfd.h}) and call
@code{bfd_hash_table_init} (if you know approximately how many
entries you will need, the function @code{bfd_hash_table_init_n},
which takes a @var{size} argument, may be used).
@code{bfd_hash_table_init} returns @code{FALSE} if some sort of
error occurs.
@findex bfd_hash_newfunc
The function @code{bfd_hash_table_init} take as an argument a
function to use to create new entries. For a basic hash
table, use the function @code{bfd_hash_newfunc}. @xref{Deriving
a New Hash Table Type}, for why you would want to use a
different value for this argument.
@findex bfd_hash_allocate
@code{bfd_hash_table_init} will create an objalloc which will be
used to allocate new entries. You may allocate memory on this
objalloc using @code{bfd_hash_allocate}.
@findex bfd_hash_table_free
Use @code{bfd_hash_table_free} to free up all the memory that has
been allocated for a hash table. This will not free up the
@code{struct bfd_hash_table} itself, which you must provide.
@findex bfd_hash_set_default_size
Use @code{bfd_hash_set_default_size} to set the default size of
hash table to use.
@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables
@subsection Looking up or entering a string
@findex bfd_hash_lookup
The function @code{bfd_hash_lookup} is used both to look up a
string in the hash table and to create a new entry.
If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup}
will look up a string. If the string is found, it will
returns a pointer to a @code{struct bfd_hash_entry}. If the
string is not found in the table @code{bfd_hash_lookup} will
return @code{NULL}. You should not modify any of the fields in
the returns @code{struct bfd_hash_entry}.
If the @var{create} argument is @code{TRUE}, the string will be
entered into the hash table if it is not already there.
Either way a pointer to a @code{struct bfd_hash_entry} will be
returned, either to the existing structure or to a newly
created one. In this case, a @code{NULL} return means that an
error occurred.
If the @var{create} argument is @code{TRUE}, and a new entry is
created, the @var{copy} argument is used to decide whether to
copy the string onto the hash table objalloc or not. If
@var{copy} is passed as @code{FALSE}, you must be careful not to
deallocate or modify the string as long as the hash table
exists.
@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables
@subsection Traversing a hash table
@findex bfd_hash_traverse
The function @code{bfd_hash_traverse} may be used to traverse a
hash table, calling a function on each element. The traversal
is done in a random order.
@code{bfd_hash_traverse} takes as arguments a function and a
generic @code{void *} pointer. The function is called with a
hash table entry (a @code{struct bfd_hash_entry *}) and the
generic pointer passed to @code{bfd_hash_traverse}. The function
must return a @code{boolean} value, which indicates whether to
continue traversing the hash table. If the function returns
@code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and
return immediately.
@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables
@subsection Deriving a new hash table type
Many uses of hash tables want to store additional information
which each entry in the hash table. Some also find it
convenient to store additional information with the hash table
itself. This may be done using a derived hash table.
Since C is not an object oriented language, creating a derived
hash table requires sticking together some boilerplate
routines with a few differences specific to the type of hash
table you want to create.
An example of a derived hash table is the linker hash table.
The structures for this are defined in @code{bfdlink.h}. The
functions are in @code{linker.c}.
You may also derive a hash table from an already derived hash
table. For example, the a.out linker backend code uses a hash
table derived from the linker hash table.
@menu
* Define the Derived Structures::
* Write the Derived Creation Routine::
* Write Other Derived Routines::
@end menu
@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type
@subsubsection Define the derived structures
You must define a structure for an entry in the hash table,
and a structure for the hash table itself.
The first field in the structure for an entry in the hash
table must be of the type used for an entry in the hash table
you are deriving from. If you are deriving from a basic hash
table this is @code{struct bfd_hash_entry}, which is defined in
@code{bfd.h}. The first field in the structure for the hash
table itself must be of the type of the hash table you are
deriving from itself. If you are deriving from a basic hash
table, this is @code{struct bfd_hash_table}.
For example, the linker hash table defines @code{struct
bfd_link_hash_entry} (in @code{bfdlink.h}). The first field,
@code{root}, is of type @code{struct bfd_hash_entry}. Similarly,
the first field in @code{struct bfd_link_hash_table}, @code{table},
is of type @code{struct bfd_hash_table}.
@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type
@subsubsection Write the derived creation routine
You must write a routine which will create and initialize an
entry in the hash table. This routine is passed as the
function argument to @code{bfd_hash_table_init}.
In order to permit other hash tables to be derived from the
hash table you are creating, this routine must be written in a
standard way.
The first argument to the creation routine is a pointer to a
hash table entry. This may be @code{NULL}, in which case the
routine should allocate the right amount of space. Otherwise
the space has already been allocated by a hash table type
derived from this one.
After allocating space, the creation routine must call the
creation routine of the hash table type it is derived from,
passing in a pointer to the space it just allocated. This
will initialize any fields used by the base hash table.
Finally the creation routine must initialize any local fields
for the new hash table type.
Here is a boilerplate example of a creation routine.
@var{function_name} is the name of the routine.
@var{entry_type} is the type of an entry in the hash table you
are creating. @var{base_newfunc} is the name of the creation
routine of the hash table type your hash table is derived
from.
@example
struct bfd_hash_entry *
@var{function_name} (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
@{
struct @var{entry_type} *ret = (@var{entry_type} *) entry;
/* Allocate the structure if it has not already been allocated by a
derived class. */
if (ret == NULL)
@{
ret = bfd_hash_allocate (table, sizeof (* ret));
if (ret == NULL)
return NULL;
@}
/* Call the allocation method of the base class. */
ret = ((@var{entry_type} *)
@var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
/* Initialize the local fields here. */
return (struct bfd_hash_entry *) ret;
@}
@end example
@strong{Description}@*
The creation routine for the linker hash table, which is in
@code{linker.c}, looks just like this example.
@var{function_name} is @code{_bfd_link_hash_newfunc}.
@var{entry_type} is @code{struct bfd_link_hash_entry}.
@var{base_newfunc} is @code{bfd_hash_newfunc}, the creation
routine for a basic hash table.
@code{_bfd_link_hash_newfunc} also initializes the local fields
in a linker hash table entry: @code{type}, @code{written} and
@code{next}.
@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type
@subsubsection Write other derived routines
You will want to write other routines for your new hash table,
as well.
You will want an initialization routine which calls the
initialization routine of the hash table you are deriving from
and initializes any other local fields. For the linker hash
table, this is @code{_bfd_link_hash_table_init} in @code{linker.c}.
You will want a lookup routine which calls the lookup routine
of the hash table you are deriving from and casts the result.
The linker hash table uses @code{bfd_link_hash_lookup} in
@code{linker.c} (this actually takes an additional argument which
it uses to decide how to return the looked up value).
You may want a traversal routine. This should just call the
traversal routine of the hash table you are deriving from with
appropriate casts. The linker hash table uses
@code{bfd_link_hash_traverse} in @code{linker.c}.
These routines may simply be defined as macros. For example,
the a.out backend linker hash table, which is derived from the
linker hash table, uses macros for the lookup and traversal
routines. These are @code{aout_link_hash_lookup} and
@code{aout_link_hash_traverse} in aoutx.h.

View File

@ -1,16 +0,0 @@
@section Initialization
@subsection Initialization functions
These are the functions that handle initializing a BFD.
@findex bfd_init
@subsubsection @code{bfd_init}
@strong{Synopsis}
@example
void bfd_init (void);
@end example
@strong{Description}@*
This routine must be called before any other BFD function to
initialize magical internal data structures.

View File

@ -1,179 +0,0 @@
@section Implementation details
@subsection Internal functions
@strong{Description}@*
These routines are used within BFD.
They are not intended for export, but are documented here for
completeness.
@findex bfd_write_bigendian_4byte_int
@subsubsection @code{bfd_write_bigendian_4byte_int}
@strong{Synopsis}
@example
bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int);
@end example
@strong{Description}@*
Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big
endian order regardless of what else is going on. This is useful in
archives.
@findex bfd_put_size
@subsubsection @code{bfd_put_size}
@findex bfd_get_size
@subsubsection @code{bfd_get_size}
@strong{Description}@*
These macros as used for reading and writing raw data in
sections; each access (except for bytes) is vectored through
the target format of the BFD and mangled accordingly. The
mangling performs any necessary endian translations and
removes alignment restrictions. Note that types accepted and
returned by these macros are identical so they can be swapped
around in macros---for example, @file{libaout.h} defines @code{GET_WORD}
to either @code{bfd_get_32} or @code{bfd_get_64}.
In the put routines, @var{val} must be a @code{bfd_vma}. If we are on a
system without prototypes, the caller is responsible for making
sure that is true, with a cast if necessary. We don't cast
them in the macro definitions because that would prevent @code{lint}
or @code{gcc -Wall} from detecting sins such as passing a pointer.
To detect calling these with less than a @code{bfd_vma}, use
@code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s.
@example
/* Byte swapping macros for user section data. */
#define bfd_put_8(abfd, val, ptr) \
((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
#define bfd_put_signed_8 \
bfd_put_8
#define bfd_get_8(abfd, ptr) \
(*(unsigned char *) (ptr) & 0xff)
#define bfd_get_signed_8(abfd, ptr) \
(((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
#define bfd_put_16(abfd, val, ptr) \
BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
#define bfd_put_signed_16 \
bfd_put_16
#define bfd_get_16(abfd, ptr) \
BFD_SEND (abfd, bfd_getx16, (ptr))
#define bfd_get_signed_16(abfd, ptr) \
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
#define bfd_put_32(abfd, val, ptr) \
BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
#define bfd_put_signed_32 \
bfd_put_32
#define bfd_get_32(abfd, ptr) \
BFD_SEND (abfd, bfd_getx32, (ptr))
#define bfd_get_signed_32(abfd, ptr) \
BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
#define bfd_put_64(abfd, val, ptr) \
BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
#define bfd_put_signed_64 \
bfd_put_64
#define bfd_get_64(abfd, ptr) \
BFD_SEND (abfd, bfd_getx64, (ptr))
#define bfd_get_signed_64(abfd, ptr) \
BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
#define bfd_get(bits, abfd, ptr) \
((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
: (bits) == 16 ? bfd_get_16 (abfd, ptr) \
: (bits) == 32 ? bfd_get_32 (abfd, ptr) \
: (bits) == 64 ? bfd_get_64 (abfd, ptr) \
: (abort (), (bfd_vma) - 1))
#define bfd_put(bits, abfd, val, ptr) \
((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
: (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
: (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
: (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
: (abort (), (void) 0))
@end example
@findex bfd_h_put_size
@subsubsection @code{bfd_h_put_size}
@strong{Description}@*
These macros have the same function as their @code{bfd_get_x}
brethren, except that they are used for removing information
for the header records of object files. Believe it or not,
some object files keep their header records in big endian
order and their data in little endian order.
@example
/* Byte swapping macros for file header data. */
#define bfd_h_put_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
#define bfd_h_put_signed_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
#define bfd_h_get_8(abfd, ptr) \
bfd_get_8 (abfd, ptr)
#define bfd_h_get_signed_8(abfd, ptr) \
bfd_get_signed_8 (abfd, ptr)
#define bfd_h_put_16(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
#define bfd_h_put_signed_16 \
bfd_h_put_16
#define bfd_h_get_16(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx16, (ptr))
#define bfd_h_get_signed_16(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
#define bfd_h_put_32(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
#define bfd_h_put_signed_32 \
bfd_h_put_32
#define bfd_h_get_32(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx32, (ptr))
#define bfd_h_get_signed_32(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
#define bfd_h_put_64(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
#define bfd_h_put_signed_64 \
bfd_h_put_64
#define bfd_h_get_64(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx64, (ptr))
#define bfd_h_get_signed_64(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
/* Aliases for the above, which should eventually go away. */
#define H_PUT_64 bfd_h_put_64
#define H_PUT_32 bfd_h_put_32
#define H_PUT_16 bfd_h_put_16
#define H_PUT_8 bfd_h_put_8
#define H_PUT_S64 bfd_h_put_signed_64
#define H_PUT_S32 bfd_h_put_signed_32
#define H_PUT_S16 bfd_h_put_signed_16
#define H_PUT_S8 bfd_h_put_signed_8
#define H_GET_64 bfd_h_get_64
#define H_GET_32 bfd_h_get_32
#define H_GET_16 bfd_h_get_16
#define H_GET_8 bfd_h_get_8
#define H_GET_S64 bfd_h_get_signed_64
#define H_GET_S32 bfd_h_get_signed_32
#define H_GET_S16 bfd_h_get_signed_16
#define H_GET_S8 bfd_h_get_signed_8
@end example
@findex bfd_log2
@subsubsection @code{bfd_log2}
@strong{Synopsis}
@example
unsigned int bfd_log2 (bfd_vma x);
@end example
@strong{Description}@*
Return the log base 2 of the value supplied, rounded up. E.g., an
@var{x} of 1025 returns 11. A @var{x} of 0 returns 0.

View File

@ -1,380 +0,0 @@
@section Linker Functions
@cindex Linker
The linker uses three special entry points in the BFD target
vector. It is not necessary to write special routines for
these entry points when creating a new BFD back end, since
generic versions are provided. However, writing them can
speed up linking and make it use significantly less runtime
memory.
The first routine creates a hash table used by the other
routines. The second routine adds the symbols from an object
file to the hash table. The third routine takes all the
object files and links them together to create the output
file. These routines are designed so that the linker proper
does not need to know anything about the symbols in the object
files that it is linking. The linker merely arranges the
sections as directed by the linker script and lets BFD handle
the details of symbols and relocs.
The second routine and third routines are passed a pointer to
a @code{struct bfd_link_info} structure (defined in
@code{bfdlink.h}) which holds information relevant to the link,
including the linker hash table (which was created by the
first routine) and a set of callback functions to the linker
proper.
The generic linker routines are in @code{linker.c}, and use the
header file @code{genlink.h}. As of this writing, the only back
ends which have implemented versions of these routines are
a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out
routines are used as examples throughout this section.
@menu
* Creating a Linker Hash Table::
* Adding Symbols to the Hash Table::
* Performing the Final Link::
@end menu
@node Creating a Linker Hash Table, Adding Symbols to the Hash Table, Linker Functions, Linker Functions
@subsection Creating a linker hash table
@cindex _bfd_link_hash_table_create in target vector
@cindex target vector (_bfd_link_hash_table_create)
The linker routines must create a hash table, which must be
derived from @code{struct bfd_link_hash_table} described in
@code{bfdlink.c}. @xref{Hash Tables}, for information on how to
create a derived hash table. This entry point is called using
the target vector of the linker output file.
The @code{_bfd_link_hash_table_create} entry point must allocate
and initialize an instance of the desired hash table. If the
back end does not require any additional information to be
stored with the entries in the hash table, the entry point may
simply create a @code{struct bfd_link_hash_table}. Most likely,
however, some additional information will be needed.
For example, with each entry in the hash table the a.out
linker keeps the index the symbol has in the final output file
(this index number is used so that when doing a relocatable
link the symbol index used in the output file can be quickly
filled in when copying over a reloc). The a.out linker code
defines the required structures and functions for a hash table
derived from @code{struct bfd_link_hash_table}. The a.out linker
hash table is created by the function
@code{NAME(aout,link_hash_table_create)}; it simply allocates
space for the hash table, initializes it, and returns a
pointer to it.
When writing the linker routines for a new back end, you will
generally not know exactly which fields will be required until
you have finished. You should simply create a new hash table
which defines no additional fields, and then simply add fields
as they become necessary.
@node Adding Symbols to the Hash Table, Performing the Final Link, Creating a Linker Hash Table, Linker Functions
@subsection Adding symbols to the hash table
@cindex _bfd_link_add_symbols in target vector
@cindex target vector (_bfd_link_add_symbols)
The linker proper will call the @code{_bfd_link_add_symbols}
entry point for each object file or archive which is to be
linked (typically these are the files named on the command
line, but some may also come from the linker script). The
entry point is responsible for examining the file. For an
object file, BFD must add any relevant symbol information to
the hash table. For an archive, BFD must determine which
elements of the archive should be used and adding them to the
link.
The a.out version of this entry point is
@code{NAME(aout,link_add_symbols)}.
@menu
* Differing file formats::
* Adding symbols from an object file::
* Adding symbols from an archive::
@end menu
@node Differing file formats, Adding symbols from an object file, Adding Symbols to the Hash Table, Adding Symbols to the Hash Table
@subsubsection Differing file formats
Normally all the files involved in a link will be of the same
format, but it is also possible to link together different
format object files, and the back end must support that. The
@code{_bfd_link_add_symbols} entry point is called via the target
vector of the file to be added. This has an important
consequence: the function may not assume that the hash table
is the type created by the corresponding
@code{_bfd_link_hash_table_create} vector. All the
@code{_bfd_link_add_symbols} function can assume about the hash
table is that it is derived from @code{struct
bfd_link_hash_table}.
Sometimes the @code{_bfd_link_add_symbols} function must store
some information in the hash table entry to be used by the
@code{_bfd_final_link} function. In such a case the @code{creator}
field of the hash table must be checked to make sure that the
hash table was created by an object file of the same format.
The @code{_bfd_final_link} routine must be prepared to handle a
hash entry without any extra information added by the
@code{_bfd_link_add_symbols} function. A hash entry without
extra information will also occur when the linker script
directs the linker to create a symbol. Note that, regardless
of how a hash table entry is added, all the fields will be
initialized to some sort of null value by the hash table entry
initialization function.
See @code{ecoff_link_add_externals} for an example of how to
check the @code{creator} field before saving information (in this
case, the ECOFF external symbol debugging information) in a
hash table entry.
@node Adding symbols from an object file, Adding symbols from an archive, Differing file formats, Adding Symbols to the Hash Table
@subsubsection Adding symbols from an object file
When the @code{_bfd_link_add_symbols} routine is passed an object
file, it must add all externally visible symbols in that
object file to the hash table. The actual work of adding the
symbol to the hash table is normally handled by the function
@code{_bfd_generic_link_add_one_symbol}. The
@code{_bfd_link_add_symbols} routine is responsible for reading
all the symbols from the object file and passing the correct
information to @code{_bfd_generic_link_add_one_symbol}.
The @code{_bfd_link_add_symbols} routine should not use
@code{bfd_canonicalize_symtab} to read the symbols. The point of
providing this routine is to avoid the overhead of converting
the symbols into generic @code{asymbol} structures.
@findex _bfd_generic_link_add_one_symbol
@code{_bfd_generic_link_add_one_symbol} handles the details of
combining common symbols, warning about multiple definitions,
and so forth. It takes arguments which describe the symbol to
add, notably symbol flags, a section, and an offset. The
symbol flags include such things as @code{BSF_WEAK} or
@code{BSF_INDIRECT}. The section is a section in the object
file, or something like @code{bfd_und_section_ptr} for an undefined
symbol or @code{bfd_com_section_ptr} for a common symbol.
If the @code{_bfd_final_link} routine is also going to need to
read the symbol information, the @code{_bfd_link_add_symbols}
routine should save it somewhere attached to the object file
BFD. However, the information should only be saved if the
@code{keep_memory} field of the @code{info} argument is TRUE, so
that the @code{-no-keep-memory} linker switch is effective.
The a.out function which adds symbols from an object file is
@code{aout_link_add_object_symbols}, and most of the interesting
work is in @code{aout_link_add_symbols}. The latter saves
pointers to the hash tables entries created by
@code{_bfd_generic_link_add_one_symbol} indexed by symbol number,
so that the @code{_bfd_final_link} routine does not have to call
the hash table lookup routine to locate the entry.
@node Adding symbols from an archive, , Adding symbols from an object file, Adding Symbols to the Hash Table
@subsubsection Adding symbols from an archive
When the @code{_bfd_link_add_symbols} routine is passed an
archive, it must look through the symbols defined by the
archive and decide which elements of the archive should be
included in the link. For each such element it must call the
@code{add_archive_element} linker callback, and it must add the
symbols from the object file to the linker hash table.
@findex _bfd_generic_link_add_archive_symbols
In most cases the work of looking through the symbols in the
archive should be done by the
@code{_bfd_generic_link_add_archive_symbols} function. This
function builds a hash table from the archive symbol table and
looks through the list of undefined symbols to see which
elements should be included.
@code{_bfd_generic_link_add_archive_symbols} is passed a function
to call to make the final decision about adding an archive
element to the link and to do the actual work of adding the
symbols to the linker hash table.
The function passed to
@code{_bfd_generic_link_add_archive_symbols} must read the
symbols of the archive element and decide whether the archive
element should be included in the link. If the element is to
be included, the @code{add_archive_element} linker callback
routine must be called with the element as an argument, and
the elements symbols must be added to the linker hash table
just as though the element had itself been passed to the
@code{_bfd_link_add_symbols} function.
When the a.out @code{_bfd_link_add_symbols} function receives an
archive, it calls @code{_bfd_generic_link_add_archive_symbols}
passing @code{aout_link_check_archive_element} as the function
argument. @code{aout_link_check_archive_element} calls
@code{aout_link_check_ar_symbols}. If the latter decides to add
the element (an element is only added if it provides a real,
non-common, definition for a previously undefined or common
symbol) it calls the @code{add_archive_element} callback and then
@code{aout_link_check_archive_element} calls
@code{aout_link_add_symbols} to actually add the symbols to the
linker hash table.
The ECOFF back end is unusual in that it does not normally
call @code{_bfd_generic_link_add_archive_symbols}, because ECOFF
archives already contain a hash table of symbols. The ECOFF
back end searches the archive itself to avoid the overhead of
creating a new hash table.
@node Performing the Final Link, , Adding Symbols to the Hash Table, Linker Functions
@subsection Performing the final link
@cindex _bfd_link_final_link in target vector
@cindex target vector (_bfd_final_link)
When all the input files have been processed, the linker calls
the @code{_bfd_final_link} entry point of the output BFD. This
routine is responsible for producing the final output file,
which has several aspects. It must relocate the contents of
the input sections and copy the data into the output sections.
It must build an output symbol table including any local
symbols from the input files and the global symbols from the
hash table. When producing relocatable output, it must
modify the input relocs and write them into the output file.
There may also be object format dependent work to be done.
The linker will also call the @code{write_object_contents} entry
point when the BFD is closed. The two entry points must work
together in order to produce the correct output file.
The details of how this works are inevitably dependent upon
the specific object file format. The a.out
@code{_bfd_final_link} routine is @code{NAME(aout,final_link)}.
@menu
* Information provided by the linker::
* Relocating the section contents::
* Writing the symbol table::
@end menu
@node Information provided by the linker, Relocating the section contents, Performing the Final Link, Performing the Final Link
@subsubsection Information provided by the linker
Before the linker calls the @code{_bfd_final_link} entry point,
it sets up some data structures for the function to use.
The @code{input_bfds} field of the @code{bfd_link_info} structure
will point to a list of all the input files included in the
link. These files are linked through the @code{link_next} field
of the @code{bfd} structure.
Each section in the output file will have a list of
@code{link_order} structures attached to the @code{map_head.link_order}
field (the @code{link_order} structure is defined in
@code{bfdlink.h}). These structures describe how to create the
contents of the output section in terms of the contents of
various input sections, fill constants, and, eventually, other
types of information. They also describe relocs that must be
created by the BFD backend, but do not correspond to any input
file; this is used to support -Ur, which builds constructors
while generating a relocatable object file.
@node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link
@subsubsection Relocating the section contents
The @code{_bfd_final_link} function should look through the
@code{link_order} structures attached to each section of the
output file. Each @code{link_order} structure should either be
handled specially, or it should be passed to the function
@code{_bfd_default_link_order} which will do the right thing
(@code{_bfd_default_link_order} is defined in @code{linker.c}).
For efficiency, a @code{link_order} of type
@code{bfd_indirect_link_order} whose associated section belongs
to a BFD of the same format as the output BFD must be handled
specially. This type of @code{link_order} describes part of an
output section in terms of a section belonging to one of the
input files. The @code{_bfd_final_link} function should read the
contents of the section and any associated relocs, apply the
relocs to the section contents, and write out the modified
section contents. If performing a relocatable link, the
relocs themselves must also be modified and written out.
@findex _bfd_relocate_contents
@findex _bfd_final_link_relocate
The functions @code{_bfd_relocate_contents} and
@code{_bfd_final_link_relocate} provide some general support for
performing the actual relocations, notably overflow checking.
Their arguments include information about the symbol the
relocation is against and a @code{reloc_howto_type} argument
which describes the relocation to perform. These functions
are defined in @code{reloc.c}.
The a.out function which handles reading, relocating, and
writing section contents is @code{aout_link_input_section}. The
actual relocation is done in @code{aout_link_input_section_std}
and @code{aout_link_input_section_ext}.
@node Writing the symbol table, , Relocating the section contents, Performing the Final Link
@subsubsection Writing the symbol table
The @code{_bfd_final_link} function must gather all the symbols
in the input files and write them out. It must also write out
all the symbols in the global hash table. This must be
controlled by the @code{strip} and @code{discard} fields of the
@code{bfd_link_info} structure.
The local symbols of the input files will not have been
entered into the linker hash table. The @code{_bfd_final_link}
routine must consider each input file and include the symbols
in the output file. It may be convenient to do this when
looking through the @code{link_order} structures, or it may be
done by stepping through the @code{input_bfds} list.
The @code{_bfd_final_link} routine must also traverse the global
hash table to gather all the externally visible symbols. It
is possible that most of the externally visible symbols may be
written out when considering the symbols of each input file,
but it is still necessary to traverse the hash table since the
linker script may have defined some symbols that are not in
any of the input files.
The @code{strip} field of the @code{bfd_link_info} structure
controls which symbols are written out. The possible values
are listed in @code{bfdlink.h}. If the value is @code{strip_some},
then the @code{keep_hash} field of the @code{bfd_link_info}
structure is a hash table of symbols to keep; each symbol
should be looked up in this hash table, and only symbols which
are present should be included in the output file.
If the @code{strip} field of the @code{bfd_link_info} structure
permits local symbols to be written out, the @code{discard} field
is used to further controls which local symbols are included
in the output file. If the value is @code{discard_l}, then all
local symbols which begin with a certain prefix are discarded;
this is controlled by the @code{bfd_is_local_label_name} entry point.
The a.out backend handles symbols by calling
@code{aout_link_write_symbols} on each input BFD and then
traversing the global hash table with the function
@code{aout_link_write_other_symbol}. It builds a string table
while writing out the symbols, which is written to the output
file at the end of @code{NAME(aout,final_link)}.
@findex bfd_link_split_section
@subsubsection @code{bfd_link_split_section}
@strong{Synopsis}
@example
bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
@end example
@strong{Description}@*
Return nonzero if @var{sec} should be split during a
reloceatable or final link.
@example
#define bfd_link_split_section(abfd, sec) \
BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
@end example
@findex bfd_section_already_linked
@subsubsection @code{bfd_section_already_linked}
@strong{Synopsis}
@example
void bfd_section_already_linked (bfd *abfd, asection *sec);
@end example
@strong{Description}@*
Check if @var{sec} has been already linked during a reloceatable
or final link.
@example
#define bfd_section_already_linked(abfd, sec) \
BFD_SEND (abfd, _section_already_linked, (abfd, sec))
@end example

View File

@ -1,365 +0,0 @@
@section mmo backend
The mmo object format is used exclusively together with Professor
Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator
@command{mmix} which is available at
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
understands this format. That package also includes a combined
assembler and linker called @command{mmixal}. The mmo format has
no advantages feature-wise compared to e.g. ELF. It is a simple
non-relocatable object format with no support for archives or
debugging information, except for symbol value information and
line numbers (which is not yet implemented in BFD). See
@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
information about MMIX. The ELF format is used for intermediate
object files in the BFD implementation.
@c We want to xref the symbol table node. A feature in "chew"
@c requires that "commands" do not contain spaces in the
@c arguments. Hence the hyphen in "Symbol-table".
@menu
* File layout::
* Symbol-table::
* mmo section mapping::
@end menu
@node File layout, Symbol-table, mmo, mmo
@subsection File layout
The mmo file contents is not partitioned into named sections as
with e.g.@: ELF. Memory areas is formed by specifying the
location of the data that follows. Only the memory area
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so
it is used for code (and constants) and the area
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for
writable data. @xref{mmo section mapping}.
There is provision for specifying ``special data'' of 65536
different types. We use type 80 (decimal), arbitrarily chosen the
same as the ELF @code{e_machine} number for MMIX, filling it with
section information normally found in ELF objects. @xref{mmo
section mapping}.
Contents is entered as 32-bit words, xor:ed over previous
contents, always zero-initialized. A word that starts with the
byte @samp{0x98} forms a command called a @samp{lopcode}, where
the next byte distinguished between the thirteen lopcodes. The
two remaining bytes, called the @samp{Y} and @samp{Z} fields, or
the @samp{YZ} field (a 16-bit big-endian number), are used for
various purposes different for each lopcode. As documented in
@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
the lopcodes are:
@table @code
@item lop_quote
0x98000001. The next word is contents, regardless of whether it
starts with 0x98 or not.
@item lop_loc
0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location
directive, setting the location for the next data to the next
32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}),
plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment
and 2 for the data segment.
@item lop_skip
0x9802YYZZ. Increase the current location by @samp{YZ} bytes.
@item lop_fixo
0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location
as 64 bits into the location pointed to by the next 32-bit
(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y *
2^56}.
@item lop_fixr
0x9804YYZZ. @samp{YZ} is stored into the current location plus
@math{2 - 4 * YZ}.
@item lop_fixrx
0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from
the following 32-bit word are used in a manner similar to
@samp{YZ} in lop_fixr: it is xor:ed into the current location
minus @math{4 * L}. The first byte of the word is 0 or 1. If it
is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0,
then @math{L = (@var{lowest 24 bits of word})}.
@item lop_file
0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of
32-bit words. Set the file number to @samp{Y} and the line
counter to 0. The next @math{Z * 4} bytes contain the file name,
padded with zeros if the count is not a multiple of four. The
same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for
all but the first occurrence.
@item lop_line
0x9807YYZZ. @samp{YZ} is the line number. Together with
lop_file, it forms the source location for the next 32-bit word.
Note that for each non-lopcode 32-bit word, line numbers are
assumed incremented by one.
@item lop_spec
0x9808YYZZ. @samp{YZ} is the type number. Data until the next
lopcode other than lop_quote forms special data of type @samp{YZ}.
@xref{mmo section mapping}.
Other types than 80, (or type 80 with a content that does not
parse) is stored in sections named @code{.MMIX.spec_data.@var{n}}
where @var{n} is the @samp{YZ}-type. The flags for such a
sections say not to allocate or load the data. The vma is 0.
Contents of multiple occurrences of special data @var{n} is
concatenated to the data of the previous lop_spec @var{n}s. The
location in data or code at which the lop_spec occurred is lost.
@item lop_pre
0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the
length of header information in 32-bit words, where the first word
tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}.
@item lop_post
0x980a00ZZ. @math{Z > 32}. This lopcode follows after all
content-generating lopcodes in a program. The @samp{Z} field
denotes the value of @samp{rG} at the beginning of the program.
The following @math{256 - Z} big-endian 64-bit words are loaded
into global registers @samp{$G} @dots{} @samp{$255}.
@item lop_stab
0x980b0000. The next-to-last lopcode in a program. Must follow
immediately after the lop_post lopcode and its data. After this
lopcode follows all symbols in a compressed format
(@pxref{Symbol-table}).
@item lop_end
0x980cYYZZ. The last lopcode in a program. It must follow the
lop_stab lopcode and its data. The @samp{YZ} field contains the
number of 32-bit words of symbol table information after the
preceding lop_stab lopcode.
@end table
Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and
@code{lop_fixo} are not generated by BFD, but are handled. They are
generated by @code{mmixal}.
This trivial one-label, one-instruction file:
@example
:Main TRAP 1,2,3
@end example
can be represented this way in mmo:
@example
0x98090101 - lop_pre, one 32-bit word with timestamp.
<timestamp>
0x98010002 - lop_loc, text segment, using a 64-bit address.
Note that mmixal does not emit this for the file above.
0x00000000 - Address, high 32 bits.
0x00000000 - Address, low 32 bits.
0x98060002 - lop_file, 2 32-bit words for file-name.
0x74657374 - "test"
0x2e730000 - ".s\0\0"
0x98070001 - lop_line, line 1.
0x00010203 - TRAP 1,2,3
0x980a00ff - lop_post, setting $255 to 0.
0x00000000
0x00000000
0x980b0000 - lop_stab for ":Main" = 0, serial 1.
0x203a4040 @xref{Symbol-table}.
0x10404020
0x4d206120
0x69016e00
0x81000000
0x980c0005 - lop_end; symbol table contained five 32-bit words.
@end example
@node Symbol-table, mmo section mapping, File layout, mmo
@subsection Symbol table format
From mmixal.w (or really, the generated mmixal.tex) in
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
``Symbols are stored and retrieved by means of a @samp{ternary
search trie}, following ideas of Bentley and Sedgewick. (See
ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369;
R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@:
Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a
character, and there are branches to subtries for the cases where
a given character is less than, equal to, or greater than the
character in the trie. There also is a pointer to a symbol table
entry if a symbol ends at the current node.''
So it's a tree encoded as a stream of bytes. The stream of bytes
acts on a single virtual global symbol, adding and removing
characters and signalling complete symbol points. Here, we read
the stream and create symbols at the completion points.
First, there's a control byte @code{m}. If any of the listed bits
in @code{m} is nonzero, we execute what stands at the right, in
the listed order:
@example
(MMO3_LEFT)
0x40 - Traverse left trie.
(Read a new command byte and recurse.)
(MMO3_SYMBITS)
0x2f - Read the next byte as a character and store it in the
current character position; increment character position.
Test the bits of @code{m}:
(MMO3_WCHAR)
0x80 - The character is 16-bit (so read another byte,
merge into current character.
(MMO3_TYPEBITS)
0xf - We have a complete symbol; parse the type, value
and serial number and do what should be done
with a symbol. The type and length information
is in j = (m & 0xf).
(MMO3_REGQUAL_BITS)
j == 0xf: A register variable. The following
byte tells which register.
j <= 8: An absolute symbol. Read j bytes as the
big-endian number the symbol equals.
A j = 2 with two zero bytes denotes an
unknown symbol.
j > 8: As with j <= 8, but add (0x20 << 56)
to the value in the following j - 8
bytes.
Then comes the serial number, as a variant of
uleb128, but better named ubeb128:
Read bytes and shift the previous value left 7
(multiply by 128). Add in the new byte, repeat
until a byte has bit 7 set. The serial number
is the computed value minus 128.
(MMO3_MIDDLE)
0x20 - Traverse middle trie. (Read a new command byte
and recurse.) Decrement character position.
(MMO3_RIGHT)
0x10 - Traverse right trie. (Read a new command byte and
recurse.)
@end example
Let's look again at the @code{lop_stab} for the trivial file
(@pxref{File layout}).
@example
0x980b0000 - lop_stab for ":Main" = 0, serial 1.
0x203a4040
0x10404020
0x4d206120
0x69016e00
0x81000000
@end example
This forms the trivial trie (note that the path between ``:'' and
``M'' is redundant):
@example
203a ":"
40 /
40 /
10 \
40 /
40 /
204d "M"
2061 "a"
2069 "i"
016e "n" is the last character in a full symbol, and
with a value represented in one byte.
00 The value is 0.
81 The serial number is 1.
@end example
@node mmo section mapping, , Symbol-table, mmo
@subsection mmo section mapping
The implementation in BFD uses special data type 80 (decimal) to
encapsulate and describe named sections, containing e.g.@: debug
information. If needed, any datum in the encapsulation will be
quoted using lop_quote. First comes a 32-bit word holding the
number of 32-bit words containing the zero-terminated zero-padded
segment name. After the name there's a 32-bit word holding flags
describing the section type. Then comes a 64-bit big-endian word
with the section length (in bytes), then another with the section
start address. Depending on the type of section, the contents
might follow, zero-padded to 32-bit boundary. For a loadable
section (such as data or code), the contents might follow at some
later point, not necessarily immediately, as a lop_loc with the
same start address as in the section description, followed by the
contents. This in effect forms a descriptor that must be emitted
before the actual contents. Sections described this way must not
overlap.
For areas that don't have such descriptors, synthetic sections are
formed by BFD. Consecutive contents in the two memory areas
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in
sections named @code{.text} and @code{.data} respectively. If an area
is not otherwise described, but would together with a neighboring
lower area be less than @samp{0x40000000} bytes long, it is joined
with the lower area and the gap is zero-filled. For other cases,
a new section is formed, named @code{.MMIX.sec.@var{n}}. Here,
@var{n} is a number, a running count through the mmo file,
starting at 0.
A loadable section specified as:
@example
.section secname,"ax"
TETRA 1,2,3,4,-1,-2009
BYTE 80
@end example
and linked to address @samp{0x4}, is represented by the sequence:
@example
0x98080050 - lop_spec 80
0x00000002 - two 32-bit words for the section name
0x7365636e - "secn"
0x616d6500 - "ame\0"
0x00000033 - flags CODE, READONLY, LOAD, ALLOC
0x00000000 - high 32 bits of section length
0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits
0x00000000 - high 32 bits of section address
0x00000004 - section address is 4
0x98010002 - 64 bits with address of following data
0x00000000 - high 32 bits of address
0x00000004 - low 32 bits: data starts at address 4
0x00000001 - 1
0x00000002 - 2
0x00000003 - 3
0x00000004 - 4
0xffffffff - -1
0xfffff827 - -2009
0x50000000 - 80 as a byte, padded with zeros.
@end example
Note that the lop_spec wrapping does not include the section
contents. Compare this to a non-loaded section specified as:
@example
.section thirdsec
TETRA 200001,100002
BYTE 38,40
@end example
This, when linked to address @samp{0x200000000000001c}, is
represented by:
@example
0x98080050 - lop_spec 80
0x00000002 - two 32-bit words for the section name
0x7365636e - "thir"
0x616d6500 - "dsec"
0x00000010 - flag READONLY
0x00000000 - high 32 bits of section length
0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
0x20000000 - high 32 bits of address
0x0000001c - low 32 bits of address 0x200000000000001c
0x00030d41 - 200001
0x000186a2 - 100002
0x26280000 - 38, 40 as bytes, padded with zeros
@end example
For the latter example, the section contents must not be
loaded in memory, and is therefore specified as part of the
special data. The address is usually unimportant but might
provide information for e.g.@: the DWARF 2 debugging format.

View File

@ -1,365 +0,0 @@
@section Opening and closing BFDs
@subsection Functions for opening and closing
@findex bfd_fopen
@subsubsection @code{bfd_fopen}
@strong{Synopsis}
@example
bfd *bfd_fopen (const char *filename, const char *target,
const char *mode, int fd);
@end example
@strong{Description}@*
Open the file @var{filename} with the target @var{target}.
Return a pointer to the created BFD. If @var{fd} is not -1,
then @code{fdopen} is used to open the file; otherwise, @code{fopen}
is used. @var{mode} is passed directly to @code{fopen} or
@code{fdopen}.
Calls @code{bfd_find_target}, so @var{target} is interpreted as by
that function.
The new BFD is marked as cacheable iff @var{fd} is -1.
If @code{NULL} is returned then an error has occured. Possible errors
are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or
@code{system_call} error.
@findex bfd_openr
@subsubsection @code{bfd_openr}
@strong{Synopsis}
@example
bfd *bfd_openr (const char *filename, const char *target);
@end example
@strong{Description}@*
Open the file @var{filename} (using @code{fopen}) with the target
@var{target}. Return a pointer to the created BFD.
Calls @code{bfd_find_target}, so @var{target} is interpreted as by
that function.
If @code{NULL} is returned then an error has occured. Possible errors
are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or
@code{system_call} error.
@findex bfd_fdopenr
@subsubsection @code{bfd_fdopenr}
@strong{Synopsis}
@example
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
@end example
@strong{Description}@*
@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to
@code{fopen}. It opens a BFD on a file already described by the
@var{fd} supplied.
When the file is later @code{bfd_close}d, the file descriptor will
be closed. If the caller desires that this file descriptor be
cached by BFD (opened as needed, closed as needed to free
descriptors for other opens), with the supplied @var{fd} used as
an initial file descriptor (but subject to closure at any time),
call bfd_set_cacheable(bfd, 1) on the returned BFD. The default
is to assume no caching; the file descriptor will remain open
until @code{bfd_close}, and will not be affected by BFD operations
on other files.
Possible errors are @code{bfd_error_no_memory},
@code{bfd_error_invalid_target} and @code{bfd_error_system_call}.
@findex bfd_openstreamr
@subsubsection @code{bfd_openstreamr}
@strong{Synopsis}
@example
bfd *bfd_openstreamr (const char *, const char *, void *);
@end example
@strong{Description}@*
Open a BFD for read access on an existing stdio stream. When
the BFD is passed to @code{bfd_close}, the stream will be closed.
@findex bfd_openr_iovec
@subsubsection @code{bfd_openr_iovec}
@strong{Synopsis}
@example
bfd *bfd_openr_iovec (const char *filename, const char *target,
void *(*open) (struct bfd *nbfd,
void *open_closure),
void *open_closure,
file_ptr (*pread) (struct bfd *nbfd,
void *stream,
void *buf,
file_ptr nbytes,
file_ptr offset),
int (*close) (struct bfd *nbfd,
void *stream));
@end example
@strong{Description}@*
Create and return a BFD backed by a read-only @var{stream}.
The @var{stream} is created using @var{open}, accessed using
@var{pread} and destroyed using @var{close}.
Calls @code{bfd_find_target}, so @var{target} is interpreted as by
that function.
Calls @var{open} (which can call @code{bfd_zalloc} and
@code{bfd_get_filename}) to obtain the read-only stream backing
the BFD. @var{open} either succeeds returning the
non-@code{NULL} @var{stream}, or fails returning @code{NULL}
(setting @code{bfd_error}).
Calls @var{pread} to request @var{nbytes} of data from
@var{stream} starting at @var{offset} (e.g., via a call to
@code{bfd_read}). @var{pread} either succeeds returning the
number of bytes read (which can be less than @var{nbytes} when
end-of-file), or fails returning -1 (setting @code{bfd_error}).
Calls @var{close} when the BFD is later closed using
@code{bfd_close}. @var{close} either succeeds returning 0, or
fails returning -1 (setting @code{bfd_error}).
If @code{bfd_openr_iovec} returns @code{NULL} then an error has
occurred. Possible errors are @code{bfd_error_no_memory},
@code{bfd_error_invalid_target} and @code{bfd_error_system_call}.
@findex bfd_openw
@subsubsection @code{bfd_openw}
@strong{Synopsis}
@example
bfd *bfd_openw (const char *filename, const char *target);
@end example
@strong{Description}@*
Create a BFD, associated with file @var{filename}, using the
file format @var{target}, and return a pointer to it.
Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory},
@code{bfd_error_invalid_target}.
@findex bfd_close
@subsubsection @code{bfd_close}
@strong{Synopsis}
@example
bfd_boolean bfd_close (bfd *abfd);
@end example
@strong{Description}@*
Close a BFD. If the BFD was open for writing, then pending
operations are completed and the file written out and closed.
If the created file is executable, then @code{chmod} is called
to mark it as such.
All memory attached to the BFD is released.
The file descriptor associated with the BFD is closed (even
if it was passed in to BFD by @code{bfd_fdopenr}).
@strong{Returns}@*
@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.
@findex bfd_close_all_done
@subsubsection @code{bfd_close_all_done}
@strong{Synopsis}
@example
bfd_boolean bfd_close_all_done (bfd *);
@end example
@strong{Description}@*
Close a BFD. Differs from @code{bfd_close} since it does not
complete any pending operations. This routine would be used
if the application had just used BFD for swapping and didn't
want to use any of the writing code.
If the created file is executable, then @code{chmod} is called
to mark it as such.
All memory attached to the BFD is released.
@strong{Returns}@*
@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.
@findex bfd_create
@subsubsection @code{bfd_create}
@strong{Synopsis}
@example
bfd *bfd_create (const char *filename, bfd *templ);
@end example
@strong{Description}@*
Create a new BFD in the manner of @code{bfd_openw}, but without
opening a file. The new BFD takes the target from the target
used by @var{template}. The format is always set to @code{bfd_object}.
@findex bfd_make_writable
@subsubsection @code{bfd_make_writable}
@strong{Synopsis}
@example
bfd_boolean bfd_make_writable (bfd *abfd);
@end example
@strong{Description}@*
Takes a BFD as created by @code{bfd_create} and converts it
into one like as returned by @code{bfd_openw}. It does this
by converting the BFD to BFD_IN_MEMORY. It's assumed that
you will call @code{bfd_make_readable} on this bfd later.
@strong{Returns}@*
@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.
@findex bfd_make_readable
@subsubsection @code{bfd_make_readable}
@strong{Synopsis}
@example
bfd_boolean bfd_make_readable (bfd *abfd);
@end example
@strong{Description}@*
Takes a BFD as created by @code{bfd_create} and
@code{bfd_make_writable} and converts it into one like as
returned by @code{bfd_openr}. It does this by writing the
contents out to the memory buffer, then reversing the
direction.
@strong{Returns}@*
@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.
@findex bfd_alloc
@subsubsection @code{bfd_alloc}
@strong{Synopsis}
@example
void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
@end example
@strong{Description}@*
Allocate a block of @var{wanted} bytes of memory attached to
@code{abfd} and return a pointer to it.
@findex bfd_alloc2
@subsubsection @code{bfd_alloc2}
@strong{Synopsis}
@example
void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size);
@end example
@strong{Description}@*
Allocate a block of @var{nmemb} elements of @var{size} bytes each
of memory attached to @code{abfd} and return a pointer to it.
@findex bfd_zalloc
@subsubsection @code{bfd_zalloc}
@strong{Synopsis}
@example
void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
@end example
@strong{Description}@*
Allocate a block of @var{wanted} bytes of zeroed memory
attached to @code{abfd} and return a pointer to it.
@findex bfd_zalloc2
@subsubsection @code{bfd_zalloc2}
@strong{Synopsis}
@example
void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size);
@end example
@strong{Description}@*
Allocate a block of @var{nmemb} elements of @var{size} bytes each
of zeroed memory attached to @code{abfd} and return a pointer to it.
@findex bfd_calc_gnu_debuglink_crc32
@subsubsection @code{bfd_calc_gnu_debuglink_crc32}
@strong{Synopsis}
@example
unsigned long bfd_calc_gnu_debuglink_crc32
(unsigned long crc, const unsigned char *buf, bfd_size_type len);
@end example
@strong{Description}@*
Computes a CRC value as used in the .gnu_debuglink section.
Advances the previously computed @var{crc} value by computing
and adding in the crc32 for @var{len} bytes of @var{buf}.
@strong{Returns}@*
Return the updated CRC32 value.
@findex get_debug_link_info
@subsubsection @code{get_debug_link_info}
@strong{Synopsis}
@example
char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
@end example
@strong{Description}@*
fetch the filename and CRC32 value for any separate debuginfo
associated with @var{abfd}. Return NULL if no such info found,
otherwise return filename and update @var{crc32_out}.
@findex separate_debug_file_exists
@subsubsection @code{separate_debug_file_exists}
@strong{Synopsis}
@example
bfd_boolean separate_debug_file_exists
(char *name, unsigned long crc32);
@end example
@strong{Description}@*
Checks to see if @var{name} is a file and if its contents
match @var{crc32}.
@findex find_separate_debug_file
@subsubsection @code{find_separate_debug_file}
@strong{Synopsis}
@example
char *find_separate_debug_file (bfd *abfd);
@end example
@strong{Description}@*
Searches @var{abfd} for a reference to separate debugging
information, scans various locations in the filesystem, including
the file tree rooted at @var{debug_file_directory}, and returns a
filename of such debugging information if the file is found and has
matching CRC32. Returns NULL if no reference to debugging file
exists, or file cannot be found.
@findex bfd_follow_gnu_debuglink
@subsubsection @code{bfd_follow_gnu_debuglink}
@strong{Synopsis}
@example
char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
@end example
@strong{Description}@*
Takes a BFD and searches it for a .gnu_debuglink section. If this
section is found, it examines the section for the name and checksum
of a '.debug' file containing auxiliary debugging information. It
then searches the filesystem for this .debug file in some standard
locations, including the directory tree rooted at @var{dir}, and if
found returns the full filename.
If @var{dir} is NULL, it will search a default path configured into
libbfd at build time. [XXX this feature is not currently
implemented].
@strong{Returns}@*
@code{NULL} on any errors or failure to locate the .debug file,
otherwise a pointer to a heap-allocated string containing the
filename. The caller is responsible for freeing this string.
@findex bfd_create_gnu_debuglink_section
@subsubsection @code{bfd_create_gnu_debuglink_section}
@strong{Synopsis}
@example
struct bfd_section *bfd_create_gnu_debuglink_section
(bfd *abfd, const char *filename);
@end example
@strong{Description}@*
Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized
to be big enough to contain a link to the specified @var{filename}.
@strong{Returns}@*
A pointer to the new section is returned if all is ok. Otherwise @code{NULL} is
returned and bfd_error is set.
@findex bfd_fill_in_gnu_debuglink_section
@subsubsection @code{bfd_fill_in_gnu_debuglink_section}
@strong{Synopsis}
@example
bfd_boolean bfd_fill_in_gnu_debuglink_section
(bfd *abfd, struct bfd_section *sect, const char *filename);
@end example
@strong{Description}@*
Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT}
and fills in the contents of the section to contain a link to the
specified @var{filename}. The filename should be relative to the
current directory.
@strong{Returns}@*
@code{TRUE} is returned if all is ok. Otherwise @code{FALSE} is returned
and bfd_error is set.

File diff suppressed because it is too large Load Diff

View File

@ -1,989 +0,0 @@
@section Sections
The raw data contained within a BFD is maintained through the
section abstraction. A single BFD may have any number of
sections. It keeps hold of them by pointing to the first;
each one points to the next in the list.
Sections are supported in BFD in @code{section.c}.
@menu
* Section Input::
* Section Output::
* typedef asection::
* section prototypes::
@end menu
@node Section Input, Section Output, Sections, Sections
@subsection Section input
When a BFD is opened for reading, the section structures are
created and attached to the BFD.
Each section has a name which describes the section in the
outside world---for example, @code{a.out} would contain at least
three sections, called @code{.text}, @code{.data} and @code{.bss}.
Names need not be unique; for example a COFF file may have several
sections named @code{.data}.
Sometimes a BFD will contain more than the ``natural'' number of
sections. A back end may attach other sections containing
constructor data, or an application may add a section (using
@code{bfd_make_section}) to the sections attached to an already open
BFD. For example, the linker creates an extra section
@code{COMMON} for each input file's BFD to hold information about
common storage.
The raw data is not necessarily read in when
the section descriptor is created. Some targets may leave the
data in place until a @code{bfd_get_section_contents} call is
made. Other back ends may read in all the data at once. For
example, an S-record file has to be read once to determine the
size of the data. An IEEE-695 file doesn't contain raw data in
sections, but data and relocation expressions intermixed, so
the data area has to be parsed to get out the data and
relocations.
@node Section Output, typedef asection, Section Input, Sections
@subsection Section output
To write a new object style BFD, the various sections to be
written have to be created. They are attached to the BFD in
the same way as input sections; data is written to the
sections using @code{bfd_set_section_contents}.
Any program that creates or combines sections (e.g., the assembler
and linker) must use the @code{asection} fields @code{output_section} and
@code{output_offset} to indicate the file sections to which each
section must be written. (If the section is being created from
scratch, @code{output_section} should probably point to the section
itself and @code{output_offset} should probably be zero.)
The data to be written comes from input sections attached
(via @code{output_section} pointers) to
the output sections. The output section structure can be
considered a filter for the input section: the output section
determines the vma of the output data and the name, but the
input section determines the offset into the output section of
the data to be written.
E.g., to create a section "O", starting at 0x100, 0x123 long,
containing two subsections, "A" at offset 0x0 (i.e., at vma
0x100) and "B" at offset 0x20 (i.e., at vma 0x120) the @code{asection}
structures would look like:
@example
section name "A"
output_offset 0x00
size 0x20
output_section -----------> section name "O"
| vma 0x100
section name "B" | size 0x123
output_offset 0x20 |
size 0x103 |
output_section --------|
@end example
@subsection Link orders
The data within a section is stored in a @dfn{link_order}.
These are much like the fixups in @code{gas}. The link_order
abstraction allows a section to grow and shrink within itself.
A link_order knows how big it is, and which is the next
link_order and where the raw data for it is; it also points to
a list of relocations which apply to it.
The link_order is used by the linker to perform relaxing on
final code. The compiler creates code which is as big as
necessary to make it work without relaxing, and the user can
select whether to relax. Sometimes relaxing takes a lot of
time. The linker runs around the relocations to see if any
are attached to data which can be shrunk, if so it does it on
a link_order by link_order basis.
@node typedef asection, section prototypes, Section Output, Sections
@subsection typedef asection
Here is the section structure:
@example
typedef struct bfd_section
@{
/* The name of the section; the name isn't a copy, the pointer is
the same as that passed to bfd_make_section. */
const char *name;
/* A unique sequence number. */
int id;
/* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
int index;
/* The next section in the list belonging to the BFD, or NULL. */
struct bfd_section *next;
/* The previous section in the list belonging to the BFD, or NULL. */
struct bfd_section *prev;
/* The field flags contains attributes of the section. Some
flags are read in from the object file, and some are
synthesized from other information. */
flagword flags;
#define SEC_NO_FLAGS 0x000
/* Tells the OS to allocate space for this section when loading.
This is clear for a section containing debug information only. */
#define SEC_ALLOC 0x001
/* Tells the OS to load the section from the file when loading.
This is clear for a .bss section. */
#define SEC_LOAD 0x002
/* The section contains data still to be relocated, so there is
some relocation information too. */
#define SEC_RELOC 0x004
/* A signal to the OS that the section contains read only data. */
#define SEC_READONLY 0x008
/* The section contains code only. */
#define SEC_CODE 0x010
/* The section contains data only. */
#define SEC_DATA 0x020
/* The section will reside in ROM. */
#define SEC_ROM 0x040
/* The section contains constructor information. This section
type is used by the linker to create lists of constructors and
destructors used by @code{g++}. When a back end sees a symbol
which should be used in a constructor list, it creates a new
section for the type of name (e.g., @code{__CTOR_LIST__}), attaches
the symbol to it, and builds a relocation. To build the lists
of constructors, all the linker has to do is catenate all the
sections called @code{__CTOR_LIST__} and relocate the data
contained within - exactly the operations it would peform on
standard data. */
#define SEC_CONSTRUCTOR 0x080
/* The section has contents - a data section could be
@code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be
@code{SEC_HAS_CONTENTS} */
#define SEC_HAS_CONTENTS 0x100
/* An instruction to the linker to not output the section
even if it has information which would normally be written. */
#define SEC_NEVER_LOAD 0x200
/* The section contains thread local data. */
#define SEC_THREAD_LOCAL 0x400
/* The section has GOT references. This flag is only for the
linker, and is currently only used by the elf32-hppa back end.
It will be set if global offset table references were detected
in this section, which indicate to the linker that the section
contains PIC code, and must be handled specially when doing a
static link. */
#define SEC_HAS_GOT_REF 0x800
/* The section contains common symbols (symbols may be defined
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
used). Most targets have exactly one of these (which we
translate to bfd_com_section_ptr), but ECOFF has two. */
#define SEC_IS_COMMON 0x1000
/* The section contains only debugging information. For
example, this is set for ELF .debug and .stab sections.
strip tests this flag to see if a section can be
discarded. */
#define SEC_DEBUGGING 0x2000
/* The contents of this section are held in memory pointed to
by the contents field. This is checked by bfd_get_section_contents,
and the data is retrieved from memory if appropriate. */
#define SEC_IN_MEMORY 0x4000
/* The contents of this section are to be excluded by the
linker for executable and shared objects unless those
objects are to be further relocated. */
#define SEC_EXCLUDE 0x8000
/* The contents of this section are to be sorted based on the sum of
the symbol and addend values specified by the associated relocation
entries. Entries without associated relocation entries will be
appended to the end of the section in an unspecified order. */
#define SEC_SORT_ENTRIES 0x10000
/* When linking, duplicate sections of the same name should be
discarded, rather than being combined into a single section as
is usually done. This is similar to how common symbols are
handled. See SEC_LINK_DUPLICATES below. */
#define SEC_LINK_ONCE 0x20000
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
should handle duplicate sections. */
#define SEC_LINK_DUPLICATES 0x40000
/* This value for SEC_LINK_DUPLICATES means that duplicate
sections with the same name should simply be discarded. */
#define SEC_LINK_DUPLICATES_DISCARD 0x0
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if there are any duplicate sections, although
it should still only link one copy. */
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections are a different size. */
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections contain different
contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
(SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
/* This section was created by the linker as part of dynamic
relocation or other arcane processing. It is skipped when
going through the first-pass output, trusting that someone
else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x200000
/* This section should not be subject to garbage collection. */
#define SEC_KEEP 0x400000
/* This section contains "short" data, and should be placed
"near" the GP. */
#define SEC_SMALL_DATA 0x800000
/* Attempt to merge identical entities in the section.
Entity size is given in the entsize field. */
#define SEC_MERGE 0x1000000
/* If given with SEC_MERGE, entities to merge are zero terminated
strings where entsize specifies character size instead of fixed
size entries. */
#define SEC_STRINGS 0x2000000
/* This section contains data about section groups. */
#define SEC_GROUP 0x4000000
/* The section is a COFF shared library section. This flag is
only for the linker. If this type of section appears in
the input file, the linker must copy it to the output file
without changing the vma or size. FIXME: Although this
was originally intended to be general, it really is COFF
specific (and the flag was renamed to indicate this). It
might be cleaner to have some more general mechanism to
allow the back end to control what the linker does with
sections. */
#define SEC_COFF_SHARED_LIBRARY 0x10000000
/* This section contains data which may be shared with other
executables or shared objects. This is for COFF only. */
#define SEC_COFF_SHARED 0x20000000
/* When a section with this flag is being linked, then if the size of
the input section is less than a page, it should not cross a page
boundary. If the size of the input section is one page or more,
it should be aligned on a page boundary. This is for TI
TMS320C54X only. */
#define SEC_TIC54X_BLOCK 0x40000000
/* Conditionally link this section; do not link if there are no
references found to any symbol in the section. This is for TI
TMS320C54X only. */
#define SEC_TIC54X_CLINK 0x80000000
/* End of section flags. */
/* Some internal packed boolean fields. */
/* See the vma field. */
unsigned int user_set_vma : 1;
/* A mark flag used by some of the linker backends. */
unsigned int linker_mark : 1;
/* Another mark flag used by some of the linker backends. Set for
output sections that have an input section. */
unsigned int linker_has_input : 1;
/* Mark flags used by some linker backends for garbage collection. */
unsigned int gc_mark : 1;
unsigned int gc_mark_from_eh : 1;
/* The following flags are used by the ELF linker. */
/* Mark sections which have been allocated to segments. */
unsigned int segment_mark : 1;
/* Type of sec_info information. */
unsigned int sec_info_type:3;
#define ELF_INFO_TYPE_NONE 0
#define ELF_INFO_TYPE_STABS 1
#define ELF_INFO_TYPE_MERGE 2
#define ELF_INFO_TYPE_EH_FRAME 3
#define ELF_INFO_TYPE_JUST_SYMS 4
/* Nonzero if this section uses RELA relocations, rather than REL. */
unsigned int use_rela_p:1;
/* Bits used by various backends. The generic code doesn't touch
these fields. */
/* Nonzero if this section has TLS related relocations. */
unsigned int has_tls_reloc:1;
/* Nonzero if this section has a gp reloc. */
unsigned int has_gp_reloc:1;
/* Nonzero if this section needs the relax finalize pass. */
unsigned int need_finalize_relax:1;
/* Whether relocations have been processed. */
unsigned int reloc_done : 1;
/* End of internal packed boolean fields. */
/* The virtual memory address of the section - where it will be
at run time. The symbols are relocated against this. The
user_set_vma flag is maintained by bfd; if it's not set, the
backend can assign addresses (for example, in @code{a.out}, where
the default address for @code{.data} is dependent on the specific
target and various flags). */
bfd_vma vma;
/* The load address of the section - where it would be in a
rom image; really only used for writing section header
information. */
bfd_vma lma;
/* The size of the section in octets, as it will be output.
Contains a value even if the section has no contents (e.g., the
size of @code{.bss}). */
bfd_size_type size;
/* For input sections, the original size on disk of the section, in
octets. This field is used by the linker relaxation code. It is
currently only set for sections where the linker relaxation scheme
doesn't cache altered section and reloc contents (stabs, eh_frame,
SEC_MERGE, some coff relaxing targets), and thus the original size
needs to be kept to read the section multiple times.
For output sections, rawsize holds the section size calculated on
a previous linker relaxation pass. */
bfd_size_type rawsize;
/* If this section is going to be output, then this value is the
offset in *bytes* into the output section of the first byte in the
input section (byte ==> smallest addressable unit on the
target). In most cases, if this was going to start at the
100th octet (8-bit quantity) in the output section, this value
would be 100. However, if the target byte size is 16 bits
(bfd_octets_per_byte is "2"), this value would be 50. */
bfd_vma output_offset;
/* The output section through which to map on output. */
struct bfd_section *output_section;
/* The alignment requirement of the section, as an exponent of 2 -
e.g., 3 aligns to 2^3 (or 8). */
unsigned int alignment_power;
/* If an input section, a pointer to a vector of relocation
records for the data in this section. */
struct reloc_cache_entry *relocation;
/* If an output section, a pointer to a vector of pointers to
relocation records for the data in this section. */
struct reloc_cache_entry **orelocation;
/* The number of relocation records in one of the above. */
unsigned reloc_count;
/* Information below is back end specific - and not always used
or updated. */
/* File position of section data. */
file_ptr filepos;
/* File position of relocation info. */
file_ptr rel_filepos;
/* File position of line data. */
file_ptr line_filepos;
/* Pointer to data for applications. */
void *userdata;
/* If the SEC_IN_MEMORY flag is set, this points to the actual
contents. */
unsigned char *contents;
/* Attached line number information. */
alent *lineno;
/* Number of line number records. */
unsigned int lineno_count;
/* Entity size for merging purposes. */
unsigned int entsize;
/* Points to the kept section if this section is a link-once section,
and is discarded. */
struct bfd_section *kept_section;
/* When a section is being output, this value changes as more
linenumbers are written out. */
file_ptr moving_line_filepos;
/* What the section number is in the target world. */
int target_index;
void *used_by_bfd;
/* If this is a constructor section then here is a list of the
relocations created to relocate items within it. */
struct relent_chain *constructor_chain;
/* The BFD which owns the section. */
bfd *owner;
/* A symbol which points at this section only. */
struct bfd_symbol *symbol;
struct bfd_symbol **symbol_ptr_ptr;
/* Early in the link process, map_head and map_tail are used to build
a list of input sections attached to an output section. Later,
output sections use these fields for a list of bfd_link_order
structs. */
union @{
struct bfd_link_order *link_order;
struct bfd_section *s;
@} map_head, map_tail;
@} asection;
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
these sections. New code should use the section_ptr macros rather
than referring directly to the const sections. The const sections
may eventually vanish. */
#define BFD_ABS_SECTION_NAME "*ABS*"
#define BFD_UND_SECTION_NAME "*UND*"
#define BFD_COM_SECTION_NAME "*COM*"
#define BFD_IND_SECTION_NAME "*IND*"
/* The absolute section. */
extern asection bfd_abs_section;
#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
/* Pointer to the undefined section. */
extern asection bfd_und_section;
#define bfd_und_section_ptr ((asection *) &bfd_und_section)
#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
/* Pointer to the common section. */
extern asection bfd_com_section;
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
/* Pointer to the indirect section. */
extern asection bfd_ind_section;
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
#define bfd_is_const_section(SEC) \
( ((SEC) == bfd_abs_section_ptr) \
|| ((SEC) == bfd_und_section_ptr) \
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct bfd_symbol * const bfd_abs_symbol;
extern const struct bfd_symbol * const bfd_com_symbol;
extern const struct bfd_symbol * const bfd_und_symbol;
extern const struct bfd_symbol * const bfd_ind_symbol;
/* Macros to handle insertion and deletion of a bfd's sections. These
only handle the list pointers, ie. do not adjust section_count,
target_index etc. */
#define bfd_section_list_remove(ABFD, S) \
do \
@{ \
asection *_s = S; \
asection *_next = _s->next; \
asection *_prev = _s->prev; \
if (_prev) \
_prev->next = _next; \
else \
(ABFD)->sections = _next; \
if (_next) \
_next->prev = _prev; \
else \
(ABFD)->section_last = _prev; \
@} \
while (0)
#define bfd_section_list_append(ABFD, S) \
do \
@{ \
asection *_s = S; \
bfd *_abfd = ABFD; \
_s->next = NULL; \
if (_abfd->section_last) \
@{ \
_s->prev = _abfd->section_last; \
_abfd->section_last->next = _s; \
@} \
else \
@{ \
_s->prev = NULL; \
_abfd->sections = _s; \
@} \
_abfd->section_last = _s; \
@} \
while (0)
#define bfd_section_list_prepend(ABFD, S) \
do \
@{ \
asection *_s = S; \
bfd *_abfd = ABFD; \
_s->prev = NULL; \
if (_abfd->sections) \
@{ \
_s->next = _abfd->sections; \
_abfd->sections->prev = _s; \
@} \
else \
@{ \
_s->next = NULL; \
_abfd->section_last = _s; \
@} \
_abfd->sections = _s; \
@} \
while (0)
#define bfd_section_list_insert_after(ABFD, A, S) \
do \
@{ \
asection *_a = A; \
asection *_s = S; \
asection *_next = _a->next; \
_s->next = _next; \
_s->prev = _a; \
_a->next = _s; \
if (_next) \
_next->prev = _s; \
else \
(ABFD)->section_last = _s; \
@} \
while (0)
#define bfd_section_list_insert_before(ABFD, B, S) \
do \
@{ \
asection *_b = B; \
asection *_s = S; \
asection *_prev = _b->prev; \
_s->prev = _prev; \
_s->next = _b; \
_b->prev = _s; \
if (_prev) \
_prev->next = _s; \
else \
(ABFD)->sections = _s; \
@} \
while (0)
#define bfd_section_removed_from_list(ABFD, S) \
((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \
/* name, id, index, next, prev, flags, user_set_vma, */ \
@{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
/* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \
0, 0, 1, 0, \
\
/* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \
0, 0, 0, 0, \
\
/* has_gp_reloc, need_finalize_relax, reloc_done, */ \
0, 0, 0, \
\
/* vma, lma, size, rawsize */ \
0, 0, 0, 0, \
\
/* output_offset, output_section, alignment_power, */ \
0, (struct bfd_section *) &SEC, 0, \
\
/* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
NULL, NULL, 0, 0, 0, \
\
/* line_filepos, userdata, contents, lineno, lineno_count, */ \
0, NULL, NULL, NULL, 0, \
\
/* entsize, kept_section, moving_line_filepos, */ \
0, NULL, 0, \
\
/* target_index, used_by_bfd, constructor_chain, owner, */ \
0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct bfd_symbol *) SYM, \
\
/* symbol_ptr_ptr, */ \
(struct bfd_symbol **) SYM_PTR, \
\
/* map_head, map_tail */ \
@{ NULL @}, @{ NULL @} \
@}
@end example
@node section prototypes, , typedef asection, Sections
@subsection Section prototypes
These are the functions exported by the section handling part of BFD.
@findex bfd_section_list_clear
@subsubsection @code{bfd_section_list_clear}
@strong{Synopsis}
@example
void bfd_section_list_clear (bfd *);
@end example
@strong{Description}@*
Clears the section list, and also resets the section count and
hash table entries.
@findex bfd_get_section_by_name
@subsubsection @code{bfd_get_section_by_name}
@strong{Synopsis}
@example
asection *bfd_get_section_by_name (bfd *abfd, const char *name);
@end example
@strong{Description}@*
Run through @var{abfd} and return the one of the
@code{asection}s whose name matches @var{name}, otherwise @code{NULL}.
@xref{Sections}, for more information.
This should only be used in special cases; the normal way to process
all sections of a given name is to use @code{bfd_map_over_sections} and
@code{strcmp} on the name (or better yet, base it on the section flags
or something else) for each section.
@findex bfd_get_section_by_name_if
@subsubsection @code{bfd_get_section_by_name_if}
@strong{Synopsis}
@example
asection *bfd_get_section_by_name_if
(bfd *abfd,
const char *name,
bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
@end example
@strong{Description}@*
Call the provided function @var{func} for each section
attached to the BFD @var{abfd} whose name matches @var{name},
passing @var{obj} as an argument. The function will be called
as if by
@example
func (abfd, the_section, obj);
@end example
It returns the first section for which @var{func} returns true,
otherwise @code{NULL}.
@findex bfd_get_unique_section_name
@subsubsection @code{bfd_get_unique_section_name}
@strong{Synopsis}
@example
char *bfd_get_unique_section_name
(bfd *abfd, const char *templat, int *count);
@end example
@strong{Description}@*
Invent a section name that is unique in @var{abfd} by tacking
a dot and a digit suffix onto the original @var{templat}. If
@var{count} is non-NULL, then it specifies the first number
tried as a suffix to generate a unique name. The value
pointed to by @var{count} will be incremented in this case.
@findex bfd_make_section_old_way
@subsubsection @code{bfd_make_section_old_way}
@strong{Synopsis}
@example
asection *bfd_make_section_old_way (bfd *abfd, const char *name);
@end example
@strong{Description}@*
Create a new empty section called @var{name}
and attach it to the end of the chain of sections for the
BFD @var{abfd}. An attempt to create a section with a name which
is already in use returns its pointer without changing the
section chain.
It has the funny name since this is the way it used to be
before it was rewritten....
Possible errors are:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} -
If output has already started for this BFD.
@item
@code{bfd_error_no_memory} -
If memory allocation fails.
@end itemize
@findex bfd_make_section_anyway_with_flags
@subsubsection @code{bfd_make_section_anyway_with_flags}
@strong{Synopsis}
@example
asection *bfd_make_section_anyway_with_flags
(bfd *abfd, const char *name, flagword flags);
@end example
@strong{Description}@*
Create a new empty section called @var{name} and attach it to the end of
the chain of sections for @var{abfd}. Create a new section even if there
is already a section with that name. Also set the attributes of the
new section to the value @var{flags}.
Return @code{NULL} and set @code{bfd_error} on error; possible errors are:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}.
@item
@code{bfd_error_no_memory} - If memory allocation fails.
@end itemize
@findex bfd_make_section_anyway
@subsubsection @code{bfd_make_section_anyway}
@strong{Synopsis}
@example
asection *bfd_make_section_anyway (bfd *abfd, const char *name);
@end example
@strong{Description}@*
Create a new empty section called @var{name} and attach it to the end of
the chain of sections for @var{abfd}. Create a new section even if there
is already a section with that name.
Return @code{NULL} and set @code{bfd_error} on error; possible errors are:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}.
@item
@code{bfd_error_no_memory} - If memory allocation fails.
@end itemize
@findex bfd_make_section_with_flags
@subsubsection @code{bfd_make_section_with_flags}
@strong{Synopsis}
@example
asection *bfd_make_section_with_flags
(bfd *, const char *name, flagword flags);
@end example
@strong{Description}@*
Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling
bfd_set_error ()) without changing the section chain if there is already a
section named @var{name}. Also set the attributes of the new section to
the value @var{flags}. If there is an error, return @code{NULL} and set
@code{bfd_error}.
@findex bfd_make_section
@subsubsection @code{bfd_make_section}
@strong{Synopsis}
@example
asection *bfd_make_section (bfd *, const char *name);
@end example
@strong{Description}@*
Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling
bfd_set_error ()) without changing the section chain if there is already a
section named @var{name}. If there is an error, return @code{NULL} and set
@code{bfd_error}.
@findex bfd_set_section_flags
@subsubsection @code{bfd_set_section_flags}
@strong{Synopsis}
@example
bfd_boolean bfd_set_section_flags
(bfd *abfd, asection *sec, flagword flags);
@end example
@strong{Description}@*
Set the attributes of the section @var{sec} in the BFD
@var{abfd} to the value @var{flags}. Return @code{TRUE} on success,
@code{FALSE} on error. Possible error returns are:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} -
The section cannot have one or more of the attributes
requested. For example, a .bss section in @code{a.out} may not
have the @code{SEC_HAS_CONTENTS} field set.
@end itemize
@findex bfd_map_over_sections
@subsubsection @code{bfd_map_over_sections}
@strong{Synopsis}
@example
void bfd_map_over_sections
(bfd *abfd,
void (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
@end example
@strong{Description}@*
Call the provided function @var{func} for each section
attached to the BFD @var{abfd}, passing @var{obj} as an
argument. The function will be called as if by
@example
func (abfd, the_section, obj);
@end example
This is the preferred method for iterating over sections; an
alternative would be to use a loop:
@example
section *p;
for (p = abfd->sections; p != NULL; p = p->next)
func (abfd, p, ...)
@end example
@findex bfd_sections_find_if
@subsubsection @code{bfd_sections_find_if}
@strong{Synopsis}
@example
asection *bfd_sections_find_if
(bfd *abfd,
bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
void *obj);
@end example
@strong{Description}@*
Call the provided function @var{operation} for each section
attached to the BFD @var{abfd}, passing @var{obj} as an
argument. The function will be called as if by
@example
operation (abfd, the_section, obj);
@end example
It returns the first section for which @var{operation} returns true.
@findex bfd_set_section_size
@subsubsection @code{bfd_set_section_size}
@strong{Synopsis}
@example
bfd_boolean bfd_set_section_size
(bfd *abfd, asection *sec, bfd_size_type val);
@end example
@strong{Description}@*
Set @var{sec} to the size @var{val}. If the operation is
ok, then @code{TRUE} is returned, else @code{FALSE}.
Possible error returns:
@itemize @bullet
@item
@code{bfd_error_invalid_operation} -
Writing has started to the BFD, so setting the size is invalid.
@end itemize
@findex bfd_set_section_contents
@subsubsection @code{bfd_set_section_contents}
@strong{Synopsis}
@example
bfd_boolean bfd_set_section_contents
(bfd *abfd, asection *section, const void *data,
file_ptr offset, bfd_size_type count);
@end example
@strong{Description}@*
Sets the contents of the section @var{section} in BFD
@var{abfd} to the data starting in memory at @var{data}. The
data is written to the output section starting at offset
@var{offset} for @var{count} octets.
Normally @code{TRUE} is returned, else @code{FALSE}. Possible error
returns are:
@itemize @bullet
@item
@code{bfd_error_no_contents} -
The output section does not have the @code{SEC_HAS_CONTENTS}
attribute, so nothing can be written to it.
@item
and some more too
@end itemize
This routine is front end to the back end function
@code{_bfd_set_section_contents}.
@findex bfd_get_section_contents
@subsubsection @code{bfd_get_section_contents}
@strong{Synopsis}
@example
bfd_boolean bfd_get_section_contents
(bfd *abfd, asection *section, void *location, file_ptr offset,
bfd_size_type count);
@end example
@strong{Description}@*
Read data from @var{section} in BFD @var{abfd}
into memory starting at @var{location}. The data is read at an
offset of @var{offset} from the start of the input section,
and is read for @var{count} bytes.
If the contents of a constructor with the @code{SEC_CONSTRUCTOR}
flag set are requested or if the section does not have the
@code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled
with zeroes. If no errors occur, @code{TRUE} is returned, else
@code{FALSE}.
@findex bfd_malloc_and_get_section
@subsubsection @code{bfd_malloc_and_get_section}
@strong{Synopsis}
@example
bfd_boolean bfd_malloc_and_get_section
(bfd *abfd, asection *section, bfd_byte **buf);
@end example
@strong{Description}@*
Read all data from @var{section} in BFD @var{abfd}
into a buffer, *@var{buf}, malloc'd by this function.
@findex bfd_copy_private_section_data
@subsubsection @code{bfd_copy_private_section_data}
@strong{Synopsis}
@example
bfd_boolean bfd_copy_private_section_data
(bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
@end example
@strong{Description}@*
Copy private section information from @var{isec} in the BFD
@var{ibfd} to the section @var{osec} in the BFD @var{obfd}.
Return @code{TRUE} on success, @code{FALSE} on error. Possible error
returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{osec}.
@end itemize
@example
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
(ibfd, isection, obfd, osection))
@end example
@findex bfd_generic_is_group_section
@subsubsection @code{bfd_generic_is_group_section}
@strong{Synopsis}
@example
bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
@end example
@strong{Description}@*
Returns TRUE if @var{sec} is a member of a group.
@findex bfd_generic_discard_group
@subsubsection @code{bfd_generic_discard_group}
@strong{Synopsis}
@example
bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
@end example
@strong{Description}@*
Remove all members of @var{group} from the output.

View File

@ -1,461 +0,0 @@
@section Symbols
BFD tries to maintain as much symbol information as it can when
it moves information from file to file. BFD passes information
to applications though the @code{asymbol} structure. When the
application requests the symbol table, BFD reads the table in
the native form and translates parts of it into the internal
format. To maintain more than the information passed to
applications, some targets keep some information ``behind the
scenes'' in a structure only the particular back end knows
about. For example, the coff back end keeps the original
symbol table structure as well as the canonical structure when
a BFD is read in. On output, the coff back end can reconstruct
the output symbol table so that no information is lost, even
information unique to coff which BFD doesn't know or
understand. If a coff symbol table were read, but were written
through an a.out back end, all the coff specific information
would be lost. The symbol table of a BFD
is not necessarily read in until a canonicalize request is
made. Then the BFD back end fills in a table provided by the
application with pointers to the canonical information. To
output symbols, the application provides BFD with a table of
pointers to pointers to @code{asymbol}s. This allows applications
like the linker to output a symbol as it was read, since the ``behind
the scenes'' information will be still available.
@menu
* Reading Symbols::
* Writing Symbols::
* Mini Symbols::
* typedef asymbol::
* symbol handling functions::
@end menu
@node Reading Symbols, Writing Symbols, Symbols, Symbols
@subsection Reading symbols
There are two stages to reading a symbol table from a BFD:
allocating storage, and the actual reading process. This is an
excerpt from an application which reads the symbol table:
@example
long storage_needed;
asymbol **symbol_table;
long number_of_symbols;
long i;
storage_needed = bfd_get_symtab_upper_bound (abfd);
if (storage_needed < 0)
FAIL
if (storage_needed == 0)
return;
symbol_table = xmalloc (storage_needed);
...
number_of_symbols =
bfd_canonicalize_symtab (abfd, symbol_table);
if (number_of_symbols < 0)
FAIL
for (i = 0; i < number_of_symbols; i++)
process_symbol (symbol_table[i]);
@end example
All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols
@subsection Writing symbols
Writing of a symbol table is automatic when a BFD open for
writing is closed. The application attaches a vector of
pointers to pointers to symbols to the BFD being written, and
fills in the symbol count. The close and cleanup code reads
through the table provided and performs all the necessary
operations. The BFD output code must always be provided with an
``owned'' symbol: one which has come from another BFD, or one
which has been created using @code{bfd_make_empty_symbol}. Here is an
example showing the creation of a symbol table with only one element:
@example
#include "bfd.h"
int main (void)
@{
bfd *abfd;
asymbol *ptrs[2];
asymbol *new;
abfd = bfd_openw ("foo","a.out-sunos-big");
bfd_set_format (abfd, bfd_object);
new = bfd_make_empty_symbol (abfd);
new->name = "dummy_symbol";
new->section = bfd_make_section_old_way (abfd, ".text");
new->flags = BSF_GLOBAL;
new->value = 0x12345;
ptrs[0] = new;
ptrs[1] = 0;
bfd_set_symtab (abfd, ptrs, 1);
bfd_close (abfd);
return 0;
@}
./makesym
nm foo
00012345 A dummy_symbol
@end example
Many formats cannot represent arbitrary symbol information; for
instance, the @code{a.out} object format does not allow an
arbitrary number of sections. A symbol pointing to a section
which is not one of @code{.text}, @code{.data} or @code{.bss} cannot
be described.
@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols
@subsection Mini Symbols
Mini symbols provide read-only access to the symbol table.
They use less memory space, but require more time to access.
They can be useful for tools like nm or objdump, which may
have to handle symbol tables of extremely large executables.
The @code{bfd_read_minisymbols} function will read the symbols
into memory in an internal form. It will return a @code{void *}
pointer to a block of memory, a symbol count, and the size of
each symbol. The pointer is allocated using @code{malloc}, and
should be freed by the caller when it is no longer needed.
The function @code{bfd_minisymbol_to_symbol} will take a pointer
to a minisymbol, and a pointer to a structure returned by
@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure.
The return value may or may not be the same as the value from
@code{bfd_make_empty_symbol} which was passed in.
@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols
@subsection typedef asymbol
An @code{asymbol} has the form:
@example
typedef struct bfd_symbol
@{
/* A pointer to the BFD which owns the symbol. This information
is necessary so that a back end can work out what additional
information (invisible to the application writer) is carried
with the symbol.
This field is *almost* redundant, since you can use section->owner
instead, except that some symbols point to the global sections
bfd_@{abs,com,und@}_section. This could be fixed by making
these globals be per-bfd (or per-target-flavor). FIXME. */
struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
/* The text of the symbol. The name is left alone, and not copied; the
application may not alter it. */
const char *name;
/* The value of the symbol. This really should be a union of a
numeric value with a pointer, since some flags indicate that
a pointer to another symbol is stored here. */
symvalue value;
/* Attributes of a symbol. */
#define BSF_NO_FLAGS 0x00
/* The symbol has local scope; @code{static} in @code{C}. The value
is the offset into the section of the data. */
#define BSF_LOCAL 0x01
/* The symbol has global scope; initialized data in @code{C}. The
value is the offset into the section of the data. */
#define BSF_GLOBAL 0x02
/* The symbol has global scope and is exported. The value is
the offset into the section of the data. */
#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
/* A normal C symbol would be one of:
@code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or
@code{BSF_GLOBAL}. */
/* The symbol is a debugging record. The value has an arbitrary
meaning, unless BSF_DEBUGGING_RELOC is also set. */
#define BSF_DEBUGGING 0x08
/* The symbol denotes a function entry point. Used in ELF,
perhaps others someday. */
#define BSF_FUNCTION 0x10
/* Used by the linker. */
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
/* A weak global symbol, overridable without warnings by
a regular global symbol of the same name. */
#define BSF_WEAK 0x80
/* This symbol was created to point to a section, e.g. ELF's
STT_SECTION symbols. */
#define BSF_SECTION_SYM 0x100
/* The symbol used to be a common symbol, but now it is
allocated. */
#define BSF_OLD_COMMON 0x200
/* The default value for common data. */
#define BFD_FORT_COMM_DEFAULT_VALUE 0
/* In some files the type of a symbol sometimes alters its
location in an output file - ie in coff a @code{ISFCN} symbol
which is also @code{C_EXT} symbol appears where it was
declared and not at the end of a section. This bit is set
by the target BFD part to convey this information. */
#define BSF_NOT_AT_END 0x400
/* Signal that the symbol is the label of constructor section. */
#define BSF_CONSTRUCTOR 0x800
/* Signal that the symbol is a warning symbol. The name is a
warning. The name of the next symbol is the one to warn about;
if a reference is made to a symbol with the same name as the next
symbol, a warning is issued by the linker. */
#define BSF_WARNING 0x1000
/* Signal that the symbol is indirect. This symbol is an indirect
pointer to the symbol with the same name as the next symbol. */
#define BSF_INDIRECT 0x2000
/* BSF_FILE marks symbols that contain a file name. This is used
for ELF STT_FILE symbols. */
#define BSF_FILE 0x4000
/* Symbol is from dynamic linking information. */
#define BSF_DYNAMIC 0x8000
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
#define BSF_OBJECT 0x10000
/* This symbol is a debugging symbol. The value is the offset
into the section of the data. BSF_DEBUGGING should be set
as well. */
#define BSF_DEBUGGING_RELOC 0x20000
/* This symbol is thread local. Used in ELF. */
#define BSF_THREAD_LOCAL 0x40000
flagword flags;
/* A pointer to the section to which this symbol is
relative. This will always be non NULL, there are special
sections for undefined and absolute symbols. */
struct bfd_section *section;
/* Back end special data. */
union
@{
void *p;
bfd_vma i;
@}
udata;
@}
asymbol;
@end example
@node symbol handling functions, , typedef asymbol, Symbols
@subsection Symbol handling functions
@findex bfd_get_symtab_upper_bound
@subsubsection @code{bfd_get_symtab_upper_bound}
@strong{Description}@*
Return the number of bytes required to store a vector of pointers
to @code{asymbols} for all the symbols in the BFD @var{abfd},
including a terminal NULL pointer. If there are no symbols in
the BFD, then return 0. If an error occurs, return -1.
@example
#define bfd_get_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
@end example
@findex bfd_is_local_label
@subsubsection @code{bfd_is_local_label}
@strong{Synopsis}
@example
bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
@end example
@strong{Description}@*
Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
a compiler generated local label, else return FALSE.
@findex bfd_is_local_label_name
@subsubsection @code{bfd_is_local_label_name}
@strong{Synopsis}
@example
bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
@end example
@strong{Description}@*
Return TRUE if a symbol with the name @var{name} in the BFD
@var{abfd} is a compiler generated local label, else return
FALSE. This just checks whether the name has the form of a
local label.
@example
#define bfd_is_local_label_name(abfd, name) \
BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
@end example
@findex bfd_is_target_special_symbol
@subsubsection @code{bfd_is_target_special_symbol}
@strong{Synopsis}
@example
bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
@end example
@strong{Description}@*
Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
special to the particular target represented by the BFD. Such symbols
should normally not be mentioned to the user.
@example
#define bfd_is_target_special_symbol(abfd, sym) \
BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
@end example
@findex bfd_canonicalize_symtab
@subsubsection @code{bfd_canonicalize_symtab}
@strong{Description}@*
Read the symbols from the BFD @var{abfd}, and fills in
the vector @var{location} with pointers to the symbols and
a trailing NULL.
Return the actual number of symbol pointers, not
including the NULL.
@example
#define bfd_canonicalize_symtab(abfd, location) \
BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
@end example
@findex bfd_set_symtab
@subsubsection @code{bfd_set_symtab}
@strong{Synopsis}
@example
bfd_boolean bfd_set_symtab
(bfd *abfd, asymbol **location, unsigned int count);
@end example
@strong{Description}@*
Arrange that when the output BFD @var{abfd} is closed,
the table @var{location} of @var{count} pointers to symbols
will be written.
@findex bfd_print_symbol_vandf
@subsubsection @code{bfd_print_symbol_vandf}
@strong{Synopsis}
@example
void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
@end example
@strong{Description}@*
Print the value and flags of the @var{symbol} supplied to the
stream @var{file}.
@findex bfd_make_empty_symbol
@subsubsection @code{bfd_make_empty_symbol}
@strong{Description}@*
Create a new @code{asymbol} structure for the BFD @var{abfd}
and return a pointer to it.
This routine is necessary because each back end has private
information surrounding the @code{asymbol}. Building your own
@code{asymbol} and pointing to it will not create the private
information, and will cause problems later on.
@example
#define bfd_make_empty_symbol(abfd) \
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
@end example
@findex _bfd_generic_make_empty_symbol
@subsubsection @code{_bfd_generic_make_empty_symbol}
@strong{Synopsis}
@example
asymbol *_bfd_generic_make_empty_symbol (bfd *);
@end example
@strong{Description}@*
Create a new @code{asymbol} structure for the BFD @var{abfd}
and return a pointer to it. Used by core file routines,
binary back-end and anywhere else where no private info
is needed.
@findex bfd_make_debug_symbol
@subsubsection @code{bfd_make_debug_symbol}
@strong{Description}@*
Create a new @code{asymbol} structure for the BFD @var{abfd},
to be used as a debugging symbol. Further details of its use have
yet to be worked out.
@example
#define bfd_make_debug_symbol(abfd,ptr,size) \
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
@end example
@findex bfd_decode_symclass
@subsubsection @code{bfd_decode_symclass}
@strong{Description}@*
Return a character corresponding to the symbol
class of @var{symbol}, or '?' for an unknown class.
@strong{Synopsis}
@example
int bfd_decode_symclass (asymbol *symbol);
@end example
@findex bfd_is_undefined_symclass
@subsubsection @code{bfd_is_undefined_symclass}
@strong{Description}@*
Returns non-zero if the class symbol returned by
bfd_decode_symclass represents an undefined symbol.
Returns zero otherwise.
@strong{Synopsis}
@example
bfd_boolean bfd_is_undefined_symclass (int symclass);
@end example
@findex bfd_symbol_info
@subsubsection @code{bfd_symbol_info}
@strong{Description}@*
Fill in the basic info about symbol that nm needs.
Additional info may be added by the back-ends after
calling this function.
@strong{Synopsis}
@example
void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
@end example
@findex bfd_copy_private_symbol_data
@subsubsection @code{bfd_copy_private_symbol_data}
@strong{Synopsis}
@example
bfd_boolean bfd_copy_private_symbol_data
(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
@end example
@strong{Description}@*
Copy private symbol information from @var{isym} in the BFD
@var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}.
Return @code{TRUE} on success, @code{FALSE} on error. Possible error
returns are:
@itemize @bullet
@item
@code{bfd_error_no_memory} -
Not enough memory exists to create private data for @var{osec}.
@end itemize
@example
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
(ibfd, isymbol, obfd, osymbol))
@end example

View File

@ -1,551 +0,0 @@
@section Targets
@strong{Description}@*
Each port of BFD to a different machine requires the creation
of a target back end. All the back end provides to the root
part of BFD is a structure containing pointers to functions
which perform certain low level operations on files. BFD
translates the applications's requests through a pointer into
calls to the back end routines.
When a file is opened with @code{bfd_openr}, its format and
target are unknown. BFD uses various mechanisms to determine
how to interpret the file. The operations performed are:
@itemize @bullet
@item
Create a BFD by calling the internal routine
@code{_bfd_new_bfd}, then call @code{bfd_find_target} with the
target string supplied to @code{bfd_openr} and the new BFD pointer.
@item
If a null target string was provided to @code{bfd_find_target},
look up the environment variable @code{GNUTARGET} and use
that as the target string.
@item
If the target string is still @code{NULL}, or the target string is
@code{default}, then use the first item in the target vector
as the target type, and set @code{target_defaulted} in the BFD to
cause @code{bfd_check_format} to loop through all the targets.
@xref{bfd_target}. @xref{Formats}.
@item
Otherwise, inspect the elements in the target vector
one by one, until a match on target name is found. When found,
use it.
@item
Otherwise return the error @code{bfd_error_invalid_target} to
@code{bfd_openr}.
@item
@code{bfd_openr} attempts to open the file using
@code{bfd_open_file}, and returns the BFD.
@end itemize
Once the BFD has been opened and the target selected, the file
format may be determined. This is done by calling
@code{bfd_check_format} on the BFD with a suggested format.
If @code{target_defaulted} has been set, each possible target
type is tried to see if it recognizes the specified format.
@code{bfd_check_format} returns @code{TRUE} when the caller guesses right.
@menu
* bfd_target::
@end menu
@node bfd_target, , Targets, Targets
@subsection bfd_target
@strong{Description}@*
This structure contains everything that BFD knows about a
target. It includes things like its byte order, name, and which
routines to call to do various operations.
Every BFD points to a target structure with its @code{xvec}
member.
The macros below are used to dispatch to functions through the
@code{bfd_target} vector. They are used in a number of macros further
down in @file{bfd.h}, and are also used when calling various
routines by hand inside the BFD implementation. The @var{arglist}
argument must be parenthesized; it contains all the arguments
to the called function.
They make the documentation (more) unpleasant to read, so if
someone wants to fix this and not break the above, please do.
@example
#define BFD_SEND(bfd, message, arglist) \
((*((bfd)->xvec->message)) arglist)
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND
#define BFD_SEND(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
((*((bfd)->xvec->message)) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
@end example
For operations which index on the BFD format:
@example
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND_FMT
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
@end example
This is the structure which defines the type of BFD this is. The
@code{xvec} member of the struct @code{bfd} itself points here. Each
module that implements access to a different target under BFD,
defines one of these.
FIXME, these names should be rationalised with the names of
the entry points which call them. Too bad we can't have one
macro to define them both!
@example
enum bfd_flavour
@{
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,
bfd_target_ihex_flavour,
bfd_target_som_flavour,
bfd_target_os9k_flavour,
bfd_target_versados_flavour,
bfd_target_msdos_flavour,
bfd_target_ovax_flavour,
bfd_target_evax_flavour,
bfd_target_mmo_flavour,
bfd_target_mach_o_flavour,
bfd_target_pef_flavour,
bfd_target_pef_xlib_flavour,
bfd_target_sym_flavour
@};
enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @};
/* Forward declaration. */
typedef struct bfd_link_info _bfd_link_info;
typedef struct bfd_target
@{
/* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
char *name;
/* The "flavour" of a back end is a general indication about
the contents of a file. */
enum bfd_flavour flavour;
/* The order of bytes within the data area of a file. */
enum bfd_endian byteorder;
/* The order of bytes within the header parts of a file. */
enum bfd_endian header_byteorder;
/* A mask of all the flags which an executable may have set -
from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. */
flagword object_flags;
/* A mask of all the flags which a section may have set - from
the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. */
flagword section_flags;
/* The character normally found at the front of a symbol.
(if any), perhaps `_'. */
char symbol_leading_char;
/* The pad character for file names within an archive header. */
char ar_pad_char;
/* The maximum number of characters in an archive header. */
unsigned short ar_max_namelen;
/* Entries for byte swapping for data. These are different from the
other entry points, since they don't take a BFD as the first argument.
Certain other handlers could do the same. */
bfd_uint64_t (*bfd_getx64) (const void *);
bfd_int64_t (*bfd_getx_signed_64) (const void *);
void (*bfd_putx64) (bfd_uint64_t, void *);
bfd_vma (*bfd_getx32) (const void *);
bfd_signed_vma (*bfd_getx_signed_32) (const void *);
void (*bfd_putx32) (bfd_vma, void *);
bfd_vma (*bfd_getx16) (const void *);
bfd_signed_vma (*bfd_getx_signed_16) (const void *);
void (*bfd_putx16) (bfd_vma, void *);
/* Byte swapping for the headers. */
bfd_uint64_t (*bfd_h_getx64) (const void *);
bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
void (*bfd_h_putx64) (bfd_uint64_t, void *);
bfd_vma (*bfd_h_getx32) (const void *);
bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
void (*bfd_h_putx32) (bfd_vma, void *);
bfd_vma (*bfd_h_getx16) (const void *);
bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
void (*bfd_h_putx16) (bfd_vma, void *);
/* Format dependent routines: these are vectors of entry points
within the target vector structure, one for each format to check. */
/* Check the format of a file being read. Return a @code{bfd_target *} or zero. */
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
/* Set the format of a file being written. */
bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
/* Write cached information into a file being written, at @code{bfd_close}. */
bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
@end example
The general target vector. These vectors are initialized using the
BFD_JUMP_TABLE macros.
@example
/* Generic entry points. */
#define BFD_JUMP_TABLE_GENERIC(NAME) \
NAME##_close_and_cleanup, \
NAME##_bfd_free_cached_info, \
NAME##_new_section_hook, \
NAME##_get_section_contents, \
NAME##_get_section_contents_in_window
/* Called when the BFD is being closed to do any necessary cleanup. */
bfd_boolean (*_close_and_cleanup) (bfd *);
/* Ask the BFD to free all cached information. */
bfd_boolean (*_bfd_free_cached_info) (bfd *);
/* Called when a new section is created. */
bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
/* Read the contents of a section. */
bfd_boolean (*_bfd_get_section_contents)
(bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
bfd_boolean (*_bfd_get_section_contents_in_window)
(bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
/* Entry points to copy private data. */
#define BFD_JUMP_TABLE_COPY(NAME) \
NAME##_bfd_copy_private_bfd_data, \
NAME##_bfd_merge_private_bfd_data, \
_bfd_generic_init_private_section_data, \
NAME##_bfd_copy_private_section_data, \
NAME##_bfd_copy_private_symbol_data, \
NAME##_bfd_copy_private_header_data, \
NAME##_bfd_set_private_flags, \
NAME##_bfd_print_private_bfd_data
/* Called to copy BFD general private data from one object file
to another. */
bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
/* Called to initialize BFD private section data from one object file
to another. */
#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
bfd_boolean (*_bfd_init_private_section_data)
(bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
/* Called to copy BFD private section data from one object file
to another. */
bfd_boolean (*_bfd_copy_private_section_data)
(bfd *, sec_ptr, bfd *, sec_ptr);
/* Called to copy BFD private symbol data from one symbol
to another. */
bfd_boolean (*_bfd_copy_private_symbol_data)
(bfd *, asymbol *, bfd *, asymbol *);
/* Called to copy BFD private header data from one object file
to another. */
bfd_boolean (*_bfd_copy_private_header_data)
(bfd *, bfd *);
/* Called to set private backend flags. */
bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
/* Called to print private BFD data. */
bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
/* Core file entry points. */
#define BFD_JUMP_TABLE_CORE(NAME) \
NAME##_core_file_failing_command, \
NAME##_core_file_failing_signal, \
NAME##_core_file_matches_executable_p
char * (*_core_file_failing_command) (bfd *);
int (*_core_file_failing_signal) (bfd *);
bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
/* Archive entry points. */
#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
NAME##_slurp_armap, \
NAME##_slurp_extended_name_table, \
NAME##_construct_extended_name_table, \
NAME##_truncate_arname, \
NAME##_write_armap, \
NAME##_read_ar_hdr, \
NAME##_openr_next_archived_file, \
NAME##_get_elt_at_index, \
NAME##_generic_stat_arch_elt, \
NAME##_update_armap_timestamp
bfd_boolean (*_bfd_slurp_armap) (bfd *);
bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
bfd_boolean (*_bfd_construct_extended_name_table)
(bfd *, char **, bfd_size_type *, const char **);
void (*_bfd_truncate_arname) (bfd *, const char *, char *);
bfd_boolean (*write_armap)
(bfd *, unsigned int, struct orl *, unsigned int, int);
void * (*_bfd_read_ar_hdr_fn) (bfd *);
bfd * (*openr_next_archived_file) (bfd *, bfd *);
#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
/* Entry points used for symbols. */
#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
NAME##_get_symtab_upper_bound, \
NAME##_canonicalize_symtab, \
NAME##_make_empty_symbol, \
NAME##_print_symbol, \
NAME##_get_symbol_info, \
NAME##_bfd_is_local_label_name, \
NAME##_bfd_is_target_special_symbol, \
NAME##_get_lineno, \
NAME##_find_nearest_line, \
_bfd_generic_find_line, \
NAME##_find_inliner_info, \
NAME##_bfd_make_debug_symbol, \
NAME##_read_minisymbols, \
NAME##_minisymbol_to_symbol
long (*_bfd_get_symtab_upper_bound) (bfd *);
long (*_bfd_canonicalize_symtab)
(bfd *, struct bfd_symbol **);
struct bfd_symbol *
(*_bfd_make_empty_symbol) (bfd *);
void (*_bfd_print_symbol)
(bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
void (*_bfd_get_symbol_info)
(bfd *, struct bfd_symbol *, symbol_info *);
#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
bfd_boolean (*_bfd_find_nearest_line)
(bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
const char **, const char **, unsigned int *);
bfd_boolean (*_bfd_find_line)
(bfd *, struct bfd_symbol **, struct bfd_symbol *,
const char **, unsigned int *);
bfd_boolean (*_bfd_find_inliner_info)
(bfd *, const char **, const char **, unsigned int *);
/* Back-door to allow format-aware applications to create debug symbols
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
asymbol * (*_bfd_make_debug_symbol)
(bfd *, void *, unsigned long size);
#define bfd_read_minisymbols(b, d, m, s) \
BFD_SEND (b, _read_minisymbols, (b, d, m, s))
long (*_read_minisymbols)
(bfd *, bfd_boolean, void **, unsigned int *);
#define bfd_minisymbol_to_symbol(b, d, m, f) \
BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
asymbol * (*_minisymbol_to_symbol)
(bfd *, bfd_boolean, const void *, asymbol *);
/* Routines for relocs. */
#define BFD_JUMP_TABLE_RELOCS(NAME) \
NAME##_get_reloc_upper_bound, \
NAME##_canonicalize_reloc, \
NAME##_bfd_reloc_type_lookup
long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
long (*_bfd_canonicalize_reloc)
(bfd *, sec_ptr, arelent **, struct bfd_symbol **);
/* See documentation on reloc types. */
reloc_howto_type *
(*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
/* Routines used when writing an object file. */
#define BFD_JUMP_TABLE_WRITE(NAME) \
NAME##_set_arch_mach, \
NAME##_set_section_contents
bfd_boolean (*_bfd_set_arch_mach)
(bfd *, enum bfd_architecture, unsigned long);
bfd_boolean (*_bfd_set_section_contents)
(bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
/* Routines used by the linker. */
#define BFD_JUMP_TABLE_LINK(NAME) \
NAME##_sizeof_headers, \
NAME##_bfd_get_relocated_section_contents, \
NAME##_bfd_relax_section, \
NAME##_bfd_link_hash_table_create, \
NAME##_bfd_link_hash_table_free, \
NAME##_bfd_link_add_symbols, \
NAME##_bfd_link_just_syms, \
NAME##_bfd_final_link, \
NAME##_bfd_link_split_section, \
NAME##_bfd_gc_sections, \
NAME##_bfd_merge_sections, \
NAME##_bfd_is_group_section, \
NAME##_bfd_discard_group, \
NAME##_section_already_linked \
int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
bfd_byte * (*_bfd_get_relocated_section_contents)
(bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, bfd_boolean, struct bfd_symbol **);
bfd_boolean (*_bfd_relax_section)
(bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
/* Create a hash table for the linker. Different backends store
different information in this table. */
struct bfd_link_hash_table *
(*_bfd_link_hash_table_create) (bfd *);
/* Release the memory associated with the linker hash table. */
void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
/* Add symbols from this object file into the hash table. */
bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
/* Indicate that we are only retrieving symbol values from this section. */
void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
/* Do a link based on the link_order structures attached to each
section of the BFD. */
bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
/* Should this section be split up into smaller pieces during linking. */
bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
/* Remove sections that are not referenced from the output. */
bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
/* Attempt to merge SEC_MERGE sections. */
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
/* Is this section a member of a group? */
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
/* Discard members of a group. */
bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
/* Check if SEC has been already linked during a reloceatable or
final link. */
void (*_section_already_linked) (bfd *, struct bfd_section *);
/* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
NAME##_get_dynamic_symtab_upper_bound, \
NAME##_canonicalize_dynamic_symtab, \
NAME##_get_synthetic_symtab, \
NAME##_get_dynamic_reloc_upper_bound, \
NAME##_canonicalize_dynamic_reloc
/* Get the amount of memory required to hold the dynamic symbols. */
long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
/* Read in the dynamic symbols. */
long (*_bfd_canonicalize_dynamic_symtab)
(bfd *, struct bfd_symbol **);
/* Create synthetized symbols. */
long (*_bfd_get_synthetic_symtab)
(bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
struct bfd_symbol **);
/* Get the amount of memory required to hold the dynamic relocs. */
long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
/* Read in the dynamic relocs. */
long (*_bfd_canonicalize_dynamic_reloc)
(bfd *, arelent **, struct bfd_symbol **);
@end example
A pointer to an alternative bfd_target in case the current one is not
satisfactory. This can happen when the target cpu supports both big
and little endian code, and target chosen by the linker has the wrong
endianness. The function open_output() in ld/ldlang.c uses this field
to find an alternative output format that is suitable.
@example
/* Opposite endian version of this target. */
const struct bfd_target * alternative_target;
/* Data for use by back-end routines, which isn't
generic enough to belong in this structure. */
const void *backend_data;
@} bfd_target;
@end example
@findex bfd_set_default_target
@subsubsection @code{bfd_set_default_target}
@strong{Synopsis}
@example
bfd_boolean bfd_set_default_target (const char *name);
@end example
@strong{Description}@*
Set the default target vector to use when recognizing a BFD.
This takes the name of the target, which may be a BFD target
name or a configuration triplet.
@findex bfd_find_target
@subsubsection @code{bfd_find_target}
@strong{Synopsis}
@example
const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
@end example
@strong{Description}@*
Return a pointer to the transfer vector for the object target
named @var{target_name}. If @var{target_name} is @code{NULL}, choose the
one in the environment variable @code{GNUTARGET}; if that is null or not
defined, then choose the first entry in the target list.
Passing in the string "default" or setting the environment
variable to "default" will cause the first entry in the target
list to be returned, and "target_defaulted" will be set in the
BFD. This causes @code{bfd_check_format} to loop over all the
targets to find the one that matches the file being read.
@findex bfd_target_list
@subsubsection @code{bfd_target_list}
@strong{Synopsis}
@example
const char ** bfd_target_list (void);
@end example
@strong{Description}@*
Return a freshly malloced NULL-terminated
vector of the names of all the valid BFD targets. Do not
modify the names.
@findex bfd_seach_for_target
@subsubsection @code{bfd_seach_for_target}
@strong{Synopsis}
@example
const bfd_target *bfd_search_for_target
(int (*search_func) (const bfd_target *, void *),
void *);
@end example
@strong{Description}@*
Return a pointer to the first transfer vector in the list of
transfer vectors maintained by BFD that produces a non-zero
result when passed to the function @var{search_func}. The
parameter @var{data} is passed, unexamined, to the search
function.

View File

@ -1,5 +1,5 @@
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005
Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007
Free Software Foundation, Inc.
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libiberty.h"
#include "libbfd.h"
#include "elf-bfd.h"

View File

@ -1,6 +1,6 @@
/* DWARF 2 support.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006 Free Software Foundation, Inc.
2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@ -29,8 +29,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libiberty.h"
#include "libbfd.h"
#include "elf-bfd.h"
@ -93,8 +93,10 @@ struct dwarf2_debug
/* Pointer to the end of the .debug_info section memory buffer. */
bfd_byte *info_ptr_end;
/* Pointer to the section and address of the beginning of the
section. */
/* Pointer to the bfd, section and address of the beginning of the
section. The bfd might be different than expected because of
gnu_debuglink sections. */
bfd * bfd;
asection *sec;
bfd_byte *sec_info_ptr;
@ -874,24 +876,45 @@ concat_filename (struct line_info_table *table, unsigned int file)
filename = table->files[file - 1].name;
if (! IS_ABSOLUTE_PATH (filename))
if (!IS_ABSOLUTE_PATH (filename))
{
char *dirname = (table->files[file - 1].dir
? table->dirs[table->files[file - 1].dir - 1]
: table->comp_dir);
char *dirname = NULL;
char *subdirname = NULL;
char *name;
size_t len;
/* Not all tools set DW_AT_comp_dir, so dirname may be unknown.
The best we can do is return the filename part. */
if (dirname != NULL)
if (table->files[file - 1].dir)
subdirname = table->dirs[table->files[file - 1].dir - 1];
if (!subdirname || !IS_ABSOLUTE_PATH (subdirname))
dirname = table->comp_dir;
if (!dirname)
{
unsigned int len = strlen (dirname) + strlen (filename) + 2;
char * name;
dirname = subdirname;
subdirname = NULL;
}
if (!dirname)
return strdup (filename);
len = strlen (dirname) + strlen (filename) + 2;
if (subdirname)
{
len += strlen (subdirname) + 1;
name = bfd_malloc (len);
if (name)
sprintf (name, "%s/%s/%s", dirname, subdirname, filename);
}
else
{
name = bfd_malloc (len);
if (name)
sprintf (name, "%s/%s", dirname, filename);
return name;
}
return name;
}
return strdup (filename);
@ -1117,7 +1140,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
unsigned int line = 1;
unsigned int column = 0;
int is_stmt = lh.default_is_stmt;
int basic_block = 0;
int end_sequence = 0;
/* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some
compilers generate address sequences that are wildly out of
@ -1142,7 +1164,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
line += lh.line_base + (adj_opcode % lh.line_range);
/* Append row to matrix using current values. */
add_line_info (table, address, filename, line, column, 0);
basic_block = 1;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@ -1214,7 +1235,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
break;
case DW_LNS_copy:
add_line_info (table, address, filename, line, column, 0);
basic_block = 0;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@ -1250,7 +1270,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
is_stmt = (!is_stmt);
break;
case DW_LNS_set_basic_block:
basic_block = 1;
break;
case DW_LNS_const_add_pc:
address += lh.minimum_instruction_length
@ -1625,7 +1644,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
if (low_pc == -1UL && high_pc != -1UL)
base_address = high_pc;
else
arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
}
}
@ -1871,8 +1890,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
to get to the line number information for the compilation unit. */
static struct comp_unit *
parse_comp_unit (bfd *abfd,
struct dwarf2_debug *stash,
parse_comp_unit (struct dwarf2_debug *stash,
bfd_vma unit_length,
bfd_byte *info_ptr_unit,
unsigned int offset_size)
@ -1890,6 +1908,7 @@ parse_comp_unit (bfd *abfd,
bfd_size_type amt;
bfd_vma low_pc = 0;
bfd_vma high_pc = 0;
bfd *abfd = stash->bfd;
version = read_2_bytes (abfd, info_ptr);
info_ptr += 2;
@ -2175,17 +2194,14 @@ find_debug_info (bfd *abfd, asection *after_sec)
{
asection * msec;
if (after_sec)
msec = after_sec->next;
else
msec = abfd->sections;
msec = after_sec != NULL ? after_sec->next : abfd->sections;
while (msec)
{
if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0)
return msec;
if (strncmp (msec->name, GNU_LINKONCE_INFO, strlen (GNU_LINKONCE_INFO)) == 0)
if (CONST_STRNEQ (msec->name, GNU_LINKONCE_INFO))
return msec;
msec = msec->next;
@ -2285,11 +2301,293 @@ place_sections (bfd *abfd, struct dwarf2_debug *stash)
return TRUE;
}
/* The DWARF2 version of find_nearest_line. Return TRUE if the line
is found without error. ADDR_SIZE is the number of bytes in the
initial .debug_info length field and in the abbreviation offset.
You may use zero to indicate that the default value should be
used. */
/* Find the source code location of SYMBOL. If SYMBOL is NULL
then find the nearest source code location corresponding to
the address SECTION + OFFSET.
Returns TRUE if the line is found without error and fills in
FILENAME_PTR and LINENUMBER_PTR. In the case where SYMBOL was
NULL the FUNCTIONNAME_PTR is also filled in.
SYMBOLS contains the symbol table for ABFD.
ADDR_SIZE is the number of bytes in the initial .debug_info length
field and in the abbreviation offset, or zero to indicate that the
default value should be used. */
static bfd_boolean
find_line (bfd *abfd,
asection *section,
bfd_vma offset,
asymbol *symbol,
asymbol **symbols,
const char **filename_ptr,
const char **functionname_ptr,
unsigned int *linenumber_ptr,
unsigned int addr_size,
void **pinfo)
{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
lookup the address, and return the line number info. If no, go
on to the next compilation unit.
We keep a list of all the previously read compilation units, and
a pointer to the next un-read compilation unit. Check the
previously read units before reading more. */
struct dwarf2_debug *stash;
/* What address are we looking for? */
bfd_vma addr;
struct comp_unit* each;
bfd_vma found = FALSE;
bfd_boolean do_line;
stash = *pinfo;
if (! stash)
{
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
}
/* In a relocatable file, 2 functions may have the same address.
We change the section vma so that they won't overlap. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
{
if (! place_sections (abfd, stash))
return FALSE;
}
do_line = (section == NULL
&& offset == 0
&& functionname_ptr == NULL
&& symbol != NULL);
if (do_line)
{
addr = symbol->value;
section = bfd_get_section (symbol);
}
else if (section != NULL
&& functionname_ptr != NULL
&& symbol == NULL)
addr = offset;
else
abort ();
if (section->output_section)
addr += section->output_section->vma + section->output_offset;
else
addr += section->vma;
*filename_ptr = NULL;
*functionname_ptr = NULL;
*linenumber_ptr = 0;
if (! *pinfo)
{
bfd *debug_bfd;
bfd_size_type total_size;
asection *msec;
*pinfo = stash;
msec = find_debug_info (abfd, NULL);
if (msec == NULL)
{
char * debug_filename = bfd_follow_gnu_debuglink (abfd, DEBUGDIR);
if (debug_filename == NULL)
/* No dwarf2 info, and no gnu_debuglink to follow.
Note that at this point the stash has been allocated, but
contains zeros. This lets future calls to this function
fail more quickly. */
goto done;
if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL
|| ! bfd_check_format (debug_bfd, bfd_object)
|| (msec = find_debug_info (debug_bfd, NULL)) == NULL)
{
if (debug_bfd)
bfd_close (debug_bfd);
/* FIXME: Should we report our failure to follow the debuglink ? */
free (debug_filename);
goto done;
}
}
else
debug_bfd = abfd;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
passes - in the first pass we just accumulate the section sizes.
In the second pass we read in the section's contents. The allows
us to avoid reallocing the data as we add sections to the stash. */
for (total_size = 0; msec; msec = find_debug_info (debug_bfd, msec))
total_size += msec->size;
stash->info_ptr = bfd_alloc (debug_bfd, total_size);
if (stash->info_ptr == NULL)
goto done;
stash->info_ptr_end = stash->info_ptr;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size;
bfd_size_type start;
size = msec->size;
if (size == 0)
continue;
start = stash->info_ptr_end - stash->info_ptr;
if ((bfd_simple_get_relocated_section_contents
(debug_bfd, msec, stash->info_ptr + start, symbols)) == NULL)
continue;
stash->info_ptr_end = stash->info_ptr + start + size;
}
BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
stash->sec = find_debug_info (debug_bfd, NULL);
stash->sec_info_ptr = stash->info_ptr;
stash->syms = symbols;
stash->bfd = debug_bfd;
}
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
if (! stash->info_ptr)
goto done;
stash->inliner_chain = NULL;
/* Check the previously read comp. units first. */
for (each = stash->all_comp_units; each; each = each->next_unit)
{
if (do_line)
found = (((symbol->flags & BSF_FUNCTION) == 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_line (each, symbol, addr,
filename_ptr, linenumber_ptr,
stash));
else
found = (comp_unit_contains_address (each, addr)
&& comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash));
if (found)
goto done;
}
/* The DWARF2 spec says that the initial length field, and the
offset of the abbreviation table, should both be 4-byte values.
However, some compilers do things differently. */
if (addr_size == 0)
addr_size = 4;
BFD_ASSERT (addr_size == 4 || addr_size == 8);
/* Read each remaining comp. units checking each as they are read. */
while (stash->info_ptr < stash->info_ptr_end)
{
bfd_vma length;
unsigned int offset_size = addr_size;
bfd_byte *info_ptr_unit = stash->info_ptr;
length = read_4_bytes (stash->bfd, stash->info_ptr);
/* A 0xffffff length is the DWARF3 way of indicating
we use 64-bit offsets, instead of 32-bit offsets. */
if (length == 0xffffffff)
{
offset_size = 8;
length = read_8_bytes (stash->bfd, stash->info_ptr + 4);
stash->info_ptr += 12;
}
/* A zero length is the IRIX way of indicating 64-bit offsets,
mostly because the 64-bit length will generally fit in 32
bits, and the endianness helps. */
else if (length == 0)
{
offset_size = 8;
length = read_4_bytes (stash->bfd, stash->info_ptr + 4);
stash->info_ptr += 8;
}
/* In the absence of the hints above, we assume 32-bit DWARF2
offsets even for targets with 64-bit addresses, because:
a) most of the time these targets will not have generated
more than 2Gb of debug info and so will not need 64-bit
offsets,
and
b) if they do use 64-bit offsets but they are not using
the size hints that are tested for above then they are
not conforming to the DWARF3 standard anyway. */
else if (addr_size == 8)
{
offset_size = 4;
stash->info_ptr += 4;
}
else
stash->info_ptr += 4;
if (length > 0)
{
each = parse_comp_unit (stash, length, info_ptr_unit,
offset_size);
stash->info_ptr += length;
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
== stash->sec->size)
{
stash->sec = find_debug_info (stash->bfd, stash->sec);
stash->sec_info_ptr = stash->info_ptr;
}
if (each)
{
each->next_unit = stash->all_comp_units;
stash->all_comp_units = each;
/* DW_AT_low_pc and DW_AT_high_pc are optional for
compilation units. If we don't have them (i.e.,
unit->high == 0), we need to consult the line info
table to see if a compilation unit contains the given
address. */
if (do_line)
found = (((symbol->flags & BSF_FUNCTION) == 0
|| each->arange.high == 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_line (each, symbol, addr,
filename_ptr,
linenumber_ptr,
stash));
else
found = ((each->arange.high == 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash));
if (found)
goto done;
}
}
}
done:
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
unset_sections (stash);
return found;
}
/* The DWARF2 version of find_nearest_line.
Return TRUE if the line is found without error. */
bfd_boolean
_bfd_dwarf2_find_nearest_line (bfd *abfd,
@ -2302,214 +2600,13 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
unsigned int addr_size,
void **pinfo)
{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
lookup the address, and return the line number info. If no, go
on to the next compilation unit.
We keep a list of all the previously read compilation units, and
a pointer to the next un-read compilation unit. Check the
previously read units before reading more. */
struct dwarf2_debug *stash;
/* What address are we looking for? */
bfd_vma addr;
struct comp_unit* each;
bfd_vma found = FALSE;
stash = *pinfo;
if (! stash)
{
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
}
/* In a relocatable file, 2 functions may have the same address.
We change the section vma so that they won't overlap. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
{
if (! place_sections (abfd, stash))
return FALSE;
}
addr = offset;
if (section->output_section)
addr += section->output_section->vma + section->output_offset;
else
addr += section->vma;
*filename_ptr = NULL;
*functionname_ptr = NULL;
*linenumber_ptr = 0;
/* The DWARF2 spec says that the initial length field, and the
offset of the abbreviation table, should both be 4-byte values.
However, some compilers do things differently. */
if (addr_size == 0)
addr_size = 4;
BFD_ASSERT (addr_size == 4 || addr_size == 8);
if (! *pinfo)
{
bfd_size_type total_size;
asection *msec;
*pinfo = stash;
msec = find_debug_info (abfd, NULL);
if (! msec)
/* No dwarf2 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
goto done;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
passes - in the first pass we just accumulate the section sizes.
In the second pass we read in the section's contents. The allows
us to avoid reallocing the data as we add sections to the stash. */
for (total_size = 0; msec; msec = find_debug_info (abfd, msec))
total_size += msec->size;
stash->info_ptr = bfd_alloc (abfd, total_size);
if (stash->info_ptr == NULL)
goto done;
stash->info_ptr_end = stash->info_ptr;
for (msec = find_debug_info (abfd, NULL);
msec;
msec = find_debug_info (abfd, msec))
{
bfd_size_type size;
bfd_size_type start;
size = msec->size;
if (size == 0)
continue;
start = stash->info_ptr_end - stash->info_ptr;
if ((bfd_simple_get_relocated_section_contents
(abfd, msec, stash->info_ptr + start, symbols)) == NULL)
continue;
stash->info_ptr_end = stash->info_ptr + start + size;
}
BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
stash->sec = find_debug_info (abfd, NULL);
stash->sec_info_ptr = stash->info_ptr;
stash->syms = symbols;
}
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
if (! stash->info_ptr)
goto done;
stash->inliner_chain = NULL;
/* Check the previously read comp. units first. */
for (each = stash->all_comp_units; each; each = each->next_unit)
if (comp_unit_contains_address (each, addr)
&& comp_unit_find_nearest_line (each, addr, filename_ptr,
functionname_ptr,
linenumber_ptr, stash))
{
found = TRUE;
goto done;
}
/* Read each remaining comp. units checking each as they are read. */
while (stash->info_ptr < stash->info_ptr_end)
{
bfd_vma length;
unsigned int offset_size = addr_size;
bfd_byte *info_ptr_unit = stash->info_ptr;
length = read_4_bytes (abfd, stash->info_ptr);
/* A 0xffffff length is the DWARF3 way of indicating we use
64-bit offsets, instead of 32-bit offsets. */
if (length == 0xffffffff)
{
offset_size = 8;
length = read_8_bytes (abfd, stash->info_ptr + 4);
stash->info_ptr += 12;
}
/* A zero length is the IRIX way of indicating 64-bit offsets,
mostly because the 64-bit length will generally fit in 32
bits, and the endianness helps. */
else if (length == 0)
{
offset_size = 8;
length = read_4_bytes (abfd, stash->info_ptr + 4);
stash->info_ptr += 8;
}
/* In the absence of the hints above, we assume addr_size-sized
offsets, for backward-compatibility with pre-DWARF3 64-bit
platforms. */
else if (addr_size == 8)
{
length = read_8_bytes (abfd, stash->info_ptr);
stash->info_ptr += 8;
}
else
stash->info_ptr += 4;
if (length > 0)
{
each = parse_comp_unit (abfd, stash, length, info_ptr_unit,
offset_size);
stash->info_ptr += length;
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
== stash->sec->size)
{
stash->sec = find_debug_info (abfd, stash->sec);
stash->sec_info_ptr = stash->info_ptr;
}
if (each)
{
each->next_unit = stash->all_comp_units;
stash->all_comp_units = each;
/* DW_AT_low_pc and DW_AT_high_pc are optional for
compilation units. If we don't have them (i.e.,
unit->high == 0), we need to consult the line info
table to see if a compilation unit contains the given
address. */
if ((each->arange.high == 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_nearest_line (each, addr,
filename_ptr,
functionname_ptr,
linenumber_ptr,
stash))
{
found = TRUE;
goto done;
}
}
}
}
done:
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
unset_sections (stash);
return found;
return find_line (abfd, section, offset, NULL, symbols, filename_ptr,
functionname_ptr, linenumber_ptr, addr_size,
pinfo);
}
/* The DWARF2 version of find_line. Return TRUE if the line is found
without error. */
/* The DWARF2 version of find_line.
Return TRUE if the line is found without error. */
bfd_boolean
_bfd_dwarf2_find_line (bfd *abfd,
@ -2520,213 +2617,9 @@ _bfd_dwarf2_find_line (bfd *abfd,
unsigned int addr_size,
void **pinfo)
{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
lookup the address, and return the line number info. If no, go
on to the next compilation unit.
We keep a list of all the previously read compilation units, and
a pointer to the next un-read compilation unit. Check the
previously read units before reading more. */
struct dwarf2_debug *stash;
/* What address are we looking for? */
bfd_vma addr;
struct comp_unit* each;
asection *section;
bfd_boolean found = FALSE;
section = bfd_get_section (symbol);
stash = *pinfo;
if (! stash)
{
bfd_size_type amt = sizeof (struct dwarf2_debug);
stash = bfd_zalloc (abfd, amt);
if (! stash)
return FALSE;
}
/* In a relocatable file, 2 functions may have the same address.
We change the section vma so that they won't overlap. */
if (!stash && (abfd->flags & (EXEC_P | DYNAMIC)) == 0)
{
if (! place_sections (abfd, stash))
return FALSE;
}
addr = symbol->value;
if (section->output_section)
addr += section->output_section->vma + section->output_offset;
else
addr += section->vma;
*filename_ptr = NULL;
*filename_ptr = NULL;
*linenumber_ptr = 0;
if (! *pinfo)
{
bfd_size_type total_size;
asection *msec;
*pinfo = stash;
msec = find_debug_info (abfd, NULL);
if (! msec)
/* No dwarf2 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
goto done;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
passes - in the first pass we just accumulate the section sizes.
In the second pass we read in the section's contents. The allows
us to avoid reallocing the data as we add sections to the stash. */
for (total_size = 0; msec; msec = find_debug_info (abfd, msec))
total_size += msec->size;
stash->info_ptr = bfd_alloc (abfd, total_size);
if (stash->info_ptr == NULL)
goto done;
stash->info_ptr_end = stash->info_ptr;
for (msec = find_debug_info (abfd, NULL);
msec;
msec = find_debug_info (abfd, msec))
{
bfd_size_type size;
bfd_size_type start;
size = msec->size;
if (size == 0)
continue;
start = stash->info_ptr_end - stash->info_ptr;
if ((bfd_simple_get_relocated_section_contents
(abfd, msec, stash->info_ptr + start, symbols)) == NULL)
continue;
stash->info_ptr_end = stash->info_ptr + start + size;
}
BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
stash->sec = find_debug_info (abfd, NULL);
stash->sec_info_ptr = stash->info_ptr;
stash->syms = symbols;
}
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
if (! stash->info_ptr)
goto done;
stash->inliner_chain = NULL;
/* Check the previously read comp. units first. */
for (each = stash->all_comp_units; each; each = each->next_unit)
if ((symbol->flags & BSF_FUNCTION) == 0
|| comp_unit_contains_address (each, addr))
{
found = comp_unit_find_line (each, symbol, addr, filename_ptr,
linenumber_ptr, stash);
if (found)
goto done;
}
/* The DWARF2 spec says that the initial length field, and the
offset of the abbreviation table, should both be 4-byte values.
However, some compilers do things differently. */
if (addr_size == 0)
addr_size = 4;
BFD_ASSERT (addr_size == 4 || addr_size == 8);
/* Read each remaining comp. units checking each as they are read. */
while (stash->info_ptr < stash->info_ptr_end)
{
bfd_vma length;
unsigned int offset_size = addr_size;
bfd_byte *info_ptr_unit = stash->info_ptr;
length = read_4_bytes (abfd, stash->info_ptr);
/* A 0xffffff length is the DWARF3 way of indicating we use
64-bit offsets, instead of 32-bit offsets. */
if (length == 0xffffffff)
{
offset_size = 8;
length = read_8_bytes (abfd, stash->info_ptr + 4);
stash->info_ptr += 12;
}
/* A zero length is the IRIX way of indicating 64-bit offsets,
mostly because the 64-bit length will generally fit in 32
bits, and the endianness helps. */
else if (length == 0)
{
offset_size = 8;
length = read_4_bytes (abfd, stash->info_ptr + 4);
stash->info_ptr += 8;
}
/* In the absence of the hints above, we assume addr_size-sized
offsets, for backward-compatibility with pre-DWARF3 64-bit
platforms. */
else if (addr_size == 8)
{
length = read_8_bytes (abfd, stash->info_ptr);
stash->info_ptr += 8;
}
else
stash->info_ptr += 4;
if (length > 0)
{
each = parse_comp_unit (abfd, stash, length, info_ptr_unit,
offset_size);
stash->info_ptr += length;
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
== stash->sec->size)
{
stash->sec = find_debug_info (abfd, stash->sec);
stash->sec_info_ptr = stash->info_ptr;
}
if (each)
{
each->next_unit = stash->all_comp_units;
stash->all_comp_units = each;
/* DW_AT_low_pc and DW_AT_high_pc are optional for
compilation units. If we don't have them (i.e.,
unit->high == 0), we need to consult the line info
table to see if a compilation unit contains the given
address. */
found = (((symbol->flags & BSF_FUNCTION) == 0
|| each->arange.high <= 0
|| comp_unit_contains_address (each, addr))
&& comp_unit_find_line (each, symbol, addr,
filename_ptr,
linenumber_ptr,
stash));
if (found)
goto done;
}
}
}
done:
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
unset_sections (stash);
return found;
return find_line (abfd, NULL, 0, symbol, symbols, filename_ptr,
NULL, linenumber_ptr, addr_size,
pinfo);
}
bfd_boolean
@ -2742,17 +2635,18 @@ _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
if (stash)
{
struct funcinfo *func = stash->inliner_chain;
if (func && func->caller_func)
{
*filename_ptr = func->caller_file;
*functionname_ptr = func->caller_func->name;
*linenumber_ptr = func->caller_line;
stash->inliner_chain = func->caller_func;
return (TRUE);
return TRUE;
}
}
return (FALSE);
return FALSE;
}
void

View File

@ -1,6 +1,6 @@
/* Generic ECOFF (Extended-COFF) routines.
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@ -20,8 +20,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "aout/ar.h"
@ -140,8 +140,7 @@ _bfd_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr)
/* Initialize a new section. */
bfd_boolean
_bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED,
asection *section)
_bfd_ecoff_new_section_hook (bfd *abfd, asection *section)
{
unsigned int i;
static struct
@ -181,7 +180,7 @@ _bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED,
uncertain about .init on some systems and I don't know how shared
libraries work. */
return TRUE;
return _bfd_generic_new_section_hook (abfd, section);
}
/* Determine the machine architecture and type. This is called from
@ -1863,7 +1862,8 @@ _bfd_ecoff_set_arch_mach (bfd *abfd,
/* Get the size of the section headers. */
int
_bfd_ecoff_sizeof_headers (bfd *abfd, bfd_boolean reloc ATTRIBUTE_UNUSED)
_bfd_ecoff_sizeof_headers (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
asection *current;
int c;
@ -1937,7 +1937,7 @@ ecoff_compute_section_file_positions (bfd *abfd)
const bfd_vma round = ecoff_backend (abfd)->round;
bfd_size_type amt;
sofar = _bfd_ecoff_sizeof_headers (abfd, FALSE);
sofar = _bfd_ecoff_sizeof_headers (abfd, NULL);
file_sofar = sofar;
/* Sort the sections by VMA. */
@ -2358,7 +2358,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
}
if ((abfd->flags & D_PAGED) != 0)
text_size = _bfd_ecoff_sizeof_headers (abfd, FALSE);
text_size = _bfd_ecoff_sizeof_headers (abfd, NULL);
else
text_size = 0;
text_start = 0;
@ -2861,7 +2861,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd)
bfd_slurp_armap, but that seems inappropriate since no other
target uses this format. Instead, we check directly for a COFF
armap. */
if (strneq (nextname, "/ ", 16))
if (CONST_STRNEQ (nextname, "/ "))
return bfd_slurp_armap (abfd);
/* See if the first element is an armap. */
@ -3087,7 +3087,7 @@ _bfd_ecoff_write_armap (bfd *abfd,
last_elt = current;
for (i = 0; i < orl_count; i++)
{
unsigned int hash, rehash;
unsigned int hash, rehash = 0;
/* Advance firstreal to the file position of this archive
element. */
@ -3097,7 +3097,7 @@ _bfd_ecoff_write_armap (bfd *abfd,
{
firstreal += arelt_size (current) + sizeof (struct ar_hdr);
firstreal += firstreal % 2;
current = current->next;
current = current->archive_next;
}
while (current != map[i].u.abfd);
}
@ -3757,7 +3757,7 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
while (*pundef != NULL)
{
struct bfd_link_hash_entry *h;
unsigned int hash, rehash;
unsigned int hash, rehash = 0;
unsigned int file_offset;
const char *name;
bfd *element;

View File

@ -1,6 +1,6 @@
/* Routines to link ECOFF debugging information.
Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006 Free Software Foundation, Inc.
2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -19,8 +19,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "objalloc.h"
@ -782,7 +782,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
fdr_ptr += fdr_add, i++)
{
FDR fdr;
bfd_vma fdr_adr;
bfd_byte *sym_out;
bfd_byte *lraw_src;
bfd_byte *lraw_end;
@ -799,8 +798,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
else
(*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr);
fdr_adr = fdr.adr;
/* FIXME: It is conceivable that this FDR points to the .init or
.fini section, in which case this will not do the right
thing. */

View File

@ -1,5 +1,5 @@
/* BFD back-end for Intel IA-32 EFI application files.
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#define TARGET_SYM bfd_efi_app_ia32_vec
#define TARGET_NAME "efi-app-ia32"

View File

@ -1,5 +1,5 @@
/* BFD back-end for HP/Intel IA-64 EFI application files.
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#define TARGET_SYM bfd_efi_app_ia64_vec
#define TARGET_NAME "efi-app-ia64"

View File

@ -0,0 +1,628 @@
/* ELF attributes support (based on ARM EABI attributes).
Copyright 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libiberty.h"
#include "libbfd.h"
#include "elf-bfd.h"
/* Return the number of bytes needed by I in uleb128 format. */
static int
uleb128_size (unsigned int i)
{
int size;
size = 1;
while (i >= 0x80)
{
i >>= 7;
size++;
}
return size;
}
/* Return TRUE if the attribute has the default value (0/""). */
static bfd_boolean
is_default_attr (obj_attribute *attr)
{
if ((attr->type & 1) && attr->i != 0)
return FALSE;
if ((attr->type & 2) && attr->s && *attr->s)
return FALSE;
return TRUE;
}
/* Return the size of a single attribute. */
static bfd_vma
obj_attr_size (int tag, obj_attribute *attr)
{
bfd_vma size;
if (is_default_attr (attr))
return 0;
size = uleb128_size (tag);
if (attr->type & 1)
size += uleb128_size (attr->i);
if (attr->type & 2)
size += strlen ((char *)attr->s) + 1;
return size;
}
/* Return the vendor name for a given object attributes section. */
static const char *
vendor_obj_attr_name (bfd *abfd, int vendor)
{
return (vendor == OBJ_ATTR_PROC
? get_elf_backend_data (abfd)->obj_attrs_vendor
: "gnu");
}
/* Return the size of the object attributes section for VENDOR
(OBJ_ATTR_PROC or OBJ_ATTR_GNU), or 0 if there are no attributes
for that vendor to record and the vendor is OBJ_ATTR_GNU. */
static bfd_vma
vendor_obj_attr_size (bfd *abfd, int vendor)
{
bfd_vma size;
obj_attribute *attr;
obj_attribute_list *list;
int i;
const char *vendor_name = vendor_obj_attr_name (abfd, vendor);
if (!vendor_name)
return 0;
attr = elf_known_obj_attributes (abfd)[vendor];
size = 0;
for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++)
size += obj_attr_size (i, &attr[i]);
for (list = elf_other_obj_attributes (abfd)[vendor];
list;
list = list->next)
size += obj_attr_size (list->tag, &list->attr);
/* <size> <vendor_name> NUL 0x1 <size> */
return ((size || vendor == OBJ_ATTR_PROC)
? size + 10 + strlen (vendor_name)
: 0);
}
/* Return the size of the object attributes section. */
bfd_vma
bfd_elf_obj_attr_size (bfd *abfd)
{
bfd_vma size;
size = vendor_obj_attr_size (abfd, OBJ_ATTR_PROC);
size += vendor_obj_attr_size (abfd, OBJ_ATTR_GNU);
/* 'A' <sections for each vendor> */
return (size ? size + 1 : 0);
}
/* Write VAL in uleb128 format to P, returning a pointer to the
following byte. */
static bfd_byte *
write_uleb128 (bfd_byte *p, unsigned int val)
{
bfd_byte c;
do
{
c = val & 0x7f;
val >>= 7;
if (val)
c |= 0x80;
*(p++) = c;
}
while (val);
return p;
}
/* Write attribute ATTR to butter P, and return a pointer to the following
byte. */
static bfd_byte *
write_obj_attribute (bfd_byte *p, int tag, obj_attribute *attr)
{
/* Suppress default entries. */
if (is_default_attr (attr))
return p;
p = write_uleb128 (p, tag);
if (attr->type & 1)
p = write_uleb128 (p, attr->i);
if (attr->type & 2)
{
int len;
len = strlen (attr->s) + 1;
memcpy (p, attr->s, len);
p += len;
}
return p;
}
/* Write the contents of the object attributes section (length SIZE)
for VENDOR to CONTENTS. */
static void
vendor_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size,
int vendor)
{
bfd_byte *p;
obj_attribute *attr;
obj_attribute_list *list;
int i;
const char *vendor_name = vendor_obj_attr_name (abfd, vendor);
size_t vendor_length = strlen (vendor_name) + 1;
p = contents;
bfd_put_32 (abfd, size, p);
p += 4;
memcpy (p, vendor_name, vendor_length);
p += vendor_length;
*(p++) = Tag_File;
bfd_put_32 (abfd, size - 4 - vendor_length, p);
p += 4;
attr = elf_known_obj_attributes (abfd)[vendor];
for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++)
p = write_obj_attribute (p, i, &attr[i]);
for (list = elf_other_obj_attributes (abfd)[vendor];
list;
list = list->next)
p = write_obj_attribute (p, list->tag, &list->attr);
}
/* Write the contents of the object attributes section to CONTENTS. */
void
bfd_elf_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size)
{
bfd_byte *p;
int vendor;
bfd_vma my_size;
p = contents;
*(p++) = 'A';
my_size = 1;
for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++)
{
bfd_vma vendor_size = vendor_obj_attr_size (abfd, vendor);
if (vendor_size)
vendor_set_obj_attr_contents (abfd, p, vendor_size, vendor);
p += vendor_size;
my_size += vendor_size;
}
if (size != my_size)
abort ();
}
/* Allocate/find an object attribute. */
static obj_attribute *
elf_new_obj_attr (bfd *abfd, int vendor, int tag)
{
obj_attribute *attr;
obj_attribute_list *list;
obj_attribute_list *p;
obj_attribute_list **lastp;
if (tag < NUM_KNOWN_OBJ_ATTRIBUTES)
{
/* Knwon tags are preallocated. */
attr = &elf_known_obj_attributes (abfd)[vendor][tag];
}
else
{
/* Create a new tag. */
list = (obj_attribute_list *)
bfd_alloc (abfd, sizeof (obj_attribute_list));
memset (list, 0, sizeof (obj_attribute_list));
list->tag = tag;
/* Keep the tag list in order. */
lastp = &elf_other_obj_attributes (abfd)[vendor];
for (p = *lastp; p; p = p->next)
{
if (tag < p->tag)
break;
lastp = &p->next;
}
list->next = *lastp;
*lastp = list;
attr = &list->attr;
}
return attr;
}
/* Return the value of an integer object attribute. */
int
bfd_elf_get_obj_attr_int (bfd *abfd, int vendor, int tag)
{
obj_attribute_list *p;
if (tag < NUM_KNOWN_OBJ_ATTRIBUTES)
{
/* Knwon tags are preallocated. */
return elf_known_obj_attributes (abfd)[vendor][tag].i;
}
else
{
for (p = elf_other_obj_attributes (abfd)[vendor];
p;
p = p->next)
{
if (tag == p->tag)
return p->attr.i;
if (tag < p->tag)
break;
}
return 0;
}
}
/* Add an integer object attribute. */
void
bfd_elf_add_obj_attr_int (bfd *abfd, int vendor, int tag, unsigned int i)
{
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
attr->type = 1;
attr->i = i;
}
/* Duplicate an object attribute string value. */
char *
_bfd_elf_attr_strdup (bfd *abfd, const char * s)
{
char * p;
int len;
len = strlen (s) + 1;
p = (char *) bfd_alloc (abfd, len);
return memcpy (p, s, len);
}
/* Add a string object attribute. */
void
bfd_elf_add_obj_attr_string (bfd *abfd, int vendor, int tag, const char *s)
{
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
attr->type = 2;
attr->s = _bfd_elf_attr_strdup (abfd, s);
}
/* Add a Tag_compatibility object attribute. */
void
bfd_elf_add_obj_attr_compat (bfd *abfd, int vendor, unsigned int i,
const char *s)
{
obj_attribute_list *list;
obj_attribute_list *p;
obj_attribute_list **lastp;
list = (obj_attribute_list *)
bfd_alloc (abfd, sizeof (obj_attribute_list));
memset (list, 0, sizeof (obj_attribute_list));
list->tag = Tag_compatibility;
list->attr.type = 3;
list->attr.i = i;
list->attr.s = _bfd_elf_attr_strdup (abfd, s);
lastp = &elf_other_obj_attributes (abfd)[vendor];
for (p = *lastp; p; p = p->next)
{
int cmp;
if (p->tag != Tag_compatibility)
break;
cmp = strcmp(s, p->attr.s);
if (cmp < 0 || (cmp == 0 && i < p->attr.i))
break;
lastp = &p->next;
}
list->next = *lastp;
*lastp = list;
}
/* Copy the object attributes from IBFD to OBFD. */
void
_bfd_elf_copy_obj_attributes (bfd *ibfd, bfd *obfd)
{
obj_attribute *in_attr;
obj_attribute *out_attr;
obj_attribute_list *list;
int i;
int vendor;
for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++)
{
in_attr = &elf_known_obj_attributes (ibfd)[vendor][4];
out_attr = &elf_known_obj_attributes (obfd)[vendor][4];
for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++)
{
out_attr->type = in_attr->type;
out_attr->i = in_attr->i;
if (in_attr->s && *in_attr->s)
out_attr->s = _bfd_elf_attr_strdup (obfd, in_attr->s);
in_attr++;
out_attr++;
}
for (list = elf_other_obj_attributes (ibfd)[vendor];
list;
list = list->next)
{
in_attr = &list->attr;
switch (in_attr->type)
{
case 1:
bfd_elf_add_obj_attr_int (obfd, vendor, list->tag, in_attr->i);
break;
case 2:
bfd_elf_add_obj_attr_string (obfd, vendor, list->tag,
in_attr->s);
break;
case 3:
bfd_elf_add_obj_attr_compat (obfd, vendor, in_attr->i,
in_attr->s);
break;
default:
abort ();
}
}
}
}
/* Determine whether a GNU object attribute tag takes an integer, a
string or both. */
static int
gnu_obj_attrs_arg_type (int tag)
{
/* Except for Tag_compatibility, for GNU attributes we follow the
same rule ARM ones > 32 follow: odd-numbered tags take strings
and even-numbered tags take integers. In addition, tag & 2 is
nonzero for architecture-independent tags and zero for
architecture-dependent ones. */
if (tag == Tag_compatibility)
return 3;
else
return (tag & 1) != 0 ? 2 : 1;
}
/* Determine what arguments an attribute tag takes. */
int
_bfd_elf_obj_attrs_arg_type (bfd *abfd, int vendor, int tag)
{
switch (vendor)
{
case OBJ_ATTR_PROC:
return get_elf_backend_data (abfd)->obj_attrs_arg_type (tag);
break;
case OBJ_ATTR_GNU:
return gnu_obj_attrs_arg_type (tag);
break;
default:
abort ();
}
}
/* Parse an object attributes section. */
void
_bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr)
{
bfd_byte *contents;
bfd_byte *p;
bfd_vma len;
const char *std_section;
contents = bfd_malloc (hdr->sh_size);
if (!contents)
return;
if (!bfd_get_section_contents (abfd, hdr->bfd_section, contents, 0,
hdr->sh_size))
{
free (contents);
return;
}
p = contents;
std_section = get_elf_backend_data (abfd)->obj_attrs_vendor;
if (*(p++) == 'A')
{
len = hdr->sh_size - 1;
while (len > 0)
{
int namelen;
bfd_vma section_len;
int vendor;
section_len = bfd_get_32 (abfd, p);
p += 4;
if (section_len > len)
section_len = len;
len -= section_len;
namelen = strlen ((char *)p) + 1;
section_len -= namelen + 4;
if (std_section && strcmp ((char *)p, std_section) == 0)
vendor = OBJ_ATTR_PROC;
else if (strcmp ((char *)p, "gnu") == 0)
vendor = OBJ_ATTR_GNU;
else
{
/* Other vendor section. Ignore it. */
p += namelen + section_len;
continue;
}
p += namelen;
while (section_len > 0)
{
int tag;
unsigned int n;
unsigned int val;
bfd_vma subsection_len;
bfd_byte *end;
tag = read_unsigned_leb128 (abfd, p, &n);
p += n;
subsection_len = bfd_get_32 (abfd, p);
p += 4;
if (subsection_len > section_len)
subsection_len = section_len;
section_len -= subsection_len;
subsection_len -= n + 4;
end = p + subsection_len;
switch (tag)
{
case Tag_File:
while (p < end)
{
int type;
tag = read_unsigned_leb128 (abfd, p, &n);
p += n;
type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
switch (type)
{
case 3:
val = read_unsigned_leb128 (abfd, p, &n);
p += n;
bfd_elf_add_obj_attr_compat (abfd, vendor, val,
(char *)p);
p += strlen ((char *)p) + 1;
break;
case 2:
bfd_elf_add_obj_attr_string (abfd, vendor, tag,
(char *)p);
p += strlen ((char *)p) + 1;
break;
case 1:
val = read_unsigned_leb128 (abfd, p, &n);
p += n;
bfd_elf_add_obj_attr_int (abfd, vendor, tag, val);
break;
default:
abort ();
}
}
break;
case Tag_Section:
case Tag_Symbol:
/* Don't have anywhere convenient to attach these.
Fall through for now. */
default:
/* Ignore things we don't kow about. */
p += subsection_len;
subsection_len = 0;
break;
}
}
}
}
free (contents);
}
/* Merge common object attributes from IBFD into OBFD. Raise an error
if there are conflicting attributes. Any processor-specific
attributes have already been merged. This must be called from the
bfd_elfNN_bfd_merge_private_bfd_data hook for each individual
target, along with any target-specific merging. Because there are
no common attributes other than Tag_compatibility at present, and
non-"gnu" Tag_compatibility is not expected in "gnu" sections, this
is not presently called for targets without their own
attributes. */
bfd_boolean
_bfd_elf_merge_object_attributes (bfd *ibfd, bfd *obfd)
{
obj_attribute *in_attr;
obj_attribute *out_attr;
obj_attribute_list *in_list;
obj_attribute_list *out_list;
int vendor;
/* The only common attribute is currently Tag_compatibility,
accepted in both processor and "gnu" sections. */
for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++)
{
in_list = elf_other_obj_attributes (ibfd)[vendor];
out_list = elf_other_obj_attributes (ibfd)[vendor];
while (in_list && in_list->tag == Tag_compatibility)
{
in_attr = &in_list->attr;
if (in_attr->i == 0)
continue;
if (in_attr->i == 1 && strcmp (in_attr->s, "gnu") != 0)
{
_bfd_error_handler
(_("ERROR: %B: Must be processed by '%s' toolchain"),
ibfd, in_attr->s);
return FALSE;
}
if (!out_list || out_list->tag != Tag_compatibility
|| strcmp (in_attr->s, out_list->attr.s) != 0)
{
/* Add this compatibility tag to the output. */
bfd_elf_add_proc_attr_compat (obfd, in_attr->i, in_attr->s);
continue;
}
out_attr = &out_list->attr;
/* Check all the input tags with the same identifier. */
for (;;)
{
if (out_list->tag != Tag_compatibility
|| in_attr->i != out_attr->i
|| strcmp (in_attr->s, out_attr->s) != 0)
{
_bfd_error_handler
(_("ERROR: %B: Incompatible object tag '%s':%d"),
ibfd, in_attr->s, in_attr->i);
return FALSE;
}
in_list = in_list->next;
if (in_list->tag != Tag_compatibility
|| strcmp (in_attr->s, in_list->attr.s) != 0)
break;
in_attr = &in_list->attr;
out_list = out_list->next;
if (out_list)
out_attr = &out_list->attr;
}
/* Check the output doesn't have extra tags with this identifier. */
if (out_list && out_list->tag == Tag_compatibility
&& strcmp (in_attr->s, out_list->attr.s) == 0)
{
_bfd_error_handler
(_("ERROR: %B: Incompatible object tag '%s':%d"),
ibfd, in_attr->s, out_list->attr.i);
return FALSE;
}
}
}
return TRUE;
}

View File

@ -1,6 +1,6 @@
/* BFD back-end data structures for ELF files.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -155,6 +155,8 @@ struct elf_link_hash_entry
unsigned int hidden : 1;
/* Symbol was forced to local scope due to a version script file. */
unsigned int forced_local : 1;
/* Symbol was forced to be dynamic due to a version script file. */
unsigned int dynamic : 1;
/* Symbol was marked during garbage collection. */
unsigned int mark : 1;
/* Symbol is referenced by a non-GOT/non-PLT relocation. This is
@ -259,31 +261,6 @@ struct elf_link_loaded_list
};
/* Structures used by the eh_frame optimization code. */
struct cie_header
{
unsigned int length;
unsigned int id;
};
struct cie
{
struct cie_header hdr;
unsigned char version;
char augmentation[20];
bfd_vma code_align;
bfd_signed_vma data_align;
bfd_vma ra_column;
bfd_vma augmentation_size;
struct elf_link_hash_entry *personality;
unsigned char per_encoding;
unsigned char lsda_encoding;
unsigned char fde_encoding;
unsigned char initial_insn_length;
unsigned char make_relative;
unsigned char make_lsda_relative;
unsigned char initial_instructions[50];
};
struct eh_cie_fde
{
/* For FDEs, this points to the CIE used. */
@ -302,12 +279,12 @@ struct eh_cie_fde
unsigned int make_lsda_relative : 1;
unsigned int need_lsda_relative : 1;
unsigned int per_encoding_relative : 1;
unsigned int *set_loc;
};
struct eh_frame_sec_info
{
unsigned int count;
unsigned int alloced;
struct eh_cie_fde entry[1];
};
@ -317,11 +294,11 @@ struct eh_frame_array_ent
bfd_vma fde;
};
struct htab;
struct eh_frame_hdr_info
{
struct cie last_cie;
asection *last_cie_sec;
struct eh_cie_fde *last_cie_inf;
struct htab *cies;
asection *hdr_sec;
unsigned int fde_count, array_count;
struct eh_frame_array_ent *array;
@ -342,6 +319,10 @@ struct elf_link_hash_table
when linking against or generating a shared object. */
bfd_boolean dynamic_sections_created;
/* True if this target has relocatable executables, so needs dynamic
section symbols. */
bfd_boolean is_relocatable_executable;
/* The BFD used to hold special sections created by the linker.
This will be the first BFD found which requires these sections to
be created. */
@ -375,6 +356,12 @@ struct elf_link_hash_table
included in the link. */
struct bfd_link_needed_list *needed;
/* Sections in the output bfd that provides a section symbol
to be used by relocations emitted against local symbols.
Most targets will not use data_index_section. */
asection *text_index_section;
asection *data_index_section;
/* The _GLOBAL_OFFSET_TABLE_ symbol. */
struct elf_link_hash_entry *hgot;
@ -403,10 +390,6 @@ struct elf_link_hash_table
/* A linked list of BFD's loaded in the link. */
struct elf_link_loaded_list *loaded;
/* True if this target has relocatable executables, so needs dynamic
section symbols. */
bfd_boolean is_relocatable_executable;
};
/* Look up an entry in an ELF linker hash table. */
@ -466,7 +449,7 @@ struct elf_size_info {
(*write_shdrs_and_ehdr) (bfd *);
void (*write_relocs)
(bfd *, asection *, void *);
void (*swap_symbol_in)
bfd_boolean (*swap_symbol_in)
(bfd *, const void *, const void *, Elf_Internal_Sym *);
void (*swap_symbol_out)
(bfd *, const Elf_Internal_Sym *, void *, void *);
@ -555,6 +538,10 @@ enum action_discarded
PRETEND = 2
};
typedef asection * (*elf_gc_mark_hook_fn)
(asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *);
struct elf_backend_data
{
/* The architecture for this backend. */
@ -563,6 +550,9 @@ struct elf_backend_data
/* The ELF machine code (EM_xxxx) for this backend. */
int elf_machine_code;
/* EI_OSABI. */
int elf_osabi;
/* The maximum page size for this backend. */
bfd_vma maxpagesize;
@ -571,6 +561,9 @@ struct elf_backend_data
pages at least this large. May be smaller than maxpagesize. */
bfd_vma minpagesize;
/* The common page size for this backend. */
bfd_vma commonpagesize;
/* The BFD flags applied to sections created for dynamic linking. */
flagword dynamic_sec_flags;
@ -725,6 +718,13 @@ struct elf_backend_data
bfd_boolean (*check_directives)
(bfd *abfd, struct bfd_link_info *info);
/* The AS_NEEDED_CLEANUP function is called once per --as-needed
input file that was not needed by the add_symbols phase of the
ELF backend linker. The function must undo any target specific
changes in the symbol hash table. */
bfd_boolean (*as_needed_cleanup)
(bfd *abfd, struct bfd_link_info *info);
/* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
linker for every symbol which is defined by a dynamic object and
referenced by a regular object. This is called after all the
@ -760,6 +760,11 @@ struct elf_backend_data
bfd_boolean (*elf_backend_size_dynamic_sections)
(bfd *output_bfd, struct bfd_link_info *info);
/* Set TEXT_INDEX_SECTION and DATA_INDEX_SECTION, the output sections
we keep to use as a base for relocs and symbols. */
void (*elf_backend_init_index_section)
(bfd *output_bfd, struct bfd_link_info *info);
/* The RELOCATE_SECTION function is called by the ELF backend linker
to handle the relocations for a section.
@ -787,8 +792,11 @@ struct elf_backend_data
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
accordingly. */
bfd_boolean (*elf_backend_relocate_section)
accordingly.
Returns FALSE on error, TRUE on success, 2 if successful and
relocations should be written for this section. */
int (*elf_backend_relocate_section)
(bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd,
asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms, asection **local_sections);
@ -826,13 +834,18 @@ struct elf_backend_data
return the number of additional program segments which this BFD
will need. It should return -1 on error. */
int (*elf_backend_additional_program_headers)
(bfd *);
(bfd *, struct bfd_link_info *);
/* This function is called to modify an existing segment map in a
backend specific fashion. */
bfd_boolean (*elf_backend_modify_segment_map)
(bfd *, struct bfd_link_info *);
/* This function is called to modify program headers just before
they are written. */
bfd_boolean (*elf_backend_modify_program_headers)
(bfd *, struct bfd_link_info *);
/* This function is called during section garbage collection to
mark sections that define global symbols. */
bfd_boolean (*gc_mark_dynamic_ref)
@ -840,9 +853,12 @@ struct elf_backend_data
/* This function is called during section gc to discover the section a
particular relocation refers to. */
asection * (*gc_mark_hook)
(asection *sec, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *h, Elf_Internal_Sym *);
elf_gc_mark_hook_fn gc_mark_hook;
/* This function, if defined, is called after the first gc marking pass
to allow the backend to mark additional sections. */
bfd_boolean (*gc_mark_extra_sections)
(struct bfd_link_info *info, elf_gc_mark_hook_fn gc_mark_hook);
/* This function, if defined, is called during the sweep phase of gc
in order that a backend might update any data structures it might
@ -865,8 +881,16 @@ struct elf_backend_data
/* This function, if defined, is called after all local symbols and
global symbols converted to locals are emitted into the symtab
section. It allows the backend to emit special global symbols
section. It allows the backend to emit special local symbols
not handled in the hash table. */
bfd_boolean (*elf_backend_output_arch_local_syms)
(bfd *, struct bfd_link_info *, void *,
bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *,
struct elf_link_hash_entry *));
/* This function, if defined, is called after all symbols are emitted
into the symtab section. It allows the backend to emit special
global symbols not handled in the hash table. */
bfd_boolean (*elf_backend_output_arch_syms)
(bfd *, struct bfd_link_info *, void *,
bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *,
@ -913,15 +937,19 @@ struct elf_backend_data
(asection *, Elf_Internal_Rela *);
/* This function, if defined, is called when an NT_PRSTATUS note is found
in a core file. */
in a core file. */
bfd_boolean (*elf_backend_grok_prstatus)
(bfd *, Elf_Internal_Note *);
/* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO
note is found in a core file. */
note is found in a core file. */
bfd_boolean (*elf_backend_grok_psinfo)
(bfd *, Elf_Internal_Note *);
/* This function, if defined, is called to write a note to a corefile. */
char *(*elf_backend_write_core_note)
(bfd *abfd, char *buf, int *bufsiz, int note_type, ...);
/* Functions to print VMAs. Special code to handle 64 bit ELF files. */
void (* elf_backend_sprintf_vma)
(bfd *, char *, bfd_vma);
@ -974,7 +1002,7 @@ struct elf_backend_data
/* This function, if defined, may write out the given section.
Returns TRUE if it did so and FALSE if the caller should. */
bfd_boolean (*elf_backend_write_section)
(bfd *, asection *, bfd_byte *);
(bfd *, struct bfd_link_info *, asection *, bfd_byte *);
/* The level of IRIX compatibility we're striving for.
MIPS ELF specific function. */
@ -1022,6 +1050,12 @@ struct elf_backend_data
bfd_boolean *, bfd_boolean *,
bfd *, asection **);
/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
bfd_boolean (*elf_hash_symbol) (struct elf_link_hash_entry *);
/* Return TRUE if type is a function symbol type. */
bfd_boolean (*is_function_type) (unsigned int type);
/* Used to handle bad SHF_LINK_ORDER input. */
bfd_error_handler_type link_order_error_handler;
@ -1041,6 +1075,19 @@ struct elf_backend_data
so-called reserved entries on some systems. */
bfd_vma got_header_size;
/* The vendor name to use for a processor-standard attributes section. */
const char *obj_attrs_vendor;
/* The section name to use for a processor-standard attributes section. */
const char *obj_attrs_section;
/* Return 1, 2 or 3 to indicate what type of arguments a
processor-specific tag takes. */
int (*obj_attrs_arg_type) (int);
/* The section type to use for an attributes section. */
unsigned int obj_attrs_section_type;
/* This is TRUE if the linker should act like collect and gather
global constructors and destructors by name. This is TRUE for
MIPS ELF because the Irix 5 tools can not handle the .init
@ -1088,10 +1135,17 @@ struct elf_backend_data
unsigned can_refcount : 1;
unsigned want_got_sym : 1;
unsigned want_dynbss : 1;
/* Targets which do not support physical addressing often require
that the p_paddr field in the section header to be set to zero.
This field indicates whether this behavior is required. */
/* Targets which do not support physical addressing often require
that the p_paddr field in the section header to be set to zero.
This field indicates whether this behavior is required. */
unsigned want_p_paddr_set_to_zero : 1;
/* True if an object file lacking a .note.GNU-stack section
should be assumed to be requesting exec stack. At least one
other file in the link needs to have a .note.GNU-stack section
for a PT_GNU_STACK segment to be created. */
unsigned default_execstack : 1;
};
/* Information stored for each BFD section in an ELF file. This
@ -1160,12 +1214,12 @@ struct bfd_elf_section_data
struct bfd_symbol *id;
} group;
/* Optional information about section group; NULL if it doesn't
belongs to any section group. */
/* For a member of a group, points to the SHT_GROUP section.
NULL for the SHT_GROUP section itself and non-group sections. */
asection *sec_group;
/* A linked list of sections in the group. Circular when used by
the linker. */
/* A linked list of member sections in the group. Circular when used by
the linker. For the SHT_GROUP section, points at first member. */
asection *next_in_group;
/* A pointer used for various section optimizations. */
@ -1181,15 +1235,11 @@ struct bfd_elf_section_data
#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group)
#define elf_sec_group(sec) (elf_section_data(sec)->sec_group)
/* Return TRUE if section has been discarded. */
#define elf_discarded_section(sec) \
(!bfd_is_abs_section (sec) \
&& bfd_is_abs_section ((sec)->output_section) \
&& (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
&& (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
#define xvec_get_elf_backend_data(xvec) \
((struct elf_backend_data *) (xvec)->backend_data)
#define get_elf_backend_data(abfd) \
((const struct elf_backend_data *) (abfd)->xvec->backend_data)
xvec_get_elf_backend_data ((abfd)->xvec)
/* This struct is used to pass information to routines called via
elf_link_hash_traverse which must return failure. */
@ -1231,6 +1281,46 @@ struct elf_find_verdep_info
bfd_boolean failed;
};
/* The maximum number of known object attributes for any target. */
#define NUM_KNOWN_OBJ_ATTRIBUTES 32
/* The value of an object attribute. type & 1 indicates whether there
is an integer value; type & 2 indicates whether there is a string
value. */
typedef struct obj_attribute
{
int type;
unsigned int i;
char *s;
} obj_attribute;
typedef struct obj_attribute_list
{
struct obj_attribute_list *next;
int tag;
obj_attribute attr;
} obj_attribute_list;
/* Object attributes may either be defined by the processor ABI, index
OBJ_ATTR_PROC in the *_obj_attributes arrays, or be GNU-specific
(and possibly also processor-specific), index OBJ_ATTR_GNU. */
#define OBJ_ATTR_PROC 0
#define OBJ_ATTR_GNU 1
#define OBJ_ATTR_FIRST OBJ_ATTR_PROC
#define OBJ_ATTR_LAST OBJ_ATTR_GNU
/* The following object attribute tags are taken as generic, for all
targets and for "gnu" where there is no target standard. */
enum
{
Tag_NULL = 0,
Tag_File = 1,
Tag_Section = 2,
Tag_Symbol = 3,
Tag_compatibility = 32
};
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
@ -1317,6 +1407,7 @@ struct elf_obj_tdata
MIPS ELF linker. FIXME: We should figure out some way to only
include this field for a MIPS ELF target. */
asection **local_stubs;
asection **local_call_stubs;
/* Used to determine if PT_GNU_EH_FRAME segment header should be
created. */
@ -1368,6 +1459,12 @@ struct elf_obj_tdata
/* Used to determine if the e_flags field has been initialized */
bfd_boolean flags_init;
/* Symbol buffer. */
void *symbuf;
obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
obj_attribute_list *other_obj_attributes[2];
};
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
@ -1397,6 +1494,12 @@ struct elf_obj_tdata
#define elf_dyn_lib_class(bfd) (elf_tdata(bfd) -> dyn_lib_class)
#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
#define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init)
#define elf_known_obj_attributes(bfd) (elf_tdata (bfd) -> known_obj_attributes)
#define elf_other_obj_attributes(bfd) (elf_tdata (bfd) -> other_obj_attributes)
#define elf_known_obj_attributes_proc(bfd) \
(elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC])
#define elf_other_obj_attributes_proc(bfd) \
(elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC])
extern void _bfd_elf_swap_verdef_in
(bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *);
@ -1462,6 +1565,8 @@ extern bfd_vma _bfd_elf_section_offset
extern unsigned long bfd_elf_hash
(const char *);
extern unsigned long bfd_elf_gnu_hash
(const char *);
extern bfd_reloc_status_type bfd_elf_generic_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
@ -1500,11 +1605,11 @@ extern bfd_boolean _bfd_elf_match_sections_by_type
extern bfd_boolean bfd_elf_is_group_section
(bfd *, const struct bfd_section *);
extern void _bfd_elf_section_already_linked
(bfd *, struct bfd_section *);
(bfd *, struct bfd_section *, struct bfd_link_info *);
extern void bfd_elf_set_group_contents
(bfd *, asection *, void *);
extern asection *_bfd_elf_check_kept_section
(asection *);
(asection *, struct bfd_link_info *);
extern void _bfd_elf_link_just_syms
(asection *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_copy_private_header_data
@ -1562,7 +1667,7 @@ extern bfd_boolean _bfd_elf_find_inliner_info
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
extern int _bfd_elf_sizeof_headers
(bfd *, bfd_boolean);
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_new_section_hook
(bfd *, asection *);
extern bfd_boolean _bfd_elf_init_reloc_shdr
@ -1632,6 +1737,8 @@ extern bfd_boolean _bfd_elf_merge_symbol
struct elf_link_hash_entry **, bfd_boolean *,
bfd_boolean *, bfd_boolean *, bfd_boolean *);
extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *);
extern bfd_boolean _bfd_elf_add_default_symbol
(bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
@ -1668,6 +1775,10 @@ extern bfd_boolean _bfd_elf_create_got_section
(bfd *, struct bfd_link_info *);
extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym
(bfd *, struct bfd_link_info *, asection *, const char *);
extern void _bfd_elf_init_1_index_section
(bfd *, struct bfd_link_info *);
extern void _bfd_elf_init_2_index_sections
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elfcore_make_pseudosection
(bfd *, char *, size_t, ufile_ptr);
@ -1690,6 +1801,9 @@ extern bfd_boolean _bfd_elf_fix_symbol_flags
extern bfd_boolean _bfd_elf_adjust_dynamic_symbol
(struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_adjust_dynamic_copy
(struct elf_link_hash_entry *, asection *);
extern bfd_boolean _bfd_elf_link_sec_merge_syms
(struct elf_link_hash_entry *, void *);
@ -1700,11 +1814,23 @@ extern bfd_boolean _bfd_elf_symbol_refs_local_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
extern bfd_boolean bfd_elf_match_symbols_in_sections
(asection *sec1, asection *sec2);
(asection *, asection *, struct bfd_link_info *);
extern void bfd_elf_perform_complex_relocation
(bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
bfd * input_bfd,
asection * input_section,
bfd_byte * contents,
Elf_Internal_Rela * rel,
Elf_Internal_Sym * local_syms,
asection ** local_sections);
extern bfd_boolean _bfd_elf_setup_sections
(bfd *);
extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *);
extern const bfd_target *bfd_elf32_object_p
(bfd *);
extern const bfd_target *bfd_elf32_core_file_p
@ -1716,7 +1842,7 @@ extern int bfd_elf32_core_file_failing_signal
extern bfd_boolean bfd_elf32_core_file_matches_executable_p
(bfd *, bfd *);
extern void bfd_elf32_swap_symbol_in
extern bfd_boolean bfd_elf32_swap_symbol_in
(bfd *, const void *, const void *, Elf_Internal_Sym *);
extern void bfd_elf32_swap_symbol_out
(bfd *, const Elf_Internal_Sym *, void *, void *);
@ -1758,7 +1884,7 @@ extern int bfd_elf64_core_file_failing_signal
extern bfd_boolean bfd_elf64_core_file_matches_executable_p
(bfd *, bfd *);
extern void bfd_elf64_swap_symbol_in
extern bfd_boolean bfd_elf64_swap_symbol_in
(bfd *, const void *, const void *, Elf_Internal_Sym *);
extern void bfd_elf64_swap_symbol_out
(bfd *, const Elf_Internal_Sym *, void *, void *);
@ -1802,6 +1928,10 @@ extern bfd_boolean bfd_elf_link_record_dynamic_symbol
extern int bfd_elf_link_record_local_dynamic_symbol
(struct bfd_link_info *, bfd *, long);
extern void bfd_elf_link_mark_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *,
Elf_Internal_Sym *);
extern bfd_boolean _bfd_elf_close_and_cleanup
(bfd *);
@ -1836,6 +1966,10 @@ extern bfd_boolean bfd_elf_gc_record_vtinherit
extern bfd_boolean bfd_elf_gc_record_vtentry
(bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern asection *_bfd_elf_gc_mark_hook
(asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *);
extern bfd_boolean _bfd_elf_gc_mark
(struct bfd_link_info *, asection *,
asection * (*) (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
@ -1850,10 +1984,14 @@ extern bfd_boolean bfd_elf_gc_common_final_link
extern bfd_boolean bfd_elf_reloc_symbol_deleted_p
(bfd_vma, void *);
extern struct elf_segment_map *
_bfd_elf_make_dynamic_segment
extern struct elf_segment_map * _bfd_elf_make_dynamic_segment
(bfd *, asection *);
extern bfd_boolean _bfd_elf_map_sections_to_segments
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
/* Exported interface for writing elf corefile notes. */
extern char *elfcore_write_note
(bfd *, char *, int *, const char *, int, const void *, int);
@ -1877,6 +2015,26 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, int));
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma);
extern int bfd_elf_get_obj_attr_int (bfd *, int, int);
extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int);
#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \
bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *);
#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \
bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
extern void bfd_elf_add_obj_attr_compat (bfd *, int, unsigned int,
const char *);
#define bfd_elf_add_proc_attr_compat(BFD, INTVAL, STRVAL) \
bfd_elf_add_obj_attr_compat ((BFD), OBJ_ATTR_PROC, (INTVAL), (STRVAL))
extern char *_bfd_elf_attr_strdup (bfd *, const char *);
extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *);
extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int);
extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *);
extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *);
/* Large common section. */
extern asection _bfd_elf_large_com_section;
@ -1936,7 +2094,7 @@ extern bfd_boolean _sh_elf_set_mach_from_flags
else if (info->unresolved_syms_in_objects == RM_IGNORE \
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \
; \
else \
else if (!info->relocatable) \
{ \
bfd_boolean err; \
err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \
@ -1952,4 +2110,9 @@ extern bfd_boolean _sh_elf_set_mach_from_flags
} \
while (0)
/* Will a symbol be bound to the the definition within the shared
library, if any. */
#define SYMBOLIC_BIND(INFO, H) \
((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic))
#endif /* _LIBELF_H_ */

View File

@ -1,5 +1,6 @@
/* .eh_frame section optimization.
Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -18,14 +19,42 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/dwarf2.h"
#define EH_FRAME_HDR_SIZE 8
struct cie
{
unsigned int length;
unsigned int hash;
unsigned char version;
unsigned char local_personality;
char augmentation[20];
bfd_vma code_align;
bfd_signed_vma data_align;
bfd_vma ra_column;
bfd_vma augmentation_size;
union {
struct elf_link_hash_entry *h;
bfd_vma val;
} personality;
asection *output_sec;
struct eh_cie_fde *cie_inf;
unsigned char per_encoding;
unsigned char lsda_encoding;
unsigned char fde_encoding;
unsigned char initial_insn_length;
unsigned char make_relative;
unsigned char make_lsda_relative;
unsigned char initial_instructions[50];
};
/* If *ITER hasn't reached END yet, read the next byte into *RESULT and
move onto the next byte. Return true on success. */
@ -180,20 +209,27 @@ write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width)
}
}
/* Return zero if C1 and C2 CIEs can be merged. */
/* Return one if C1 and C2 CIEs can be merged. */
static
int cie_compare (struct cie *c1, struct cie *c2)
static int
cie_eq (const void *e1, const void *e2)
{
if (c1->hdr.length == c2->hdr.length
const struct cie *c1 = e1;
const struct cie *c2 = e2;
if (c1->hash == c2->hash
&& c1->length == c2->length
&& c1->version == c2->version
&& c1->local_personality == c2->local_personality
&& strcmp (c1->augmentation, c2->augmentation) == 0
&& strcmp (c1->augmentation, "eh") != 0
&& c1->code_align == c2->code_align
&& c1->data_align == c2->data_align
&& c1->ra_column == c2->ra_column
&& c1->augmentation_size == c2->augmentation_size
&& c1->personality == c2->personality
&& memcmp (&c1->personality, &c2->personality,
sizeof (c1->personality)) == 0
&& c1->output_sec == c2->output_sec
&& c1->per_encoding == c2->per_encoding
&& c1->lsda_encoding == c2->lsda_encoding
&& c1->fde_encoding == c2->fde_encoding
@ -201,9 +237,38 @@ int cie_compare (struct cie *c1, struct cie *c2)
&& memcmp (c1->initial_instructions,
c2->initial_instructions,
c1->initial_insn_length) == 0)
return 0;
return 1;
return 1;
return 0;
}
static hashval_t
cie_hash (const void *e)
{
const struct cie *c = e;
return c->hash;
}
static hashval_t
cie_compute_hash (struct cie *c)
{
hashval_t h = 0;
h = iterative_hash_object (c->length, h);
h = iterative_hash_object (c->version, h);
h = iterative_hash (c->augmentation, strlen (c->augmentation) + 1, h);
h = iterative_hash_object (c->code_align, h);
h = iterative_hash_object (c->data_align, h);
h = iterative_hash_object (c->ra_column, h);
h = iterative_hash_object (c->augmentation_size, h);
h = iterative_hash_object (c->personality, h);
h = iterative_hash_object (c->output_sec, h);
h = iterative_hash_object (c->per_encoding, h);
h = iterative_hash_object (c->lsda_encoding, h);
h = iterative_hash_object (c->fde_encoding, h);
h = iterative_hash_object (c->initial_insn_length, h);
h = iterative_hash (c->initial_instructions, c->initial_insn_length, h);
c->hash = h;
return h;
}
/* Return the number of extra bytes that we'll be inserting into
@ -273,11 +338,14 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width)
if (!read_byte (iter, end, &op))
return FALSE;
switch (op & 0x80 ? op & 0xc0 : op)
switch (op & 0xc0 ? op & 0xc0 : op)
{
case DW_CFA_nop:
case DW_CFA_advance_loc:
case DW_CFA_restore:
case DW_CFA_remember_state:
case DW_CFA_restore_state:
case DW_CFA_GNU_window_save:
/* No arguments. */
return TRUE;
@ -292,6 +360,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width)
/* One leb128 argument. */
return skip_leb128 (iter, end);
case DW_CFA_val_offset:
case DW_CFA_val_offset_sf:
case DW_CFA_offset_extended:
case DW_CFA_register:
case DW_CFA_def_cfa:
@ -308,6 +378,7 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width)
&& skip_bytes (iter, end, length));
case DW_CFA_expression:
case DW_CFA_val_expression:
/* A leb128 followed by a variable-length argument. */
return (skip_leb128 (iter, end)
&& read_uleb128 (iter, end, &length)
@ -339,7 +410,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width)
ENCODED_PTR_WIDTH is as for skip_cfa_op. */
static bfd_byte *
skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width)
skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width,
unsigned int *set_loc_count)
{
bfd_byte *last;
@ -349,6 +421,8 @@ skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width)
buf++;
else
{
if (*buf == DW_CFA_set_loc)
++*set_loc_count;
if (!skip_cfa_op (&buf, end, encoded_ptr_width))
return 0;
last = buf;
@ -374,15 +448,24 @@ _bfd_elf_discard_section_eh_frame
while (0)
bfd_byte *ehbuf = NULL, *buf;
bfd_byte *last_cie, *last_fde;
struct eh_cie_fde *ent, *last_cie_inf, *this_inf;
struct cie_header hdr;
struct cie cie;
bfd_byte *last_fde;
struct eh_cie_fde *ent, *this_inf;
unsigned int hdr_length, hdr_id;
struct extended_cie
{
struct cie cie;
unsigned int offset;
unsigned int usage_count;
unsigned int entry;
} *ecies = NULL, *ecie;
unsigned int ecie_count = 0, ecie_alloced = 0;
struct cie *cie;
struct elf_link_hash_table *htab;
struct eh_frame_hdr_info *hdr_info;
struct eh_frame_sec_info *sec_info = NULL;
unsigned int cie_usage_count, offset;
unsigned int offset;
unsigned int ptr_size;
unsigned int entry_alloced;
if (sec->size == 0)
{
@ -390,8 +473,7 @@ _bfd_elf_discard_section_eh_frame
return FALSE;
}
if ((sec->output_section != NULL
&& bfd_is_abs_section (sec->output_section)))
if (bfd_is_abs_section (sec->output_section))
{
/* At least one of the sections is being discarded from the
link, so we should just ignore them. */
@ -401,6 +483,9 @@ _bfd_elf_discard_section_eh_frame
htab = elf_hash_table (info);
hdr_info = &htab->eh_info;
if (hdr_info->cies == NULL && !info->relocatable)
hdr_info->cies = htab_try_create (1, cie_hash, cie_eq, free);
/* Read the frame unwind information from abfd. */
REQUIRE (bfd_malloc_and_get_section (abfd, sec, &ehbuf));
@ -423,15 +508,11 @@ _bfd_elf_discard_section_eh_frame
REQUIRE (ptr_size != 0);
buf = ehbuf;
last_cie = NULL;
last_cie_inf = NULL;
memset (&cie, 0, sizeof (cie));
cie_usage_count = 0;
sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info)
+ 99 * sizeof (struct eh_cie_fde));
REQUIRE (sec_info);
sec_info->alloced = 100;
entry_alloced = 100;
#define ENSURE_NO_RELOCS(buf) \
REQUIRE (!(cookie->rel < cookie->relend \
@ -454,118 +535,84 @@ _bfd_elf_discard_section_eh_frame
for (;;)
{
char *aug;
bfd_byte *start, *end, *insns;
bfd_byte *start, *end, *insns, *insns_end;
bfd_size_type length;
unsigned int set_loc_count;
if (sec_info->count == sec_info->alloced)
if (sec_info->count == entry_alloced)
{
struct eh_cie_fde *old_entry = sec_info->entry;
sec_info = bfd_realloc (sec_info,
sizeof (struct eh_frame_sec_info)
+ ((sec_info->alloced + 99)
+ ((entry_alloced + 99)
* sizeof (struct eh_cie_fde)));
REQUIRE (sec_info);
memset (&sec_info->entry[sec_info->alloced], 0,
memset (&sec_info->entry[entry_alloced], 0,
100 * sizeof (struct eh_cie_fde));
sec_info->alloced += 100;
/* Now fix any pointers into the array. */
if (last_cie_inf >= old_entry
&& last_cie_inf < old_entry + sec_info->count)
last_cie_inf = sec_info->entry + (last_cie_inf - old_entry);
entry_alloced += 100;
}
this_inf = sec_info->entry + sec_info->count;
last_fde = buf;
/* If we are at the end of the section, we still need to decide
on whether to output or discard last encountered CIE (if any). */
if ((bfd_size_type) (buf - ehbuf) == sec->size)
break;
/* Read the length of the entry. */
REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4));
hdr_length = bfd_get_32 (abfd, buf - 4);
/* 64-bit .eh_frame is not supported. */
REQUIRE (hdr_length != 0xffffffff);
/* The CIE/FDE must be fully contained in this input section. */
REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr_length <= sec->size);
end = buf + hdr_length;
this_inf->offset = last_fde - ehbuf;
this_inf->size = 4 + hdr_length;
if (hdr_length == 0)
{
hdr.length = 0;
hdr.id = (unsigned int) -1;
end = buf;
}
else
{
/* Read the length of the entry. */
REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4));
hdr.length = bfd_get_32 (abfd, buf - 4);
/* 64-bit .eh_frame is not supported. */
REQUIRE (hdr.length != 0xffffffff);
/* The CIE/FDE must be fully contained in this input section. */
REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr.length <= sec->size);
end = buf + hdr.length;
this_inf->offset = last_fde - ehbuf;
this_inf->size = 4 + hdr.length;
if (hdr.length == 0)
{
/* A zero-length CIE should only be found at the end of
the section. */
REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size);
ENSURE_NO_RELOCS (buf);
sec_info->count++;
/* Now just finish last encountered CIE processing and break
the loop. */
hdr.id = (unsigned int) -1;
}
else
{
REQUIRE (skip_bytes (&buf, end, 4));
hdr.id = bfd_get_32 (abfd, buf - 4);
REQUIRE (hdr.id != (unsigned int) -1);
}
/* A zero-length CIE should only be found at the end of
the section. */
REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size);
ENSURE_NO_RELOCS (buf);
sec_info->count++;
break;
}
if (hdr.id == 0 || hdr.id == (unsigned int) -1)
REQUIRE (skip_bytes (&buf, end, 4));
hdr_id = bfd_get_32 (abfd, buf - 4);
if (hdr_id == 0)
{
unsigned int initial_insn_length;
/* CIE */
if (last_cie != NULL)
{
/* Now check if this CIE is identical to the last CIE,
in which case we can remove it provided we adjust
all FDEs. Also, it can be removed if we have removed
all FDEs using it. */
if ((!info->relocatable
&& hdr_info->last_cie_sec
&& (sec->output_section
== hdr_info->last_cie_sec->output_section)
&& cie_compare (&cie, &hdr_info->last_cie) == 0)
|| cie_usage_count == 0)
last_cie_inf->removed = 1;
else
{
hdr_info->last_cie = cie;
hdr_info->last_cie_sec = sec;
last_cie_inf->make_relative = cie.make_relative;
last_cie_inf->make_lsda_relative = cie.make_lsda_relative;
last_cie_inf->per_encoding_relative
= (cie.per_encoding & 0x70) == DW_EH_PE_pcrel;
}
}
if (hdr.id == (unsigned int) -1)
break;
last_cie_inf = this_inf;
this_inf->cie = 1;
cie_usage_count = 0;
memset (&cie, 0, sizeof (cie));
cie.hdr = hdr;
REQUIRE (read_byte (&buf, end, &cie.version));
if (ecie_count == ecie_alloced)
{
ecies = bfd_realloc (ecies,
(ecie_alloced + 20) * sizeof (*ecies));
REQUIRE (ecies);
memset (&ecies[ecie_alloced], 0, 20 * sizeof (*ecies));
ecie_alloced += 20;
}
cie = &ecies[ecie_count].cie;
ecies[ecie_count].offset = this_inf->offset;
ecies[ecie_count++].entry = sec_info->count;
cie->length = hdr_length;
start = buf;
REQUIRE (read_byte (&buf, end, &cie->version));
/* Cannot handle unknown versions. */
REQUIRE (cie.version == 1 || cie.version == 3);
REQUIRE (strlen ((char *) buf) < sizeof (cie.augmentation));
REQUIRE (cie->version == 1 || cie->version == 3);
REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
strcpy (cie.augmentation, (char *) buf);
strcpy (cie->augmentation, (char *) buf);
buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1;
ENSURE_NO_RELOCS (buf);
if (buf[0] == 'e' && buf[1] == 'h')
@ -577,26 +624,26 @@ _bfd_elf_discard_section_eh_frame
REQUIRE (skip_bytes (&buf, end, ptr_size));
SKIP_RELOCS (buf);
}
REQUIRE (read_uleb128 (&buf, end, &cie.code_align));
REQUIRE (read_sleb128 (&buf, end, &cie.data_align));
if (cie.version == 1)
REQUIRE (read_uleb128 (&buf, end, &cie->code_align));
REQUIRE (read_sleb128 (&buf, end, &cie->data_align));
if (cie->version == 1)
{
REQUIRE (buf < end);
cie.ra_column = *buf++;
cie->ra_column = *buf++;
}
else
REQUIRE (read_uleb128 (&buf, end, &cie.ra_column));
REQUIRE (read_uleb128 (&buf, end, &cie->ra_column));
ENSURE_NO_RELOCS (buf);
cie.lsda_encoding = DW_EH_PE_omit;
cie.fde_encoding = DW_EH_PE_omit;
cie.per_encoding = DW_EH_PE_omit;
aug = cie.augmentation;
cie->lsda_encoding = DW_EH_PE_omit;
cie->fde_encoding = DW_EH_PE_omit;
cie->per_encoding = DW_EH_PE_omit;
aug = cie->augmentation;
if (aug[0] != 'e' || aug[1] != 'h')
{
if (*aug == 'z')
{
aug++;
REQUIRE (read_uleb128 (&buf, end, &cie.augmentation_size));
REQUIRE (read_uleb128 (&buf, end, &cie->augmentation_size));
ENSURE_NO_RELOCS (buf);
}
@ -604,14 +651,14 @@ _bfd_elf_discard_section_eh_frame
switch (*aug++)
{
case 'L':
REQUIRE (read_byte (&buf, end, &cie.lsda_encoding));
REQUIRE (read_byte (&buf, end, &cie->lsda_encoding));
ENSURE_NO_RELOCS (buf);
REQUIRE (get_DW_EH_PE_width (cie.lsda_encoding, ptr_size));
REQUIRE (get_DW_EH_PE_width (cie->lsda_encoding, ptr_size));
break;
case 'R':
REQUIRE (read_byte (&buf, end, &cie.fde_encoding));
REQUIRE (read_byte (&buf, end, &cie->fde_encoding));
ENSURE_NO_RELOCS (buf);
REQUIRE (get_DW_EH_PE_width (cie.fde_encoding, ptr_size));
REQUIRE (get_DW_EH_PE_width (cie->fde_encoding, ptr_size));
break;
case 'S':
break;
@ -619,18 +666,17 @@ _bfd_elf_discard_section_eh_frame
{
int per_width;
REQUIRE (read_byte (&buf, end, &cie.per_encoding));
per_width = get_DW_EH_PE_width (cie.per_encoding,
REQUIRE (read_byte (&buf, end, &cie->per_encoding));
per_width = get_DW_EH_PE_width (cie->per_encoding,
ptr_size);
REQUIRE (per_width);
if ((cie.per_encoding & 0xf0) == DW_EH_PE_aligned)
if ((cie->per_encoding & 0xf0) == DW_EH_PE_aligned)
{
length = -(buf - ehbuf) & (per_width - 1);
REQUIRE (skip_bytes (&buf, end, length));
}
ENSURE_NO_RELOCS (buf);
/* Ensure we have a reloc here, against
a global symbol. */
/* Ensure we have a reloc here. */
if (GET_RELOC (buf) != NULL)
{
unsigned long r_symndx;
@ -641,7 +687,9 @@ _bfd_elf_discard_section_eh_frame
else
#endif
r_symndx = ELF32_R_SYM (cookie->rel->r_info);
if (r_symndx >= cookie->locsymcount)
if (r_symndx >= cookie->locsymcount
|| ELF_ST_BIND (cookie->locsyms[r_symndx]
.st_info) != STB_LOCAL)
{
struct elf_link_hash_entry *h;
@ -653,14 +701,39 @@ _bfd_elf_discard_section_eh_frame
h = (struct elf_link_hash_entry *)
h->root.u.i.link;
cie.personality = h;
cie->personality.h = h;
}
else
{
Elf_Internal_Sym *sym;
asection *sym_sec;
bfd_vma val;
sym = &cookie->locsyms[r_symndx];
sym_sec = (bfd_section_from_elf_index
(abfd, sym->st_shndx));
if (sym_sec != NULL)
{
if (sym_sec->kept_section != NULL)
sym_sec = sym_sec->kept_section;
if (sym_sec->output_section != NULL)
{
val = (sym->st_value
+ sym_sec->output_offset
+ sym_sec->output_section->vma);
cie->personality.val = val;
cie->local_personality = 1;
}
}
}
/* Cope with MIPS-style composite relocations. */
do
cookie->rel++;
while (GET_RELOC (buf) != NULL);
}
REQUIRE (skip_bytes (&buf, end, per_width));
REQUIRE (cie->local_personality || cie->personality.h);
}
break;
default:
@ -676,18 +749,18 @@ _bfd_elf_discard_section_eh_frame
->elf_backend_can_make_relative_eh_frame
(abfd, info, sec)))
{
if ((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_relative = 1;
if ((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr)
cie->make_relative = 1;
/* If the CIE doesn't already have an 'R' entry, it's fairly
easy to add one, provided that there's no aligned data
after the augmentation string. */
else if (cie.fde_encoding == DW_EH_PE_omit
&& (cie.per_encoding & 0xf0) != DW_EH_PE_aligned)
else if (cie->fde_encoding == DW_EH_PE_omit
&& (cie->per_encoding & 0xf0) != DW_EH_PE_aligned)
{
if (*cie.augmentation == 0)
if (*cie->augmentation == 0)
this_inf->add_augmentation_size = 1;
this_inf->add_fde_encoding = 1;
cie.make_relative = 1;
cie->make_relative = 1;
}
}
@ -695,30 +768,36 @@ _bfd_elf_discard_section_eh_frame
&& (get_elf_backend_data (abfd)
->elf_backend_can_make_lsda_relative_eh_frame
(abfd, info, sec))
&& (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_lsda_relative = 1;
&& (cie->lsda_encoding & 0xf0) == DW_EH_PE_absptr)
cie->make_lsda_relative = 1;
/* If FDE encoding was not specified, it defaults to
DW_EH_absptr. */
if (cie.fde_encoding == DW_EH_PE_omit)
cie.fde_encoding = DW_EH_PE_absptr;
if (cie->fde_encoding == DW_EH_PE_omit)
cie->fde_encoding = DW_EH_PE_absptr;
initial_insn_length = end - buf;
if (initial_insn_length <= 50)
if (initial_insn_length <= sizeof (cie->initial_instructions))
{
cie.initial_insn_length = initial_insn_length;
memcpy (cie.initial_instructions, buf, initial_insn_length);
cie->initial_insn_length = initial_insn_length;
memcpy (cie->initial_instructions, buf, initial_insn_length);
}
insns = buf;
buf += initial_insn_length;
ENSURE_NO_RELOCS (buf);
last_cie = last_fde;
}
else
{
/* Ensure this FDE uses the last CIE encountered. */
REQUIRE (last_cie);
REQUIRE (hdr.id == (unsigned int) (buf - 4 - last_cie));
/* Find the corresponding CIE. */
unsigned int cie_offset = this_inf->offset + 4 - hdr_id;
for (ecie = ecies; ecie < ecies + ecie_count; ++ecie)
if (cie_offset == ecie->offset)
break;
/* Ensure this FDE references one of the CIEs in this input
section. */
REQUIRE (ecie != ecies + ecie_count);
cie = &ecie->cie;
ENSURE_NO_RELOCS (buf);
REQUIRE (GET_RELOC (buf));
@ -730,26 +809,31 @@ _bfd_elf_discard_section_eh_frame
else
{
if (info->shared
&& (((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr
&& cie.make_relative == 0)
|| (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned))
&& (((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr
&& cie->make_relative == 0)
|| (cie->fde_encoding & 0xf0) == DW_EH_PE_aligned))
{
/* If a shared library uses absolute pointers
which we cannot turn into PC relative,
don't create the binary search table,
since it is affected by runtime relocations. */
hdr_info->table = FALSE;
(*info->callbacks->einfo)
(_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr"
" table being created.\n"), abfd, sec);
}
cie_usage_count++;
ecie->usage_count++;
hdr_info->fde_count++;
this_inf->cie_inf = (void *) (ecie - ecies);
}
/* Skip the initial location and address range. */
start = buf;
length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size);
length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size);
REQUIRE (skip_bytes (&buf, end, 2 * length));
/* Skip the augmentation size, if present. */
if (cie.augmentation[0] == 'z')
if (cie->augmentation[0] == 'z')
REQUIRE (read_uleb128 (&buf, end, &length));
else
length = 0;
@ -757,12 +841,12 @@ _bfd_elf_discard_section_eh_frame
/* Of the supported augmentation characters above, only 'L'
adds augmentation data to the FDE. This code would need to
be adjusted if any future augmentations do the same thing. */
if (cie.lsda_encoding != DW_EH_PE_omit)
if (cie->lsda_encoding != DW_EH_PE_omit)
{
this_inf->lsda_offset = buf - start;
/* If there's no 'z' augmentation, we don't know where the
CFA insns begin. Assume no padding. */
if (cie.augmentation[0] != 'z')
if (cie->augmentation[0] != 'z')
length = end - buf;
}
@ -770,57 +854,131 @@ _bfd_elf_discard_section_eh_frame
REQUIRE (skip_bytes (&buf, end, length));
insns = buf;
buf = last_fde + 4 + hdr.length;
buf = last_fde + 4 + hdr_length;
SKIP_RELOCS (buf);
}
/* Try to interpret the CFA instructions and find the first
padding nop. Shrink this_inf's size so that it doesn't
including the padding. */
length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size);
insns = skip_non_nops (insns, end, length);
if (insns != 0)
this_inf->size -= end - insns;
include the padding. */
length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size);
set_loc_count = 0;
insns_end = skip_non_nops (insns, end, length, &set_loc_count);
/* If we don't understand the CFA instructions, we can't know
what needs to be adjusted there. */
if (insns_end == NULL
/* For the time being we don't support DW_CFA_set_loc in
CIE instructions. */
|| (set_loc_count && this_inf->cie))
goto free_no_table;
this_inf->size -= end - insns_end;
if (insns_end != end && this_inf->cie)
{
cie->initial_insn_length -= end - insns_end;
cie->length -= end - insns_end;
}
if (set_loc_count
&& ((cie->fde_encoding & 0xf0) == DW_EH_PE_pcrel
|| cie->make_relative))
{
unsigned int cnt;
bfd_byte *p;
this_inf->fde_encoding = cie.fde_encoding;
this_inf->lsda_encoding = cie.lsda_encoding;
this_inf->set_loc = bfd_malloc ((set_loc_count + 1)
* sizeof (unsigned int));
REQUIRE (this_inf->set_loc);
this_inf->set_loc[0] = set_loc_count;
p = insns;
cnt = 0;
while (p < end)
{
if (*p == DW_CFA_set_loc)
this_inf->set_loc[++cnt] = p + 1 - start;
REQUIRE (skip_cfa_op (&p, end, length));
}
}
this_inf->fde_encoding = cie->fde_encoding;
this_inf->lsda_encoding = cie->lsda_encoding;
sec_info->count++;
}
elf_section_data (sec)->sec_info = sec_info;
sec->sec_info_type = ELF_INFO_TYPE_EH_FRAME;
/* Look at all CIEs in this section and determine which can be
removed as unused, which can be merged with previous duplicate
CIEs and which need to be kept. */
for (ecie = ecies; ecie < ecies + ecie_count; ++ecie)
{
if (ecie->usage_count == 0)
{
sec_info->entry[ecie->entry].removed = 1;
continue;
}
ecie->cie.output_sec = sec->output_section;
ecie->cie.cie_inf = sec_info->entry + ecie->entry;
cie_compute_hash (&ecie->cie);
if (hdr_info->cies != NULL)
{
void **loc = htab_find_slot_with_hash (hdr_info->cies, &ecie->cie,
ecie->cie.hash, INSERT);
if (loc != NULL)
{
if (*loc != HTAB_EMPTY_ENTRY)
{
sec_info->entry[ecie->entry].removed = 1;
ecie->cie.cie_inf = ((struct cie *) *loc)->cie_inf;
continue;
}
*loc = malloc (sizeof (struct cie));
if (*loc == NULL)
*loc = HTAB_DELETED_ENTRY;
else
memcpy (*loc, &ecie->cie, sizeof (struct cie));
}
}
ecie->cie.cie_inf->make_relative = ecie->cie.make_relative;
ecie->cie.cie_inf->make_lsda_relative = ecie->cie.make_lsda_relative;
ecie->cie.cie_inf->per_encoding_relative
= (ecie->cie.per_encoding & 0x70) == DW_EH_PE_pcrel;
}
/* Ok, now we can assign new offsets. */
offset = 0;
last_cie_inf = hdr_info->last_cie_inf;
for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent)
if (!ent->removed)
{
if (ent->cie)
last_cie_inf = ent;
else
ent->cie_inf = last_cie_inf;
if (!ent->cie)
{
ecie = ecies + (unsigned long) ent->cie_inf;
ent->cie_inf = ecie->cie.cie_inf;
}
ent->new_offset = offset;
offset += size_of_output_cie_fde (ent, ptr_size);
}
hdr_info->last_cie_inf = last_cie_inf;
/* Resize the sec as needed. */
sec->rawsize = sec->size;
sec->size = offset;
if (sec->size == 0)
sec->flags |= SEC_EXCLUDE;
free (ehbuf);
if (ecies)
free (ecies);
return offset != sec->rawsize;
free_no_table:
(*info->callbacks->einfo)
(_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
abfd, sec);
if (ehbuf)
free (ehbuf);
if (sec_info)
free (sec_info);
if (ecies)
free (ecies);
hdr_info->table = FALSE;
hdr_info->last_cie.hdr.length = 0;
return FALSE;
#undef REQUIRE
@ -839,6 +997,13 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
htab = elf_hash_table (info);
hdr_info = &htab->eh_info;
if (hdr_info->cies != NULL)
{
htab_delete (hdr_info->cies);
hdr_info->cies = NULL;
}
sec = hdr_info->hdr_sec;
if (sec == NULL)
return FALSE;
@ -847,8 +1012,6 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
if (hdr_info->table)
sec->size += 4 + hdr_info->fde_count * 8;
/* Request program headers to be recalculated. */
elf_tdata (abfd)->program_header_size = 0;
elf_tdata (abfd)->eh_frame_hdr = sec;
return TRUE;
}
@ -968,6 +1131,23 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
return (bfd_vma) -2;
}
/* If converting to DW_EH_PE_pcrel, there will be no need for run-time
relocation against DW_CFA_set_loc's arguments. */
if (sec_info->entry[mid].set_loc
&& (sec_info->entry[mid].cie
? sec_info->entry[mid].make_relative
: sec_info->entry[mid].cie_inf->make_relative)
&& (offset >= sec_info->entry[mid].offset + 8
+ sec_info->entry[mid].set_loc[1]))
{
unsigned int cnt;
for (cnt = 1; cnt <= sec_info->entry[mid].set_loc[0]; cnt++)
if (offset == sec_info->entry[mid].offset + 8
+ sec_info->entry[mid].set_loc[cnt])
return (bfd_vma) -2;
}
if (hdr_info->offsets_adjusted)
offset -= sec->output_offset;
/* Any new augmentation bytes go before the first relocation. */
@ -1192,6 +1372,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
/* FDE */
bfd_vma value, address;
unsigned int width;
bfd_byte *start;
/* Skip length. */
buf += 4;
@ -1228,6 +1409,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
write_value (abfd, buf, value, width);
}
start = buf;
if (hdr_info)
{
hdr_info->array[hdr_info->array_count].initial_loc = address;
@ -1260,12 +1443,42 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
memmove (buf + 1, buf, end - buf);
*buf = 0;
}
if (ent->set_loc)
{
/* Adjust DW_CFA_set_loc. */
unsigned int cnt, width;
bfd_vma new_offset;
width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size);
new_offset = ent->new_offset + 8
+ extra_augmentation_string_bytes (ent)
+ extra_augmentation_data_bytes (ent);
for (cnt = 1; cnt <= ent->set_loc[0]; cnt++)
{
bfd_vma value;
buf = start + ent->set_loc[cnt];
value = read_value (abfd, buf, width,
get_DW_EH_PE_signed (ent->fde_encoding));
if (!value)
continue;
if ((ent->fde_encoding & 0xf0) == DW_EH_PE_pcrel)
value += ent->offset + 8 - new_offset;
if (ent->cie_inf->make_relative)
value -= sec->output_section->vma + new_offset
+ ent->set_loc[cnt];
write_value (abfd, buf, value, width);
}
}
}
}
/* We don't align the section to its section alignment since the
runtime library only expects all CIE/FDE records aligned at
the pointer size. _bfd_elf_discard_section_eh_frame should
the pointer size. _bfd_elf_discard_section_eh_frame should
have padded CIE/FDE records to multiple of pointer size with
size_of_output_cie_fde. */
if ((sec->size % ptr_size) != 0)

View File

@ -1,5 +1,6 @@
/* ELF strtab with GC and suffix merging support.
Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
Copyright 2001, 2002, 2003, 2005, 2006, 2007
Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -18,8 +19,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "hashtab.h"

View File

@ -1,5 +1,5 @@
/* VxWorks support for ELF
Copyright 2005 Free Software Foundation, Inc.
Copyright 2005, 2007 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -20,15 +20,34 @@
/* This file provides routines used by all VxWorks targets. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf-vxworks.h"
/* Return true if symbol NAME, as defined by ABFD, is one of the special
__GOTT_BASE__ or __GOTT_INDEX__ symbols. */
static bfd_boolean
elf_vxworks_gott_symbol_p (bfd *abfd, const char *name)
{
char leading;
leading = bfd_get_symbol_leading_char (abfd);
if (leading)
{
if (*name != leading)
return FALSE;
name++;
}
return (strcmp (name, "__GOTT_BASE__") == 0
|| strcmp (name, "__GOTT_INDEX__") == 0);
}
/* Tweak magic VxWorks symbols as they are loaded. */
bfd_boolean
elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
elf_vxworks_add_symbol_hook (bfd *abfd,
struct bfd_link_info *info,
Elf_Internal_Sym *sym,
const char **namep,
@ -45,8 +64,7 @@ elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
This transformation will be undone in
elf_i386_vxworks_link_output_symbol_hook. */
if ((info->shared || abfd->flags & DYNAMIC)
&& (strcmp (*namep, "__GOTT_INDEX__") == 0
|| strcmp (*namep, "__GOTT_BASE__") == 0))
&& elf_vxworks_gott_symbol_p (abfd, *namep))
{
sym->st_info = ELF_ST_INFO (STB_WEAK, ELF_ST_TYPE (sym->st_info));
*flagsp |= BSF_WEAK;
@ -114,16 +132,12 @@ elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info
const char *name,
Elf_Internal_Sym *sym,
asection *input_sec ATTRIBUTE_UNUSED,
struct elf_link_hash_entry *h
ATTRIBUTE_UNUSED)
struct elf_link_hash_entry *h)
{
/* Ignore the first dummy symbol. */
if (!name)
return TRUE;
/* Reverse the effects of the hack in elf_vxworks_add_symbol_hook. */
if (strcmp (name, "__GOTT_INDEX__") == 0
|| strcmp (name, "__GOTT_BASE__") == 0)
if (h
&& h->root.type == bfd_link_hash_undefweak
&& elf_vxworks_gott_symbol_p (h->root.u.undef.abfd, name))
sym->st_info = ELF_ST_INFO (STB_GLOBAL, ELF_ST_TYPE (sym->st_info));
return TRUE;
@ -156,7 +170,8 @@ elf_vxworks_emit_relocs (bfd *output_bfd,
&& *rel_hash
&& (*rel_hash)->def_dynamic
&& !(*rel_hash)->def_regular
&& (*rel_hash)->root.type == bfd_link_hash_defined
&& ((*rel_hash)->root.type == bfd_link_hash_defined
|| (*rel_hash)->root.type == bfd_link_hash_defweak)
&& (*rel_hash)->root.u.def.section->output_section != NULL)
{
/* This is a relocation from an executable or shared library
@ -171,8 +186,7 @@ elf_vxworks_emit_relocs (bfd *output_bfd,
for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
{
asection *sec = (*rel_hash)->root.u.def.section;
int this_idx =
elf_section_data (sec->output_section)->this_idx;
int this_idx = sec->output_section->target_index;
irela[j].r_info = ELF32_R_INFO (this_idx,
ELF32_R_TYPE (irela[j].r_info));

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* ARC-specific support for 32-bit ELF
Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005
Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005, 2007
Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
@ -20,8 +20,8 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/arc.h"
@ -147,6 +147,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return NULL;
}
static reloc_howto_type *
bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;
for (i = 0;
i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]);
i++)
if (elf_arc_howto_table[i].name != NULL
&& strcasecmp (elf_arc_howto_table[i].name, r_name) == 0)
return &elf_arc_howto_table[i];
return NULL;
}
/* Set the howto pointer for an ARC ELF reloc. */
static void

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
/* AVR-specific support for 32-bit ELF.
Copyright 2006 Free Software Foundation, Inc.
Written by Bjoern Haase <bjoern.m.haase@web.de>
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1301, USA. */
/* These four functions will be called from the ld back-end. */
extern void
elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *,
bfd_boolean, bfd_boolean, bfd_boolean,
bfd_vma, bfd_boolean);
extern int
elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *);
extern bfd_boolean
elf32_avr_size_stubs (bfd *, struct bfd_link_info *, bfd_boolean);
extern bfd_boolean
elf32_avr_build_stubs (struct bfd_link_info *);

Some files were not shown because too many files have changed in this diff Show More