mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Enlist the FreeBSD-CURRENT users as testers of what is to become Binutils
version 2.12.0. These bits are taken from the FSF anoncvs repo on 27-January-2002 03:41 PST.
This commit is contained in:
parent
855ee8c509
commit
dbbf32dd39
529 changed files with 108359 additions and 47518 deletions
|
|
@ -1,3 +1,195 @@
|
|||
2002-01-26 Jason Thorpe <thorpej@wasabisystems.com>
|
||||
|
||||
* configure.in (*-*-netbsd*): New. Skip target-newlib,
|
||||
target-libiberty, and target-libgloss. Skip Java-related
|
||||
libraries if not supported for NetBSD on target CPU.
|
||||
|
||||
2002-01-23 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* configure.in: Import StrongARM and XScale target_configdirs from
|
||||
FSF GCC version.
|
||||
|
||||
2002-01-16 H.J. Lu (hjl@gnu.org)
|
||||
|
||||
* config.guess: Import from master sources, rev 1.225.
|
||||
* config.sub: Import from master sources, rev 1.238.
|
||||
|
||||
* MAINTAINERS: Updated notes on config.guess and config.sub.
|
||||
|
||||
2002-01-11 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* configure.in (ia64*-*-hpux*): New target for IA64 HP-UX,
|
||||
ld and gdb are not supported.
|
||||
|
||||
2002-01-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* Change reference to Cygnus Solutions to be Red Hat.
|
||||
|
||||
2002-01-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* COPYING.NEWLIB: Update generic copyright date.
|
||||
|
||||
2002-01-07 Mark Salter <msalter@redhat.com>
|
||||
|
||||
* configure.in: Remove target-bsp and target-cygmon from arm builds.
|
||||
Allow target-libgloss to be built for arm, strongarm, and xscale.
|
||||
|
||||
2002-01-03 Ben Elliston <bje@redhat.com>
|
||||
|
||||
* MAINTAINERS: Update URL for config.* scripts.
|
||||
|
||||
2001-12-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* config.sub: Import latest version.
|
||||
* config.guess: Likewise.
|
||||
|
||||
2001-12-13 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||
|
||||
* configure.in (FLAGS_FOR_TARGET): Remove -nostdinc and -isystem
|
||||
options for i[3456]86-pc-linux* native builds.
|
||||
|
||||
2001-12-05 Laurent Guerby <guerby@acm.org>
|
||||
|
||||
* MAINTAINERS: gcc adopts symlink-tree, refer more to
|
||||
libiberty.
|
||||
|
||||
Import this patch from gcc:
|
||||
|
||||
2000-12-09 Laurynas Biveinis <lauras@softhome.net>
|
||||
|
||||
* symlink-tree: handle DOS-style absolute paths.
|
||||
|
||||
2001-11-28 DJ Delorie <dj@redhat.com>
|
||||
Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
When build != host, create libiberty for the build machine.
|
||||
|
||||
* Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace
|
||||
CONFIG_ARGUMENTS.
|
||||
(ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR):
|
||||
New variables.
|
||||
(ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables
|
||||
and rules.
|
||||
(all.normal): Depend on ALL_BUILD_MODULES.
|
||||
(CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS.
|
||||
(all-build-libiberty): Depend on configure-build-libiberty.
|
||||
|
||||
* configure: Calculate and substitute proper value for
|
||||
ALL_BUILD_MODULES.
|
||||
* configure.in: Create the build subdirectory.
|
||||
Calculate and substitute TARGET_CONFIGARGS (formerly
|
||||
CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new).
|
||||
|
||||
2001-11-26 Geoffrey Keating <geoffk@redhat.com>
|
||||
|
||||
* config.sub: Update to version 1.232 on subversion.
|
||||
|
||||
2001-11-20 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* Makefile.in (do-proto-toplev): Use msgfmt to generate .gmo
|
||||
files from .po files for a distribution.
|
||||
|
||||
2001-11-19 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* COPYING.NEWLIB: Mention preserved notice in specific parts.
|
||||
|
||||
2001-11-13 Jeff Holcomb <jeffh@redhat.com>
|
||||
|
||||
Merged from net gcc:
|
||||
2001-07-30 Jeff Sturm <jsturm@one-pont.com>
|
||||
* ltcf-c.sh: Use $objext, not $ac_objext.
|
||||
2001-07-27 Mark Kettenis <kettenis@gnu.org>
|
||||
* ltcf-cxx.sh: Add support for GNU.
|
||||
2001-07-22 Timothy Wall <twall@redhat.com>
|
||||
* ltcf-c.sh: Don't disable shared libraries for AIX5/IA64. Preserve
|
||||
default settings if using GNU tools with that configuration.
|
||||
* ltcf-cxx.sh: Ditto.
|
||||
* ltcf-gcj.sh: Ditto.
|
||||
2001-07-21 Michael Chastain <chastain@redhat.com>
|
||||
* ltconfig: Set max_cmd_len to a maximum of 512Kb, as it seems some
|
||||
HPUX 11.0 systems have trouble with 1MB. Mark as gcc-local.
|
||||
* ltmain.sh: Mark as gcc-local.
|
||||
|
||||
2001-11-13 Jeff Holcomb <jeffh@redhat.com>
|
||||
|
||||
* Makefile.in (all-bison): Revert 2001-10-24.
|
||||
Don't depend on texinfo.
|
||||
|
||||
2001-11-12 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* COPYING.NEWLIB: Add BSD-style license/copyright blurb for my work.
|
||||
|
||||
2001-11-08 Phil Edwards <pedwards@disaster.jaj.com>
|
||||
|
||||
* configure.in (--enable-languages): Be more permissive about
|
||||
syntax. Check for empty lists better. Warn about $LANGUAGES.
|
||||
|
||||
2001-11-06 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* Makefile.in (MAKEINFO): Use "missing" for makeinfo older than 4.0.
|
||||
|
||||
2001-10-24 Jeff Holcomb <jeffh@redhat.com>
|
||||
|
||||
Makefile.in (all-bison): Don't depend on texinfo.
|
||||
|
||||
2001-10-03 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* gettext.m4: Test po/POTFILES.in exists before trying to read.
|
||||
|
||||
2001-09-29 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* Makefile.in (configure-target-gperf): Depend on $(ALL_GCC_CXX).
|
||||
|
||||
2001-09-28 Hans-Peter Nilsson <hp@axis.com>
|
||||
|
||||
* config.sub, config.guess: Import latest from subversions.
|
||||
|
||||
2001-09-21 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET,
|
||||
DLLTOOL_FOR_TARGET, WINDRES_FOR_TARGET, AR_FOR_TARGET,
|
||||
RANLIB_FOR_TARGET, NM_FOR_TARGET): Don't use double quotes to
|
||||
avoid quotes nesting problems.
|
||||
(NATIVE_CHECK_MODULES): Ditto, just for consistency.
|
||||
(DO_X): Export only variables that are set.
|
||||
|
||||
2001-09-19 Ben Elliston <bje@redhat.com>
|
||||
|
||||
* configure.in (sparc-sun-solaris2*): Don't use /usr/bin/which on
|
||||
Solaris when testing for the /usr/ucb/cc compiler; it has incorrect
|
||||
semantics. Use the shell built-in "type" command instead.
|
||||
|
||||
2001-09-15 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
|
||||
|
||||
* config.sub: Reverted the earlier change, this version is not the
|
||||
master file.
|
||||
|
||||
2001-09-14 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
|
||||
|
||||
* config.sub: Change machine triplets from mipsel*-* to mips*el-*.
|
||||
Add support for mips64.
|
||||
|
||||
2001-09-03 Jeff Holcomb <jeffh@redhat.com>
|
||||
|
||||
* configure.in: Enable libstdc++-v3 for h8300 targets.
|
||||
|
||||
2001-08-30 Eric Christopher <echristo@redhat.com>
|
||||
Jason Eckhardt <jle@redhat.com>
|
||||
|
||||
* config.sub: Add support for mipsisa32.
|
||||
|
||||
2001-08-30 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* config.sub, config.guess: Import latest from subversions.
|
||||
|
||||
2001-08-20 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* config.sub, config.guess: Import latest from subversions.
|
||||
|
||||
2001-07-26 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* MAINTAINERS: Clarify libiberty merge rules and procedures.
|
||||
|
||||
2001-06-19 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.in: Revert 2001-06-17.
|
||||
|
|
@ -9,21 +201,177 @@
|
|||
(gas+binutils.tar.bz2): Likewise.
|
||||
(binutils.tar.bz2): Pass TOOL=bfd PACKAGE=binutils to make.
|
||||
|
||||
2001-06-11 Alan Modra <amodra@bigpond.net.au>
|
||||
Fri Jun 8 11:14:02 2001 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (VER): When present, extract the version number from
|
||||
the file version.in.
|
||||
|
||||
2001-06-08 Alexandre Oliva <aoliva@redhat.com>, Jeff Sturm <jsturm@one-point.com>
|
||||
|
||||
* Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): If
|
||||
gcc/xgcc is built, use -print-prog-name to find out the program
|
||||
name to use.
|
||||
|
||||
2001-06-04 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris,
|
||||
with_gcc]: Use `gcc -shared' to build a shared library.
|
||||
|
||||
2001-06-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
||||
|
||||
* ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared
|
||||
archives.
|
||||
|
||||
2001-05-28 Simon Patarin <simon.patarin@inria.fr>
|
||||
|
||||
* ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared
|
||||
libraries when using g++ with native linker.
|
||||
|
||||
2001-05-28 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256.
|
||||
|
||||
2001-05-24 Tom Rix <trix@redhat.com>
|
||||
|
||||
* configure.in : enable ld for aix
|
||||
|
||||
2001-05-22 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag)
|
||||
[aix4*|aix5*]: Prepend blank.
|
||||
|
||||
2001-05-20 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
|
||||
ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number
|
||||
of subdir/configure scripts to use the new libtool.m4.
|
||||
|
||||
2001-05-14 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* config.if (libc_interface): Set to -libc6.2- for cross
|
||||
compiling to Linux/glibc 2.2.
|
||||
|
||||
2001-05-03 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* configure.in (noconfigdirs) [*-cygwin*, *-mingw*, *-beos]: Disable
|
||||
libgcj.
|
||||
|
||||
2001-04-26 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* configure.in (noconfigdirs): Don't reset it from scratch in the
|
||||
target case; only append to it.
|
||||
|
||||
2001-04-26 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* configure.in (noconfigdirs) [hppa*-*-*, mips*-*-irix6*,
|
||||
sparc-*-solaris2.8]: Disable ${libgcj}.
|
||||
|
||||
2001-04-25 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* configure.in (libgcj_saved): Copy from $libgcj.
|
||||
(libgcj): Zero out if --enable-libgcj; add to noconfigdirs is
|
||||
--disable-libgcj.
|
||||
|
||||
2001-04-20 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltconfig, ltmain.sh, ltcf-cxx.sh: Upgraded to libtool 1.4a
|
||||
1.641.2.228.
|
||||
|
||||
2001-04-12 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
|
||||
ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.226.
|
||||
|
||||
2001-04-01 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
|
||||
New macros.
|
||||
(bootstrap, cross): Use RECURSE_FLAGS.
|
||||
* configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.
|
||||
|
||||
2001-03-27 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3.
|
||||
|
||||
2001-03-23 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
Merge from mainline.
|
||||
2001-03-23 Nick Clifton <nickc@redhat.com>
|
||||
* README-maintainer-mode: Add note about inability to use "make
|
||||
distclean" in maintainer mode.
|
||||
|
||||
2001-03-22 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
Re-installed:
|
||||
2001-01-02 Laurynas Biveinis <lauras@softhome.net>
|
||||
* ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add
|
||||
'-DPIC' to ac_cv_prog_cc_pic for DJGPP.
|
||||
* ltcf-cxx.sh: Likewise.
|
||||
* ltcf-gcj.sh: Likewise.
|
||||
|
||||
2001-03-22 Philip Blundell <philb@gnu.org>
|
||||
|
||||
* config.sub, config.guess: Import latest from subversions.
|
||||
|
||||
2001-03-22 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
|
||||
ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198.
|
||||
|
||||
2001-03-20 Michael Chastain <chastain@redhat.com>
|
||||
|
||||
* Makefile.in: all-m4 depends on all-texinfo.
|
||||
|
||||
2001-03-08 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* Makefile.in (ALL_GCC, ALL_GCC_C, ALL_GCC_CXX): Set before use.
|
||||
|
||||
2001-02-22 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* COPYING.NEWLIB: Remove DJ Delorie's address because it is no
|
||||
longer valid.
|
||||
|
||||
2001-02-16 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* configure.in (noconfigdirs): Allow configuration of texinfo
|
||||
for Cygwin hosts.
|
||||
|
||||
2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
|
||||
* config.guess: Add linux target for S/390.
|
||||
* config.sub: Likewise.
|
||||
* configure.in: Likewise.
|
||||
|
||||
2001-02-06 Ben Elliston <bje@redhat.com>
|
||||
|
||||
* configure: Output host type to stdout, not stderr.
|
||||
|
||||
2001-02-04 Michael Sokolov <msokolov@ivan.Harhan.ORG>
|
||||
|
||||
* config.guess: Import from subversions.gnu.org (revision 1.181).
|
||||
* config.sub: Import from subversions.gnu.org (revision 1.199).
|
||||
|
||||
2001-01-30 Alan Modra <alan@linuxcare.com.au>
|
||||
|
||||
* config.guess: Handle hppa64-linux systems.
|
||||
|
||||
2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>
|
||||
|
||||
* ltcf-cxx.sh (ac_cv_prog_cc_pic_works, ac_cv_prog_cc_static_works):
|
||||
Don't unset, it's non-portable and no longer necessary, set to empty
|
||||
instead.
|
||||
|
||||
2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>, Alexandre Oliva <oliva@lsd.ic.unicamp.br>
|
||||
|
||||
* ltconfig: Shell portability fix for the tagname validity check.
|
||||
|
||||
2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>
|
||||
|
||||
* ltcf-cxx.sh: Use parentheses around eval $ac_compile.
|
||||
|
||||
2001-01-27 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltcf-c.sh (ld_shlibs) [aix5*]: Disable on unknown CPU types.
|
||||
* ltcf-cxx.sh, ltcf-gcj.sh: Likewise.
|
||||
|
||||
2001-01-24 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* ltmain.sh (TAG disable-shared, TAG disable-static): Make sure we
|
||||
|
|
@ -86,12 +434,12 @@
|
|||
or C++ library to have already been built to work properly.
|
||||
(do_proto_toplev): Set them to an empty string.
|
||||
|
||||
Sat Nov 18 18:57:50 2000 Alexandre Oliva <aoliva@redhat.com>
|
||||
2000-11-18 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* Makefile.in (HOST_LIB_PATH, TARGET_LIB_PATH): New macros.
|
||||
(REALLY_SET_LIB_PATH): Use them.
|
||||
|
||||
Mon Nov 6 14:19:35 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
2000-11-06 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* config.sub: Add support for Sun Chorus
|
||||
|
||||
|
|
@ -252,7 +600,7 @@ Mon Nov 6 14:19:35 2000 Christopher Faylor <cgf@cygnus.com>
|
|||
|
||||
* symlink-tree: Check number of arguments.
|
||||
|
||||
Thu Jul 6 15:36:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-06-06 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* texinfo/texinfo.tex: Update to version 2000-05-28.15.
|
||||
|
||||
|
|
@ -282,11 +630,11 @@ Thu Jul 6 15:36:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
* README-maintainer-mode: New file: Contains notes on using
|
||||
--enable-maintainer-mode with binutils.
|
||||
|
||||
Mon May 29 13:50:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-05-29 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* texinfo/texinfo.tex: Update. Version from makeinfo 4.0.
|
||||
|
||||
Tue May 30 19:01:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-05-30 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* config.sub: Import CVS version 1.167 Tue May 30 09:00:07 2000.
|
||||
* config.guess: Import CVS version 1.148 Tue May 30 09:00:06 2000
|
||||
|
|
@ -300,11 +648,11 @@ Tue May 30 19:01:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
(GCC_FOR_TARGET): Likewise.
|
||||
(CXX_FOR_TARGET): Likewise.
|
||||
|
||||
Thu May 18 10:58:13 2000 Jeffrey A Law (law@cygnus.com)
|
||||
2000-05-18 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* configure.in (hppa*64*-*-*): Do build ld for this configuration.
|
||||
|
||||
Wed May 17 16:03:48 2000 Alexandre Oliva <aoliva@cygnus.com>
|
||||
2000-05-17 Alexandre Oliva <aoliva@cygnus.com>
|
||||
|
||||
* Makefile.in (configure-target-libiberty): Depend on
|
||||
configure-target-newlib.
|
||||
|
|
@ -314,12 +662,12 @@ Wed May 17 16:03:48 2000 Alexandre Oliva <aoliva@cygnus.com>
|
|||
* configure.in, Makefile.in: Merge all libffi-related
|
||||
configury stuff from the libgcj tree.
|
||||
|
||||
Tue May 16 10:06:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-05-16 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
Thu Apr 27 11:01:48 2000 Andrew Cagney <cagney@b1.cygnus.com>:
|
||||
* Makefile.in (do-tar-bz2, do-md5sum): Skip CVS directories.
|
||||
|
||||
Tue May 16 09:57:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-05-16 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
Wed Apr 26 17:03:53 2000 Andrew Cagney <cagney@b1.cygnus.com>:
|
||||
* Makefile.in (do-djunpack): New target. Update djunpack.bat with
|
||||
|
|
@ -335,11 +683,11 @@ Tue May 16 09:57:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
* ltmain.sh: Preserve in relink_command any environment
|
||||
variables that may affect the linker behavior.
|
||||
|
||||
Fri May 12 11:23:17 2000 Jeffrey A Law (law@cygnus.com)
|
||||
2000-05-12 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* config.sub (basic_machine): Recognize hppa64 as a valid cpu type.
|
||||
|
||||
Wed May 10 21:26:51 2000 Jim Wilson <wilson@cygnus.com>
|
||||
2000-05-10 Jim Wilson <wilson@cygnus.com>
|
||||
|
||||
* configure.in (ia64*-*-elf*): Add gdb and friends to noconfigdirs.
|
||||
|
||||
|
|
@ -356,7 +704,7 @@ Wed May 10 21:26:51 2000 Jim Wilson <wilson@cygnus.com>
|
|||
|
||||
* djunpack.bat: New file.
|
||||
|
||||
Wed Apr 19 12:46:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-04-19 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2,
|
||||
gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2,
|
||||
|
|
@ -368,7 +716,7 @@ Wed Apr 19 12:46:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
* config.sub (case $basic_machine): Change default for "ibm-*"
|
||||
to "openedition".
|
||||
|
||||
Wed Apr 12 16:42:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-04-12 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (gdb-taz): New target. GDB specific archive.
|
||||
(do-md5sum): New target.
|
||||
|
|
@ -382,7 +730,7 @@ Wed Apr 12 16:42:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
(gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2,
|
||||
insight.tar.bz2): Use gdb-taz to create archive.
|
||||
|
||||
Fri Apr 7 18:10:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-04-07 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* configure (warn_cflags): Delete.
|
||||
|
||||
|
|
@ -403,7 +751,7 @@ Fri Apr 7 18:10:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
|
||||
* configure.in: -linux-gnu*, not -linux-gnu.
|
||||
|
||||
Fri Mar 3 18:44:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-03-03 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (taz): Set PACKAGE to TOOL when not defined.
|
||||
(do-tar-bz2): Replace TOOL with PACKAGE.
|
||||
|
|
@ -424,7 +772,7 @@ Fri Mar 3 18:44:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
|
||||
* config.sub: Support an OS of "wince".
|
||||
|
||||
Thu Feb 24 16:15:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
2000-02-24 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* config.guess, config.sub: Updated to match config's 2000-02-15
|
||||
version.
|
||||
|
|
@ -451,7 +799,7 @@ Thu Feb 24 16:15:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
|
||||
* config.sub: Add support for avr target.
|
||||
|
||||
Tue Feb 1 00:07:46 2000 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
2000-02-01 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* config.sub: Add mmix-knuth-mmixware.
|
||||
|
||||
|
|
@ -630,11 +978,11 @@ Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
|||
|
||||
* config.sub: Add mcore target.
|
||||
|
||||
Sun May 30 16:03:16 1999 Cort Dougan <cort@cs.nmt.edu>
|
||||
1999-05-30 Cort Dougan <cort@cs.nmt.edu>
|
||||
|
||||
* config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux.
|
||||
|
||||
Tue May 25 11:20:46 1999 H.J. Lu (hjl@gnu.org)
|
||||
1999-05-25 H.J. Lu (hjl@gnu.org)
|
||||
|
||||
* config.guess (dummy): Changed to $dummy.
|
||||
|
||||
|
|
@ -651,7 +999,7 @@ Tue May 25 11:20:46 1999 H.J. Lu (hjl@gnu.org)
|
|||
more accurately recorded in this ChangeLog.
|
||||
* config.sub: Likewise.
|
||||
|
||||
Thu May 20 10:00:42 1999 Stephen L Moshier <moshier@world.std.com>
|
||||
1999-05-20 Stephen L Moshier <moshier@world.std.com>
|
||||
|
||||
* Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include.
|
||||
|
||||
|
|
@ -679,13 +1027,13 @@ Tue Apr 13 22:50:54 1999 Donn Terry (donn@interix.com)
|
|||
* configure.in (i?86-*-beos*): Do config gperf; don't config
|
||||
gdb, newlib, or libgloss.
|
||||
|
||||
Sun Apr 11 23:55:34 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
1999-04-11 Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
|
||||
* config-ml.in: On mips*-*-*, if multidirs contains mabi=64, try to
|
||||
link a trivial program with -mabi=64. If it fails, remove mabi=64
|
||||
from multidirs.
|
||||
|
||||
Sat Apr 10 21:50:01 1999 Philipp Thomas (kthomas@gwdg.de)
|
||||
1999-04-10 Philipp Thomas (kthomas@gwdg.de)
|
||||
|
||||
* config.sub: Set basic_machine to i586 when target_alias = k6-*.
|
||||
|
||||
|
|
@ -765,7 +1113,7 @@ Wed Mar 10 17:39:09 1999 Drew Moseley <dmoseley@cygnus.com>
|
|||
|
||||
* config.sub: Rename CYGNUS LOCAL to EGCS LOCAL
|
||||
|
||||
Sun Feb 28 02:20:00 1999 Geoffrey Noer <noer@cygnus.com>
|
||||
1999-02-28 Geoffrey Noer <noer@cygnus.com>
|
||||
|
||||
* config.sub: Check for "cygwin*" rather than "cygwin32*"
|
||||
|
||||
|
|
@ -773,14 +1121,14 @@ Sun Feb 28 02:20:00 1999 Geoffrey Noer <noer@cygnus.com>
|
|||
|
||||
* config.sub: Fix typo in arm recognition.
|
||||
|
||||
Wed Feb 24 13:51:40 1999 Drew Moseley <dmoseley@cygnus.com>
|
||||
1999-02-24 Drew Moseley <dmoseley@cygnus.com>
|
||||
|
||||
* configure.in (noconfigdirs): Changed target_configdirs to
|
||||
include target-bsp only for m68k-*-elf* and m68k-*-coff*
|
||||
rather than m68k-*-* since it is not known to work on
|
||||
m68k-aout. Ditto for arm-*-*oabi.
|
||||
|
||||
Wed Feb 24 12:52:17 1999 Stan Shebs <shebs@andros.cygnus.com>
|
||||
1999-02-24 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* configure.in (*-*-windows*): Remove, no longer used.
|
||||
* config/mh-windows: Ditto.
|
||||
|
|
@ -790,11 +1138,11 @@ Wed Feb 24 12:52:17 1999 Stan Shebs <shebs@andros.cygnus.com>
|
|||
* config.guess: Automatically recognise ELF on FreeBSD. From Niall
|
||||
Smart and improved by Andrew Cagney.
|
||||
|
||||
Thu Feb 18 19:55:09 1999 Marc Espie <espie@cvs.openbsd.org>
|
||||
1999-02-18 Marc Espie <espie@cvs.openbsd.org>
|
||||
|
||||
* config.guess: Recognize openbsd-*-hppa.
|
||||
|
||||
Wed Feb 17 01:38:59 1999 H.J. Lu (hjl@gnu.org)
|
||||
1999-02-17 H.J. Lu (hjl@gnu.org)
|
||||
|
||||
* Makefile.in (REALLY_SET_LIB_PATH): Append $$$(RPATH_ENVVAR)
|
||||
only if it is not empty.
|
||||
|
|
@ -811,7 +1159,7 @@ Wed Feb 17 01:38:59 1999 H.J. Lu (hjl@gnu.org)
|
|||
|
||||
* configure.in: Added target-bsp for sparclite.
|
||||
|
||||
Mon Feb 8 14:17:24 1999 Richard Henderson <rth@cygnus.com>
|
||||
1999-02-08 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* config.sub: Recognize alphapca5[67] and up to alphaev8.
|
||||
|
||||
|
|
@ -820,51 +1168,51 @@ Mon Feb 8 14:17:24 1999 Richard Henderson <rth@cygnus.com>
|
|||
* configure.in: Add support for strongarm port.
|
||||
* config.sub: Add support for strongarm target.
|
||||
|
||||
Sun Feb 7 18:01:54 1999 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
1999-02-07 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
|
||||
* configure.in (*-*-cygwin32*): Use config/mh-cygwin instead of
|
||||
the old name config/mh-cygwin32.
|
||||
Enable texinfo.
|
||||
|
||||
Thu Feb 4 20:43:25 1999 Ian Lance Taylor <ian@cygnus.com>
|
||||
1999-02-04 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* configure.in: Do build ld for ix86 Solaris.
|
||||
|
||||
Tue Feb 2 19:46:40 1999 Jim Wilson <wilson@cygnus.com>
|
||||
1999-02-02 Jim Wilson <wilson@cygnus.com>
|
||||
|
||||
* Makefile.in (EXTRA_GCC_FLAGS): Set AR to $AR instead of
|
||||
$AR_FOR_TARGET. Likewise for RANLIB.
|
||||
|
||||
Tue Feb 2 20:05:05 1999 Catherine Moore <clm@cygnus.com>
|
||||
1999-02-02 Catherine Moore <clm@cygnus.com>
|
||||
|
||||
* config.sub (oabi): Recognize.
|
||||
* configure.in (arm-*-oabi): Handle.
|
||||
|
||||
Sat Jan 30 06:09:00 1999 Robert Lipe (robertlipe@usa.net)
|
||||
1999-01-30 Robert Lipe (robertlipe@usa.net)
|
||||
|
||||
* config.guess: Improve detection of i686 on UnixWare 7.
|
||||
|
||||
Sat Jan 30 08:04:00 1999 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
1999-01-30 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
|
||||
* config.guess: Add support for i386-pc-interix.
|
||||
* config.sub: Likewise.
|
||||
* configure.in: Likewise.
|
||||
* config/mh-interix: New file.
|
||||
|
||||
Mon Jan 18 13:59:20 1999 Christopher Faylor <cgf@cygnus.com>
|
||||
1999-01-18 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* Makefile.in: Remove unneeded all-target-libio from
|
||||
from all-target-winsup target since it is now unneeded.
|
||||
Add all-target-libtermcap in its place since it is now
|
||||
needed.
|
||||
|
||||
Wed Dec 30 20:34:52 1998 Christopher Faylor <cgf@cygnus.com>
|
||||
1998-12-30 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* configure.in: makefile stub for cygwin target is probably
|
||||
unnecessary. Remove it for now.
|
||||
* config/mt-cygwin: Remove.
|
||||
|
||||
Wed Dec 30 01:13:03 1998 Christopher Faylor <cgf@cygnus.com>
|
||||
1998-12-30 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* configure.in: libtermcap.a should be built when cygwin is the
|
||||
target as well as the host.
|
||||
|
|
@ -872,11 +1220,11 @@ Wed Dec 30 01:13:03 1998 Christopher Faylor <cgf@cygnus.com>
|
|||
* Makefile.in: Add libtermcap target.
|
||||
* config/mt-cygwin: New file. libtermcap target info.
|
||||
|
||||
Wed Dec 23 00:20:50 1998 Jeffrey A Law (law@cygnus.com)
|
||||
1998-12-23 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* config.sub: Clean up handling of hppa2.0.
|
||||
|
||||
Tue Dec 22 23:56:31 1998 Rodney Brown (rodneybrown@pmsc.com)
|
||||
1998-12-22 Rodney Brown (rodneybrown@pmsc.com)
|
||||
|
||||
* config.guess: Use C code to identify more HP machines.
|
||||
|
||||
|
|
@ -924,7 +1272,7 @@ Wed Nov 18 20:13:29 1998 Christopher Faylor <cgf@cygnus.com>
|
|||
|
||||
* configure.in: Add libtermcap to list of cygwin dependencies.
|
||||
|
||||
Tue Nov 17 16:57:51 1998 Geoffrey Noer <noer@cygnus.com>
|
||||
1998-11-17 Geoffrey Noer <noer@cygnus.com>
|
||||
|
||||
* Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that
|
||||
they include winsup/include when it's a cygwin target.
|
||||
|
|
@ -939,25 +1287,25 @@ Tue Nov 17 16:57:51 1998 Geoffrey Noer <noer@cygnus.com>
|
|||
(INSTALL_MODULES): Added install-zip.
|
||||
(CLEAN_MODULES): Added clean-zip.
|
||||
|
||||
Thu Nov 12 17:27:21 1998 Geoffrey Noer <noer@cygnus.com>
|
||||
1998-11-12 Geoffrey Noer <noer@cygnus.com>
|
||||
|
||||
* Makefile.in: lose "32" from comment about cygwin.
|
||||
|
||||
Thu Nov 5 15:00:31 1998 Nick Clifton <nickc@cygnus.com>
|
||||
1998-11-05 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* configure.in: Use -Os to build target libraries for the fr30.
|
||||
|
||||
Wed Nov 4 18:49:43 1998 Dave Brolley <brolley@cygnus.com>
|
||||
1998-11-04 Dave Brolley <brolley@cygnus.com>
|
||||
|
||||
* config.sub: Add fr30.
|
||||
|
||||
Mon Nov 2 15:19:33 1998 Geoffrey Noer <noer@cygnus.com>
|
||||
1998-11-02 Geoffrey Noer <noer@cygnus.com>
|
||||
|
||||
* configure.in: drop "32" from config/mh-cygwin32. Check
|
||||
cygwin* instead of cygwin32*.
|
||||
* config.sub: Check cygwin* instead of cygwin32*.
|
||||
|
||||
Thu Oct 22 10:55:25 1998 Robert Lipe <robertl@dgii.com>
|
||||
1998-10-22 Robert Lipe <robertl@dgii.com>
|
||||
|
||||
* config.guess: Match any version of Unixware7.
|
||||
|
||||
|
|
@ -966,16 +1314,16 @@ Thu Oct 22 10:55:25 1998 Robert Lipe <robertl@dgii.com>
|
|||
* Makefile.in configure.in: Add the ability to use tcl8.1 and tk8.1
|
||||
if desired.
|
||||
|
||||
Sun Oct 18 18:34:50 1998 Jeffrey A Law (law@cygnus.com)
|
||||
1998-10-18 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* config.if (cxx_interface, libstdcxx_interface): Do not try to set
|
||||
these if the appropriate directories and files to not exist.
|
||||
|
||||
Wed Oct 14 10:29:06 1998 Jeffrey A Law (law@cygnus.com)
|
||||
1998-10-14 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* Makefile.in (DEVO_SUPPORT): Add config.if.
|
||||
|
||||
Tue Oct 13 15:45:36 1998 Manfred Hollstein <manfred@s-direktnet.de>
|
||||
1998-10-13 Manfred Hollstein <manfred@s-direktnet.de>
|
||||
|
||||
* configure: Add pattern to replace "build_tooldir"'s
|
||||
definition in the generated Makefile with "tooldir"'s
|
||||
|
|
@ -7273,7 +7621,7 @@ Fri Dec 13 01:17:06 1991 K. Richard Pixley (rich at cygnus.com)
|
|||
|
||||
* config.subr: resync from rms.
|
||||
|
||||
Wed Dec 11 22:25:20 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-11 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* configure, config.sub, config.subr: merge config.sub into
|
||||
config.subr, call the result config.subr, remove config.sub, use
|
||||
|
|
@ -7281,7 +7629,7 @@ Wed Dec 11 22:25:20 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
|||
|
||||
* Makefile.in: revised install for dir.info.
|
||||
|
||||
Tue Dec 10 00:04:35 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* configure.in: add decstation host makefile frag.
|
||||
|
||||
|
|
@ -7290,11 +7638,11 @@ Tue Dec 10 00:04:35 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
|||
Make directories for info install. Build dir.info here then
|
||||
install it.
|
||||
|
||||
Mon Dec 9 16:48:33 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-09 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Makefile.in: fix for bad directory tests.
|
||||
|
||||
Sat Dec 7 00:17:01 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-07 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* configure: \{1,2\} appears to be a sysv'ism. Use a different
|
||||
regexp. -srcdir relative was being handled incorrectly.
|
||||
|
|
@ -7303,13 +7651,13 @@ Sat Dec 7 00:17:01 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
|||
work again and so one can focus one's attention on a particular
|
||||
package.
|
||||
|
||||
Fri Dec 6 00:22:08 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* configure: added PWD as a stand in for `pwd` (for speed). use
|
||||
elif wherever possible. make -srcdir work without -objdir.
|
||||
-objdir= commented out.
|
||||
|
||||
Thu Dec 5 22:46:52 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* configure: +options become --options. -subdirs commented out.
|
||||
added -host, -datadir. Renamed -destdir to -prefix. Comment in
|
||||
|
|
@ -7321,7 +7669,7 @@ Thu Dec 5 22:46:52 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
|||
and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
|
||||
and mandir now keyed off datadir by default.
|
||||
|
||||
Fri Nov 22 07:38:11 1991 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
1991-11-22 K. Richard Pixley (rich at rtl.cygnus.com)
|
||||
|
||||
* Freshly created ChangeLog.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,18 +21,21 @@ cgen/; cgen parts of opcodes/, sim/ & include/
|
|||
May need separate opcodes/ or sim/ approval for
|
||||
commits of regenerated files there.
|
||||
|
||||
config.guess; config.sub
|
||||
config: http://gnu.org
|
||||
config.guess; config.sub; dejagnu/config.guess;
|
||||
readline/support/config.sub; readline/support/config.guess
|
||||
config: http://savannah.gnu.org/projects/config
|
||||
Patches to config-patches@gnu.org.
|
||||
Changes need to be done in tandem with the official CONFIG
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge.
|
||||
Please notify the following of any committed patches:
|
||||
binutils@sources.redhat.com
|
||||
gdb-patches@sources.redhat.com
|
||||
|
||||
dejagnu/
|
||||
Notify http://dejagnu.sourceforge.net/ of generic changes.
|
||||
Generic patches to gdb-patches@sources.redhat.com &
|
||||
sid@sources.redhat.com.
|
||||
See also SID & GDB.
|
||||
Generic patches to gdb-patches@sources.redhat.com;
|
||||
Other dependents of dejagnu include sid@, binutils@, gcc@, etc.
|
||||
|
||||
gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/
|
||||
gdb: http://sources.redhat.com/gdb/
|
||||
|
|
@ -46,7 +49,11 @@ 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.
|
||||
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.
|
||||
|
||||
ltconfig; ltmain.sh
|
||||
libtool: http://gnu.org
|
||||
|
|
@ -54,13 +61,17 @@ ltconfig; ltmain.sh
|
|||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge.
|
||||
|
||||
mkinstalldirs; move-if-change; symlink-tree
|
||||
mkinstalldirs; move-if-change
|
||||
autoconf: http://gnu.org
|
||||
Patches to autoconf-patches@gnu.org.
|
||||
Changes need to be done in tandem with the official AUTOCONF
|
||||
sources or submitted to the master file maintainer and brought
|
||||
in via a merge.
|
||||
|
||||
symlink-tree
|
||||
gcc: http://gcc.gnu.org
|
||||
See libiberty.
|
||||
|
||||
newlib/; libgloss/
|
||||
http://sources.redhat.com/newlib/
|
||||
Patches to newlib@sources.redhat.com.
|
||||
|
|
@ -89,7 +100,7 @@ expect/; config-ml.in; mpw-README; mpw-build.in; mpw-config.in;
|
|||
mpw-configure; mpw-install; setup.com; missing; makefile.vms; utils/;
|
||||
config/; config.if; makefile.vms; missing; ylwrap; mkdep; etc/;
|
||||
install-sh; intl/
|
||||
Ask.
|
||||
Ask DJ Delorie <dj@redhat.com> after reading the libiberty entry.
|
||||
|
||||
modules file
|
||||
Obviously changes to this file should not go through
|
||||
|
|
|
|||
|
|
@ -141,9 +141,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \
|
|||
then echo $$r/m4/m4 ; \
|
||||
else echo ${DEFAULT_M4} ; fi`
|
||||
|
||||
# For an installed makeinfo, we require it to be from texinfo 4 or
|
||||
# higher, else we use the "missing" dummy.
|
||||
MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
|
||||
then echo $$r/texinfo/makeinfo/makeinfo ; \
|
||||
else echo makeinfo ; fi`
|
||||
else if (makeinfo --version \
|
||||
| egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
|
||||
then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
|
||||
|
||||
# This just becomes part of the MAKEINFO definition passed down to
|
||||
# sub-makes. It lets flags be given on the command line while still
|
||||
|
|
@ -175,8 +179,16 @@ TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstd
|
|||
# Changed by configure to $(target_alias) if cross.
|
||||
TARGET_SUBDIR = .
|
||||
|
||||
# This is set by the configure script to the arguments passed to configure.
|
||||
CONFIG_ARGUMENTS =
|
||||
BUILD_CONFIGDIRS = libiberty
|
||||
BUILD_SUBDIR = .
|
||||
|
||||
# This is set by the configure script to the arguments to use when configuring
|
||||
# directories built for the target.
|
||||
TARGET_CONFIGARGS =
|
||||
|
||||
# This is set by the configure script to the arguments to use when configuring
|
||||
# directories built for the build system.
|
||||
BUILD_CONFIGARGS =
|
||||
|
||||
# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
|
||||
# was used.
|
||||
|
|
@ -220,6 +232,7 @@ FLAGS_FOR_TARGET =
|
|||
CC_FOR_TARGET =
|
||||
CHILL_FOR_TARGET =
|
||||
CXX_FOR_TARGET =
|
||||
CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
|
||||
|
||||
# If GCC_FOR_TARGET is not overriden on the command line, then this
|
||||
# variable is passed down to the gcc Makefile, where it is used to
|
||||
|
|
@ -230,8 +243,10 @@ GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
|
|||
AS_FOR_TARGET = ` \
|
||||
if [ -f $$r/gas/as-new ] ; then \
|
||||
echo $$r/gas/as-new ; \
|
||||
elif [ -f $$r/gcc/xgcc ]; then \
|
||||
$(CC_FOR_TARGET) -print-prog-name=as ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(AS); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -241,8 +256,10 @@ AS_FOR_TARGET = ` \
|
|||
LD_FOR_TARGET = ` \
|
||||
if [ -f $$r/ld/ld-new ] ; then \
|
||||
echo $$r/ld/ld-new ; \
|
||||
elif [ -f $$r/gcc/xgcc ]; then \
|
||||
$(CC_FOR_TARGET) -print-prog-name=ld ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(LD); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -253,7 +270,7 @@ DLLTOOL_FOR_TARGET = ` \
|
|||
if [ -f $$r/binutils/dlltool ] ; then \
|
||||
echo $$r/binutils/dlltool ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(DLLTOOL); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -264,7 +281,7 @@ WINDRES_FOR_TARGET = ` \
|
|||
if [ -f $$r/binutils/windres ] ; then \
|
||||
echo $$r/binutils/windres ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(WINDRES); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -275,7 +292,7 @@ AR_FOR_TARGET = ` \
|
|||
if [ -f $$r/binutils/ar ] ; then \
|
||||
echo $$r/binutils/ar ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(AR); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -286,8 +303,12 @@ RANLIB_FOR_TARGET = ` \
|
|||
if [ -f $$r/binutils/ranlib ] ; then \
|
||||
echo $$r/binutils/ranlib ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
echo $(RANLIB); \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
if [ x'$(RANLIB)' != x ]; then \
|
||||
echo $(RANLIB); \
|
||||
else \
|
||||
echo ranlib; \
|
||||
fi; \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
|
||||
fi; \
|
||||
|
|
@ -296,8 +317,10 @@ RANLIB_FOR_TARGET = ` \
|
|||
NM_FOR_TARGET = ` \
|
||||
if [ -f $$r/binutils/nm-new ] ; then \
|
||||
echo $$r/binutils/nm-new ; \
|
||||
elif [ -f $$r/gcc/xgcc ]; then \
|
||||
$(CC_FOR_TARGET) -print-prog-name=nm ; \
|
||||
else \
|
||||
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
echo $(NM); \
|
||||
else \
|
||||
t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
|
||||
|
|
@ -385,6 +408,14 @@ BASE_FLAGS_TO_PASS = \
|
|||
"target_alias=$(target_alias)" \
|
||||
"libsubdir=$(libsubdir)"
|
||||
|
||||
# For any flags above that may contain shell code that varies from one
|
||||
# target library to another. When doing recursive invocations of the
|
||||
# top-level Makefile, we don't want the outer make to evaluate them,
|
||||
# so we pass these variables down unchanged. They must not contain
|
||||
# single nor double quotes.
|
||||
RECURSE_FLAGS = \
|
||||
CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
|
||||
|
||||
# Flags to pass down to most sub-makes, in which we're building with
|
||||
# the host environment.
|
||||
# If any variables are added here, they must be added to do-*, below.
|
||||
|
|
@ -465,6 +496,18 @@ EXTRA_GCC_FLAGS = \
|
|||
|
||||
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
|
||||
|
||||
# This is a list of the targets for all of the modules which are compiled
|
||||
# using the build machine's native compiler. Configure edits the second
|
||||
# macro for build!=host builds.
|
||||
ALL_BUILD_MODULES_LIST = \
|
||||
all-build-libiberty
|
||||
ALL_BUILD_MODULES =
|
||||
|
||||
# This is a list of the configure targets for all of the modules which
|
||||
# are compiled using the native tools.
|
||||
CONFIGURE_BUILD_MODULES = \
|
||||
configure-build-libiberty
|
||||
|
||||
# This is a list of the targets for all of the modules which are compiled
|
||||
# using $(FLAGS_TO_PASS).
|
||||
ALL_MODULES = \
|
||||
|
|
@ -931,6 +974,7 @@ CLEAN_X11_MODULES = \
|
|||
# The target built for a native build.
|
||||
.PHONY: all.normal
|
||||
all.normal: \
|
||||
$(ALL_BUILD_MODULES) \
|
||||
$(ALL_MODULES) \
|
||||
$(ALL_X11_MODULES) \
|
||||
$(ALL_TARGET_MODULES) \
|
||||
|
|
@ -964,16 +1008,15 @@ $(DO_X):
|
|||
case $$i in \
|
||||
gcc) \
|
||||
for flag in $(EXTRA_GCC_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
;; \
|
||||
*) \
|
||||
for flag in $(EXTRA_HOST_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
;; \
|
||||
esac ; \
|
||||
export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
|
||||
if (cd ./$$i; \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
|
|
@ -990,9 +1033,8 @@ $(DO_X):
|
|||
for i in $(TARGET_CONFIGDIRS) -dummy-; do \
|
||||
if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
|
||||
if (cd $(TARGET_SUBDIR)/$$i; \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
|
|
@ -1174,6 +1216,106 @@ gcc-no-fixedincludes:
|
|||
mv gcc/tmp-include gcc/include 2>/dev/null; \
|
||||
else true; fi
|
||||
|
||||
# This rule is used to build the modules which are built with the
|
||||
# build machine's native compiler.
|
||||
.PHONY: $(ALL_BUILD_MODULES)
|
||||
$(ALL_BUILD_MODULES):
|
||||
dir=`echo $@ | sed -e 's/all-build-//'`; \
|
||||
if [ -f ./$${dir}/Makefile ] ; then \
|
||||
r=`pwd`; export r; \
|
||||
s=`cd $(srcdir); pwd`; export s; \
|
||||
(cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
|
||||
# This rule is used to configure the modules which are built with the
|
||||
# native tools.
|
||||
.PHONY: $(CONFIGURE_BUILD_MODULES)
|
||||
$(CONFIGURE_BUILD_MODULES):
|
||||
@dir=`echo $@ | sed -e 's/configure-build-//'`; \
|
||||
if [ ! -d $(BUILD_SUBDIR) ]; then \
|
||||
true; \
|
||||
elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
|
||||
true; \
|
||||
elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
|
||||
if [ -d $(srcdir)/$${dir} ]; then \
|
||||
[ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
|
||||
r=`pwd`; export r; \
|
||||
s=`cd $(srcdir); pwd`; export s; \
|
||||
AR="$(AR_FOR_BUILD)"; export AR; \
|
||||
AS="$(AS_FOR_BUILD)"; export AS; \
|
||||
CC="$(CC_FOR_BUILD)"; export CC; \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
|
||||
CXX="$(CXX_FOR_BUILD)"; export CXX; \
|
||||
CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
|
||||
GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
|
||||
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
|
||||
LD="$(LD_FOR_BUILD)"; export LD; \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
|
||||
NM="$(NM_FOR_BUILD)"; export NM; \
|
||||
RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
|
||||
WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
|
||||
echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
|
||||
cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
|
||||
case $(srcdir) in \
|
||||
/* | [A-Za-z]:[\\/]*) \
|
||||
topdir=$(srcdir) ;; \
|
||||
*) \
|
||||
case "$(BUILD_SUBDIR)" in \
|
||||
.) topdir="../$(srcdir)" ;; \
|
||||
*) topdir="../../$(srcdir)" ;; \
|
||||
esac ;; \
|
||||
esac; \
|
||||
if [ "$(srcdir)" = "." ] ; then \
|
||||
if [ "$(BUILD_SUBDIR)" != "." ] ; then \
|
||||
if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
|
||||
if [ -f Makefile ]; then \
|
||||
if $(MAKE) distclean; then \
|
||||
true; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
srcdiroption="--srcdir=."; \
|
||||
libsrcdir="."; \
|
||||
else \
|
||||
srcdiroption="--srcdir=$${topdir}/$${dir}"; \
|
||||
libsrcdir="$$s/$${dir}"; \
|
||||
fi; \
|
||||
if [ -f $${libsrcdir}/configure ] ; then \
|
||||
rm -f no-such-file skip-this-dir; \
|
||||
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
|
||||
$(BUILD_CONFIGARGS) $${srcdiroption} \
|
||||
--with-build-subdir="$(BUILD_SUBDIR)"; \
|
||||
else \
|
||||
rm -f no-such-file skip-this-dir; \
|
||||
CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
|
||||
$(BUILD_CONFIGARGS) $${srcdiroption} \
|
||||
--with-build-subdir="$(BUILD_SUBDIR)"; \
|
||||
fi || exit 1; \
|
||||
if [ -f skip-this-dir ] ; then \
|
||||
sh skip-this-dir; \
|
||||
rm -f skip-this-dir; \
|
||||
cd ..; rmdir $${dir} || true; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
|
||||
# This rule is used to build the modules which use FLAGS_TO_PASS. To
|
||||
# build a target all-X means to cd to X and make all.
|
||||
#
|
||||
|
|
@ -1198,7 +1340,7 @@ $(ALL_MODULES) all-gui all-libproc:
|
|||
|
||||
.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
|
||||
$(NATIVE_CHECK_MODULES):
|
||||
@if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
|
||||
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
|
||||
dir=`echo $@ | sed -e 's/check-//'`; \
|
||||
if [ -f ./$${dir}/Makefile ] ; then \
|
||||
r=`pwd`; export r; \
|
||||
|
|
@ -1318,12 +1460,12 @@ $(CONFIGURE_TARGET_MODULES):
|
|||
if [ -f $${libsrcdir}/configure ] ; then \
|
||||
rm -f no-such-file skip-this-dir; \
|
||||
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
|
||||
$(CONFIG_ARGUMENTS) $${srcdiroption} \
|
||||
$(TARGET_CONFIGARGS) $${srcdiroption} \
|
||||
--with-target-subdir="$(TARGET_SUBDIR)"; \
|
||||
else \
|
||||
rm -f no-such-file skip-this-dir; \
|
||||
CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
|
||||
$(CONFIG_ARGUMENTS) $${srcdiroption} \
|
||||
$(TARGET_CONFIGARGS) $${srcdiroption} \
|
||||
--with-target-subdir="$(TARGET_SUBDIR)"; \
|
||||
fi; \
|
||||
if [ -f skip-this-dir ] ; then \
|
||||
|
|
@ -1349,7 +1491,8 @@ $(ALL_TARGET_MODULES):
|
|||
r=`pwd`; export r; \
|
||||
s=`cd $(srcdir); pwd`; export s; \
|
||||
$(SET_LIB_PATH) \
|
||||
(cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
|
||||
(cd $(TARGET_SUBDIR)/$${dir}; \
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
|
|
@ -1363,7 +1506,8 @@ $(CHECK_TARGET_MODULES):
|
|||
r=`pwd`; export r; \
|
||||
s=`cd $(srcdir); pwd`; export s; \
|
||||
$(SET_LIB_PATH) \
|
||||
(cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
|
||||
(cd $(TARGET_SUBDIR)/$${dir}; \
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
|
|
@ -1478,7 +1622,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
|
|||
s=`cd $(srcdir); pwd` ; export s; \
|
||||
$(SET_LIB_PATH) \
|
||||
echo "Building runtime libraries"; \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) all
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
|
||||
|
||||
.PHONY: cross
|
||||
cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
|
||||
|
|
@ -1491,7 +1635,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
|
|||
s=`cd $(srcdir); pwd` ; export s; \
|
||||
$(SET_LIB_PATH) \
|
||||
echo "Building runtime libraries"; \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
|
||||
LANGUAGES="c c++" all
|
||||
|
||||
.PHONY: check-gcc
|
||||
check-gcc:
|
||||
|
|
@ -1542,6 +1687,9 @@ install-dosrel: installdirs info
|
|||
|
||||
install-dosrel-fake:
|
||||
|
||||
ALL_GCC = all-gcc
|
||||
ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
|
||||
ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3
|
||||
|
||||
# This is a list of inter-dependencies among modules.
|
||||
all-apache:
|
||||
|
|
@ -1578,17 +1726,14 @@ all-flex: all-libiberty all-bison all-byacc
|
|||
all-gas: all-libiberty all-opcodes all-bfd all-intl
|
||||
all-gash: all-tcl
|
||||
all-gawk:
|
||||
ALL_GCC = all-gcc
|
||||
ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
|
||||
ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3
|
||||
all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
|
||||
all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
|
||||
GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
|
||||
all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
|
||||
all-gettext:
|
||||
all-gnuserv:
|
||||
configure-target-gperf: $(ALL_GCC_C)
|
||||
all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
|
||||
configure-target-gperf: $(ALL_GCC_CXX)
|
||||
all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3
|
||||
all-gprof: all-libiberty all-bfd all-opcodes all-intl
|
||||
all-grep: all-libiberty
|
||||
all-grez: all-libiberty all-bfd all-opcodes
|
||||
|
|
@ -1611,6 +1756,9 @@ all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libib
|
|||
check-target-libio: all-target-libstdc++
|
||||
all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
|
||||
all-libiberty:
|
||||
|
||||
all-build-libiberty: configure-build-libiberty
|
||||
|
||||
configure-target-libffi: $(ALL_GCC_C)
|
||||
all-target-libffi: configure-target-libffi
|
||||
configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
|
||||
|
|
@ -1630,7 +1778,7 @@ configure-target-libchill: $(ALL_GCC_C)
|
|||
all-target-libchill: configure-target-libchill all-target-libiberty
|
||||
configure-target-libobjc: $(ALL_GCC_C)
|
||||
all-target-libobjc: configure-target-libobjc all-target-libiberty
|
||||
all-m4: all-libiberty
|
||||
all-m4: all-libiberty all-texinfo
|
||||
all-make: all-libiberty
|
||||
all-mmalloc:
|
||||
configure-target-newlib: $(ALL_GCC)
|
||||
|
|
@ -1743,8 +1891,12 @@ VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null
|
|||
sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
|
||||
elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
|
||||
sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
|
||||
else \
|
||||
elif test -f $(TOOL)/version.in; then \
|
||||
head -1 $(TOOL)/version.in; \
|
||||
elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
|
||||
sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
|
||||
else \
|
||||
echo VERSION; \
|
||||
fi`
|
||||
PACKAGE = $(TOOL)
|
||||
|
||||
|
|
@ -1836,6 +1988,11 @@ do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
|
|||
else true; fi
|
||||
chmod -R og=u . || chmod og=u `find . -print`
|
||||
#
|
||||
# Create .gmo files from .po files.
|
||||
for f in `find . -name '*.po' -type f -print`; do \
|
||||
msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
|
||||
done
|
||||
#
|
||||
-rm -f $(PACKAGE)-$(VER)
|
||||
ln -s proto-toplev $(PACKAGE)-$(VER)
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
9592
contrib/binutils/bfd/ChangeLog-0001
Normal file
9592
contrib/binutils/bfd/ChangeLog-0001
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -408,7 +408,7 @@ Tue Nov 30 16:45:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
|||
* config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE.
|
||||
(HDEPFILES): Define to be irix-core.o.
|
||||
* Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o. Removed
|
||||
sco-core.o, which no longer exists.
|
||||
sco5-core.o, which no longer exists.
|
||||
(CFILES): Added all *-core.c files.
|
||||
Rebuilt dependencies.
|
||||
|
||||
|
|
@ -458,11 +458,11 @@ Mon Nov 22 14:17:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
|||
Mon Nov 22 10:54:27 1993 Fred Fish (fnf@cygnus.com)
|
||||
|
||||
Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
|
||||
* bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
|
||||
* bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
|
||||
* bfd/ptrace-core.c: New file for dealing with core files with
|
||||
* config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
|
||||
* config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
|
||||
* ptrace-core.c: New file for dealing with core files with
|
||||
start with the ptrace_user structure found on BCS compliant systems.
|
||||
* bfd/targets.c (ptrace_core_vec): New vector.
|
||||
* targets.c (ptrace_core_vec): New vector.
|
||||
|
||||
Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
|
||||
|
||||
|
|
@ -1855,7 +1855,7 @@ Thu Sep 2 00:59:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
|||
* libhppa.h (hppa_field_adjust): Remove unused `init_value' variable.
|
||||
|
||||
* hosts/delta88v4.h: New for SVR4.
|
||||
* configure.hosts: Use it.
|
||||
* configure.host: Use it.
|
||||
|
||||
Wed Sep 1 14:23:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
|
|
@ -2379,8 +2379,9 @@ Sat Aug 7 09:14:21 1993 David J. Mackenzie (djm@thepub.cygnus.com)
|
|||
* config/i386-sco.mt (TDEFAULTS): Don't put &sco_core_vec in
|
||||
SELECT_VECS manually; -DSCO_CORE does it automatically now.
|
||||
|
||||
* config/h8300-coff.mt,h8500-coff.mt,sh-coff.mt,st2000.mt,z8k-coff.mt
|
||||
(TDEFAULTS): Don't define BFD; not used.
|
||||
* config/h8300-coff.mt, config/h8500-coff.mt, config/sh-coff.mt,
|
||||
config/st2000.mt, config/z8k-coff.mt (TDEFAULTS): Don't define
|
||||
BFD; not used.
|
||||
|
||||
* config/hppaosf.mh (HDEFINES): Don't define SELECT_ARCHITECTURES;
|
||||
this is a host, not a target.
|
||||
|
|
@ -2559,7 +2560,7 @@ Tue Aug 3 16:33:11 1993 David J. Mackenzie (djm@thepub.cygnus.com)
|
|||
|
||||
Tue Aug 3 15:19:09 1993 Fred Fish (fnf@deneb.cygnus.com)
|
||||
|
||||
* nlm_slurp_symbol_table: Don't use '&' on arrays.
|
||||
* nlmcode.h (nlm_slurp_symbol_table): Don't use '&' on arrays.
|
||||
|
||||
Tue Aug 3 11:06:28 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
|
|
@ -2671,7 +2672,7 @@ Mon Jul 26 17:39:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
|||
|
||||
Yet another trad-core variant:
|
||||
* config/esix.mh, hosts/esix.h: New files.
|
||||
* configure.hosts: Use them.
|
||||
* configure.host: Use them.
|
||||
|
||||
Mon Jul 26 13:22:15 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
|
|
@ -3740,8 +3741,8 @@ Fri Apr 30 17:25:23 1993 Stu Grossman (grossman@cygnus.com)
|
|||
* The following patches are from Jeffrey Law <law@cs.utah.edu>.
|
||||
* hppa.c (hppa_core_file_p): Provide a temporary dummy routine
|
||||
for HOST_HPPABSD.
|
||||
* bfd/hosts/hppabsd.h: Fix declarations of malloc and free.
|
||||
* bfd/libhppa.h: Include sysdep here. Conditionalize
|
||||
* hosts/hppabsd.h: Fix declarations of malloc and free.
|
||||
* libhppa.h: Include sysdep here. Conditionalize
|
||||
includes based on HOST_HPPAHPUX or HOST_HPPABSD.
|
||||
Provide definitions for MAXCOMLEN and _PA_RISC_ID suitable
|
||||
for BSD.
|
||||
|
|
@ -4424,7 +4425,7 @@ Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com)
|
|||
(bfd_com_section): Set SEC_IS_COMMON flag.
|
||||
* bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON.
|
||||
* aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c,
|
||||
coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.: Use
|
||||
coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.c: Use
|
||||
bfd_is_com_section macro rather than checking for equality to
|
||||
bfd_com_section.
|
||||
|
||||
|
|
@ -4850,7 +4851,7 @@ Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com)
|
|||
|
||||
Thu Nov 5 04:43:09 1992 John Gilmore (gnu@cygnus.com)
|
||||
|
||||
* target.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT
|
||||
* targets.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT
|
||||
macros; use PARAMS to declare the function pointers involved.
|
||||
|
||||
* bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c,
|
||||
|
|
@ -5261,12 +5262,6 @@ Fri Aug 28 16:29:15 1992 Ian Lance Taylor (ian@cygnus.com)
|
|||
large, assume we're using a swapped byte order and fail with
|
||||
wrong_format rather than dumping core.
|
||||
|
||||
Fri Aug 28 15:38:03 1992 Ken Raeburn (raeburn@cygnus.com)
|
||||
|
||||
* Renamed opc-sparc.c to sparc-opc.c for systems with short
|
||||
filename constraints.
|
||||
* Makefile.in: Updated to reflect change.
|
||||
|
||||
Thu Aug 27 13:05:28 1992 Brendan Kehoe (brendan@cygnus.com)
|
||||
|
||||
Add preliminary support for the we32k:
|
||||
|
|
@ -5297,7 +5292,7 @@ Tue Aug 25 08:39:10 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
|||
Fri Aug 14 15:39:29 PDT 1992 Howard Chu (hyc@hanauma.jpl.nasa.gov)
|
||||
|
||||
Documentation fixes:
|
||||
* ctors.c, format.c, section.c, reloc.c: append " -" to item tags.
|
||||
* ctor.c, format.c, section.c, reloc.c: append " -" to item tags.
|
||||
* reloc.c, section.c, syms.c, targets.c: add DOCDD before @node
|
||||
comments.
|
||||
* reloc.c: break out addend item from surrounding text.
|
||||
|
|
@ -5381,7 +5376,7 @@ Sat Aug 8 23:15:35 1992 Fred Fish (fnf@cygnus.com)
|
|||
pointers to bfd_byte* before performing arithmetic on them. Such
|
||||
use with bare void* pointers is a gcc extension.
|
||||
* cache.c (bfd_cache_delete): Forward decl with prototype form.
|
||||
* archive (normalize): Add to CONST to match actual usages with
|
||||
* archive.c (normalize): Add to CONST to match actual usages with
|
||||
CONST.
|
||||
|
||||
Mon Aug 3 00:35:29 1992 Fred Fish (fnf@cygnus.com)
|
||||
|
|
@ -5471,7 +5466,7 @@ Tue Jul 7 00:23:23 1992 Fred Fish (fnf@cygnus.com)
|
|||
|
||||
Sat Jul 4 03:29:41 1992 John Gilmore (gnu at cygnus.com)
|
||||
|
||||
* syms.h: Define BSF_FILE, update BSF_SECTION_SYM desc.
|
||||
* syms.c: Define BSF_FILE, update BSF_SECTION_SYM desc.
|
||||
* elf.c: Remove unconditional debug printf's.
|
||||
(elf_write_object_contents, elf_slurp_symbol_table): Handle
|
||||
BSF_SECTION_SYM <=> STT_SECTION, BSF_FILE <=> STT_FILE.
|
||||
|
|
@ -5497,7 +5492,7 @@ Tue Jun 23 21:54:44 1992 Fred Fish (fnf@cygnus.com)
|
|||
* libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition.
|
||||
* reloc.c (bfd_default_reloc_type_lookup): Make cast on return
|
||||
type match actual return type.
|
||||
* elf_print_symbol (section_name): Make CONST.
|
||||
* section.c (elf_print_symbol): Make CONST.
|
||||
|
||||
Mon Jun 22 17:35:24 1992 Per Bothner (bothner@cygnus.com)
|
||||
|
||||
|
|
@ -5766,7 +5761,7 @@ Tue May 12 14:08:59 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
|||
* opncls.c: don't use fdopen on DOS systems
|
||||
|
||||
short patches from Glenn Kasten (glenn@ready.com)
|
||||
* target.c: enabled oasys support
|
||||
* targets.c: enabled oasys support
|
||||
* oasys.c: Insert . when UNDERSCORE_HACK is enabled,
|
||||
fix problem where a relocation which crossed a modification byte
|
||||
boundary did not work. Fix problem where a relocation near the end
|
||||
|
|
@ -5923,7 +5918,7 @@ Tue Mar 17 14:12:25 1992 Per Bothner (bothner@rtl.cygnus.com)
|
|||
Tue Mar 17 10:45:12 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||
|
||||
* aout-target.h: change ar_max_namelen to 15 (the right value)
|
||||
* coff-a29k, coffcode.h: more hangovers from the bfd_abs_section
|
||||
* coff-a29k.c, coffcode.h: more hangovers from the bfd_abs_section
|
||||
change
|
||||
|
||||
Mon Mar 16 14:57:22 1992 Steve Chamberlain (sac@rtl.cygnus.com)
|
||||
|
|
@ -6384,7 +6379,7 @@ Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
|
|||
* aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c,
|
||||
coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c,
|
||||
coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c,
|
||||
newos3.c, stab-syms.c, syms.c: All these files have had their
|
||||
newsos3.c, stab-syms.c, syms.c: All these files have had their
|
||||
#includes altered to point to the new places.
|
||||
|
||||
Fri Nov 29 20:04:49 1991 Fred Fish (fnf at cygnus.com)
|
||||
|
|
@ -6792,7 +6787,7 @@ Fri Oct 11 13:03:02 1991 Per Bothner (bothner at cygnus.com)
|
|||
* host-aout.c (NAME(host_aout, callback) and
|
||||
NAME(host_aout,mkobject): Ditto.
|
||||
* i386aout.c (aout386_callback) and new aout386_mkobject): Ditto.
|
||||
* newos3.c (newsos3_callback) and new newsos_mkobject): Ditto.
|
||||
* newsos3.c (newsos3_callback) and new newsos_mkobject): Ditto.
|
||||
* aoutf1.c (sunos4_callback) and new sunos_mkobject): Ditto.
|
||||
* aoutx.h (NAME(aout,some_aout_object_p)): Don't subtract
|
||||
EXEC_BYTES_SIZE from the a_test size; this is only appropriate
|
||||
|
|
@ -7182,7 +7177,7 @@ Wed Aug 21 14:33:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
|
|||
* bfd.c, reloc.c, syms.c: minor spelling/wording fixes in doc
|
||||
portions
|
||||
|
||||
* Makefile.in, awkscan-ip, awkscan-p, intobfd,
|
||||
* Makefile.in, awkscan-ip, awkscan-p, doc/intobfd,
|
||||
libbfd.h, libcoff.h, tolibcoff; new bfd-in.h, libbfd-in.h,
|
||||
libcoff-in.h: (a) use separate files for invariant parts of bfd.h,
|
||||
libbfd.h, and libcoff.h; (b) in generated parts of same, use less
|
||||
|
|
@ -7251,12 +7246,14 @@ Mon Jul 15 16:27:42 1991 Steve Chamberlain (steve at cygint.cygnus.com)
|
|||
|
||||
Thu Jul 4 09:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com)
|
||||
|
||||
* Everything: created some new files, core.c format.c, reloc.c,
|
||||
section.c and syms.c to split the functionality a bit better.
|
||||
* core.c: New file.
|
||||
* format.c: New file.
|
||||
* reloc.c: New file.
|
||||
* section.c: New file.
|
||||
* syms.c: New filew.
|
||||
Cleaned up the rest of the files a bit, and added some
|
||||
documentation.
|
||||
|
||||
|
||||
Mon Jul 1 13:29:47 1991 David Wood (wood at david.ultra.nya.edu)
|
||||
|
||||
* opncls.c, ../include/sys/h-sun3.h ../include/sys/h-sun4.h: fcntl
|
||||
|
|
@ -7299,7 +7296,7 @@ Fri Jun 7 12:35:46 1991 Sean Fagan (sef at cygint.cygnus.com)
|
|||
|
||||
Thu Jun 6 18:27:38 1991 Steve Chamberlain (steve at cygint.cygnus.com)
|
||||
|
||||
* ../include/oasys.h oasys.c (oasys_archive_p): fixed so it works
|
||||
* oasys.c (oasys_archive_p): fixed so it works
|
||||
|
||||
* srec.c: now allows any number of sections to be created in a
|
||||
file. Outputs addresses of the right length.
|
||||
|
|
@ -7445,7 +7442,7 @@ Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com)
|
|||
get_section_contents in favor of generics. New transfer vector
|
||||
regime.
|
||||
|
||||
* newsos.c: New support for Sony NEWS, another a.out format.
|
||||
* newsos3.c: New support for Sony NEWS, another a.out format.
|
||||
|
||||
* ecoff.c: Remove close_and_cleanup. New tvec regime.
|
||||
* icoff.c, m88k-bcs.c: Add write_contents to tvec.
|
||||
|
|
@ -7465,7 +7462,7 @@ Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com)
|
|||
* liba.out.h: Handle the new aout.c split. Add prototypes for
|
||||
all routines defined in aout.c. Rename "sunos" things to "aout"
|
||||
things. Add a few fields where needed for various formats.
|
||||
* Makefile.in: Add aout.c and newsos.c.
|
||||
* Makefile.in: Add aout.c and newsos3.c.
|
||||
|
||||
* archive.c, ieee.c, oasys.c: Lint.
|
||||
|
||||
|
|
@ -7698,7 +7695,7 @@ Mon Jan 28 19:15:29 PST 1991 steve@cygnus.com
|
|||
|
||||
Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com
|
||||
|
||||
* bfd.h changed name of alignment entry in sec_struct to
|
||||
* bfd.h: changed name of alignment entry in sec_struct to
|
||||
alignment_power, because of conflicting uses within bfd.
|
||||
Now it should be obvious that it's a 2**n alignment
|
||||
specifier. Removed start_pad, end_alignment, block, minsize,
|
||||
|
|
@ -7706,21 +7703,21 @@ Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com
|
|||
Added align_power() macro. Fixed bfd_section_alignment
|
||||
acessor macros. Added bfd_symbol_same_target macro.
|
||||
|
||||
* b.out.c (b_out_write_object_contents) fixed to use
|
||||
* b.out.c (b_out_write_object_contents): fixed to use
|
||||
new alignment member. Fixed (callj_callback) to use section
|
||||
relative symbols properly.
|
||||
|
||||
* sunos.c (sunos4_object_p) fixed to use new alignment_power.
|
||||
* sunos.c (sunos4_object_p): fixed to use new alignment_power.
|
||||
Fixed (translate_from_native_sym_flags) to correctly make
|
||||
symbols section relative.
|
||||
|
||||
* bfd.c (bfd_errmsg) fixed various enum cast problems.
|
||||
(bfd_make_section) took out initialization of obsolete members.
|
||||
(bfd_print_symbol_vandf) added
|
||||
* bfd.c (bfd_errmsg): fixed various enum cast problems.
|
||||
(bfd_make_section): took out initialization of obsolete members.
|
||||
(bfd_print_symbol_vandf): added
|
||||
|
||||
* opncls.c (bfd_create) created.
|
||||
* opncls.c (bfd_create): created.
|
||||
|
||||
* coff-code.h (coff_new_section_hook) took away refs
|
||||
* coff-code.h (coff_new_section_hook): took away refs
|
||||
to obsolete members. (make_a_section_from_file) added
|
||||
conversion between alignment types. (coff_symbol_from)
|
||||
added. (coff_count_linenumbers) only counts linenumbers
|
||||
|
|
@ -7732,36 +7729,36 @@ Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com
|
|||
|
||||
Sat Jan 19 16:10:42 PST 1991 steve@cygnus.com
|
||||
|
||||
* archive.c lots of lint
|
||||
* archive.c> lots of lint.
|
||||
|
||||
* b.out.c added callj relocation support, upgrated reloc howto.
|
||||
* b.out.c: added callj relocation support, upgrated reloc howto.
|
||||
Fixed so that asymbol and reloc records are output
|
||||
correctly.
|
||||
|
||||
* bfd.c lots of lint, support for new bfd entry point
|
||||
* bfd.c: lots of lint, support for new bfd entry point
|
||||
bfd_print_symbol.
|
||||
|
||||
* bfd.h changed definition of asymbol to contain pointer to
|
||||
* bfd.h: changed definition of asymbol to contain pointer to
|
||||
owning bfd, removed target dependencies.
|
||||
|
||||
* cache.c took out print statements, put in BFD_ASSERT calls.
|
||||
* cache.c: took out print statements, put in BFD_ASSERT calls.
|
||||
|
||||
* coff-code.h various lints, corrected linenumber output
|
||||
* coff-code.h: various lints, corrected linenumber output
|
||||
functionality. Added support for new style asymbols and
|
||||
bfd_print_symbol. Fixed so that asymbol and
|
||||
reloc records are handled correctly. Added timestamp.
|
||||
|
||||
* icoff.c Added support for new howto shape.
|
||||
* icoff.c: Added support for new howto shape.
|
||||
|
||||
* liba.out.h Added support for new asymbol shape
|
||||
* liba.out.h: Added support for new asymbol shape
|
||||
|
||||
* libbfd.c various lints
|
||||
* libbfd.c: various lints
|
||||
|
||||
* libbfd.h various lints
|
||||
* libbfd.h: various lints
|
||||
|
||||
* libcoff.h added support for new asymbol shape.
|
||||
* libcoff.h: added support for new asymbol shape.
|
||||
|
||||
* sunos.c various lints. Added support for new asymbol shape
|
||||
* sunos.c: various lints. Added support for new asymbol shape
|
||||
and bfd_print_symbol.
|
||||
|
||||
Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com
|
||||
|
|
@ -7785,7 +7782,7 @@ Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com
|
|||
Wed Jan 16 01:55:53 1991 John Gilmore (gnu at rtl)
|
||||
|
||||
* ChangeLog: Started ChangeLog for BFD.
|
||||
* ToDo: Create file for suggestions.
|
||||
* TODO: Create file for suggestions.
|
||||
|
||||
* Makefile: Support easy loading into Saber C.
|
||||
Add dependencies for icoff.o and bcs88kcoff.o.
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ Fri Dec 1 14:46:51 1995 Ian Lance Taylor <ian@cygnus.com>
|
|||
|
||||
* bfd.c (bfd_record_phdr): New function.
|
||||
* bfd-in.h (bfd_record_phdr): Declare.
|
||||
* bfd_in2.h: Rebuild.
|
||||
* bfd-in2.h: Rebuild.
|
||||
|
||||
* elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus
|
||||
BFD_ASSERT.
|
||||
|
|
@ -407,7 +407,7 @@ Wed Nov 15 18:05:52 1995 Ian Lance Taylor <ian@cygnus.com>
|
|||
_bfd_print_private_bfd_data from void * to PTR.
|
||||
* libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast
|
||||
using PTR rather than void *.
|
||||
* bfd-in2, libbfd.h: Rebuild.
|
||||
* bfd-in2.h, libbfd.h: Rebuild.
|
||||
* peicode.h (pe_print_private_bfd_data): Change vfile from void *
|
||||
to PTR.
|
||||
* elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as
|
||||
|
|
@ -2357,7 +2357,7 @@ Wed Aug 6 09:12:50 1995 Doug Evans <dje@canuck.cygnus.com>
|
|||
|
||||
Sat Aug 5 00:04:08 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* som (som_get_reloc_upper_bound): Return -1 on error. Compute
|
||||
* som.c (som_get_reloc_upper_bound): Return -1 on error. Compute
|
||||
return value with sizeof (arelent *), not sizeof (arelent).
|
||||
|
||||
Wed Aug 2 12:32:21 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
|
@ -4334,7 +4334,7 @@ Thu Nov 17 17:37:39 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
|
|||
|
||||
Thu Nov 17 13:12:08 1994 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the
|
||||
* elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the
|
||||
vma from the output_section containing $global$ when computing
|
||||
global_vlaue.
|
||||
|
||||
|
|
@ -7454,7 +7454,7 @@ Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
|||
gas does this anyhow, but some other assemblers seem to leave
|
||||
garbage in the R_IHCONST address field.
|
||||
|
||||
* bfd/archive.c: Consistently use ARFMAG; from
|
||||
* archive.c: Consistently use ARFMAG; from
|
||||
schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
|
||||
(_bfd_write_archive_contents): Use ARFMAG rather than '`' and
|
||||
'\012'.
|
||||
|
|
@ -8307,7 +8307,7 @@ Mon Mar 21 12:28:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
|||
|
||||
Sun Mar 20 09:24:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
|
||||
|
||||
* bfd/som.c (som_begin_writing): Fix thinko (off by one error).
|
||||
* som.c (som_begin_writing): Fix thinko (off by one error).
|
||||
|
||||
* som.c (bfd_section_from_som_symbol): Only to do the value
|
||||
comparison for function symbols within executables.
|
||||
|
|
@ -8539,7 +8539,7 @@ Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
|
|||
undefined symbols. Correctly distinguish between debugger symbols
|
||||
and section symbols.
|
||||
|
||||
* som (setup_sections): Set SEC_DEBUGGING and the section attributes
|
||||
* som.c (setup_sections): Set SEC_DEBUGGING and the section attributes
|
||||
for spaces and subspaces.
|
||||
|
||||
* som.c (som_bfd_count_ar_symbols): Fix typo.
|
||||
|
|
@ -9587,7 +9587,7 @@ Mon Jan 24 12:38:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
|||
|
||||
* elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
|
||||
|
||||
* bfd/aoutx.h (aout_link_input_section_std,
|
||||
* aoutx.h (aout_link_input_section_std,
|
||||
aout_link_input_section_ext): Pass additional arguments to
|
||||
reloc_overflow callback.
|
||||
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ Tue Nov 25 11:26:27 1997 Ian Lance Taylor <ian@cygnus.com>
|
|||
* Makefile.am (BFD32_BACKENDS): Remove tekhex.lo.
|
||||
(BFD32_BACKENDS_CFILES): Remove tekhex.c.
|
||||
* Makefile.in: Rebuild.
|
||||
* aclocal.m4, configure, src/Makefile.in: Rebuild with current
|
||||
* aclocal.m4, configure, Makefile.in: Rebuild with current
|
||||
automake and autoconf.
|
||||
|
||||
* coff-arm.c (arm_allocate_interworking_sections): Fix typo
|
||||
|
|
@ -672,7 +672,7 @@ Tue Sep 9 10:21:56 1997 Nick Clifton <nickc@cygnus.com>
|
|||
|
||||
Sun Sep 7 12:25:22 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
|
||||
|
||||
* bfd/elf64-alpha.c (reloc_howto_type): Fix the howto table.
|
||||
* elf64-alpha.c (reloc_howto_type): Fix the howto table.
|
||||
|
||||
Thu Sep 4 09:44:10 1997 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
|
|
@ -762,7 +762,10 @@ Tue Aug 26 17:26:51 1997 Ian Lance Taylor <ian@cygnus.com>
|
|||
|
||||
* acinclude.m4 (BFD_CC_FOR_BUILD): Set EXEEXT_FOR_BUILD.
|
||||
* doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT.
|
||||
* aclocal.m4, configure, Makefile.in, doc/Makefile.in: Rebuild.
|
||||
* aclocal.m4: Rebuild.
|
||||
* configure: Rebuild.
|
||||
* Makefile.in: Rebuild.
|
||||
* doc/Makefile.in: Rebuild.
|
||||
|
||||
Mon Aug 25 16:14:34 1997 Christopher Provenzano <proven@cygnus.com>
|
||||
|
||||
|
|
@ -920,8 +923,10 @@ Sun Aug 10 14:45:56 1997 Ian Lance Taylor <ian@cygnus.com>
|
|||
|
||||
* coff-stgo32.c: Rename from coff-stubgo32.c to avoid old System V
|
||||
file system 14 character limit.
|
||||
* Makefile.am, configure.in: Corresponding changes.
|
||||
* Makefile.in, configure: Rebuild.
|
||||
* Makefile.am: Corresponding changes.
|
||||
* configure.in: Corresponding changes.
|
||||
* Makefile.in: Rebuild.
|
||||
* configure: Rebuild.
|
||||
|
||||
Fri Aug 8 18:34:36 1997 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
|
|
@ -958,7 +963,9 @@ Fri Aug 1 12:58:32 1997 Ian Lance Taylor <ian@cygnus.com>
|
|||
* acinclude.m4: Move acmacros.m4 in here. Remove AM_PROG_LIBTOOL
|
||||
copy; use a patches libtool instead.
|
||||
* acmacros.m4: Remove.
|
||||
* Makefile.in, aclocal.m4, configure: Rebuild.
|
||||
* Makefile.in: Rebuild.
|
||||
* aclocal.m4: Rebuild.
|
||||
* configure: Rebuild.
|
||||
|
||||
Thu Jul 31 19:55:36 1997 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
|
|
@ -2022,7 +2029,7 @@ Thu Mar 20 12:39:02 1997 Ian Lance Taylor <ian@cygnus.com>
|
|||
* cf-m68klynx.c: Simplify greatly: just define macros to control
|
||||
coff-m68k.c.
|
||||
* coff-aux.c: Likewise. Just leave add_one_symbol routine.
|
||||
* targets. (m68ksysvcoff_vec): Declare.
|
||||
* targets.c (m68ksysvcoff_vec): Declare.
|
||||
(bfd_target_vector): Add m68ksysvcoff_vec.
|
||||
* config.bfd (m68*-motorola-sysv*): New target.
|
||||
* configure.in (m68ksysvcoff_vec): New vector.
|
||||
|
|
@ -2478,7 +2485,7 @@ Fri Feb 21 13:55:14 1997 Doug Evans <dje@seba.cygnus.com>
|
|||
Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns.
|
||||
Add small data area support (R_M32R_SDA16).
|
||||
* reloc.c: Document BFD_RELOC_M32R_SDA16.
|
||||
* bfd-in2.h,libbfd.h: Regenerated.
|
||||
* bfd-in2.h, libbfd.h: Regenerated.
|
||||
|
||||
Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
|
|
@ -2495,12 +2502,18 @@ Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com)
|
|||
|
||||
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
|
||||
|
||||
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
|
||||
reloc.c, targets.c: New target, elf-*-D30V.
|
||||
|
||||
* bfd-in2.h, configure, libbfd.h: Rebuilt.
|
||||
|
||||
* cpu-d30v.c, elf32-d30v.c: New files.
|
||||
* Makefile.in: New target, elf-*-D30V.
|
||||
* archures.c: New target, elf-*-D30V.
|
||||
* config.bfd: New target, elf-*-D30V.
|
||||
* configure.in: New target, elf-*-D30V.
|
||||
* elf.c: New target, elf-*-D30V.
|
||||
* reloc.c: New target, elf-*-D30V.
|
||||
* targets.c: New target, elf-*-D30V.
|
||||
* bfd-in2.h: Rebuilt.
|
||||
* configure: Rebuilt.
|
||||
* libbfd.h: Rebuilt.
|
||||
* cpu-d30v.c: New files.
|
||||
* elf32-d30v.c: New files.
|
||||
|
||||
Tue Feb 18 15:31:48 1997 Fred Fish <fnf@cygnus.com>
|
||||
|
||||
|
|
@ -3398,8 +3411,8 @@ Wed Oct 2 15:46:45 1996 Klaus Kaempf <kkaempf@progis.de>
|
|||
* evax-emh.c (get_vms_time_string): Local function now.
|
||||
(_bfd_evax_write_emh): Extract source filename and case_hack flags
|
||||
from symbol table.
|
||||
* evax_write_etir (_bfd_evax_write_etir): Pass all symbol names
|
||||
through _bfd_evax_case_hack_symbol.
|
||||
(_bfd_evax_write_etir): Pass all symbol names through
|
||||
_bfd_evax_case_hack_symbol.
|
||||
* evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New
|
||||
functions.
|
||||
(_bfd_evax_basename): Removed.
|
||||
|
|
@ -3521,7 +3534,7 @@ Thu Sep 12 11:45:57 1996 Doug Evans <dje@seba.cygnus.com>
|
|||
|
||||
* reloc.c: Add m32r relocs.
|
||||
* bfd-in2.h, libbfd.h: Rebuilt.
|
||||
* cpu-m32r.c,elf32-m32r.c: New files.
|
||||
* cpu-m32r.c, elf32-m32r.c: New files.
|
||||
|
||||
Thu Sep 12 11:10:05 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
|
|
@ -3626,8 +3639,13 @@ Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com)
|
|||
|
||||
Mon Sep 9 12:31:22 1996 Doug Evans <dje@canuck.cygnus.com>
|
||||
|
||||
* config.bfd,configure.in,configure: Add m32r support.
|
||||
* Makefile.in,archures.c,elf.c,targets.c: Likewise.
|
||||
* config.bfd: Add m32r support.
|
||||
* configure.in: Likewise.
|
||||
* configure: Likewise.
|
||||
* Makefile.in: Likewise.
|
||||
* archures.c: Likewise.
|
||||
* elf.c: Likewise.
|
||||
* targets.c: Likewise.
|
||||
* config.bfd: Keep target list alphabetically sorted.
|
||||
|
||||
Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
|
@ -4320,7 +4338,7 @@ Tue Jun 25 11:41:24 1996 Richard Henderson <rth@tamu.edu>
|
|||
|
||||
Mon Jun 24 17:15:10 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
|
||||
|
||||
* Makefile.in, (bindir, libdir, datadir, mandir, infodir, includedir):
|
||||
* Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir):
|
||||
Use autoconf-set values.
|
||||
* doc/Makefile.in (bindir, libdir, datadir, mandir, infodir,
|
||||
includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set
|
||||
|
|
@ -4699,7 +4717,7 @@ Wed May 29 16:15:29 1996 Ian Lance Taylor <ian@cygnus.com>
|
|||
* config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and
|
||||
bfd_elf64_littlemips_vec to targ_selvecs.
|
||||
(mips*-*-elf*): Likewise.
|
||||
* confingure.in: Add bfd_elf64_bigmips_vec and
|
||||
* configure.in: Add bfd_elf64_bigmips_vec and
|
||||
bfd_elf64_littlemips_vec to vector switch.
|
||||
* configure: Rebuild.
|
||||
* elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function,
|
||||
|
|
@ -5110,7 +5128,7 @@ Wed Apr 17 12:08:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
|||
* pe{,i}-ppc.c (PPC_PE): Define instead of PPC, so that compiling
|
||||
on Solaris PowerPC systems doesn't get confused.
|
||||
|
||||
* ccffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not
|
||||
* coffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not
|
||||
#ifdef PPC.
|
||||
|
||||
* elfcore.h (bfd_prstatus, bfd_fpregset): Add thread argument.
|
||||
|
|
|
|||
|
|
@ -2072,10 +2072,10 @@ Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com)
|
|||
|
||||
1999-06-10 Jakub Jelinek <jj@ultra.linux.cz>
|
||||
|
||||
* elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std
|
||||
* elf64-sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std
|
||||
instead of R_SPARC_max.
|
||||
(sparc64_elf_info_to_howto): Likewise.
|
||||
* elf32_sparc.c (elf32_sparc_relocate_section): Likewise.
|
||||
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
|
||||
(elf32_sparc_info_to_howto): Likewise; handle vtable relocations.
|
||||
|
||||
1999-06-07 Richard Henderson <rth@cygnus.com>
|
||||
|
|
@ -2380,7 +2380,7 @@ Wed Jun 2 11:51:12 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
|
|||
|
||||
1999-05-25 Philip Blundell <pb@nexus.co.uk>
|
||||
|
||||
* bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
|
||||
* elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
|
||||
(elf32_arm_link_hash_table_create): Use above function as the
|
||||
constructor for hash table entries.
|
||||
(elf32_arm_relocate_section): Avoid crash when there is no output
|
||||
|
|
@ -2431,7 +2431,7 @@ Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com>
|
|||
IMAGE_REL_MCORE_RVA.
|
||||
(coff_mcore_relocate_section): Add support for
|
||||
IMAGE_REL_MCORE_RVA.
|
||||
* elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE.
|
||||
* elf32-mcore.c (mcore_elf_howto_): Add R_MCORE_RELATIVE.
|
||||
(mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to
|
||||
R_MCORE_RELATIVE.
|
||||
(mcore_elf_relocate_section): Delete redundant case labels.
|
||||
|
|
@ -2724,9 +2724,9 @@ Sat Apr 10 15:12:09 1999 Richard Henderson <rth@cygnus.com>
|
|||
* targets.c: Add support for arm-epoc-pe target.
|
||||
* coff-arm.c: Allow header files to override definition of
|
||||
TARGET_UNDERSCORE and USER_LABEL_PREFIX.
|
||||
* pe-arm.h: Allow previous header files to override definition of
|
||||
* pe-arm.c: Allow previous header files to override definition of
|
||||
TARGET_LITTLE_SYM and TARGET_BIG_SYM.
|
||||
* pei-arm.h: Allow previous header files to override definition of
|
||||
* pei-arm.c: Allow previous header files to override definition of
|
||||
TARGET_LITTLE_SYM and TARGET_BIG_SYM.
|
||||
* epoc-pe-arm.c: New file. Support arm-epoc-pe target.
|
||||
* epoc-pei-arm.c: New file. Support arm-epoc-pei target.
|
||||
|
|
@ -3079,7 +3079,8 @@ Tue Dec 22 15:21:41 1998 Catherine Moore <clm@cygnus.com>
|
|||
|
||||
1998-12-16 Gavin Romig-Koch <gavin@cygnus.com>
|
||||
|
||||
* archures.c,bfd-in2.h (bfd_mach_mips4111): New.
|
||||
* archures.c (bfd_mach_mips4111): New.
|
||||
* bfd-in2.h: Regenerate.
|
||||
* cpu-mips.c: Add support for and independent 4111.
|
||||
* elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111.
|
||||
(_bfd_mips_elf_final_write_processing):
|
||||
|
|
@ -3597,7 +3598,7 @@ Mon Oct 5 12:02:31 1998 Gavin Romig-Koch <gavin@cygnus.com>
|
|||
|
||||
* dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line.
|
||||
* configure.in (elf): Add dwarf1.lo.
|
||||
* elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info.
|
||||
* elf-bfd.h (elf_ob_tdata): Add dwarf1_find_line_info.
|
||||
* elf.c (_bfd_elf_find_nearest_line): Add call to
|
||||
_bfd_dwarf1_find_nearest_line.
|
||||
* elf32-mips.c (_bfd_mips_elf_find_nearest_line):
|
||||
|
|
@ -4334,7 +4335,10 @@ Thu Jun 25 18:31:41 1998 Richard Henderson <rth@cygnus.com>
|
|||
* aout-adobe.c: Hook to default implementation.
|
||||
* aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise.
|
||||
* coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise.
|
||||
* evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise.
|
||||
* evax-alpha.c: Likewise.
|
||||
* i386msdos.c: Likewise.
|
||||
* i386os9k.c: Likewise.
|
||||
* ieee.c: Likewise.
|
||||
* ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise.
|
||||
* tekhex.c, versados.c: Likewise.
|
||||
* libbfd-in.h (_bfd_nolink_bfd_gc_sections): New.
|
||||
|
|
@ -4600,7 +4604,7 @@ Thu May 7 17:40:56 1998 Ian Lance Taylor <ian@cygnus.com>
|
|||
* aoutx.h: Don't include <string.h>. Use "sysdep.h" rather than
|
||||
<sysdep.h>.
|
||||
* archive.c: Don't include <string.h> or <errno.h>.
|
||||
* evax-alpha.c; Don't include <stdio.h>.
|
||||
* evax-alpha.c: Don't include <stdio.h>.
|
||||
* evax-egsd.c: Likewise.
|
||||
* evax-etir.c: Likewise.
|
||||
* evax-misc.c: Likewise.
|
||||
|
|
|
|||
|
|
@ -25,19 +25,23 @@ BFD_H = bfd.h
|
|||
# for the debugger, so if you are downloading things as S-records you
|
||||
# need two copies of the executable, one to download and one for the
|
||||
# debugger).
|
||||
BFD_LIBS = \
|
||||
BFD32_LIBS = \
|
||||
archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
|
||||
format.lo init.lo libbfd.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 \
|
||||
dwarf2.lo
|
||||
merge.lo dwarf2.lo
|
||||
|
||||
BFD_LIBS_CFILES = \
|
||||
BFD64_LIBS = archive64.lo
|
||||
|
||||
BFD32_LIBS_CFILES = \
|
||||
archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
|
||||
format.c init.c libbfd.c opncls.c reloc.c \
|
||||
section.c syms.c targets.c hash.c linker.c \
|
||||
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
|
||||
dwarf2.c
|
||||
merge.c dwarf2.c
|
||||
|
||||
BFD64_LIBS_CFILES = archive64.c
|
||||
|
||||
# This list is alphabetized to make it easier to keep in sync
|
||||
# with the decls and initializer in archures.c.
|
||||
|
|
@ -68,10 +72,14 @@ ALL_MACHINES = \
|
|||
cpu-m10300.lo \
|
||||
cpu-mcore.lo \
|
||||
cpu-mips.lo \
|
||||
cpu-mmix.lo \
|
||||
cpu-ns32k.lo \
|
||||
cpu-openrisc.lo \
|
||||
cpu-pdp11.lo \
|
||||
cpu-pj.lo \
|
||||
cpu-powerpc.lo \
|
||||
cpu-rs6000.lo \
|
||||
cpu-s390.lo \
|
||||
cpu-sh.lo \
|
||||
cpu-sparc.lo \
|
||||
cpu-tic30.lo \
|
||||
|
|
@ -81,6 +89,7 @@ ALL_MACHINES = \
|
|||
cpu-vax.lo \
|
||||
cpu-we32k.lo \
|
||||
cpu-w65.lo \
|
||||
cpu-xstormy16.lo \
|
||||
cpu-z8k.lo
|
||||
|
||||
ALL_MACHINES_CFILES = \
|
||||
|
|
@ -110,10 +119,14 @@ ALL_MACHINES_CFILES = \
|
|||
cpu-m10300.c \
|
||||
cpu-mcore.c \
|
||||
cpu-mips.c \
|
||||
cpu-mmix.c \
|
||||
cpu-ns32k.c \
|
||||
cpu-openrisc.c \
|
||||
cpu-pdp11.c \
|
||||
cpu-pj.c \
|
||||
cpu-powerpc.c \
|
||||
cpu-rs6000.c \
|
||||
cpu-s390.c \
|
||||
cpu-sh.c \
|
||||
cpu-sparc.c \
|
||||
cpu-tic30.c \
|
||||
|
|
@ -123,6 +136,7 @@ ALL_MACHINES_CFILES = \
|
|||
cpu-vax.c \
|
||||
cpu-we32k.c \
|
||||
cpu-w65.c \
|
||||
cpu-xstormy16.c \
|
||||
cpu-z8k.c
|
||||
|
||||
# The .o files needed by all of the 32 bit vectors that are configured into
|
||||
|
|
@ -154,7 +168,6 @@ BFD32_BACKENDS = \
|
|||
coff-m68k.lo \
|
||||
coff-m88k.lo \
|
||||
coff-mips.lo \
|
||||
coff-pmac.lo \
|
||||
coff-rs6000.lo \
|
||||
coff-sh.lo \
|
||||
coff-sparc.lo \
|
||||
|
|
@ -182,6 +195,7 @@ BFD32_BACKENDS = \
|
|||
elf32-d30v.lo \
|
||||
elf32-fr30.lo \
|
||||
elf32-gen.lo \
|
||||
elf32-h8300.lo \
|
||||
elf32-hppa.lo \
|
||||
elf32-i370.lo \
|
||||
elf32-i386.lo \
|
||||
|
|
@ -197,14 +211,20 @@ BFD32_BACKENDS = \
|
|||
elf-m10300.lo \
|
||||
elf32-mcore.lo \
|
||||
elf32-mips.lo \
|
||||
elf32-openrisc.lo \
|
||||
elf32-pj.lo \
|
||||
elf32-ppc.lo \
|
||||
elf32-s390.lo \
|
||||
elf32-sh.lo \
|
||||
elf32-sh-lin.lo \
|
||||
elf32-sh-nbsd.lo \
|
||||
elf32-sparc.lo \
|
||||
elf32-v850.lo \
|
||||
elf32-xstormy16.lo \
|
||||
elf32.lo \
|
||||
elflink.lo \
|
||||
elf-strtab.lo \
|
||||
elf-eh-frame.lo \
|
||||
epoc-pe-arm.lo \
|
||||
epoc-pei-arm.lo \
|
||||
hp300bsd.lo \
|
||||
|
|
@ -236,6 +256,7 @@ BFD32_BACKENDS = \
|
|||
ns32knetbsd.lo \
|
||||
oasys.lo \
|
||||
pc532-mach.lo \
|
||||
pdp11.lo \
|
||||
pe-arm.lo \
|
||||
pei-arm.lo \
|
||||
pe-i386.lo \
|
||||
|
|
@ -292,7 +313,6 @@ BFD32_BACKENDS_CFILES = \
|
|||
coff-m68k.c \
|
||||
coff-m88k.c \
|
||||
coff-mips.c \
|
||||
coff-pmac.c \
|
||||
coff-rs6000.c \
|
||||
coff-sh.c \
|
||||
coff-sparc.c \
|
||||
|
|
@ -320,6 +340,7 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32-d30v.c \
|
||||
elf32-fr30.c \
|
||||
elf32-gen.c \
|
||||
elf32-h8300.c \
|
||||
elf32-hppa.c \
|
||||
elf32-i370.c \
|
||||
elf32-i386.c \
|
||||
|
|
@ -334,14 +355,20 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf-m10300.c \
|
||||
elf32-mcore.c \
|
||||
elf32-mips.c \
|
||||
elf32-openrisc.c \
|
||||
elf32-pj.c \
|
||||
elf32-ppc.c \
|
||||
elf32-s390.c \
|
||||
elf32-sh.c \
|
||||
elf32-sh-lin.c \
|
||||
elf32-sh-nbsd.c \
|
||||
elf32-sparc.c \
|
||||
elf32-v850.c \
|
||||
elf32-xstormy16.c \
|
||||
elf32.c \
|
||||
elflink.c \
|
||||
elf-strtab.c \
|
||||
elf-eh-frame.c \
|
||||
epoc-pe-arm.c \
|
||||
epoc-pei-arm.c \
|
||||
hp300bsd.c \
|
||||
|
|
@ -373,6 +400,7 @@ BFD32_BACKENDS_CFILES = \
|
|||
ns32knetbsd.c \
|
||||
oasys.c \
|
||||
pc532-mach.c \
|
||||
pdp11.c \
|
||||
pe-arm.c \
|
||||
pei-arm.c \
|
||||
pe-i386.c \
|
||||
|
|
@ -416,8 +444,12 @@ BFD64_BACKENDS = \
|
|||
elf64-ia64.lo \
|
||||
elf64-gen.lo \
|
||||
elf64-mips.lo \
|
||||
elf64-mmix.lo \
|
||||
elf64-ppc.lo \
|
||||
elf64-s390.lo \
|
||||
elf64-sparc.lo \
|
||||
elf64.lo \
|
||||
mmo.lo \
|
||||
nlm32-alpha.lo \
|
||||
nlm64.lo \
|
||||
pepigen.lo
|
||||
|
|
@ -433,8 +465,12 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf64-hppa.c \
|
||||
elf64-gen.c \
|
||||
elf64-mips.c \
|
||||
elf64-mmix.c \
|
||||
elf64-ppc.c \
|
||||
elf64-s390.c \
|
||||
elf64-sparc.c \
|
||||
elf64.c \
|
||||
mmo.c \
|
||||
nlm32-alpha.c \
|
||||
nlm64.c
|
||||
|
||||
|
|
@ -462,6 +498,7 @@ OPTIONAL_BACKENDS_CFILES = \
|
|||
WORDSIZE = @wordsize@
|
||||
ALL_BACKENDS = @all_backends@
|
||||
BFD_BACKENDS = @bfd_backends@
|
||||
BFD_LIBS = @bfd_libs@
|
||||
BFD_MACHINES = @bfd_machines@
|
||||
TDEFAULTS = @tdefaults@
|
||||
|
||||
|
|
@ -469,7 +506,8 @@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES
|
|||
|
||||
# C source files that correspond to .o's.
|
||||
SOURCE_CFILES = \
|
||||
$(BFD_LIBS_CFILES) \
|
||||
$(BFD32_LIBS_CFILES) \
|
||||
$(BFD64_LIBS_CFILES) \
|
||||
$(ALL_MACHINES_CFILES) \
|
||||
$(BFD32_BACKENDS_CFILES) \
|
||||
$(BFD64_BACKENDS_CFILES) \
|
||||
|
|
@ -487,7 +525,8 @@ SOURCE_HFILES = \
|
|||
elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
|
||||
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
|
||||
libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
|
||||
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h
|
||||
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
|
||||
xcoff-target.h version.h
|
||||
|
||||
## ... and all .h files which are in the build tree.
|
||||
BUILD_HFILES = \
|
||||
|
|
@ -499,12 +538,12 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
|
|||
BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
|
||||
|
||||
po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
|
||||
for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/SRC-POTFILES.in
|
||||
for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \
|
||||
&& mv tmp.src $(srcdir)/po/SRC-POTFILES.in
|
||||
|
||||
po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
|
||||
for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/BLD-POTFILES.in
|
||||
for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \
|
||||
&& mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
|
||||
|
||||
# The following target is retained for upgrade purposes.
|
||||
# This target used to exist in older versions of this makefile, and was
|
||||
|
|
@ -539,7 +578,7 @@ stamp-ofiles: Makefile
|
|||
|
||||
ofiles: stamp-ofiles ; @true
|
||||
|
||||
libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
|
||||
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
|
||||
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
|
||||
libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
|
||||
libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
|
||||
|
|
@ -610,12 +649,14 @@ pepigen.c : peXXigen.c
|
|||
sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
|
||||
mv -f pepigen.new pepigen.c
|
||||
|
||||
BFD_H_DEPS= $(INCDIR)/ansidecl.h
|
||||
BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
|
||||
LOCAL_H_DEPS= libbfd.h sysdep.h config.h
|
||||
$(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD32_LIBS) \
|
||||
$(BFD64_LIBS) \
|
||||
$(ALL_MACHINES) \
|
||||
$(BFD32_BACKENDS) \
|
||||
$(BFD64_BACKENDS) \
|
||||
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
|
||||
# Install BFD include file, and others that it needs.
|
||||
install-data-local: $(BFD_H)
|
||||
|
|
@ -623,8 +664,10 @@ install-data-local: $(BFD_H)
|
|||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
|
||||
$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
|
||||
$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
|
||||
$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
|
||||
|
||||
Makefile: $(srcdir)/configure.in
|
||||
|
||||
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
|
||||
DEP: dep.sed $(CFILES) $(HFILES) bfd.h
|
||||
|
|
@ -684,7 +727,8 @@ stmp-bfd-h: bfd-in3.h
|
|||
touch stmp-bfd-h
|
||||
|
||||
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
|
||||
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
|
||||
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
|
||||
BFD64_H_FILES = archive64.c
|
||||
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
|
||||
LIBCOFF_H_FILES = libcoff-in.h coffcode.h
|
||||
|
||||
|
|
@ -702,7 +746,7 @@ headers:
|
|||
# configured with --enable-maintainer-mode.
|
||||
|
||||
$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
|
||||
stmp-bin2-h: $(BFD_H_FILES)
|
||||
stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
|
||||
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
|
||||
cp $(docdir)/bfd.h bfd-in2.h-new
|
||||
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
|
||||
|
|
@ -739,12 +783,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
|
|||
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
||||
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
||||
archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
|
||||
$(INCDIR)/aout/ranlib.h
|
||||
archures.lo: archures.c $(INCDIR)/filenames.h
|
||||
$(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h
|
||||
archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.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
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.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
|
||||
cache.lo: cache.c $(INCDIR)/filenames.h
|
||||
coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h
|
||||
|
|
@ -755,24 +800,28 @@ libbfd.lo: libbfd.c $(INCDIR)/filenames.h
|
|||
opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
|
||||
reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
|
||||
section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
|
||||
syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \
|
||||
targmatch.h
|
||||
hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
|
||||
linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h
|
||||
srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
binary.lo: binary.c $(INCDIR)/filenames.h
|
||||
srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
binary.lo: binary.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h
|
||||
stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
|
||||
merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
|
||||
dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
|
||||
archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
|
||||
cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
|
||||
cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
|
||||
cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h
|
||||
|
|
@ -800,47 +849,55 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h
|
|||
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h
|
||||
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h
|
||||
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h
|
||||
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h
|
||||
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h
|
||||
cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h
|
||||
cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h
|
||||
cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h
|
||||
cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h
|
||||
cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h
|
||||
cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h
|
||||
cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h
|
||||
cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h
|
||||
cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h
|
||||
cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h
|
||||
cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h
|
||||
cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h
|
||||
cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h
|
||||
cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h
|
||||
cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h
|
||||
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h
|
||||
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h
|
||||
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \
|
||||
ns32k.h libaout.h $(INCDIR)/bfdlink.h
|
||||
ns32k.h libaout.h $(INCDIR)/bfdlink.h aoutx.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h
|
||||
aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \
|
||||
libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \
|
||||
libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -848,94 +905,94 @@ bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def libaout.h
|
||||
cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \
|
||||
$(INCDIR)/coff/internal.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 coff-m68k.c \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/apollo.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.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 libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
coffswap.h
|
||||
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
|
||||
coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \
|
||||
libecoff.h coffswap.h ecoffswap.h
|
||||
coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
xcoff-target.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
|
||||
libcoff.h libecoff.h coffswap.h ecoffswap.h
|
||||
coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h
|
||||
coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
|
||||
$(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \
|
||||
coffswap.h
|
||||
coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
|
||||
coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \
|
||||
go32stub.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/go32exe.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h go32stub.h
|
||||
coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.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 \
|
||||
$(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.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 \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h
|
||||
dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
|
|
@ -951,16 +1008,16 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h libcoff.h libecoff.h
|
||||
efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
|
||||
elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/libiberty.h
|
||||
elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
$(INCDIR)/libiberty.h elf32-target.h
|
||||
elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
|
||||
|
|
@ -992,6 +1049,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \
|
|||
elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h elf32-target.h
|
||||
elf32-h8300.lo: elf32-h8300.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/h8.h \
|
||||
$(INCDIR)/elf/reloc-macros.h elf32-target.h
|
||||
elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \
|
||||
|
|
@ -1045,7 +1106,12 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
|
||||
ecoffswap.h elf32-target.h
|
||||
elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \
|
||||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
|
||||
elf32-target.h
|
||||
elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
|
|
@ -1055,11 +1121,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
|
||||
elf32-target.h
|
||||
elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \
|
||||
elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \
|
||||
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
|
||||
elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/bfdlink.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 elf32-target.h
|
||||
|
|
@ -1071,28 +1145,41 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
|
|||
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/libiberty.h elf32-target.h
|
||||
elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h elfcore.h elflink.h
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \
|
||||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
|
||||
elf32-target.h
|
||||
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
|
||||
elflink.h
|
||||
elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h
|
||||
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h
|
||||
elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
|
||||
epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \
|
||||
coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-arm.c $(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
|
||||
epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \
|
||||
coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-arm.c $(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
|
||||
hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.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
|
||||
hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
|
||||
aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
som.lo: som.c $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h
|
||||
i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \
|
||||
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
|
||||
|
|
@ -1101,9 +1188,9 @@ i386bsd.lo: i386bsd.c $(INCDIR)/filenames.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
|
||||
i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \
|
||||
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
$(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
|
||||
i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -1124,7 +1211,7 @@ i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \
|
|||
i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/os9k.h
|
||||
ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \
|
||||
libieee.h
|
||||
libieee.h $(INCDIR)/safe-ctype.h
|
||||
m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -1163,58 +1250,64 @@ nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \
|
|||
ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \
|
||||
liboasys.h
|
||||
oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/oasys.h liboasys.h
|
||||
pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
pdp11.lo: pdp11.c $(INCDIR)/filenames.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
|
||||
pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \
|
||||
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.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.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \
|
||||
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.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)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/i386.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-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/i386.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-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \
|
||||
$(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/mcore.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-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \
|
||||
$(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/mcore.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-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \
|
||||
$(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
$(INCDIR)/coff/powerpc.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-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \
|
||||
$(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h coffcode.h peicode.h libpei.h
|
||||
$(INCDIR)/coff/powerpc.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-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
coffcode.h peicode.h libpei.h
|
||||
pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.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-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \
|
||||
$(INCDIR)/coff/mipspe.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)/filenames.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
|
||||
reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h $(INCDIR)/coff/internal.h libcoff.h
|
||||
riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \
|
||||
|
|
@ -1243,31 +1336,33 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
$(INCDIR)/safe-ctype.h vms.h
|
||||
vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h
|
||||
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
|
||||
libxcoff.h
|
||||
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
|
||||
libcoff.h libecoff.h coffswap.h ecoffswap.h
|
||||
coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
|
||||
$(INCDIR)/coff/rs6k64.h libcoff.h libxcoff.h coffcode.h \
|
||||
coffswap.h
|
||||
demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \
|
||||
coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
|
||||
elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \
|
||||
|
|
@ -1293,14 +1388,29 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
|
|||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
|
||||
ecoffswap.h elf64-target.h
|
||||
elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/opcode/mmix.h elf64-target.h
|
||||
elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf64-ppc.h elf64-target.h
|
||||
elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
|
||||
elf64-target.h
|
||||
elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \
|
||||
$(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf64-target.h
|
||||
elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h elfcore.h elflink.h
|
||||
elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
|
||||
elflink.h
|
||||
mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
|
||||
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \
|
||||
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \
|
||||
|
|
@ -1308,8 +1418,8 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
|
|||
nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \
|
||||
$(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
|
||||
aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h
|
||||
hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h
|
||||
irix-core.lo: irix-core.c $(INCDIR)/filenames.h
|
||||
lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h
|
||||
|
|
@ -1328,9 +1438,9 @@ elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \
|
|||
$(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \
|
||||
$(INCDIR)/elf/reloc-macros.h elf64-target.h
|
||||
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h libpei.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)/coff/internal.h \
|
||||
$(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h libpei.h
|
||||
$(INCDIR)/coff/ia64.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
|
||||
|
|
|
|||
|
|
@ -114,7 +114,12 @@ WIN32LDFLAGS = @WIN32LDFLAGS@
|
|||
WIN32LIBADD = @WIN32LIBADD@
|
||||
all_backends = @all_backends@
|
||||
bfd_backends = @bfd_backends@
|
||||
bfd_default_target_size = @bfd_default_target_size@
|
||||
bfd_libs = @bfd_libs@
|
||||
bfd_machines = @bfd_machines@
|
||||
bfd_version = @bfd_version@
|
||||
bfd_version_date = @bfd_version_date@
|
||||
bfd_version_string = @bfd_version_string@
|
||||
l = @l@
|
||||
tdefaults = @tdefaults@
|
||||
wordsize = @wordsize@
|
||||
|
|
@ -144,22 +149,26 @@ BFD_H = bfd.h
|
|||
# for the debugger, so if you are downloading things as S-records you
|
||||
# need two copies of the executable, one to download and one for the
|
||||
# debugger).
|
||||
BFD_LIBS = \
|
||||
BFD32_LIBS = \
|
||||
archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
|
||||
format.lo init.lo libbfd.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 \
|
||||
dwarf2.lo
|
||||
merge.lo dwarf2.lo
|
||||
|
||||
|
||||
BFD_LIBS_CFILES = \
|
||||
BFD64_LIBS = archive64.lo
|
||||
|
||||
BFD32_LIBS_CFILES = \
|
||||
archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
|
||||
format.c init.c libbfd.c opncls.c reloc.c \
|
||||
section.c syms.c targets.c hash.c linker.c \
|
||||
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
|
||||
dwarf2.c
|
||||
merge.c dwarf2.c
|
||||
|
||||
|
||||
BFD64_LIBS_CFILES = archive64.c
|
||||
|
||||
# This list is alphabetized to make it easier to keep in sync
|
||||
# with the decls and initializer in archures.c.
|
||||
ALL_MACHINES = \
|
||||
|
|
@ -189,10 +198,14 @@ ALL_MACHINES = \
|
|||
cpu-m10300.lo \
|
||||
cpu-mcore.lo \
|
||||
cpu-mips.lo \
|
||||
cpu-mmix.lo \
|
||||
cpu-ns32k.lo \
|
||||
cpu-openrisc.lo \
|
||||
cpu-pdp11.lo \
|
||||
cpu-pj.lo \
|
||||
cpu-powerpc.lo \
|
||||
cpu-rs6000.lo \
|
||||
cpu-s390.lo \
|
||||
cpu-sh.lo \
|
||||
cpu-sparc.lo \
|
||||
cpu-tic30.lo \
|
||||
|
|
@ -202,6 +215,7 @@ ALL_MACHINES = \
|
|||
cpu-vax.lo \
|
||||
cpu-we32k.lo \
|
||||
cpu-w65.lo \
|
||||
cpu-xstormy16.lo \
|
||||
cpu-z8k.lo
|
||||
|
||||
|
||||
|
|
@ -232,10 +246,14 @@ ALL_MACHINES_CFILES = \
|
|||
cpu-m10300.c \
|
||||
cpu-mcore.c \
|
||||
cpu-mips.c \
|
||||
cpu-mmix.c \
|
||||
cpu-ns32k.c \
|
||||
cpu-openrisc.c \
|
||||
cpu-pdp11.c \
|
||||
cpu-pj.c \
|
||||
cpu-powerpc.c \
|
||||
cpu-rs6000.c \
|
||||
cpu-s390.c \
|
||||
cpu-sh.c \
|
||||
cpu-sparc.c \
|
||||
cpu-tic30.c \
|
||||
|
|
@ -245,6 +263,7 @@ ALL_MACHINES_CFILES = \
|
|||
cpu-vax.c \
|
||||
cpu-we32k.c \
|
||||
cpu-w65.c \
|
||||
cpu-xstormy16.c \
|
||||
cpu-z8k.c
|
||||
|
||||
|
||||
|
|
@ -277,7 +296,6 @@ BFD32_BACKENDS = \
|
|||
coff-m68k.lo \
|
||||
coff-m88k.lo \
|
||||
coff-mips.lo \
|
||||
coff-pmac.lo \
|
||||
coff-rs6000.lo \
|
||||
coff-sh.lo \
|
||||
coff-sparc.lo \
|
||||
|
|
@ -305,6 +323,7 @@ BFD32_BACKENDS = \
|
|||
elf32-d30v.lo \
|
||||
elf32-fr30.lo \
|
||||
elf32-gen.lo \
|
||||
elf32-h8300.lo \
|
||||
elf32-hppa.lo \
|
||||
elf32-i370.lo \
|
||||
elf32-i386.lo \
|
||||
|
|
@ -320,14 +339,20 @@ BFD32_BACKENDS = \
|
|||
elf-m10300.lo \
|
||||
elf32-mcore.lo \
|
||||
elf32-mips.lo \
|
||||
elf32-openrisc.lo \
|
||||
elf32-pj.lo \
|
||||
elf32-ppc.lo \
|
||||
elf32-s390.lo \
|
||||
elf32-sh.lo \
|
||||
elf32-sh-lin.lo \
|
||||
elf32-sh-nbsd.lo \
|
||||
elf32-sparc.lo \
|
||||
elf32-v850.lo \
|
||||
elf32-xstormy16.lo \
|
||||
elf32.lo \
|
||||
elflink.lo \
|
||||
elf-strtab.lo \
|
||||
elf-eh-frame.lo \
|
||||
epoc-pe-arm.lo \
|
||||
epoc-pei-arm.lo \
|
||||
hp300bsd.lo \
|
||||
|
|
@ -359,6 +384,7 @@ BFD32_BACKENDS = \
|
|||
ns32knetbsd.lo \
|
||||
oasys.lo \
|
||||
pc532-mach.lo \
|
||||
pdp11.lo \
|
||||
pe-arm.lo \
|
||||
pei-arm.lo \
|
||||
pe-i386.lo \
|
||||
|
|
@ -416,7 +442,6 @@ BFD32_BACKENDS_CFILES = \
|
|||
coff-m68k.c \
|
||||
coff-m88k.c \
|
||||
coff-mips.c \
|
||||
coff-pmac.c \
|
||||
coff-rs6000.c \
|
||||
coff-sh.c \
|
||||
coff-sparc.c \
|
||||
|
|
@ -444,6 +469,7 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf32-d30v.c \
|
||||
elf32-fr30.c \
|
||||
elf32-gen.c \
|
||||
elf32-h8300.c \
|
||||
elf32-hppa.c \
|
||||
elf32-i370.c \
|
||||
elf32-i386.c \
|
||||
|
|
@ -458,14 +484,20 @@ BFD32_BACKENDS_CFILES = \
|
|||
elf-m10300.c \
|
||||
elf32-mcore.c \
|
||||
elf32-mips.c \
|
||||
elf32-openrisc.c \
|
||||
elf32-pj.c \
|
||||
elf32-ppc.c \
|
||||
elf32-s390.c \
|
||||
elf32-sh.c \
|
||||
elf32-sh-lin.c \
|
||||
elf32-sh-nbsd.c \
|
||||
elf32-sparc.c \
|
||||
elf32-v850.c \
|
||||
elf32-xstormy16.c \
|
||||
elf32.c \
|
||||
elflink.c \
|
||||
elf-strtab.c \
|
||||
elf-eh-frame.c \
|
||||
epoc-pe-arm.c \
|
||||
epoc-pei-arm.c \
|
||||
hp300bsd.c \
|
||||
|
|
@ -497,6 +529,7 @@ BFD32_BACKENDS_CFILES = \
|
|||
ns32knetbsd.c \
|
||||
oasys.c \
|
||||
pc532-mach.c \
|
||||
pdp11.c \
|
||||
pe-arm.c \
|
||||
pei-arm.c \
|
||||
pe-i386.c \
|
||||
|
|
@ -541,8 +574,12 @@ BFD64_BACKENDS = \
|
|||
elf64-ia64.lo \
|
||||
elf64-gen.lo \
|
||||
elf64-mips.lo \
|
||||
elf64-mmix.lo \
|
||||
elf64-ppc.lo \
|
||||
elf64-s390.lo \
|
||||
elf64-sparc.lo \
|
||||
elf64.lo \
|
||||
mmo.lo \
|
||||
nlm32-alpha.lo \
|
||||
nlm64.lo \
|
||||
pepigen.lo
|
||||
|
|
@ -559,8 +596,12 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf64-hppa.c \
|
||||
elf64-gen.c \
|
||||
elf64-mips.c \
|
||||
elf64-mmix.c \
|
||||
elf64-ppc.c \
|
||||
elf64-s390.c \
|
||||
elf64-sparc.c \
|
||||
elf64.c \
|
||||
mmo.c \
|
||||
nlm32-alpha.c \
|
||||
nlm64.c
|
||||
|
||||
|
|
@ -591,6 +632,7 @@ OPTIONAL_BACKENDS_CFILES = \
|
|||
WORDSIZE = @wordsize@
|
||||
ALL_BACKENDS = @all_backends@
|
||||
BFD_BACKENDS = @bfd_backends@
|
||||
BFD_LIBS = @bfd_libs@
|
||||
BFD_MACHINES = @bfd_machines@
|
||||
TDEFAULTS = @tdefaults@
|
||||
|
||||
|
|
@ -598,7 +640,8 @@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES
|
|||
|
||||
# C source files that correspond to .o's.
|
||||
SOURCE_CFILES = \
|
||||
$(BFD_LIBS_CFILES) \
|
||||
$(BFD32_LIBS_CFILES) \
|
||||
$(BFD64_LIBS_CFILES) \
|
||||
$(ALL_MACHINES_CFILES) \
|
||||
$(BFD32_BACKENDS_CFILES) \
|
||||
$(BFD64_BACKENDS_CFILES) \
|
||||
|
|
@ -617,7 +660,8 @@ SOURCE_HFILES = \
|
|||
elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
|
||||
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
|
||||
libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
|
||||
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h
|
||||
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
|
||||
xcoff-target.h version.h
|
||||
|
||||
|
||||
BUILD_HFILES = \
|
||||
|
|
@ -635,7 +679,7 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
|
|||
# COREFILE Core file routines for a native configuration
|
||||
OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
|
||||
|
||||
libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
|
||||
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES)
|
||||
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
|
||||
libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
|
||||
libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
|
||||
|
|
@ -648,12 +692,13 @@ libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
|
|||
noinst_LIBRARIES = libbfd.a
|
||||
libbfd_a_SOURCES =
|
||||
|
||||
BFD_H_DEPS = $(INCDIR)/ansidecl.h
|
||||
BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
|
||||
LOCAL_H_DEPS = libbfd.h sysdep.h config.h
|
||||
|
||||
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
|
||||
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
|
||||
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
|
||||
|
||||
BFD64_H_FILES = archive64.c
|
||||
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
|
||||
LIBCOFF_H_FILES = libcoff-in.h coffcode.h
|
||||
|
||||
|
|
@ -672,6 +717,7 @@ LIBRARIES = $(noinst_LIBRARIES)
|
|||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I.
|
||||
#DEFS = @DEFS@ @elf_dynamic_interpreter@ -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
|
|
@ -682,7 +728,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
|
|||
libbfd_la_OBJECTS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
|
||||
corefile.lo format.lo init.lo libbfd.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 dwarf2.lo
|
||||
ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
|
@ -1074,12 +1120,12 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
|||
|
||||
|
||||
po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
|
||||
for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/SRC-POTFILES.in
|
||||
for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \
|
||||
&& mv tmp.src $(srcdir)/po/SRC-POTFILES.in
|
||||
|
||||
po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
|
||||
for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/BLD-POTFILES.in
|
||||
for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \
|
||||
&& mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
|
||||
|
||||
# The following target is retained for upgrade purposes.
|
||||
# This target used to exist in older versions of this makefile, and was
|
||||
|
|
@ -1164,10 +1210,12 @@ 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
|
||||
$(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
$(BFD32_LIBS) \
|
||||
$(BFD64_LIBS) \
|
||||
$(ALL_MACHINES) \
|
||||
$(BFD32_BACKENDS) \
|
||||
$(BFD64_BACKENDS) \
|
||||
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
|
||||
|
||||
# Install BFD include file, and others that it needs.
|
||||
install-data-local: $(BFD_H)
|
||||
|
|
@ -1175,8 +1223,11 @@ install-data-local: $(BFD_H)
|
|||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
|
||||
$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
|
||||
$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
|
||||
$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
|
||||
|
||||
Makefile: $(srcdir)/configure.in
|
||||
|
||||
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
|
||||
DEP: dep.sed $(CFILES) $(HFILES) bfd.h
|
||||
rm -f DEP1
|
||||
|
|
@ -1248,7 +1299,7 @@ headers:
|
|||
# configured with --enable-maintainer-mode.
|
||||
|
||||
$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
|
||||
stmp-bin2-h: $(BFD_H_FILES)
|
||||
stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
|
||||
(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
|
||||
cp $(docdir)/bfd.h bfd-in2.h-new
|
||||
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
|
||||
|
|
@ -1277,12 +1328,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
|
|||
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
||||
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
||||
archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
|
||||
$(INCDIR)/aout/ranlib.h
|
||||
archures.lo: archures.c $(INCDIR)/filenames.h
|
||||
$(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h
|
||||
archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.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
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.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
|
||||
cache.lo: cache.c $(INCDIR)/filenames.h
|
||||
coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h
|
||||
|
|
@ -1293,24 +1345,28 @@ libbfd.lo: libbfd.c $(INCDIR)/filenames.h
|
|||
opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
|
||||
reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
|
||||
section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
|
||||
syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \
|
||||
targmatch.h
|
||||
hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
|
||||
linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h
|
||||
srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
binary.lo: binary.c $(INCDIR)/filenames.h
|
||||
srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
binary.lo: binary.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
|
||||
ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h
|
||||
stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
|
||||
merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
|
||||
dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
|
||||
archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
|
||||
cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
|
||||
cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
|
||||
cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h
|
||||
|
|
@ -1338,47 +1394,55 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h
|
|||
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h
|
||||
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h
|
||||
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h
|
||||
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h
|
||||
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h
|
||||
cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h
|
||||
cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h
|
||||
cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h
|
||||
cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h
|
||||
cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h
|
||||
cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h
|
||||
cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h
|
||||
cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h
|
||||
cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h
|
||||
cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h
|
||||
cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h
|
||||
cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h
|
||||
cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
|
||||
cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h
|
||||
cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h
|
||||
cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h
|
||||
cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h
|
||||
cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h
|
||||
aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \
|
||||
ns32k.h libaout.h $(INCDIR)/bfdlink.h
|
||||
ns32k.h libaout.h $(INCDIR)/bfdlink.h aoutx.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/safe-ctype.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h
|
||||
aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \
|
||||
libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h \
|
||||
$(INCDIR)/safe-ctype.h
|
||||
aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \
|
||||
libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -1386,94 +1450,94 @@ bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def libaout.h
|
||||
cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \
|
||||
$(INCDIR)/coff/internal.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 coff-m68k.c \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/apollo.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.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 libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
coffswap.h
|
||||
coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
|
||||
coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \
|
||||
libecoff.h coffswap.h ecoffswap.h
|
||||
coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
xcoff-target.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
|
||||
libcoff.h libecoff.h coffswap.h ecoffswap.h
|
||||
coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h
|
||||
coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
|
||||
$(INCDIR)/coff/rs6000.h libcoff.h libxcoff.h coffcode.h \
|
||||
coffswap.h
|
||||
coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
|
||||
coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \
|
||||
go32stub.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/go32exe.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h go32stub.h
|
||||
coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.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 \
|
||||
$(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.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 \
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
|
||||
coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
coffcode.h coffswap.h
|
||||
$(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h coffcode.h coffswap.h
|
||||
cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h
|
||||
dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
|
|
@ -1489,16 +1553,16 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h libcoff.h libecoff.h
|
||||
efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
|
||||
elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/libiberty.h
|
||||
elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
$(INCDIR)/libiberty.h elf32-target.h
|
||||
elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
|
||||
|
|
@ -1530,6 +1594,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \
|
|||
elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h elf32-target.h
|
||||
elf32-h8300.lo: elf32-h8300.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/h8.h \
|
||||
$(INCDIR)/elf/reloc-macros.h elf32-target.h
|
||||
elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \
|
||||
|
|
@ -1583,7 +1651,12 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
|
||||
ecoffswap.h elf32-target.h
|
||||
elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \
|
||||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
|
||||
elf32-target.h
|
||||
elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
|
|
@ -1593,11 +1666,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
|
||||
elf32-target.h
|
||||
elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \
|
||||
elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \
|
||||
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
|
||||
elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/bfdlink.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 elf32-target.h
|
||||
|
|
@ -1609,28 +1690,41 @@ elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
|
|||
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf32-target.h
|
||||
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/libiberty.h elf32-target.h
|
||||
elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h elfcore.h elflink.h
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \
|
||||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
|
||||
elf32-target.h
|
||||
elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
|
||||
elflink.h
|
||||
elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h
|
||||
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h
|
||||
elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
|
||||
epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \
|
||||
coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-arm.c $(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
|
||||
epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \
|
||||
coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-arm.c $(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
|
||||
hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.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
|
||||
hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
|
||||
aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
|
||||
aout-target.h
|
||||
som.lo: som.c $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h
|
||||
i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \
|
||||
libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
|
||||
|
|
@ -1639,9 +1733,9 @@ i386bsd.lo: i386bsd.c $(INCDIR)/filenames.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
|
||||
i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \
|
||||
$(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
$(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
|
||||
i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -1662,7 +1756,7 @@ i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \
|
|||
i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/os9k.h
|
||||
ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \
|
||||
libieee.h
|
||||
libieee.h $(INCDIR)/safe-ctype.h
|
||||
m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
|
|
@ -1701,58 +1795,64 @@ nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \
|
|||
ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.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
|
||||
oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \
|
||||
liboasys.h
|
||||
oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/oasys.h liboasys.h
|
||||
pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
pdp11.lo: pdp11.c $(INCDIR)/filenames.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
|
||||
pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \
|
||||
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.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.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \
|
||||
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.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)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/i386.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-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/i386.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-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \
|
||||
$(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/mcore.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-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \
|
||||
$(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
$(INCDIR)/coff/mcore.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-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \
|
||||
$(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
$(INCDIR)/coff/powerpc.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-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \
|
||||
$(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
|
||||
libcoff.h coffcode.h peicode.h libpei.h
|
||||
$(INCDIR)/coff/powerpc.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-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
coffcode.h peicode.h libpei.h
|
||||
pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
|
||||
$(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \
|
||||
libpei.h
|
||||
pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.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-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \
|
||||
$(INCDIR)/coff/mipspe.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)/filenames.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
|
||||
reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
genlink.h $(INCDIR)/coff/internal.h libcoff.h
|
||||
riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \
|
||||
|
|
@ -1781,31 +1881,33 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
|||
vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
$(INCDIR)/safe-ctype.h vms.h
|
||||
vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
vms.h
|
||||
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h libcoff.h
|
||||
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
|
||||
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
|
||||
libxcoff.h
|
||||
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
|
||||
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
|
||||
coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
|
||||
libcoff.h libecoff.h coffswap.h ecoffswap.h
|
||||
coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \
|
||||
$(INCDIR)/coff/rs6k64.h libcoff.h libxcoff.h coffcode.h \
|
||||
coffswap.h
|
||||
demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \
|
||||
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
|
||||
$(INCDIR)/aout/ar.h aout-target.h
|
||||
efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \
|
||||
coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
|
||||
peicode.h libpei.h
|
||||
coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
|
||||
elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \
|
||||
|
|
@ -1831,14 +1933,29 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
|
|||
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
|
||||
ecoffswap.h elf64-target.h
|
||||
elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/opcode/mmix.h elf64-target.h
|
||||
elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf64-ppc.h elf64-target.h
|
||||
elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
|
||||
elf64-target.h
|
||||
elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \
|
||||
$(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
|
||||
elf64-target.h
|
||||
elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
|
||||
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/external.h elfcore.h elflink.h
|
||||
elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
|
||||
elflink.h
|
||||
mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
|
||||
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \
|
||||
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \
|
||||
|
|
@ -1846,8 +1963,8 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
|
|||
nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \
|
||||
$(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
|
||||
aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
|
||||
libcoff.h $(INCDIR)/bfdlink.h
|
||||
hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h
|
||||
irix-core.lo: irix-core.c $(INCDIR)/filenames.h
|
||||
lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h
|
||||
|
|
@ -1866,11 +1983,11 @@ elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \
|
|||
$(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \
|
||||
$(INCDIR)/elf/reloc-macros.h elf64-target.h
|
||||
peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
|
||||
$(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h libpei.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)/coff/internal.h \
|
||||
$(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \
|
||||
$(INCDIR)/bfdlink.h libpei.h
|
||||
$(INCDIR)/coff/ia64.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.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
BFD is a an object file library. It permits applications to use the
|
||||
BFD is an object file library. It permits applications to use the
|
||||
same routines to process object files regardless of their format.
|
||||
|
||||
BFD is used by the GNU debugger, assembler, linker, and the binary
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for raw ARM a.out binaries.
|
||||
Copyright 1994, 1995, 1997, 1998, 1999, 2000
|
||||
Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
|
||||
|
||||
|
|
@ -19,80 +19,90 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define N_TXTADDR(x) \
|
||||
((N_MAGIC(x) == NMAGIC) ? 0x8000 : \
|
||||
(N_MAGIC(x) != ZMAGIC) ? 0 : \
|
||||
(N_SHARED_LIB(x)) ? ((x).a_entry & ~(TARGET_PAGE_SIZE - 1)) : \
|
||||
TEXT_START_ADDR)
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
|
||||
/* Avoid multiple defininitions from aoutx if supporting standarad a.out
|
||||
as well as our own. */
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define NAME(x,y) CONCAT3 (aoutarm,_32_,y)
|
||||
|
||||
#define N_TXTADDR(x) \
|
||||
((N_MAGIC (x) == NMAGIC) \
|
||||
? (bfd_vma) 0x8000 \
|
||||
: ((N_MAGIC (x) != ZMAGIC) \
|
||||
? (bfd_vma) 0 \
|
||||
: ((N_SHARED_LIB (x)) \
|
||||
? ((x).a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \
|
||||
: (bfd_vma) TEXT_START_ADDR)))
|
||||
|
||||
#define TEXT_START_ADDR 0x8000
|
||||
#define TARGET_PAGE_SIZE 0x8000
|
||||
#define SEGMENT_SIZE TARGET_PAGE_SIZE
|
||||
#define DEFAULT_ARCH bfd_arch_arm
|
||||
|
||||
#define MY(OP) CAT(aoutarm_,OP)
|
||||
#define MY(OP) CONCAT2 (aoutarm_,OP)
|
||||
#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \
|
||||
(((x).a_info & ~006000) != OMAGIC) && \
|
||||
((x).a_info != NMAGIC))
|
||||
#define N_MAGIC(x) ((x).a_info & ~07200)
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
|
||||
#define MYARM(OP) CAT(aoutarm_,OP)
|
||||
reloc_howto_type *MYARM(bfd_reloc_type_lookup)
|
||||
PARAMS((bfd *, bfd_reloc_code_real_type));
|
||||
static boolean MYARM(write_object_contents) PARAMS((bfd *));
|
||||
|
||||
/* Avoid multiple defininitions from aoutx if supporting standarad a.out
|
||||
as well as our own. */
|
||||
#define NAME(x,y) CAT3(aoutarm,_32_,y)
|
||||
|
||||
#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
|
||||
|
||||
#include "libaout.h"
|
||||
#include "aout/aout64.h"
|
||||
|
||||
static bfd_reloc_status_type
|
||||
MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR,
|
||||
asection *, bfd *, char **));
|
||||
|
||||
static bfd_reloc_status_type
|
||||
MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR,
|
||||
asection *, bfd *, char **));
|
||||
static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
|
||||
arelent *, asymbol **,
|
||||
bfd_size_type));
|
||||
void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *,
|
||||
struct reloc_std_external *));
|
||||
|
||||
static boolean MY(write_object_contents)
|
||||
PARAMS ((bfd *));
|
||||
static bfd_reloc_status_type MY(fix_pcrel_26_done)
|
||||
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
||||
static bfd_reloc_status_type MY(fix_pcrel_26)
|
||||
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
||||
static void MY(swap_std_reloc_in)
|
||||
PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **,
|
||||
bfd_size_type));
|
||||
reloc_howto_type *MY(bfd_reloc_type_lookup)
|
||||
PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
reloc_howto_type * MY(reloc_howto)
|
||||
PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *));
|
||||
void MY(put_reloc)
|
||||
PARAMS ((bfd *, int, int, bfd_vma, reloc_howto_type *,
|
||||
struct reloc_std_external *));
|
||||
void MY(relocatable_reloc)
|
||||
PARAMS ((reloc_howto_type *, bfd *, struct reloc_std_external *, bfd_vma *,
|
||||
bfd_vma));
|
||||
void MY(swap_std_reloc_out)
|
||||
PARAMS ((bfd *, arelent *, struct reloc_std_external *));
|
||||
|
||||
reloc_howto_type MY(howto_table)[] =
|
||||
{
|
||||
/* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask
|
||||
pcdone */
|
||||
HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true,
|
||||
0x000000ff, 0x000000ff, false),
|
||||
HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true,
|
||||
0x0000ffff, 0x0000ffff, false),
|
||||
HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true,
|
||||
0xffffffff, 0xffffffff, false),
|
||||
HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26),
|
||||
"ARM26", true, 0x00ffffff, 0x00ffffff, true),
|
||||
HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true,
|
||||
0x000000ff, 0x000000ff, true),
|
||||
HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true,
|
||||
0x0000ffff, 0x0000ffff, true),
|
||||
HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true,
|
||||
0xffffffff, 0xffffffff, true),
|
||||
HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed,
|
||||
MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0,
|
||||
false),
|
||||
EMPTY_HOWTO (-1),
|
||||
HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true,
|
||||
0x0000ffff, 0x0000ffff, false),
|
||||
HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true,
|
||||
0xffffffff, 0xffffffff, false)
|
||||
};
|
||||
{
|
||||
/* Type rs size bsz pcrel bitpos ovrf sf name part_inpl
|
||||
readmask setmask pcdone. */
|
||||
HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true,
|
||||
0x000000ff, 0x000000ff, false),
|
||||
HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true,
|
||||
0x0000ffff, 0x0000ffff, false),
|
||||
HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true,
|
||||
0xffffffff, 0xffffffff, false),
|
||||
HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26),
|
||||
"ARM26", true, 0x00ffffff, 0x00ffffff, true),
|
||||
HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true,
|
||||
0x000000ff, 0x000000ff, true),
|
||||
HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true,
|
||||
0x0000ffff, 0x0000ffff, true),
|
||||
HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true,
|
||||
0xffffffff, 0xffffffff, true),
|
||||
HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed,
|
||||
MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0,
|
||||
false),
|
||||
EMPTY_HOWTO (-1),
|
||||
HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true,
|
||||
0x0000ffff, 0x0000ffff, false),
|
||||
HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true,
|
||||
0xffffffff, 0xffffffff, false)
|
||||
};
|
||||
|
||||
#define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08)
|
||||
#define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10)
|
||||
|
|
@ -148,7 +158,7 @@ MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc)
|
|||
bfd *abfd;
|
||||
int r_extern;
|
||||
int r_index;
|
||||
long value;
|
||||
bfd_vma value;
|
||||
reloc_howto_type *howto;
|
||||
struct reloc_std_external *reloc;
|
||||
{
|
||||
|
|
@ -157,14 +167,16 @@ MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc)
|
|||
int r_neg;
|
||||
|
||||
PUT_WORD (abfd, value, reloc->r_address);
|
||||
r_length = howto->size ; /* Size as a power of two */
|
||||
/* Size as a power of two. */
|
||||
r_length = howto->size;
|
||||
|
||||
/* Special case for branch relocations. */
|
||||
if (howto->type == 3 || howto->type == 7)
|
||||
r_length = 3;
|
||||
|
||||
r_pcrel = howto->type & 4; /* PC Relative done? */
|
||||
r_neg = howto->type & 8; /* Negative relocation */
|
||||
r_pcrel = howto->type & 4; /* PC Relative done? */
|
||||
r_neg = howto->type & 8; /* Negative relocation. */
|
||||
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
reloc->r_index[0] = r_index >> 16;
|
||||
|
|
@ -255,10 +267,10 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section,
|
|||
{
|
||||
bfd_vma relocation;
|
||||
bfd_size_type addr = reloc_entry->address;
|
||||
long target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
|
||||
bfd_vma target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
|
||||
bfd_reloc_status_type flag = bfd_reloc_ok;
|
||||
|
||||
/* If this is an undefined symbol, return error */
|
||||
/* If this is an undefined symbol, return error. */
|
||||
if (symbol->section == &bfd_und_section
|
||||
&& (symbol->flags & BSF_WEAK) == 0)
|
||||
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
|
||||
|
|
@ -270,7 +282,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section,
|
|||
return bfd_reloc_ok;
|
||||
|
||||
relocation = (target & 0x00ffffff) << 2;
|
||||
relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */
|
||||
relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */
|
||||
relocation += symbol->value;
|
||||
relocation += symbol->section->output_section->vma;
|
||||
relocation += symbol->section->output_offset;
|
||||
|
|
@ -281,16 +293,16 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section,
|
|||
if (relocation & 3)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
/* Check for overflow */
|
||||
/* Check for overflow. */
|
||||
if (relocation & 0x02000000)
|
||||
{
|
||||
if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff)
|
||||
flag = bfd_reloc_overflow;
|
||||
}
|
||||
else if (relocation & ~0x03ffffff)
|
||||
else if (relocation & ~ (bfd_vma) 0x03ffffff)
|
||||
flag = bfd_reloc_overflow;
|
||||
|
||||
target &= ~0x00ffffff;
|
||||
target &= ~ (bfd_vma) 0x00ffffff;
|
||||
target |= (relocation >> 2) & 0x00ffffff;
|
||||
bfd_put_32 (abfd, target, (bfd_byte *) data + addr);
|
||||
|
||||
|
|
@ -313,7 +325,8 @@ MY(bfd_reloc_type_lookup) (abfd,code)
|
|||
case 32:
|
||||
code = BFD_RELOC_32;
|
||||
break;
|
||||
default: return (CONST struct reloc_howto_struct *) 0;
|
||||
default:
|
||||
return (const struct reloc_howto_struct *) 0;
|
||||
}
|
||||
|
||||
switch (code)
|
||||
|
|
@ -324,7 +337,8 @@ MY(bfd_reloc_type_lookup) (abfd,code)
|
|||
ASTD (BFD_RELOC_8_PCREL, 4);
|
||||
ASTD (BFD_RELOC_16_PCREL, 5);
|
||||
ASTD (BFD_RELOC_32_PCREL, 6);
|
||||
default: return (CONST struct reloc_howto_struct *) 0;
|
||||
default:
|
||||
return (const struct reloc_howto_struct *) 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +364,7 @@ MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount)
|
|||
int r_pcrel;
|
||||
struct aoutdata *su = &(abfd->tdata.aout_data->a);
|
||||
|
||||
cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address);
|
||||
cache_ptr->address = H_GET_32 (abfd, bytes->r_address);
|
||||
|
||||
cache_ptr->howto = MY_reloc_howto (abfd, bytes, r_index, r_extern, r_pcrel);
|
||||
|
||||
|
|
@ -419,25 +433,25 @@ MY_swap_std_reloc_out (abfd, g, natptr)
|
|||
if (bfd_abs_section.symbol == sym)
|
||||
{
|
||||
/* Whoops, looked like an abs symbol, but is really an offset
|
||||
from the abs section */
|
||||
from the abs section. */
|
||||
r_index = 0;
|
||||
r_extern = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fill in symbol */
|
||||
/* Fill in symbol. */
|
||||
r_extern = 1;
|
||||
r_index = (*(g->sym_ptr_ptr))->KEEPIT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Just an ordinary section */
|
||||
/* Just an ordinary section. */
|
||||
r_extern = 0;
|
||||
r_index = output_section->target_index;
|
||||
}
|
||||
|
||||
/* now the fun stuff */
|
||||
/* Now the fun stuff. */
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
natptr->r_index[0] = r_index >> 16;
|
||||
|
|
@ -469,83 +483,83 @@ MY_swap_std_reloc_out (abfd, g, natptr)
|
|||
extern const bfd_target aout_arm_big_vec;
|
||||
|
||||
const bfd_target aout_arm_little_vec =
|
||||
{
|
||||
"a.out-arm-little", /* name */
|
||||
bfd_target_aout_flavour,
|
||||
BFD_ENDIAN_LITTLE, /* target byte order (little) */
|
||||
BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
|
||||
(HAS_RELOC | EXEC_P | /* object flags */
|
||||
HAS_LINENO | HAS_DEBUG |
|
||||
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
|
||||
MY_symbol_leading_char,
|
||||
AR_PAD_CHAR, /* ar_pad_char */
|
||||
15, /* ar_max_namelen */
|
||||
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
|
||||
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
|
||||
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
|
||||
bfd_generic_archive_p, MY_core_file_p},
|
||||
{bfd_false, MY_mkobject, /* bfd_set_format */
|
||||
_bfd_generic_mkarchive, bfd_false},
|
||||
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
|
||||
_bfd_write_archive_contents, bfd_false},
|
||||
{
|
||||
"a.out-arm-little", /* name */
|
||||
bfd_target_aout_flavour,
|
||||
BFD_ENDIAN_LITTLE, /* target byte order (little) */
|
||||
BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
|
||||
(HAS_RELOC | EXEC_P | /* object flags */
|
||||
HAS_LINENO | HAS_DEBUG |
|
||||
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
|
||||
MY_symbol_leading_char,
|
||||
AR_PAD_CHAR, /* ar_pad_char */
|
||||
15, /* ar_max_namelen */
|
||||
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
|
||||
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
|
||||
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
|
||||
bfd_generic_archive_p, MY_core_file_p},
|
||||
{bfd_false, MY_mkobject, /* bfd_set_format */
|
||||
_bfd_generic_mkarchive, bfd_false},
|
||||
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
|
||||
_bfd_write_archive_contents, bfd_false},
|
||||
|
||||
BFD_JUMP_TABLE_GENERIC (MY),
|
||||
BFD_JUMP_TABLE_COPY (MY),
|
||||
BFD_JUMP_TABLE_CORE (MY),
|
||||
BFD_JUMP_TABLE_ARCHIVE (MY),
|
||||
BFD_JUMP_TABLE_SYMBOLS (MY),
|
||||
BFD_JUMP_TABLE_RELOCS (MY),
|
||||
BFD_JUMP_TABLE_WRITE (MY),
|
||||
BFD_JUMP_TABLE_LINK (MY),
|
||||
BFD_JUMP_TABLE_DYNAMIC (MY),
|
||||
BFD_JUMP_TABLE_GENERIC (MY),
|
||||
BFD_JUMP_TABLE_COPY (MY),
|
||||
BFD_JUMP_TABLE_CORE (MY),
|
||||
BFD_JUMP_TABLE_ARCHIVE (MY),
|
||||
BFD_JUMP_TABLE_SYMBOLS (MY),
|
||||
BFD_JUMP_TABLE_RELOCS (MY),
|
||||
BFD_JUMP_TABLE_WRITE (MY),
|
||||
BFD_JUMP_TABLE_LINK (MY),
|
||||
BFD_JUMP_TABLE_DYNAMIC (MY),
|
||||
|
||||
& aout_arm_big_vec,
|
||||
& aout_arm_big_vec,
|
||||
|
||||
(PTR) MY_backend_data,
|
||||
};
|
||||
(PTR) MY_backend_data,
|
||||
};
|
||||
|
||||
const bfd_target aout_arm_big_vec =
|
||||
{
|
||||
"a.out-arm-big", /* name */
|
||||
bfd_target_aout_flavour,
|
||||
BFD_ENDIAN_BIG, /* target byte order (big) */
|
||||
BFD_ENDIAN_BIG, /* target headers byte order (big) */
|
||||
(HAS_RELOC | EXEC_P | /* object flags */
|
||||
HAS_LINENO | HAS_DEBUG |
|
||||
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
|
||||
MY_symbol_leading_char,
|
||||
AR_PAD_CHAR, /* ar_pad_char */
|
||||
15, /* ar_max_namelen */
|
||||
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
||||
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
||||
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
|
||||
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
||||
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
||||
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
|
||||
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
|
||||
bfd_generic_archive_p, MY_core_file_p},
|
||||
{bfd_false, MY_mkobject, /* bfd_set_format */
|
||||
_bfd_generic_mkarchive, bfd_false},
|
||||
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
|
||||
_bfd_write_archive_contents, bfd_false},
|
||||
{
|
||||
"a.out-arm-big", /* name */
|
||||
bfd_target_aout_flavour,
|
||||
BFD_ENDIAN_BIG, /* target byte order (big) */
|
||||
BFD_ENDIAN_BIG, /* target headers byte order (big) */
|
||||
(HAS_RELOC | EXEC_P | /* object flags */
|
||||
HAS_LINENO | HAS_DEBUG |
|
||||
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
|
||||
MY_symbol_leading_char,
|
||||
AR_PAD_CHAR, /* ar_pad_char */
|
||||
15, /* ar_max_namelen */
|
||||
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
||||
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
||||
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
|
||||
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
||||
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
||||
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
|
||||
{_bfd_dummy_target, MY_object_p, /* bfd_check_format */
|
||||
bfd_generic_archive_p, MY_core_file_p},
|
||||
{bfd_false, MY_mkobject, /* bfd_set_format */
|
||||
_bfd_generic_mkarchive, bfd_false},
|
||||
{bfd_false, MY_write_object_contents, /* bfd_write_contents */
|
||||
_bfd_write_archive_contents, bfd_false},
|
||||
|
||||
BFD_JUMP_TABLE_GENERIC (MY),
|
||||
BFD_JUMP_TABLE_COPY (MY),
|
||||
BFD_JUMP_TABLE_CORE (MY),
|
||||
BFD_JUMP_TABLE_ARCHIVE (MY),
|
||||
BFD_JUMP_TABLE_SYMBOLS (MY),
|
||||
BFD_JUMP_TABLE_RELOCS (MY),
|
||||
BFD_JUMP_TABLE_WRITE (MY),
|
||||
BFD_JUMP_TABLE_LINK (MY),
|
||||
BFD_JUMP_TABLE_DYNAMIC (MY),
|
||||
BFD_JUMP_TABLE_GENERIC (MY),
|
||||
BFD_JUMP_TABLE_COPY (MY),
|
||||
BFD_JUMP_TABLE_CORE (MY),
|
||||
BFD_JUMP_TABLE_ARCHIVE (MY),
|
||||
BFD_JUMP_TABLE_SYMBOLS (MY),
|
||||
BFD_JUMP_TABLE_RELOCS (MY),
|
||||
BFD_JUMP_TABLE_WRITE (MY),
|
||||
BFD_JUMP_TABLE_LINK (MY),
|
||||
BFD_JUMP_TABLE_DYNAMIC (MY),
|
||||
|
||||
& aout_arm_little_vec,
|
||||
& aout_arm_little_vec,
|
||||
|
||||
(PTR) MY_backend_data,
|
||||
};
|
||||
(PTR) MY_backend_data,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* BFD back-end for a.out files encapsulated with COFF headers.
|
||||
Copyright 1990, 1991, 1994, 1995, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1990, 1991, 1994, 1995, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
|
@ -27,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#endif
|
||||
|
||||
#include "bfd.h"
|
||||
#include <sysdep.h>
|
||||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include <aout/aout64.h>
|
||||
#include "aout/aout64.h"
|
||||
#include "aout/stab_gnu.h"
|
||||
#include "aout/ar.h"
|
||||
#include "libaout.h" /* BFD a.out internal data structures */
|
||||
|
|
@ -45,39 +46,40 @@ encap_object_p (abfd)
|
|||
short coff_magic;
|
||||
struct external_exec exec_bytes;
|
||||
struct internal_exec exec;
|
||||
bfd_size_type amt = sizeof (magicbuf);
|
||||
|
||||
if (bfd_read ((PTR)magicbuf, 1, sizeof (magicbuf), abfd) !=
|
||||
sizeof (magicbuf))
|
||||
if (bfd_bread ((PTR) magicbuf, amt, abfd) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return 0;
|
||||
}
|
||||
|
||||
coff_magic = bfd_h_get_16 (abfd, magicbuf);
|
||||
coff_magic = H_GET_16 (abfd, magicbuf);
|
||||
if (coff_magic != COFF_MAGIC)
|
||||
return 0; /* Not an encap coff file */
|
||||
|
||||
__header_offset_temp==COFF_MAGIC ? sizeof (struct coffheader) : 0)
|
||||
(fseek ((f), HEADER_OFFSET((f)), 1))
|
||||
magic = H_GET_32 (abfd, magicbuf);
|
||||
|
||||
magic = bfd_h_get_32 (abfd, magicbuf);
|
||||
|
||||
if (N_BADMAG (*((struct internal_exec *) &magic))) return 0;
|
||||
|
||||
struct external_exec exec_bytes;
|
||||
if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
|
||||
!= EXEC_BYTES_SIZE) {
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
if (N_BADMAG (*((struct internal_exec *) &magic)))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) sizeof (struct coffheader), SEEK_SET) != 0)
|
||||
return 0;
|
||||
|
||||
amt = EXEC_BYTES_SIZE;
|
||||
if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return 0;
|
||||
}
|
||||
NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec);
|
||||
|
||||
return aout_32_some_aout_object_p (abfd, &exec, encap_realcallback);
|
||||
}
|
||||
|
||||
/* Finish up the reading of a encapsulated-coff a.out file header */
|
||||
/* Finish up the reading of an encapsulated-coff a.out file header. */
|
||||
const bfd_target *
|
||||
encap_real_callback (abfd)
|
||||
bfd *abfd;
|
||||
|
|
@ -90,24 +92,26 @@ encap_real_callback (abfd)
|
|||
text_start and exec_data_start. This is particularly useful
|
||||
for remote debugging of embedded systems. */
|
||||
if (N_FLAGS(exec_aouthdr) & N_FLAGS_COFF_ENCAPSULATE)
|
||||
{
|
||||
struct coffheader ch;
|
||||
int val;
|
||||
val = lseek (execchan, -(sizeof (AOUTHDR) + sizeof (ch)), 1);
|
||||
if (val == -1)
|
||||
perror_with_name (filename);
|
||||
val = myread (execchan, &ch, sizeof (ch));
|
||||
if (val < 0)
|
||||
perror_with_name (filename);
|
||||
text_start = ch.text_start;
|
||||
exec_data_start = ch.data_start;
|
||||
} else
|
||||
{
|
||||
text_start =
|
||||
IS_OBJECT_FILE (exec_aouthdr) ? 0 : N_TXTADDR (exec_aouthdr);
|
||||
exec_data_start = IS_OBJECT_FILE (exec_aouthdr)
|
||||
? exec_aouthdr.a_text : N_DATADDR (exec_aouthdr);
|
||||
}
|
||||
{
|
||||
struct coffheader ch;
|
||||
int val;
|
||||
val = lseek (execchan, -(sizeof (AOUTHDR) + sizeof (ch)), 1);
|
||||
if (val == -1)
|
||||
perror_with_name (filename);
|
||||
val = myread (execchan, &ch, sizeof (ch));
|
||||
if (val < 0)
|
||||
perror_with_name (filename);
|
||||
text_start = ch.text_start;
|
||||
exec_data_start = ch.data_start;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_start =
|
||||
IS_OBJECT_FILE (exec_aouthdr) ? 0 : N_TXTADDR (exec_aouthdr);
|
||||
exec_data_start = (IS_OBJECT_FILE (exec_aouthdr)
|
||||
? exec_aouthdr.a_text
|
||||
: N_DATADDR (exec_aouthdr));
|
||||
}
|
||||
|
||||
/* Determine the architecture and machine type of the object file. */
|
||||
bfd_default_set_arch_mach(abfd, bfd_arch_m68k, 0); /* FIXME */
|
||||
|
|
@ -127,10 +131,10 @@ encap_write_object_contents (abfd)
|
|||
struct external_exec exec_bytes;
|
||||
struct internal_exec *execp = exec_hdr (abfd);
|
||||
|
||||
/****** FIXME: Fragments from the old GNU LD program for dealing with
|
||||
encap coff. */
|
||||
struct coffheader coffheader;
|
||||
int need_coff_header;
|
||||
/* FIXME: Fragments from the old GNU LD program for dealing with
|
||||
encap coff. */
|
||||
struct coffheader coffheader;
|
||||
int need_coff_header;
|
||||
|
||||
/* Determine whether to count the header as part of
|
||||
the text size, and initialize the text size accordingly.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD backend for sparc little-endian aout binaries.
|
||||
Copyright 1996 Free Software Foundation, Inc.
|
||||
Copyright 1996, 2001 Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -19,7 +19,11 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define TARGETNAME "a.out-sparc-little"
|
||||
#define MY(OP) CAT(sparcle_aout_,OP)
|
||||
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (sparcle_aout_,OP)
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bfdlink.h"
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ MY(callback) (abfd)
|
|||
|
||||
/* Determine the architecture and machine type of the object file. */
|
||||
#ifdef SET_ARCH_MACH
|
||||
SET_ARCH_MACH(abfd, *execp);
|
||||
SET_ARCH_MACH (abfd, *execp);
|
||||
#else
|
||||
bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
|
||||
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
|
||||
#endif
|
||||
|
||||
/* The number of relocation records. This must be called after
|
||||
|
|
@ -146,18 +146,19 @@ MY(object_p) (abfd)
|
|||
struct external_exec exec_bytes; /* Raw exec header from file */
|
||||
struct internal_exec exec; /* Cleaned-up exec header */
|
||||
const bfd_target *target;
|
||||
bfd_size_type amt = EXEC_BYTES_SIZE;
|
||||
|
||||
if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
|
||||
!= EXEC_BYTES_SIZE) {
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return 0;
|
||||
}
|
||||
if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SWAP_MAGIC
|
||||
exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
|
||||
#else
|
||||
exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
|
||||
exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
|
||||
#endif /* SWAP_MAGIC */
|
||||
|
||||
if (N_BADMAG (exec)) return 0;
|
||||
|
|
@ -250,6 +251,8 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
|
|||
file header, symbols, and relocation. */
|
||||
|
||||
#ifndef MY_write_object_contents
|
||||
static boolean MY(write_object_contents) PARAMS ((bfd *));
|
||||
|
||||
static boolean
|
||||
MY(write_object_contents) (abfd)
|
||||
bfd *abfd;
|
||||
|
|
@ -326,7 +329,7 @@ MY(set_sizes) (abfd)
|
|||
#define MY_finish_dynamic_link 0
|
||||
#endif
|
||||
|
||||
static CONST struct aout_backend_data MY(backend_data) = {
|
||||
static const struct aout_backend_data MY(backend_data) = {
|
||||
MY_zmagic_contiguous,
|
||||
MY_text_includes_header,
|
||||
MY_entry_is_text_address,
|
||||
|
|
@ -507,6 +510,9 @@ MY_bfd_final_link (abfd, info)
|
|||
#ifndef MY_bfd_gc_sections
|
||||
#define MY_bfd_gc_sections bfd_generic_gc_sections
|
||||
#endif
|
||||
#ifndef MY_bfd_merge_sections
|
||||
#define MY_bfd_merge_sections bfd_generic_merge_sections
|
||||
#endif
|
||||
#ifndef MY_bfd_reloc_type_lookup
|
||||
#define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD backend for SunOS style a.out with flags set to 0
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
|
|
@ -20,7 +20,11 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define TARGETNAME "a.out-zero-big"
|
||||
#define MY(OP) CAT(aout0_big_,OP)
|
||||
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (aout0_big_,OP)
|
||||
|
||||
#include "bfd.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* A.out "format 1" file handling code for BFD.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
|
||||
2001, 2002
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ The name put into the target vector.
|
|||
#endif
|
||||
|
||||
static boolean sunos_merge_private_bfd_data PARAMS ((bfd *, bfd *));
|
||||
static void sunos_set_arch_mach PARAMS ((bfd *, int));
|
||||
static void sunos_set_arch_mach PARAMS ((bfd *, enum machine_type));
|
||||
static void choose_reloc_size PARAMS ((bfd *));
|
||||
static boolean sunos_write_object_contents PARAMS ((bfd *));
|
||||
static const bfd_target *sunos4_core_file_p PARAMS ((bfd *));
|
||||
|
|
@ -113,11 +114,11 @@ sunos_merge_private_bfd_data (ibfd, obfd)
|
|||
static void
|
||||
sunos_set_arch_mach (abfd, machtype)
|
||||
bfd *abfd;
|
||||
int machtype;
|
||||
enum machine_type machtype;
|
||||
{
|
||||
/* Determine the architecture and machine type of the object file. */
|
||||
enum bfd_architecture arch;
|
||||
long machine;
|
||||
unsigned long machine;
|
||||
switch (machtype)
|
||||
{
|
||||
|
||||
|
|
@ -259,7 +260,7 @@ sunos_write_object_contents (abfd)
|
|||
|
||||
N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
|
||||
|
||||
N_SET_DYNAMIC (*execp, bfd_get_file_flags (abfd) & DYNAMIC);
|
||||
N_SET_DYNAMIC (*execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC));
|
||||
|
||||
WRITE_HEADERS (abfd, execp);
|
||||
|
||||
|
|
@ -422,8 +423,8 @@ swapcore_sun3 (abfd, ext, intcore)
|
|||
{
|
||||
struct external_sun3_core *extcore = (struct external_sun3_core *) ext;
|
||||
|
||||
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic);
|
||||
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len);
|
||||
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
|
||||
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
|
||||
intcore->c_regs_pos = (long) (((struct external_sun3_core *) 0)->c_regs);
|
||||
intcore->c_regs_size = sizeof (extcore->c_regs);
|
||||
#if ARCH_SIZE == 64
|
||||
|
|
@ -432,20 +433,21 @@ swapcore_sun3 (abfd, ext, intcore)
|
|||
aout_32_swap_exec_header_in
|
||||
#endif
|
||||
(abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
|
||||
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo);
|
||||
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize);
|
||||
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize);
|
||||
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
|
||||
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
|
||||
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
|
||||
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
|
||||
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize);
|
||||
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
|
||||
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
|
||||
intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff);
|
||||
/* FP stuff takes up whole rest of struct, except c_ucode. */
|
||||
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
|
||||
(file_ptr) (((struct external_sun3_core *) 0)->fp_stuff);
|
||||
/* Ucode is the last thing in the struct -- just before the end */
|
||||
intcore->c_ucode =
|
||||
bfd_h_get_32 (abfd,
|
||||
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore);
|
||||
intcore->c_ucode = H_GET_32 (abfd,
|
||||
(intcore->c_len
|
||||
- sizeof (extcore->c_ucode)
|
||||
+ (unsigned char *) extcore));
|
||||
intcore->c_stacktop = 0x0E000000; /* By experimentation */
|
||||
}
|
||||
|
||||
|
|
@ -458,8 +460,8 @@ swapcore_sparc (abfd, ext, intcore)
|
|||
{
|
||||
struct external_sparc_core *extcore = (struct external_sparc_core *) ext;
|
||||
|
||||
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic);
|
||||
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len);
|
||||
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
|
||||
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
|
||||
intcore->c_regs_pos = (long) (((struct external_sparc_core *) 0)->c_regs);
|
||||
intcore->c_regs_size = sizeof (extcore->c_regs);
|
||||
#if ARCH_SIZE == 64
|
||||
|
|
@ -468,20 +470,21 @@ swapcore_sparc (abfd, ext, intcore)
|
|||
aout_32_swap_exec_header_in
|
||||
#endif
|
||||
(abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
|
||||
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo);
|
||||
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize);
|
||||
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize);
|
||||
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
|
||||
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
|
||||
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
|
||||
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
|
||||
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize);
|
||||
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
|
||||
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
|
||||
intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff);
|
||||
/* FP stuff takes up whole rest of struct, except c_ucode. */
|
||||
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
|
||||
(file_ptr) (((struct external_sparc_core *) 0)->fp_stuff);
|
||||
/* Ucode is the last thing in the struct -- just before the end */
|
||||
intcore->c_ucode =
|
||||
bfd_h_get_32 (abfd,
|
||||
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore);
|
||||
intcore->c_ucode = H_GET_32 (abfd,
|
||||
(intcore->c_len
|
||||
- sizeof (extcore->c_ucode)
|
||||
+ (unsigned char *) extcore));
|
||||
|
||||
/* Supposedly the user stack grows downward from the bottom of kernel memory.
|
||||
Presuming that this remains true, this definition will work. */
|
||||
|
|
@ -499,8 +502,7 @@ swapcore_sparc (abfd, ext, intcore)
|
|||
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
|
||||
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
|
||||
{
|
||||
bfd_vma sp = bfd_h_get_32
|
||||
(abfd, (unsigned char *) &((struct regs *) &extcore->c_regs[0])->r_o6);
|
||||
bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
|
||||
if (sp < SPARC_USRSTACK_SPARC10)
|
||||
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
|
||||
else
|
||||
|
|
@ -518,8 +520,8 @@ swapcore_solaris_bcp (abfd, ext, intcore)
|
|||
struct external_solaris_bcp_core *extcore =
|
||||
(struct external_solaris_bcp_core *) ext;
|
||||
|
||||
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic);
|
||||
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len);
|
||||
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
|
||||
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
|
||||
intcore->c_regs_pos = (long) (((struct external_solaris_bcp_core *) 0)->c_regs);
|
||||
intcore->c_regs_size = sizeof (extcore->c_regs);
|
||||
|
||||
|
|
@ -534,12 +536,11 @@ swapcore_solaris_bcp (abfd, ext, intcore)
|
|||
the data section is written from address zero instead of the data
|
||||
start address. */
|
||||
memset ((PTR) &intcore->c_aouthdr, 0, sizeof (struct internal_exec));
|
||||
intcore->c_data_addr =
|
||||
bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_exdata_datorg);
|
||||
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo);
|
||||
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize);
|
||||
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize);
|
||||
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize);
|
||||
intcore->c_data_addr = H_GET_32 (abfd, &extcore->c_exdata_datorg);
|
||||
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
|
||||
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
|
||||
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
|
||||
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
|
||||
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
|
||||
intcore->fp_stuff_pos =
|
||||
(long) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
|
||||
|
|
@ -547,9 +548,10 @@ swapcore_solaris_bcp (abfd, ext, intcore)
|
|||
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
|
||||
(file_ptr) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
|
||||
/* Ucode is the last thing in the struct -- just before the end */
|
||||
intcore->c_ucode =
|
||||
bfd_h_get_32 (abfd,
|
||||
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore);
|
||||
intcore->c_ucode = H_GET_32 (abfd,
|
||||
(intcore->c_len
|
||||
- sizeof (extcore->c_ucode)
|
||||
+ (unsigned char *) extcore));
|
||||
|
||||
/* Supposedly the user stack grows downward from the bottom of kernel memory.
|
||||
Presuming that this remains true, this definition will work. */
|
||||
|
|
@ -567,8 +569,7 @@ swapcore_solaris_bcp (abfd, ext, intcore)
|
|||
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
|
||||
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
|
||||
{
|
||||
bfd_vma sp = bfd_h_get_32
|
||||
(abfd, (unsigned char *) &((struct regs *) &extcore->c_regs[0])->r_o6);
|
||||
bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
|
||||
if (sp < SPARC_USRSTACK_SPARC10)
|
||||
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
|
||||
else
|
||||
|
|
@ -598,7 +599,7 @@ sunos4_core_file_p (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
unsigned char longbuf[4]; /* Raw bytes of various header fields */
|
||||
bfd_size_type core_size;
|
||||
bfd_size_type core_size, amt;
|
||||
unsigned long core_mag;
|
||||
struct internal_sunos_core *core;
|
||||
char *extcore;
|
||||
|
|
@ -607,38 +608,41 @@ sunos4_core_file_p (abfd)
|
|||
struct sun_core_struct suncoredata;
|
||||
struct internal_sunos_core internal_sunos_core;
|
||||
char external_core[1];
|
||||
}
|
||||
*mergem;
|
||||
} *mergem;
|
||||
|
||||
if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) !=
|
||||
sizeof (longbuf))
|
||||
if (bfd_bread ((PTR) longbuf, (bfd_size_type) sizeof (longbuf), abfd)
|
||||
!= sizeof (longbuf))
|
||||
return 0;
|
||||
core_mag = bfd_h_get_32 (abfd, longbuf);
|
||||
core_mag = H_GET_32 (abfd, longbuf);
|
||||
|
||||
if (core_mag != CORE_MAGIC)
|
||||
return 0;
|
||||
|
||||
/* SunOS core headers can vary in length; second word is size; */
|
||||
if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) !=
|
||||
sizeof (longbuf))
|
||||
if (bfd_bread ((PTR) longbuf, (bfd_size_type) sizeof (longbuf), abfd)
|
||||
!= sizeof (longbuf))
|
||||
return 0;
|
||||
core_size = bfd_h_get_32 (abfd, longbuf);
|
||||
core_size = H_GET_32 (abfd, longbuf);
|
||||
/* Sanity check */
|
||||
if (core_size > 20000)
|
||||
return 0;
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0)
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
||||
return 0;
|
||||
|
||||
mergem = (struct mergem *) bfd_zalloc (abfd, core_size + sizeof (struct mergem));
|
||||
amt = core_size + sizeof (struct mergem);
|
||||
mergem = (struct mergem *) bfd_zalloc (abfd, amt);
|
||||
if (mergem == NULL)
|
||||
return 0;
|
||||
|
||||
extcore = mergem->external_core;
|
||||
|
||||
if ((bfd_read ((PTR) extcore, 1, core_size, abfd)) != core_size)
|
||||
if ((bfd_bread ((PTR) extcore, core_size, abfd)) != core_size)
|
||||
{
|
||||
loser:
|
||||
bfd_release (abfd, (char *) mergem);
|
||||
abfd->tdata.any = NULL;
|
||||
bfd_section_list_clear (abfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -659,47 +663,29 @@ sunos4_core_file_p (abfd)
|
|||
break;
|
||||
default:
|
||||
bfd_set_error (bfd_error_system_call); /* FIXME */
|
||||
bfd_release (abfd, (char *) mergem);
|
||||
return 0;
|
||||
goto loser;
|
||||
}
|
||||
|
||||
abfd->tdata.sun_core_data = &mergem->suncoredata;
|
||||
abfd->tdata.sun_core_data->hdr = core;
|
||||
|
||||
/* create the sections. This is raunchy, but bfd_close wants to reclaim
|
||||
them */
|
||||
core_stacksec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
|
||||
/* Create the sections. */
|
||||
core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack");
|
||||
if (core_stacksec (abfd) == NULL)
|
||||
{
|
||||
loser:
|
||||
bfd_release (abfd, (char *) mergem);
|
||||
return 0;
|
||||
}
|
||||
core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
|
||||
if (core_datasec (abfd) == NULL)
|
||||
{
|
||||
loser1:
|
||||
bfd_release (abfd, core_stacksec (abfd));
|
||||
goto loser;
|
||||
}
|
||||
core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
|
||||
if (core_regsec (abfd) == NULL)
|
||||
{
|
||||
loser2:
|
||||
bfd_release (abfd, core_datasec (abfd));
|
||||
goto loser1;
|
||||
}
|
||||
core_reg2sec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
|
||||
if (core_reg2sec (abfd) == NULL)
|
||||
{
|
||||
bfd_release (abfd, core_regsec (abfd));
|
||||
goto loser2;
|
||||
}
|
||||
/* bfd_release frees everything allocated after it's arg. */
|
||||
goto loser;
|
||||
|
||||
core_stacksec (abfd)->name = ".stack";
|
||||
core_datasec (abfd)->name = ".data";
|
||||
core_regsec (abfd)->name = ".reg";
|
||||
core_reg2sec (abfd)->name = ".reg2";
|
||||
core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data");
|
||||
if (core_datasec (abfd) == NULL)
|
||||
goto loser;
|
||||
|
||||
core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg");
|
||||
if (core_regsec (abfd) == NULL)
|
||||
goto loser;
|
||||
|
||||
core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2");
|
||||
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;
|
||||
|
|
@ -728,13 +714,6 @@ sunos4_core_file_p (abfd)
|
|||
core_regsec (abfd)->alignment_power = 2;
|
||||
core_reg2sec (abfd)->alignment_power = 2;
|
||||
|
||||
abfd->sections = core_stacksec (abfd);
|
||||
core_stacksec (abfd)->next = core_datasec (abfd);
|
||||
core_datasec (abfd)->next = core_regsec (abfd);
|
||||
core_regsec (abfd)->next = core_reg2sec (abfd);
|
||||
|
||||
abfd->section_count = 4;
|
||||
|
||||
return abfd->xvec;
|
||||
}
|
||||
|
||||
|
|
@ -822,7 +801,7 @@ sunos4_set_sizes (abfd)
|
|||
#define MY_finish_dynamic_link 0
|
||||
#endif
|
||||
|
||||
static CONST struct aout_backend_data sunos4_aout_backend =
|
||||
static const struct aout_backend_data sunos4_aout_backend =
|
||||
{
|
||||
0, /* zmagic files are not contiguous */
|
||||
1, /* text includes header */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
/* BFD back-end for archive files (libraries).
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
2000
|
||||
2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ DESCRIPTION
|
|||
#include "libbfd.h"
|
||||
#include "aout/ar.h"
|
||||
#include "aout/ranlib.h"
|
||||
#include <ctype.h>
|
||||
#include "safe-ctype.h"
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
|
|
@ -142,12 +142,6 @@ extern int errno;
|
|||
#define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB)
|
||||
#endif
|
||||
|
||||
/* Define offsetof for those systems which lack it */
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
|
||||
#endif
|
||||
|
||||
/* We keep a cache of archive filepointers to archive elements to
|
||||
speed up searching the archive by filepos. We only add an entry to
|
||||
the cache when we actually read one. We also don't sort the cache;
|
||||
|
|
@ -170,6 +164,7 @@ static char *get_extended_arelt_filename PARAMS ((bfd *arch,
|
|||
const char *name));
|
||||
static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd));
|
||||
static boolean do_slurp_coff_armap PARAMS ((bfd *abfd));
|
||||
boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *abfd));
|
||||
static const char *normalize PARAMS ((bfd *, const char *file));
|
||||
static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd,
|
||||
const char *,
|
||||
|
|
@ -179,9 +174,9 @@ boolean
|
|||
_bfd_generic_mkarchive (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
abfd->tdata.aout_ar_data = ((struct artdata *)
|
||||
bfd_zalloc (abfd, sizeof (struct artdata)));
|
||||
bfd_size_type amt = sizeof (struct artdata);
|
||||
|
||||
abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
|
||||
if (bfd_ardata (abfd) == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -290,10 +285,9 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
|
|||
bfd *arch_bfd, *new_elt;
|
||||
file_ptr filepos;
|
||||
{
|
||||
struct ar_cache *new_cache = ((struct ar_cache *)
|
||||
bfd_zalloc (arch_bfd,
|
||||
sizeof (struct ar_cache)));
|
||||
bfd_size_type amt = sizeof (struct ar_cache);
|
||||
|
||||
struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt);
|
||||
if (new_cache == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -364,14 +358,14 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
|
|||
{
|
||||
struct ar_hdr hdr;
|
||||
char *hdrp = (char *) &hdr;
|
||||
unsigned int parsed_size;
|
||||
size_t parsed_size;
|
||||
struct areltdata *ared;
|
||||
char *filename = NULL;
|
||||
unsigned int namelen = 0;
|
||||
unsigned int allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);
|
||||
bfd_size_type namelen = 0;
|
||||
bfd_size_type allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);
|
||||
char *allocptr = 0;
|
||||
|
||||
if (bfd_read ((PTR) hdrp, 1, sizeof (struct ar_hdr), abfd)
|
||||
if (bfd_bread ((PTR) hdrp, (bfd_size_type) sizeof (struct ar_hdr), abfd)
|
||||
!= sizeof (struct ar_hdr))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
|
|
@ -414,7 +408,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
|
|||
else if (hdr.ar_name[0] == '#'
|
||||
&& hdr.ar_name[1] == '1'
|
||||
&& hdr.ar_name[2] == '/'
|
||||
&& isdigit ((unsigned char) hdr.ar_name[3]))
|
||||
&& ISDIGIT (hdr.ar_name[3]))
|
||||
{
|
||||
/* BSD-4.4 extended name */
|
||||
namelen = atoi (&hdr.ar_name[3]);
|
||||
|
|
@ -427,7 +421,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
|
|||
filename = (allocptr
|
||||
+ sizeof (struct areltdata)
|
||||
+ sizeof (struct ar_hdr));
|
||||
if (bfd_read (filename, 1, namelen, abfd) != namelen)
|
||||
if (bfd_bread (filename, namelen, abfd) != namelen)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_no_more_archived_files);
|
||||
|
|
@ -482,7 +476,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
|
|||
ared->filename = allocptr + (sizeof (struct areltdata) +
|
||||
sizeof (struct ar_hdr));
|
||||
if (namelen)
|
||||
memcpy (ared->filename, hdr.ar_name, namelen);
|
||||
memcpy (ared->filename, hdr.ar_name, (size_t) namelen);
|
||||
ared->filename[namelen] = '\0';
|
||||
}
|
||||
|
||||
|
|
@ -607,10 +601,11 @@ bfd_generic_archive_p (abfd)
|
|||
{
|
||||
struct artdata *tdata_hold;
|
||||
char armag[SARMAG + 1];
|
||||
bfd_size_type amt;
|
||||
|
||||
tdata_hold = abfd->tdata.aout_ar_data;
|
||||
|
||||
if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG)
|
||||
if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -628,8 +623,8 @@ bfd_generic_archive_p (abfd)
|
|||
|
||||
/* We are setting bfd_ardata(abfd) here, but since bfd_ardata
|
||||
involves a cast, we can't do it as the left operand of assignment. */
|
||||
abfd->tdata.aout_ar_data = ((struct artdata *)
|
||||
bfd_zalloc (abfd, sizeof (struct artdata)));
|
||||
amt = sizeof (struct artdata);
|
||||
abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
|
||||
|
||||
if (bfd_ardata (abfd) == NULL)
|
||||
return NULL;
|
||||
|
|
@ -684,15 +679,19 @@ bfd_generic_archive_p (abfd)
|
|||
if (bfd_check_format (first, bfd_object)
|
||||
&& first->xvec != abfd->xvec)
|
||||
{
|
||||
#if 0
|
||||
/* We ought to close `first' here, but we can't, because
|
||||
we have no way to remove it from the archive cache.
|
||||
It's close to impossible to figure out when we can
|
||||
release bfd_ardata. FIXME. */
|
||||
(void) bfd_close (first);
|
||||
bfd_release (abfd, bfd_ardata (abfd));
|
||||
abfd->tdata.aout_ar_data = tdata_hold;
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
#endif
|
||||
bfd_set_error (bfd_error_wrong_object_format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* We ought to close first here, but we can't, because we
|
||||
have no way to remove it from the archive cache. FIXME. */
|
||||
/* And we ought to close `first' here too. */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -702,7 +701,7 @@ bfd_generic_archive_p (abfd)
|
|||
/* Some constants for a 32 bit BSD archive structure. We do not
|
||||
support 64 bit archives presently; so far as I know, none actually
|
||||
exist. Supporting them would require changing these constants, and
|
||||
changing some bfd_h_get_32 to bfd_h_get_64. */
|
||||
changing some H_GET_32 to H_GET_64. */
|
||||
|
||||
/* The size of an external symdef structure. */
|
||||
#define BSD_SYMDEF_SIZE 8
|
||||
|
|
@ -727,7 +726,7 @@ do_slurp_bsd_armap (abfd)
|
|||
bfd_byte *raw_armap, *rbase;
|
||||
struct artdata *ardata = bfd_ardata (abfd);
|
||||
char *stringbase;
|
||||
unsigned int parsed_size;
|
||||
bfd_size_type parsed_size, amt;
|
||||
carsym *set;
|
||||
|
||||
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
|
||||
|
|
@ -740,7 +739,7 @@ do_slurp_bsd_armap (abfd)
|
|||
if (raw_armap == (bfd_byte *) NULL)
|
||||
return false;
|
||||
|
||||
if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)
|
||||
if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -749,7 +748,7 @@ do_slurp_bsd_armap (abfd)
|
|||
return false;
|
||||
}
|
||||
|
||||
ardata->symdef_count = bfd_h_get_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;
|
||||
ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;
|
||||
|
||||
if (ardata->symdef_count * BSD_SYMDEF_SIZE >
|
||||
parsed_size - BSD_SYMDEF_COUNT_SIZE)
|
||||
|
|
@ -764,9 +763,8 @@ do_slurp_bsd_armap (abfd)
|
|||
stringbase = ((char *) rbase
|
||||
+ ardata->symdef_count * BSD_SYMDEF_SIZE
|
||||
+ BSD_STRING_COUNT_SIZE);
|
||||
ardata->symdefs = (carsym *) bfd_alloc (abfd,
|
||||
(ardata->symdef_count
|
||||
* sizeof (carsym)));
|
||||
amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym);
|
||||
ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
|
||||
if (!ardata->symdefs)
|
||||
return false;
|
||||
|
||||
|
|
@ -774,8 +772,8 @@ do_slurp_bsd_armap (abfd)
|
|||
counter < ardata->symdef_count;
|
||||
counter++, set++, rbase += BSD_SYMDEF_SIZE)
|
||||
{
|
||||
set->name = bfd_h_get_32 (abfd, rbase) + stringbase;
|
||||
set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
|
||||
set->name = H_GET_32 (abfd, rbase) + stringbase;
|
||||
set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
|
||||
}
|
||||
|
||||
ardata->first_file_filepos = bfd_tell (abfd);
|
||||
|
|
@ -798,13 +796,14 @@ do_slurp_coff_armap (abfd)
|
|||
int *raw_armap, *rawptr;
|
||||
struct artdata *ardata = bfd_ardata (abfd);
|
||||
char *stringbase;
|
||||
unsigned int stringsize;
|
||||
bfd_size_type stringsize;
|
||||
unsigned int parsed_size;
|
||||
carsym *carsyms;
|
||||
unsigned int nsymz; /* Number of symbols in armap. */
|
||||
bfd_size_type nsymz; /* Number of symbols in armap. */
|
||||
bfd_vma (*swap) PARAMS ((const bfd_byte *));
|
||||
char int_buf[sizeof (long)];
|
||||
unsigned int carsym_size, ptrsize, i;
|
||||
bfd_size_type carsym_size, ptrsize;
|
||||
unsigned int i;
|
||||
|
||||
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
|
||||
if (mapdata == NULL)
|
||||
|
|
@ -812,7 +811,7 @@ do_slurp_coff_armap (abfd)
|
|||
parsed_size = mapdata->parsed_size;
|
||||
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
|
||||
|
||||
if (bfd_read ((PTR) int_buf, 1, 4, abfd) != 4)
|
||||
if (bfd_bread ((PTR) int_buf, (bfd_size_type) 4, abfd) != 4)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -857,8 +856,8 @@ do_slurp_coff_armap (abfd)
|
|||
raw_armap = (int *) bfd_alloc (abfd, ptrsize);
|
||||
if (raw_armap == NULL)
|
||||
goto release_symdefs;
|
||||
if (bfd_read ((PTR) raw_armap, 1, ptrsize, abfd) != ptrsize
|
||||
|| bfd_read ((PTR) stringbase, 1, stringsize, abfd) != stringsize)
|
||||
if (bfd_bread ((PTR) raw_armap, ptrsize, abfd) != ptrsize
|
||||
|| (bfd_bread ((PTR) stringbase, stringsize, abfd) != stringsize))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -888,7 +887,7 @@ do_slurp_coff_armap (abfd)
|
|||
{
|
||||
struct areltdata *tmp;
|
||||
|
||||
bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
|
||||
bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
|
||||
tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd);
|
||||
if (tmp != NULL)
|
||||
{
|
||||
|
|
@ -896,7 +895,7 @@ do_slurp_coff_armap (abfd)
|
|||
&& tmp->arch_header[1] == ' ')
|
||||
{
|
||||
ardata->first_file_filepos +=
|
||||
(tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1;
|
||||
(tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~(unsigned) 1;
|
||||
}
|
||||
bfd_release (abfd, tmp);
|
||||
}
|
||||
|
|
@ -919,14 +918,14 @@ bfd_slurp_armap (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
char nextname[17];
|
||||
int i = bfd_read ((PTR) nextname, 1, 16, abfd);
|
||||
int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
|
||||
|
||||
if (i == 0)
|
||||
return true;
|
||||
if (i != 16)
|
||||
return false;
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
|
||||
return false;
|
||||
|
||||
if (!strncmp (nextname, "__.SYMDEF ", 16)
|
||||
|
|
@ -936,9 +935,13 @@ bfd_slurp_armap (abfd)
|
|||
return do_slurp_coff_armap (abfd);
|
||||
else if (!strncmp (nextname, "/SYM64/ ", 16))
|
||||
{
|
||||
/* Irix 6 archive--must be recognized by code in elf64-mips.c. */
|
||||
/* 64bit ELF (Irix 6) archive. */
|
||||
#ifdef BFD64
|
||||
return bfd_elf64_archive_slurp_armap (abfd);
|
||||
#else
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bfd_has_map (abfd) = false;
|
||||
|
|
@ -963,8 +966,9 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
struct artdata *ardata = bfd_ardata (abfd);
|
||||
char *stringbase;
|
||||
unsigned int stringsize;
|
||||
bfd_size_type amt;
|
||||
carsym *set;
|
||||
int i = bfd_read ((PTR) nextname, 1, 16, abfd);
|
||||
int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
|
||||
|
||||
if (i == 0)
|
||||
return true;
|
||||
|
|
@ -972,7 +976,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
return false;
|
||||
|
||||
/* The archive has at least 16 bytes in it. */
|
||||
if (bfd_seek (abfd, -16L, SEEK_CUR) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
|
||||
return false;
|
||||
|
||||
if (!strncmp (nextname, "__.SYMDEF ", 16)
|
||||
|
|
@ -989,7 +993,8 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
if (mapdata == NULL)
|
||||
return false;
|
||||
|
||||
raw_armap = (bfd_byte *) bfd_zalloc (abfd, mapdata->parsed_size);
|
||||
amt = mapdata->parsed_size;
|
||||
raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt);
|
||||
if (raw_armap == NULL)
|
||||
{
|
||||
byebye:
|
||||
|
|
@ -997,8 +1002,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (bfd_read ((PTR) raw_armap, 1, mapdata->parsed_size, abfd) !=
|
||||
mapdata->parsed_size)
|
||||
if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -1007,7 +1011,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
goto byebye;
|
||||
}
|
||||
|
||||
ardata->symdef_count = bfd_h_get_16 (abfd, (PTR) raw_armap);
|
||||
ardata->symdef_count = H_GET_16 (abfd, (PTR) raw_armap);
|
||||
|
||||
if (ardata->symdef_count * BSD_SYMDEF_SIZE
|
||||
> mapdata->parsed_size - HPUX_SYMDEF_COUNT_SIZE)
|
||||
|
|
@ -1019,15 +1023,14 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
|
||||
ardata->cache = 0;
|
||||
|
||||
stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
|
||||
stringsize = H_GET_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
|
||||
/* Skip sym count and string sz. */
|
||||
stringbase = ((char *) raw_armap
|
||||
+ HPUX_SYMDEF_COUNT_SIZE
|
||||
+ BSD_STRING_COUNT_SIZE);
|
||||
rbase = (bfd_byte *) stringbase + stringsize;
|
||||
ardata->symdefs = (carsym *) bfd_alloc (abfd,
|
||||
(ardata->symdef_count
|
||||
* BSD_SYMDEF_SIZE));
|
||||
amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE;
|
||||
ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
|
||||
if (!ardata->symdefs)
|
||||
return false;
|
||||
|
||||
|
|
@ -1035,8 +1038,8 @@ bfd_slurp_bsd_armap_f2 (abfd)
|
|||
counter < ardata->symdef_count;
|
||||
counter++, set++, rbase += BSD_SYMDEF_SIZE)
|
||||
{
|
||||
set->name = bfd_h_get_32 (abfd, rbase) + stringbase;
|
||||
set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
|
||||
set->name = H_GET_32 (abfd, rbase) + stringbase;
|
||||
set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
|
||||
}
|
||||
|
||||
ardata->first_file_filepos = bfd_tell (abfd);
|
||||
|
|
@ -1067,13 +1070,14 @@ _bfd_slurp_extended_name_table (abfd)
|
|||
{
|
||||
char nextname[17];
|
||||
struct areltdata *namedata;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* FIXME: Formatting sucks here, and in case of failure of BFD_READ,
|
||||
we probably don't want to return true. */
|
||||
bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET);
|
||||
if (bfd_read ((PTR) nextname, 1, 16, abfd) == 16)
|
||||
if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16)
|
||||
{
|
||||
if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
|
||||
return false;
|
||||
|
||||
if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 &&
|
||||
|
|
@ -1087,8 +1091,8 @@ _bfd_slurp_extended_name_table (abfd)
|
|||
if (namedata == NULL)
|
||||
return false;
|
||||
|
||||
bfd_ardata (abfd)->extended_names =
|
||||
bfd_zalloc (abfd, namedata->parsed_size);
|
||||
amt = namedata->parsed_size;
|
||||
bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt);
|
||||
if (bfd_ardata (abfd)->extended_names == NULL)
|
||||
{
|
||||
byebye:
|
||||
|
|
@ -1096,8 +1100,7 @@ _bfd_slurp_extended_name_table (abfd)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (bfd_read ((PTR) bfd_ardata (abfd)->extended_names, 1,
|
||||
namedata->parsed_size, abfd) != namedata->parsed_size)
|
||||
if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -1147,8 +1150,8 @@ normalize (abfd, file)
|
|||
bfd *abfd;
|
||||
const char *file;
|
||||
{
|
||||
CONST char *first;
|
||||
CONST char *last;
|
||||
const char *first;
|
||||
const char *last;
|
||||
char *copy;
|
||||
|
||||
first = file + strlen (file) - 1;
|
||||
|
|
@ -1166,7 +1169,7 @@ normalize (abfd, file)
|
|||
first--;
|
||||
}
|
||||
|
||||
copy = (char *) bfd_alloc (abfd, last - first + 1);
|
||||
copy = (char *) bfd_alloc (abfd, (bfd_size_type) (last - first + 1));
|
||||
if (copy == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1244,7 +1247,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
|
|||
bfd_size_type *tablen;
|
||||
{
|
||||
unsigned int maxname = abfd->xvec->ar_max_namelen;
|
||||
unsigned int total_namelen = 0;
|
||||
bfd_size_type total_namelen = 0;
|
||||
bfd *current;
|
||||
char *strptr;
|
||||
|
||||
|
|
@ -1392,6 +1395,7 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
|
|||
struct areltdata *ared;
|
||||
struct ar_hdr *hdr;
|
||||
char *temp, *temp1;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (member && (member->flags & BFD_IN_MEMORY) != 0)
|
||||
{
|
||||
|
|
@ -1409,8 +1413,8 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ared = (struct areltdata *) bfd_zalloc (abfd, sizeof (struct ar_hdr) +
|
||||
sizeof (struct areltdata));
|
||||
amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
|
||||
ared = (struct areltdata *) bfd_zalloc (abfd, amt);
|
||||
if (ared == NULL)
|
||||
return NULL;
|
||||
hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata));
|
||||
|
|
@ -1537,7 +1541,7 @@ bfd_generic_stat_arch_elt (abfd, buf)
|
|||
void
|
||||
bfd_dont_truncate_arname (abfd, pathname, arhdr)
|
||||
bfd *abfd;
|
||||
CONST char *pathname;
|
||||
const char *pathname;
|
||||
char *arhdr;
|
||||
{
|
||||
/* FIXME: This interacts unpleasantly with ar's quick-append option.
|
||||
|
|
@ -1577,13 +1581,13 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr)
|
|||
void
|
||||
bfd_bsd_truncate_arname (abfd, pathname, arhdr)
|
||||
bfd *abfd;
|
||||
CONST char *pathname;
|
||||
const char *pathname;
|
||||
char *arhdr;
|
||||
{
|
||||
struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
|
||||
int length;
|
||||
CONST char *filename = strrchr (pathname, '/');
|
||||
int maxlen = ar_maxnamelen (abfd);
|
||||
size_t length;
|
||||
const char *filename = strrchr (pathname, '/');
|
||||
size_t maxlen = ar_maxnamelen (abfd);
|
||||
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
{
|
||||
|
|
@ -1628,13 +1632,13 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr)
|
|||
void
|
||||
bfd_gnu_truncate_arname (abfd, pathname, arhdr)
|
||||
bfd *abfd;
|
||||
CONST char *pathname;
|
||||
const char *pathname;
|
||||
char *arhdr;
|
||||
{
|
||||
struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
|
||||
int length;
|
||||
CONST char *filename = strrchr (pathname, '/');
|
||||
int maxlen = ar_maxnamelen (abfd);
|
||||
size_t length;
|
||||
const char *filename = strrchr (pathname, '/');
|
||||
size_t maxlen = ar_maxnamelen (abfd);
|
||||
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
{
|
||||
|
|
@ -1733,16 +1737,16 @@ _bfd_write_archive_contents (arch)
|
|||
if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0)
|
||||
return false;
|
||||
#ifdef GNU960
|
||||
wrote = bfd_write (BFD_GNU960_ARMAG (arch), 1, SARMAG, arch);
|
||||
wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch);
|
||||
#else
|
||||
wrote = bfd_write (ARMAG, 1, SARMAG, arch);
|
||||
wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch);
|
||||
#endif
|
||||
if (wrote != SARMAG)
|
||||
return false;
|
||||
|
||||
if (makemap && hasobjects)
|
||||
{
|
||||
if (_bfd_compute_and_write_armap (arch, elength) != true)
|
||||
if (_bfd_compute_and_write_armap (arch, (unsigned int) elength) != true)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1754,18 +1758,18 @@ _bfd_write_archive_contents (arch)
|
|||
strcpy (hdr.ar_name, ename);
|
||||
/* Round size up to even number in archive header. */
|
||||
sprintf (&(hdr.ar_size[0]), "%-10d",
|
||||
(int) ((elength + 1) & ~1));
|
||||
(int) ((elength + 1) & ~(bfd_size_type) 1));
|
||||
strncpy (hdr.ar_fmag, ARFMAG, 2);
|
||||
for (i = 0; i < sizeof (struct ar_hdr); i++)
|
||||
if (((char *) (&hdr))[i] == '\0')
|
||||
(((char *) (&hdr))[i]) = ' ';
|
||||
if ((bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch)
|
||||
if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
|
||||
!= sizeof (struct ar_hdr))
|
||||
|| bfd_write (etable, 1, elength, arch) != elength)
|
||||
|| bfd_bwrite (etable, elength, arch) != elength)
|
||||
return false;
|
||||
if ((elength % 2) == 1)
|
||||
{
|
||||
if (bfd_write ("\012", 1, 1, arch) != 1)
|
||||
if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1777,7 +1781,8 @@ _bfd_write_archive_contents (arch)
|
|||
struct ar_hdr *hdr = arch_hdr (current);
|
||||
|
||||
/* Write ar header. */
|
||||
if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr))
|
||||
if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch)
|
||||
!= sizeof (*hdr))
|
||||
return false;
|
||||
if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
|
||||
return false;
|
||||
|
|
@ -1787,19 +1792,19 @@ _bfd_write_archive_contents (arch)
|
|||
if (amt > remaining)
|
||||
amt = remaining;
|
||||
errno = 0;
|
||||
if (bfd_read (buffer, amt, 1, current) != amt)
|
||||
if (bfd_bread (buffer, (bfd_size_type) amt, current) != amt)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
return false;
|
||||
}
|
||||
if (bfd_write (buffer, amt, 1, arch) != amt)
|
||||
if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt)
|
||||
return false;
|
||||
remaining -= amt;
|
||||
}
|
||||
if ((arelt_size (current) % 2) == 1)
|
||||
{
|
||||
if (bfd_write ("\012", 1, 1, arch) != 1)
|
||||
if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1837,25 +1842,27 @@ _bfd_compute_and_write_armap (arch, elength)
|
|||
bfd *current;
|
||||
file_ptr elt_no = 0;
|
||||
struct orl *map = NULL;
|
||||
int orl_max = 1024; /* fine initial default */
|
||||
int orl_count = 0;
|
||||
unsigned int orl_max = 1024; /* fine initial default */
|
||||
unsigned int orl_count = 0;
|
||||
int stridx = 0; /* string index */
|
||||
asymbol **syms = NULL;
|
||||
long syms_max = 0;
|
||||
boolean ret;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Dunno if this is the best place for this info... */
|
||||
if (elength != 0)
|
||||
elength += sizeof (struct ar_hdr);
|
||||
elength += elength % 2;
|
||||
|
||||
map = (struct orl *) bfd_malloc (orl_max * sizeof (struct orl));
|
||||
amt = (bfd_size_type) orl_max * sizeof (struct orl);
|
||||
map = (struct orl *) bfd_malloc (amt);
|
||||
if (map == NULL)
|
||||
goto error_return;
|
||||
|
||||
/* We put the symbol names on the arch objalloc, and then discard
|
||||
them when done. */
|
||||
first_name = bfd_alloc (arch, 1);
|
||||
first_name = bfd_alloc (arch, (bfd_size_type) 1);
|
||||
if (first_name == NULL)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1887,7 +1894,7 @@ _bfd_compute_and_write_armap (arch, elength)
|
|||
if (syms_max > 0)
|
||||
free (syms);
|
||||
syms_max = storage;
|
||||
syms = (asymbol **) bfd_malloc ((size_t) syms_max);
|
||||
syms = (asymbol **) bfd_malloc ((bfd_size_type) syms_max);
|
||||
if (syms == NULL)
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -1908,16 +1915,15 @@ _bfd_compute_and_write_armap (arch, elength)
|
|||
bfd_is_com_section (sec))
|
||||
&& ! bfd_is_und_section (sec))
|
||||
{
|
||||
size_t namelen;
|
||||
bfd_size_type namelen;
|
||||
struct orl *new_map;
|
||||
|
||||
/* This symbol will go into the archive header. */
|
||||
if (orl_count == orl_max)
|
||||
{
|
||||
orl_max *= 2;
|
||||
new_map =
|
||||
((struct orl *)
|
||||
bfd_realloc (map, orl_max * sizeof (struct orl)));
|
||||
amt = (bfd_size_type) orl_max * sizeof (struct orl);
|
||||
new_map = (struct orl *) bfd_realloc (map, amt);
|
||||
if (new_map == (struct orl *) NULL)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1925,17 +1931,16 @@ _bfd_compute_and_write_armap (arch, elength)
|
|||
}
|
||||
|
||||
namelen = strlen (syms[src_count]->name);
|
||||
map[orl_count].name = ((char **)
|
||||
bfd_alloc (arch,
|
||||
sizeof (char *)));
|
||||
amt = sizeof (char *);
|
||||
map[orl_count].name = (char **) bfd_alloc (arch, amt);
|
||||
if (map[orl_count].name == NULL)
|
||||
goto error_return;
|
||||
*(map[orl_count].name) = bfd_alloc (arch, namelen + 1);
|
||||
if (*(map[orl_count].name) == NULL)
|
||||
goto error_return;
|
||||
strcpy (*(map[orl_count].name), syms[src_count]->name);
|
||||
(map[orl_count]).pos = (file_ptr) current;
|
||||
(map[orl_count]).namidx = stridx;
|
||||
map[orl_count].u.abfd = current;
|
||||
map[orl_count].namidx = stridx;
|
||||
|
||||
stridx += namelen + 1;
|
||||
++orl_count;
|
||||
|
|
@ -2013,18 +2018,18 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
|
|||
for (i = 0; i < sizeof (struct ar_hdr); i++)
|
||||
if (((char *) (&hdr))[i] == '\0')
|
||||
(((char *) (&hdr))[i]) = ' ';
|
||||
if (bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch)
|
||||
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
|
||||
!= sizeof (struct ar_hdr))
|
||||
return false;
|
||||
bfd_h_put_32 (arch, (bfd_vma) ranlibsize, temp);
|
||||
if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp))
|
||||
H_PUT_32 (arch, ranlibsize, temp);
|
||||
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
|
||||
return false;
|
||||
|
||||
for (count = 0; count < orl_count; count++)
|
||||
{
|
||||
bfd_byte buf[BSD_SYMDEF_SIZE];
|
||||
|
||||
if (((bfd *) (map[count]).pos) != last_elt)
|
||||
if (map[count].u.abfd != last_elt)
|
||||
{
|
||||
do
|
||||
{
|
||||
|
|
@ -2032,25 +2037,26 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
|
|||
firstreal += firstreal % 2;
|
||||
current = current->next;
|
||||
}
|
||||
while (current != (bfd *) (map[count]).pos);
|
||||
while (current != map[count].u.abfd);
|
||||
} /* if new archive element */
|
||||
|
||||
last_elt = current;
|
||||
bfd_h_put_32 (arch, map[count].namidx, buf);
|
||||
bfd_h_put_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE);
|
||||
if (bfd_write (buf, BSD_SYMDEF_SIZE, 1, arch) != BSD_SYMDEF_SIZE)
|
||||
H_PUT_32 (arch, map[count].namidx, buf);
|
||||
H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE);
|
||||
if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch)
|
||||
!= BSD_SYMDEF_SIZE)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Now write the strings themselves. */
|
||||
bfd_h_put_32 (arch, stringsize, temp);
|
||||
if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp))
|
||||
H_PUT_32 (arch, stringsize, temp);
|
||||
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
|
||||
return false;
|
||||
for (count = 0; count < orl_count; count++)
|
||||
{
|
||||
size_t len = strlen (*map[count].name) + 1;
|
||||
|
||||
if (bfd_write (*map[count].name, 1, len, arch) != len)
|
||||
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2058,7 +2064,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
|
|||
bug-compatible for sun's ar we use a null. */
|
||||
if (padit)
|
||||
{
|
||||
if (bfd_write ("", 1, 1, arch) != 1)
|
||||
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2107,7 +2113,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
|
|||
bfd_ardata (arch)->armap_datepos = (SARMAG
|
||||
+ offsetof (struct ar_hdr, ar_date[0]));
|
||||
if (bfd_seek (arch, bfd_ardata (arch)->armap_datepos, SEEK_SET) != 0
|
||||
|| (bfd_write (hdr.ar_date, sizeof (hdr.ar_date), 1, arch)
|
||||
|| (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch)
|
||||
!= sizeof (hdr.ar_date)))
|
||||
{
|
||||
/* FIXME: bfd can't call perror. */
|
||||
|
|
@ -2144,11 +2150,11 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
|
|||
int stridx;
|
||||
{
|
||||
/* The size of the ranlib is the number of exported symbols in the
|
||||
archive * the number of bytes in a int, + an int for the count. */
|
||||
archive * the number of bytes in an int, + an int for the count. */
|
||||
unsigned int ranlibsize = (symbol_count * 4) + 4;
|
||||
unsigned int stringsize = stridx;
|
||||
unsigned int mapsize = stringsize + ranlibsize;
|
||||
file_ptr archive_member_file_ptr;
|
||||
unsigned int archive_member_file_ptr;
|
||||
bfd *current = arch->archive_head;
|
||||
unsigned int count;
|
||||
struct ar_hdr hdr;
|
||||
|
|
@ -2180,7 +2186,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
|
|||
|
||||
/* Write the ar header for this item and the number of symbols. */
|
||||
|
||||
if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), arch)
|
||||
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
|
||||
!= sizeof (struct ar_hdr))
|
||||
return false;
|
||||
|
||||
|
|
@ -2199,7 +2205,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
|
|||
/* For each symbol which is used defined in this object, write
|
||||
out the object file's address in the archive. */
|
||||
|
||||
while (count < symbol_count && ((bfd *) (map[count]).pos) == current)
|
||||
while (count < symbol_count && map[count].u.abfd == current)
|
||||
{
|
||||
bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr);
|
||||
count++;
|
||||
|
|
@ -2217,7 +2223,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
|
|||
{
|
||||
size_t len = strlen (*map[count].name) + 1;
|
||||
|
||||
if (bfd_write (*map[count].name, 1, len, arch) != len)
|
||||
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2225,7 +2231,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
|
|||
bug-compatible for arc960 we use a null. */
|
||||
if (padit)
|
||||
{
|
||||
if (bfd_write ("", 1, 1, arch) != 1)
|
||||
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
245
contrib/binutils/bfd/archive64.c
Normal file
245
contrib/binutils/bfd/archive64.c
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
/* MIPS-specific support for 64-bit ELF
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001
|
||||
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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file supports the 64-bit (MIPS) ELF archives. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include "aout/ar.h"
|
||||
|
||||
/* Irix 6 defines a 64bit archive map format, so that they can
|
||||
have archives more than 4 GB in size. */
|
||||
|
||||
boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *));
|
||||
boolean bfd_elf64_archive_write_armap
|
||||
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
|
||||
|
||||
/* Read an Irix 6 armap. */
|
||||
|
||||
boolean
|
||||
bfd_elf64_archive_slurp_armap (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
struct artdata *ardata = bfd_ardata (abfd);
|
||||
char nextname[17];
|
||||
file_ptr arhdrpos;
|
||||
bfd_size_type i, parsed_size, nsymz, stringsize, carsym_size, ptrsize;
|
||||
struct areltdata *mapdata;
|
||||
bfd_byte int_buf[8];
|
||||
char *stringbase;
|
||||
bfd_byte *raw_armap = NULL;
|
||||
carsym *carsyms;
|
||||
bfd_size_type amt;
|
||||
|
||||
ardata->symdefs = NULL;
|
||||
|
||||
/* Get the name of the first element. */
|
||||
arhdrpos = bfd_tell (abfd);
|
||||
i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
|
||||
if (i == 0)
|
||||
return true;
|
||||
if (i != 16)
|
||||
return false;
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
|
||||
return false;
|
||||
|
||||
/* Archives with traditional armaps are still permitted. */
|
||||
if (strncmp (nextname, "/ ", 16) == 0)
|
||||
return bfd_slurp_armap (abfd);
|
||||
|
||||
if (strncmp (nextname, "/SYM64/ ", 16) != 0)
|
||||
{
|
||||
bfd_has_map (abfd) = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
|
||||
if (mapdata == NULL)
|
||||
return false;
|
||||
parsed_size = mapdata->parsed_size;
|
||||
bfd_release (abfd, (PTR) mapdata);
|
||||
|
||||
if (bfd_bread (int_buf, (bfd_size_type) 8, abfd) != 8)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
return false;
|
||||
}
|
||||
|
||||
nsymz = bfd_getb64 (int_buf);
|
||||
stringsize = parsed_size - 8 * nsymz - 8;
|
||||
|
||||
carsym_size = nsymz * sizeof (carsym);
|
||||
ptrsize = 8 * nsymz;
|
||||
|
||||
amt = carsym_size + stringsize + 1;
|
||||
ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt);
|
||||
if (ardata->symdefs == NULL)
|
||||
return false;
|
||||
carsyms = ardata->symdefs;
|
||||
stringbase = ((char *) ardata->symdefs) + carsym_size;
|
||||
|
||||
raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize);
|
||||
if (raw_armap == NULL)
|
||||
goto release_symdefs;
|
||||
|
||||
if (bfd_bread (raw_armap, ptrsize, abfd) != ptrsize
|
||||
|| bfd_bread (stringbase, stringsize, abfd) != stringsize)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
goto release_raw_armap;
|
||||
}
|
||||
|
||||
for (i = 0; i < nsymz; i++)
|
||||
{
|
||||
carsyms->file_offset = bfd_getb64 (raw_armap + i * 8);
|
||||
carsyms->name = stringbase;
|
||||
stringbase += strlen (stringbase) + 1;
|
||||
++carsyms;
|
||||
}
|
||||
*stringbase = '\0';
|
||||
|
||||
ardata->symdef_count = nsymz;
|
||||
ardata->first_file_filepos = bfd_tell (abfd);
|
||||
/* Pad to an even boundary if you have to. */
|
||||
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
|
||||
|
||||
bfd_has_map (abfd) = true;
|
||||
bfd_release (abfd, raw_armap);
|
||||
|
||||
return true;
|
||||
|
||||
release_raw_armap:
|
||||
bfd_release (abfd, raw_armap);
|
||||
release_symdefs:
|
||||
bfd_release (abfd, ardata->symdefs);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Write out an Irix 6 armap. The Irix 6 tools are supposed to be
|
||||
able to handle ordinary ELF armaps, but at least on Irix 6.2 the
|
||||
linker crashes. */
|
||||
|
||||
boolean
|
||||
bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
|
||||
bfd *arch;
|
||||
unsigned int elength;
|
||||
struct orl *map;
|
||||
unsigned int symbol_count;
|
||||
int stridx;
|
||||
{
|
||||
unsigned int ranlibsize = (symbol_count * 8) + 8;
|
||||
unsigned int stringsize = stridx;
|
||||
unsigned int mapsize = stringsize + ranlibsize;
|
||||
file_ptr archive_member_file_ptr;
|
||||
bfd *current = arch->archive_head;
|
||||
unsigned int count;
|
||||
struct ar_hdr hdr;
|
||||
unsigned int i;
|
||||
int padding;
|
||||
bfd_byte buf[8];
|
||||
|
||||
padding = BFD_ALIGN (mapsize, 8) - mapsize;
|
||||
mapsize += padding;
|
||||
|
||||
/* work out where the first object file will go in the archive */
|
||||
archive_member_file_ptr = (mapsize
|
||||
+ elength
|
||||
+ sizeof (struct ar_hdr)
|
||||
+ SARMAG);
|
||||
|
||||
memset ((char *) (&hdr), 0, sizeof (struct ar_hdr));
|
||||
strcpy (hdr.ar_name, "/SYM64/");
|
||||
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
|
||||
sprintf (hdr.ar_date, "%ld", (long) time (NULL));
|
||||
/* This, at least, is what Intel coff sets the values to.: */
|
||||
sprintf ((hdr.ar_uid), "%d", 0);
|
||||
sprintf ((hdr.ar_gid), "%d", 0);
|
||||
sprintf ((hdr.ar_mode), "%-7o", (unsigned) 0);
|
||||
strncpy (hdr.ar_fmag, ARFMAG, 2);
|
||||
|
||||
for (i = 0; i < sizeof (struct ar_hdr); i++)
|
||||
if (((char *) (&hdr))[i] == '\0')
|
||||
(((char *) (&hdr))[i]) = ' ';
|
||||
|
||||
/* Write the ar header for this item and the number of symbols */
|
||||
|
||||
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
|
||||
!= sizeof (struct ar_hdr))
|
||||
return false;
|
||||
|
||||
bfd_putb64 ((bfd_vma) symbol_count, buf);
|
||||
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
|
||||
return false;
|
||||
|
||||
/* Two passes, first write the file offsets for each symbol -
|
||||
remembering that each offset is on a two byte boundary. */
|
||||
|
||||
/* Write out the file offset for the file associated with each
|
||||
symbol, and remember to keep the offsets padded out. */
|
||||
|
||||
current = arch->archive_head;
|
||||
count = 0;
|
||||
while (current != (bfd *) NULL && count < symbol_count)
|
||||
{
|
||||
/* For each symbol which is used defined in this object, write out
|
||||
the object file's address in the archive */
|
||||
|
||||
while (map[count].u.abfd == current)
|
||||
{
|
||||
bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf);
|
||||
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
|
||||
return false;
|
||||
count++;
|
||||
}
|
||||
/* Add size of this archive entry */
|
||||
archive_member_file_ptr += (arelt_size (current)
|
||||
+ sizeof (struct ar_hdr));
|
||||
/* remember about the even alignment */
|
||||
archive_member_file_ptr += archive_member_file_ptr % 2;
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
/* now write the strings themselves */
|
||||
for (count = 0; count < symbol_count; count++)
|
||||
{
|
||||
size_t len = strlen (*map[count].name) + 1;
|
||||
|
||||
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The spec says that this should be padded to an 8 byte boundary.
|
||||
However, the Irix 6.2 tools do not appear to do this. */
|
||||
while (padding != 0)
|
||||
{
|
||||
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
|
||||
return false;
|
||||
--padding;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include <ctype.h>
|
||||
#include "safe-ctype.h"
|
||||
|
||||
/*
|
||||
|
||||
|
|
@ -137,11 +137,10 @@ DESCRIPTION
|
|||
.#define bfd_mach_mips10000 10000
|
||||
.#define bfd_mach_mips12000 12000
|
||||
.#define bfd_mach_mips16 16
|
||||
.#define bfd_mach_mips32 32
|
||||
.#define bfd_mach_mips32_4k 3204113 {* 32, 04, octal 'K' *}
|
||||
.#define bfd_mach_mips5 5
|
||||
.#define bfd_mach_mips64 64
|
||||
.#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *}
|
||||
.#define bfd_mach_mipsisa32 32
|
||||
.#define bfd_mach_mipsisa64 64
|
||||
. bfd_arch_i386, {* Intel 386 *}
|
||||
.#define bfd_mach_i386_i386 0
|
||||
.#define bfd_mach_i386_i8086 1
|
||||
|
|
@ -161,6 +160,7 @@ DESCRIPTION
|
|||
.#define bfd_mach_h8300 1
|
||||
.#define bfd_mach_h8300h 2
|
||||
.#define bfd_mach_h8300s 3
|
||||
. bfd_arch_pdp11, {* DEC PDP-11 *}
|
||||
. bfd_arch_powerpc, {* PowerPC *}
|
||||
.#define bfd_mach_ppc 0
|
||||
.#define bfd_mach_ppc_403 403
|
||||
|
|
@ -254,6 +254,13 @@ DESCRIPTION
|
|||
.#define bfd_mach_avr4 4
|
||||
.#define bfd_mach_avr5 5
|
||||
. bfd_arch_cris, {* Axis CRIS *}
|
||||
. bfd_arch_s390, {* IBM s390 *}
|
||||
.#define bfd_mach_s390_esa 0
|
||||
.#define bfd_mach_s390_esame 1
|
||||
. bfd_arch_openrisc, {* OpenRISC *}
|
||||
. bfd_arch_mmix, {* Donald Knuth's educational processor *}
|
||||
. bfd_arch_xstormy16,
|
||||
.#define bfd_mach_xstormy16 0
|
||||
. bfd_arch_last
|
||||
. };
|
||||
*/
|
||||
|
|
@ -311,6 +318,7 @@ extern const bfd_arch_info_type bfd_m88k_arch;
|
|||
extern const bfd_arch_info_type bfd_mips_arch;
|
||||
extern const bfd_arch_info_type bfd_mn10200_arch;
|
||||
extern const bfd_arch_info_type bfd_mn10300_arch;
|
||||
extern const bfd_arch_info_type bfd_pdp11_arch;
|
||||
extern const bfd_arch_info_type bfd_powerpc_arch;
|
||||
extern const bfd_arch_info_type bfd_rs6000_arch;
|
||||
extern const bfd_arch_info_type bfd_pj_arch;
|
||||
|
|
@ -329,6 +337,10 @@ extern const bfd_arch_info_type bfd_fr30_arch;
|
|||
extern const bfd_arch_info_type bfd_mcore_arch;
|
||||
extern const bfd_arch_info_type bfd_avr_arch;
|
||||
extern const bfd_arch_info_type bfd_ia64_arch;
|
||||
extern const bfd_arch_info_type bfd_s390_arch;
|
||||
extern const bfd_arch_info_type bfd_openrisc_arch;
|
||||
extern const bfd_arch_info_type bfd_mmix_arch;
|
||||
extern const bfd_arch_info_type bfd_xstormy16_arch;
|
||||
|
||||
static const bfd_arch_info_type * const bfd_archures_list[] = {
|
||||
#ifdef SELECT_ARCHITECTURES
|
||||
|
|
@ -356,6 +368,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = {
|
|||
&bfd_mips_arch,
|
||||
&bfd_mn10200_arch,
|
||||
&bfd_mn10300_arch,
|
||||
&bfd_pdp11_arch,
|
||||
&bfd_powerpc_arch,
|
||||
&bfd_rs6000_arch,
|
||||
&bfd_sh_arch,
|
||||
|
|
@ -373,6 +386,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] = {
|
|||
&bfd_mcore_arch,
|
||||
&bfd_avr_arch,
|
||||
&bfd_ia64_arch,
|
||||
&bfd_s390_arch,
|
||||
&bfd_openrisc_arch,
|
||||
&bfd_mmix_arch,
|
||||
&bfd_xstormy16_arch,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
|
@ -448,6 +465,7 @@ bfd_arch_list ()
|
|||
const char **name_ptr;
|
||||
const char **name_list;
|
||||
const bfd_arch_info_type * const *app;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Determine the number of architectures. */
|
||||
vec_length = 0;
|
||||
|
|
@ -460,8 +478,8 @@ bfd_arch_list ()
|
|||
}
|
||||
}
|
||||
|
||||
name_list = (const char **)
|
||||
bfd_malloc ((vec_length + 1) * sizeof (char **));
|
||||
amt = (vec_length + 1) * sizeof (char **);
|
||||
name_list = (const char **) bfd_malloc (amt);
|
||||
if (name_list == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -717,7 +735,7 @@ DESCRIPTION
|
|||
|
||||
boolean
|
||||
bfd_default_scan (info, string)
|
||||
const struct bfd_arch_info *info;
|
||||
const bfd_arch_info_type *info;
|
||||
const char *string;
|
||||
{
|
||||
const char *ptr_src;
|
||||
|
|
@ -741,7 +759,7 @@ bfd_default_scan (info, string)
|
|||
printable_name_colon = strchr (info->printable_name, ':');
|
||||
if (printable_name_colon == NULL)
|
||||
{
|
||||
int strlen_arch_name = strlen (info->arch_name);
|
||||
size_t strlen_arch_name = strlen (info->arch_name);
|
||||
if (strncasecmp (string, info->arch_name, strlen_arch_name) == 0)
|
||||
{
|
||||
if (string[strlen_arch_name] == ':')
|
||||
|
|
@ -763,7 +781,7 @@ bfd_default_scan (info, string)
|
|||
Attempt to match: <arch> <mach>? */
|
||||
if (printable_name_colon != NULL)
|
||||
{
|
||||
int colon_index = printable_name_colon - info->printable_name;
|
||||
size_t colon_index = printable_name_colon - info->printable_name;
|
||||
if (strncasecmp (string, info->printable_name, colon_index) == 0
|
||||
&& strcasecmp (string + colon_index,
|
||||
info->printable_name + colon_index + 1) == 0)
|
||||
|
|
@ -802,7 +820,7 @@ bfd_default_scan (info, string)
|
|||
}
|
||||
|
||||
number = 0;
|
||||
while (isdigit ((unsigned char) *ptr_src))
|
||||
while (ISDIGIT (*ptr_src))
|
||||
{
|
||||
number = number * 10 + *ptr_src - '0';
|
||||
ptr_src++;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for NetBSD/ARM a.out-ish binaries.
|
||||
Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
|
@ -27,12 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define DEFAULT_MID M_ARM6_NETBSD
|
||||
/*#define MACHTYPE_OK(mtype) ((mtype) == M_ARM6_NETBSD)*/
|
||||
|
||||
#define MY(OP) CAT (armnetbsd_, OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (armnetbsd_, OP)
|
||||
|
||||
/* This needs to start with a.out so GDB knows it is an a.out variant. */
|
||||
#define TARGETNAME "a.out-arm-netbsd"
|
||||
|
||||
#if 0
|
||||
#define NAME(x,y) CAT3(aoutarm,_32_,y)
|
||||
#define NAME(x,y) CONCAT3 (aoutarm,_32_,y)
|
||||
|
||||
#define aoutarm_32_get_section_contents aout_32_get_section_contents
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@
|
|||
Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Support.
|
||||
|
||||
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
|
||||
** instead, change bfd-in.h or the other BFD source files processed to
|
||||
** generate these files.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -24,25 +20,6 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* bfd.h -- The only header file required by users of the bfd library
|
||||
|
||||
The bfd.h file is generated from bfd-in.h and various .c files; if you
|
||||
change it, your changes will probably be lost.
|
||||
|
||||
All the prototypes and definitions following the comment "THE FOLLOWING
|
||||
IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
|
||||
BFD. If you change it, someone oneday will extract it from the source
|
||||
again, and your changes will be lost. To save yourself from this bind,
|
||||
change the definitions in the source in the bfd directory. Type "make
|
||||
docs" and then "make headers" in that directory, and magically this file
|
||||
will change to reflect your changes.
|
||||
|
||||
If you don't have the tools to perform the extraction, then you are
|
||||
safe from someone on your system trampling over your header files.
|
||||
You should still maintain the equivalence between the source and this
|
||||
file though; every change you make to the .c file should be reflected
|
||||
here. */
|
||||
|
||||
#ifndef __BFD_H_SEEN__
|
||||
#define __BFD_H_SEEN__
|
||||
|
||||
|
|
@ -51,10 +28,31 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include "symcat.h"
|
||||
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
|
||||
#ifndef SABER
|
||||
/* This hack is to avoid a problem with some strict ANSI C preprocessors.
|
||||
The problem is, "32_" is not a valid preprocessing token, and we don't
|
||||
want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
|
||||
cause the inner CONCAT2 macros to be evaluated first, producing
|
||||
still-valid pp-tokens. Then the final concatenation can be done. */
|
||||
#undef CONCAT4
|
||||
#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* These two lines get substitutions done by commands in Makefile.in. */
|
||||
#define BFD_VERSION "@VERSION@"
|
||||
#define BFD_VERSION @bfd_version@
|
||||
#define BFD_VERSION_DATE @bfd_version_date@
|
||||
#define BFD_VERSION_STRING @bfd_version_string@
|
||||
|
||||
/* 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. */
|
||||
#define BFD_ARCH_SIZE @wordsize@
|
||||
|
||||
/* The word size of the default bfd target. */
|
||||
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
|
||||
|
||||
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
|
||||
#if @BFD_HOST_64_BIT_DEFINED@
|
||||
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
|
||||
|
|
@ -106,16 +104,6 @@ typedef enum bfd_boolean {false, true} boolean;
|
|||
typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
|
||||
#endif
|
||||
|
||||
/* A pointer to a position in a file. */
|
||||
/* FIXME: This should be using off_t from <sys/types.h>.
|
||||
For now, try to avoid breaking stuff by not including <sys/types.h> here.
|
||||
This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
|
||||
Probably the best long-term answer is to avoid using file_ptr AND off_t
|
||||
in this header file, and to handle this in the BFD implementation
|
||||
rather than in its interface. */
|
||||
/* typedef off_t file_ptr; */
|
||||
typedef long int file_ptr;
|
||||
|
||||
/* Support for different sizes of target format ints and addresses.
|
||||
If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
|
||||
set to 1 above. Otherwise, if gcc is being used, this code will
|
||||
|
|
@ -183,7 +171,22 @@ typedef unsigned long bfd_size_type;
|
|||
|
||||
#endif /* not BFD64 */
|
||||
|
||||
/* A pointer to a position in a file. */
|
||||
/* FIXME: This should be using off_t from <sys/types.h>.
|
||||
For now, try to avoid breaking stuff by not including <sys/types.h> here.
|
||||
This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
|
||||
Probably the best long-term answer is to avoid using file_ptr AND off_t
|
||||
in this header file, and to handle this in the BFD implementation
|
||||
rather than in its interface. */
|
||||
/* typedef off_t file_ptr; */
|
||||
typedef bfd_signed_vma file_ptr;
|
||||
typedef bfd_vma ufile_ptr;
|
||||
|
||||
extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma));
|
||||
extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma));
|
||||
|
||||
#define printf_vma(x) fprintf_vma(stdout,x)
|
||||
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
|
||||
|
||||
typedef unsigned int flagword; /* 32 bits of flags */
|
||||
typedef unsigned char bfd_byte;
|
||||
|
|
@ -289,7 +292,10 @@ typedef struct carsym {
|
|||
Perhaps just a forward definition would do? */
|
||||
struct orl { /* output ranlib */
|
||||
char **name; /* symbol name */
|
||||
file_ptr pos; /* bfd* or file position */
|
||||
union {
|
||||
file_ptr pos;
|
||||
bfd *abfd;
|
||||
} u; /* bfd* or file position */
|
||||
int namidx; /* index into string table */
|
||||
};
|
||||
|
||||
|
|
@ -298,7 +304,7 @@ typedef struct lineno_cache_entry {
|
|||
unsigned int line_number; /* Linenumber from start of function*/
|
||||
union {
|
||||
struct symbol_cache_entry *sym; /* Function name */
|
||||
unsigned long offset; /* Offset into section */
|
||||
bfd_vma offset; /* Offset into section */
|
||||
} u;
|
||||
} alent;
|
||||
|
||||
|
|
@ -341,11 +347,11 @@ typedef struct _symbol_info
|
|||
{
|
||||
symvalue value;
|
||||
char type;
|
||||
CONST char *name; /* Symbol name. */
|
||||
const char *name; /* Symbol name. */
|
||||
unsigned char stab_type; /* Stab type. */
|
||||
char stab_other; /* Stab other. */
|
||||
short stab_desc; /* Stab desc. */
|
||||
CONST char *stab_name; /* String for stab type. */
|
||||
const char *stab_name; /* String for stab type. */
|
||||
} symbol_info;
|
||||
|
||||
/* Get the name of a stabs type code. */
|
||||
|
|
@ -438,47 +444,39 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
|
|||
boolean (*) (struct bfd_hash_entry *,
|
||||
PTR),
|
||||
PTR info));
|
||||
|
||||
/* Semi-portable string concatenation in cpp.
|
||||
The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
|
||||
The problem is, "32_" is not a valid preprocessing token, and we don't
|
||||
want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the
|
||||
inner CAT macros to be evaluated first, producing still-valid pp-tokens.
|
||||
Then the final concatenation can be done. (Sigh.) */
|
||||
#ifndef CAT
|
||||
#ifdef SABER
|
||||
#define CAT(a,b) a##b
|
||||
#define CAT3(a,b,c) a##b##c
|
||||
#define CAT4(a,b,c,d) a##b##c##d
|
||||
#else
|
||||
#if defined(__STDC__) || defined(ALMOST_STDC)
|
||||
#define CAT(a,b) a##b
|
||||
#define CAT3(a,b,c) a##b##c
|
||||
#define XCAT2(a,b) CAT(a,b)
|
||||
#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d))
|
||||
#else
|
||||
#define CAT(a,b) a/**/b
|
||||
#define CAT3(a,b,c) a/**/b/**/c
|
||||
#define CAT4(a,b,c,d) a/**/b/**/c/**/d
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
|
||||
|
||||
|
||||
/* User program access to BFD facilities */
|
||||
|
||||
/* Direct I/O routines, for programs which know more about the object
|
||||
file than BFD does. Use higher level routines if possible. */
|
||||
|
||||
extern bfd_size_type bfd_read
|
||||
PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
||||
extern bfd_size_type bfd_write
|
||||
PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
||||
extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction));
|
||||
extern long bfd_tell PARAMS ((bfd *abfd));
|
||||
extern int bfd_flush PARAMS ((bfd *abfd));
|
||||
extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
|
||||
extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *));
|
||||
extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *));
|
||||
extern int bfd_seek PARAMS ((bfd *, file_ptr, int));
|
||||
extern ufile_ptr bfd_tell PARAMS ((bfd *));
|
||||
extern int bfd_flush PARAMS ((bfd *));
|
||||
extern int bfd_stat PARAMS ((bfd *, struct stat *));
|
||||
|
||||
/* Deprecated old routines. */
|
||||
#if __GNUC__
|
||||
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
||||
(warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
|
||||
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
||||
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
||||
(warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
|
||||
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
||||
#else
|
||||
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
||||
(warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
|
||||
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
||||
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
||||
(warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
|
||||
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
||||
#endif
|
||||
extern void warn_deprecated
|
||||
PARAMS ((const char *, const char *, int, const char *));
|
||||
|
||||
/* Cast from const char * to char * so that caller can assign to
|
||||
a char * without a warning. */
|
||||
|
|
@ -514,6 +512,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
|
|||
|
||||
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
|
||||
|
||||
extern boolean bfd_cache_close PARAMS ((bfd *abfd));
|
||||
/* NB: This declaration should match the autogenerated one in libbfd.h. */
|
||||
|
||||
extern boolean bfd_record_phdr
|
||||
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
||||
boolean, boolean, unsigned int, struct sec **));
|
||||
|
|
@ -622,11 +623,11 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list
|
|||
extern boolean bfd_elf_get_bfd_needed_list
|
||||
PARAMS ((bfd *, struct bfd_link_needed_list **));
|
||||
extern boolean bfd_elf32_size_dynamic_sections
|
||||
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
|
||||
PARAMS ((bfd *, const char *, const char *, const char *,
|
||||
const char * const *, struct bfd_link_info *, struct sec **,
|
||||
struct bfd_elf_version_tree *));
|
||||
extern boolean bfd_elf64_size_dynamic_sections
|
||||
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
|
||||
PARAMS ((bfd *, const char *, const char *, const char *,
|
||||
const char * const *, struct bfd_link_info *, struct sec **,
|
||||
struct bfd_elf_version_tree *));
|
||||
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
|
||||
|
|
@ -634,6 +635,10 @@ extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
|
|||
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
|
||||
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
extern boolean bfd_elf32_discard_info
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
extern boolean bfd_elf64_discard_info
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
/* Return an upper bound on the number of bytes required to store a
|
||||
copy of ABFD's program header table entries. Return -1 if an error
|
||||
|
|
@ -708,10 +713,9 @@ extern boolean bfd_xcoff_link_record_set
|
|||
bfd_size_type));
|
||||
extern boolean bfd_xcoff_import_symbol
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
||||
bfd_vma, const char *, const char *, const char *));
|
||||
bfd_vma, const char *, const char *, const char *, unsigned int));
|
||||
extern boolean bfd_xcoff_export_symbol
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
||||
boolean));
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
|
||||
extern boolean bfd_xcoff_link_count_reloc
|
||||
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
||||
extern boolean bfd_xcoff_record_link_assignment
|
||||
|
|
@ -720,6 +724,8 @@ extern boolean bfd_xcoff_size_dynamic_sections
|
|||
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
|
||||
unsigned long, unsigned long, unsigned long, boolean,
|
||||
int, boolean, boolean, struct sec **));
|
||||
extern boolean bfd_xcoff_link_generate_rtinit
|
||||
PARAMS ((bfd *, const char *, const char *));
|
||||
|
||||
/* Externally visible COFF routines. */
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -37,7 +37,7 @@ CODE_FRAGMENT
|
|||
.struct _bfd
|
||||
.{
|
||||
. {* The filename the application opened the BFD with. *}
|
||||
. CONST char *filename;
|
||||
. const char *filename;
|
||||
.
|
||||
. {* A pointer to the target jump table. *}
|
||||
. const struct bfd_target *xvec;
|
||||
|
|
@ -70,7 +70,7 @@ CODE_FRAGMENT
|
|||
. {* When a file is closed by the caching routines, BFD retains
|
||||
. state information on the file here: *}
|
||||
.
|
||||
. file_ptr where;
|
||||
. ufile_ptr where;
|
||||
.
|
||||
. {* and here: (``once'' means at least once) *}
|
||||
.
|
||||
|
|
@ -108,14 +108,20 @@ CODE_FRAGMENT
|
|||
. anything. I believe that this can become always an add of
|
||||
. origin, with origin set to 0 for non archive files. *}
|
||||
.
|
||||
. file_ptr origin;
|
||||
. ufile_ptr origin;
|
||||
.
|
||||
. {* Remember when output has begun, to stop strange things
|
||||
. from happening. *}
|
||||
. boolean output_has_begun;
|
||||
.
|
||||
. {* Pointer to linked list of sections*}
|
||||
. struct sec *sections;
|
||||
. {* A hash table for section names. *}
|
||||
. struct bfd_hash_table section_htab;
|
||||
.
|
||||
. {* Pointer to linked list of sections. *}
|
||||
. struct sec *sections;
|
||||
.
|
||||
. {* The place where we add to the section list. *}
|
||||
. struct sec **section_tail;
|
||||
.
|
||||
. {* The number of sections *}
|
||||
. unsigned int section_count;
|
||||
|
|
@ -167,6 +173,7 @@ CODE_FRAGMENT
|
|||
. 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;
|
||||
|
|
@ -203,6 +210,7 @@ CODE_FRAGMENT
|
|||
#endif
|
||||
|
||||
#include "libiberty.h"
|
||||
#include "safe-ctype.h"
|
||||
#include "bfdlink.h"
|
||||
#include "libbfd.h"
|
||||
#include "coff/internal.h"
|
||||
|
|
@ -211,8 +219,6 @@ CODE_FRAGMENT
|
|||
#include "libecoff.h"
|
||||
#undef obj_symbols
|
||||
#include "elf-bfd.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
/* provide storage for subsystem, stack and heap data which may have been
|
||||
passed in on the command line. Ld puts this data into a bfd_link_info
|
||||
|
|
@ -248,6 +254,7 @@ CODE_FRAGMENT
|
|||
. 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,
|
||||
|
|
@ -269,27 +276,29 @@ CODE_FRAGMENT
|
|||
|
||||
static bfd_error_type bfd_error = bfd_error_no_error;
|
||||
|
||||
CONST char *CONST bfd_errmsgs[] = {
|
||||
N_("No error"),
|
||||
N_("System call error"),
|
||||
N_("Invalid bfd target"),
|
||||
N_("File in wrong format"),
|
||||
N_("Invalid operation"),
|
||||
N_("Memory exhausted"),
|
||||
N_("No symbols"),
|
||||
N_("Archive has no index; run ranlib to add one"),
|
||||
N_("No more archived files"),
|
||||
N_("Malformed archive"),
|
||||
N_("File format not recognized"),
|
||||
N_("File format is ambiguous"),
|
||||
N_("Section has no contents"),
|
||||
N_("Nonrepresentable section on output"),
|
||||
N_("Symbol needs debug section which does not exist"),
|
||||
N_("Bad value"),
|
||||
N_("File truncated"),
|
||||
N_("File too big"),
|
||||
N_("#<Invalid error code>")
|
||||
};
|
||||
const char *const bfd_errmsgs[] =
|
||||
{
|
||||
N_("No error"),
|
||||
N_("System call error"),
|
||||
N_("Invalid bfd target"),
|
||||
N_("File in wrong format"),
|
||||
N_("Archive object file in wrong format"),
|
||||
N_("Invalid operation"),
|
||||
N_("Memory exhausted"),
|
||||
N_("No symbols"),
|
||||
N_("Archive has no index; run ranlib to add one"),
|
||||
N_("No more archived files"),
|
||||
N_("Malformed archive"),
|
||||
N_("File format not recognized"),
|
||||
N_("File format is ambiguous"),
|
||||
N_("Section has no contents"),
|
||||
N_("Nonrepresentable section on output"),
|
||||
N_("Symbol needs debug section which does not exist"),
|
||||
N_("Bad value"),
|
||||
N_("File truncated"),
|
||||
N_("File too big"),
|
||||
N_("#<Invalid error code>")
|
||||
};
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
|
|
@ -331,14 +340,14 @@ FUNCTION
|
|||
bfd_errmsg
|
||||
|
||||
SYNOPSIS
|
||||
CONST char *bfd_errmsg (bfd_error_type error_tag);
|
||||
const char *bfd_errmsg (bfd_error_type error_tag);
|
||||
|
||||
DESCRIPTION
|
||||
Return a string describing the error @var{error_tag}, or
|
||||
the system error if @var{error_tag} is <<bfd_error_system_call>>.
|
||||
*/
|
||||
|
||||
CONST char *
|
||||
const char *
|
||||
bfd_errmsg (error_tag)
|
||||
bfd_error_type error_tag;
|
||||
{
|
||||
|
|
@ -348,8 +357,8 @@ bfd_errmsg (error_tag)
|
|||
if (error_tag == bfd_error_system_call)
|
||||
return xstrerror (errno);
|
||||
|
||||
if ((((int)error_tag <(int) bfd_error_no_error) ||
|
||||
((int)error_tag > (int)bfd_error_invalid_error_code)))
|
||||
if ((((int) error_tag < (int) bfd_error_no_error) ||
|
||||
((int) error_tag > (int) bfd_error_invalid_error_code)))
|
||||
error_tag = bfd_error_invalid_error_code;/* sanity check */
|
||||
|
||||
return _(bfd_errmsgs [(int)error_tag]);
|
||||
|
|
@ -360,7 +369,7 @@ FUNCTION
|
|||
bfd_perror
|
||||
|
||||
SYNOPSIS
|
||||
void bfd_perror (CONST char *message);
|
||||
void bfd_perror (const char *message);
|
||||
|
||||
DESCRIPTION
|
||||
Print to the standard error stream a string describing the
|
||||
|
|
@ -372,16 +381,18 @@ DESCRIPTION
|
|||
|
||||
void
|
||||
bfd_perror (message)
|
||||
CONST char *message;
|
||||
const char *message;
|
||||
{
|
||||
if (bfd_get_error () == bfd_error_system_call)
|
||||
perror((char *)message); /* must be system error then... */
|
||||
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 ()));
|
||||
}
|
||||
/* Must be a system error then. */
|
||||
perror ((char *)message);
|
||||
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 ()));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -406,57 +417,24 @@ static const char *_bfd_error_program_name;
|
|||
|
||||
/* This is the default routine to handle BFD error messages. */
|
||||
|
||||
#ifdef ANSI_PROTOTYPES
|
||||
|
||||
static void _bfd_default_error_handler PARAMS ((const char *s, ...));
|
||||
|
||||
static void
|
||||
_bfd_default_error_handler (const char *s, ...)
|
||||
_bfd_default_error_handler VPARAMS ((const char *s, ...))
|
||||
{
|
||||
va_list p;
|
||||
|
||||
if (_bfd_error_program_name != NULL)
|
||||
fprintf (stderr, "%s: ", _bfd_error_program_name);
|
||||
else
|
||||
fprintf (stderr, "BFD: ");
|
||||
|
||||
va_start (p, s);
|
||||
|
||||
VA_OPEN (p, s);
|
||||
VA_FIXEDARG (p, const char *, s);
|
||||
vfprintf (stderr, s, p);
|
||||
|
||||
va_end (p);
|
||||
VA_CLOSE (p);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
#else /* ! defined (ANSI_PROTOTYPES) */
|
||||
|
||||
static void _bfd_default_error_handler ();
|
||||
|
||||
static void
|
||||
_bfd_default_error_handler (va_alist)
|
||||
va_dcl
|
||||
{
|
||||
va_list p;
|
||||
const char *s;
|
||||
|
||||
if (_bfd_error_program_name != NULL)
|
||||
fprintf (stderr, "%s: ", _bfd_error_program_name);
|
||||
else
|
||||
fprintf (stderr, "BFD: ");
|
||||
|
||||
va_start (p);
|
||||
|
||||
s = va_arg (p, const char *);
|
||||
vfprintf (stderr, s, p);
|
||||
|
||||
va_end (p);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
#endif /* ! defined (ANSI_PROTOTYPES) */
|
||||
|
||||
/* This is a function pointer to the routine which should handle BFD
|
||||
error messages. It is called when a BFD routine encounters an
|
||||
error for which it wants to print a message. Going through a
|
||||
|
|
@ -525,6 +503,54 @@ bfd_get_error_handler ()
|
|||
{
|
||||
return _bfd_error_handler;
|
||||
}
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
bfd_archive_filename
|
||||
|
||||
SYNOPSIS
|
||||
const char *bfd_archive_filename (bfd *);
|
||||
|
||||
DESCRIPTION
|
||||
For a BFD that is a component of an archive, returns a string
|
||||
with both the archive name and file name. For other BFDs, just
|
||||
returns the file name.
|
||||
*/
|
||||
|
||||
const char *
|
||||
bfd_archive_filename (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
if (abfd->my_archive)
|
||||
{
|
||||
static size_t curr = 0;
|
||||
static char *buf;
|
||||
size_t needed;
|
||||
|
||||
needed = (strlen (bfd_get_filename (abfd->my_archive))
|
||||
+ strlen (bfd_get_filename (abfd)) + 3);
|
||||
if (needed > curr)
|
||||
{
|
||||
if (curr)
|
||||
free (buf);
|
||||
curr = needed + (needed >> 1);
|
||||
buf = bfd_malloc ((bfd_size_type) curr);
|
||||
/* If we can't malloc, fail safe by returning just the file
|
||||
name. This function is only used when building error
|
||||
messages. */
|
||||
if (!buf)
|
||||
{
|
||||
curr = 0;
|
||||
return bfd_get_filename (abfd);
|
||||
}
|
||||
}
|
||||
sprintf (buf, "%s(%s)", bfd_get_filename (abfd->my_archive),
|
||||
bfd_get_filename (abfd));
|
||||
return buf;
|
||||
}
|
||||
else
|
||||
return bfd_get_filename (abfd);
|
||||
}
|
||||
|
||||
/*
|
||||
SECTION
|
||||
|
|
@ -550,10 +576,11 @@ bfd_get_reloc_upper_bound (abfd, asect)
|
|||
bfd *abfd;
|
||||
sec_ptr asect;
|
||||
{
|
||||
if (abfd->format != bfd_object) {
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return -1;
|
||||
}
|
||||
if (abfd->format != bfd_object)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return BFD_SEND (abfd, _get_reloc_upper_bound, (abfd, asect));
|
||||
}
|
||||
|
|
@ -589,10 +616,12 @@ bfd_canonicalize_reloc (abfd, asect, location, symbols)
|
|||
arelent **location;
|
||||
asymbol **symbols;
|
||||
{
|
||||
if (abfd->format != bfd_object) {
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return -1;
|
||||
}
|
||||
if (abfd->format != bfd_object)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return BFD_SEND (abfd, _bfd_canonicalize_reloc,
|
||||
(abfd, asect, location, symbols));
|
||||
}
|
||||
|
|
@ -648,23 +677,26 @@ bfd_set_file_flags (abfd, flags)
|
|||
bfd *abfd;
|
||||
flagword flags;
|
||||
{
|
||||
if (abfd->format != bfd_object) {
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
}
|
||||
if (abfd->format != bfd_object)
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bfd_read_p (abfd)) {
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
if (bfd_read_p (abfd))
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
|
||||
bfd_get_file_flags (abfd) = flags;
|
||||
if ((flags & bfd_applicable_file_flags (abfd)) != flags) {
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
if ((flags & bfd_applicable_file_flags (abfd)) != flags)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -672,7 +704,8 @@ bfd_assert (file, line)
|
|||
const char *file;
|
||||
int line;
|
||||
{
|
||||
(*_bfd_error_handler) (_("bfd assertion fail %s:%d"), file, line);
|
||||
(*_bfd_error_handler) (_("BFD %s assertion fail %s:%d"),
|
||||
BFD_VERSION_STRING, file, line);
|
||||
}
|
||||
|
||||
/* A more or less friendly abort message. In libbfd.h abort is
|
||||
|
|
@ -690,12 +723,12 @@ _bfd_abort (file, line, fn)
|
|||
{
|
||||
if (fn != NULL)
|
||||
(*_bfd_error_handler)
|
||||
(_("BFD internal error, aborting at %s line %d in %s\n"),
|
||||
file, line, fn);
|
||||
(_("BFD %s internal error, aborting at %s line %d in %s\n"),
|
||||
BFD_VERSION_STRING, file, line, fn);
|
||||
else
|
||||
(*_bfd_error_handler)
|
||||
(_("BFD internal error, aborting at %s line %d\n"),
|
||||
file, line);
|
||||
(_("BFD %s internal error, aborting at %s line %d\n"),
|
||||
BFD_VERSION_STRING, file, line);
|
||||
(*_bfd_error_handler) (_("Please report this bug.\n"));
|
||||
xexit (EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -752,9 +785,21 @@ int
|
|||
bfd_get_sign_extend_vma (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
char *name;
|
||||
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
||||
return (get_elf_backend_data (abfd)->sign_extend_vma);
|
||||
|
||||
name = bfd_get_target (abfd);
|
||||
|
||||
/* Return a proper value for DJGPP COFF (an x86 COFF variant).
|
||||
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)
|
||||
return 1;
|
||||
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -774,9 +819,9 @@ RETURNS
|
|||
*/
|
||||
|
||||
boolean
|
||||
bfd_set_start_address(abfd, vma)
|
||||
bfd *abfd;
|
||||
bfd_vma vma;
|
||||
bfd_set_start_address (abfd, vma)
|
||||
bfd *abfd;
|
||||
bfd_vma vma;
|
||||
{
|
||||
abfd->start_address = vma;
|
||||
return true;
|
||||
|
|
@ -857,7 +902,7 @@ bfd_get_size (abfd)
|
|||
return ((struct bfd_in_memory *) abfd->iostream)->size;
|
||||
|
||||
fp = bfd_cache_lookup (abfd);
|
||||
if (0 != fstat (fileno (fp), &buf))
|
||||
if (0 != fstat (fileno (fp), & buf))
|
||||
return 0;
|
||||
|
||||
return buf.st_size;
|
||||
|
|
@ -868,7 +913,7 @@ FUNCTION
|
|||
bfd_get_gp_size
|
||||
|
||||
SYNOPSIS
|
||||
int bfd_get_gp_size(bfd *abfd);
|
||||
unsigned int bfd_get_gp_size(bfd *abfd);
|
||||
|
||||
DESCRIPTION
|
||||
Return the maximum size of objects to be optimized using the GP
|
||||
|
|
@ -876,7 +921,7 @@ DESCRIPTION
|
|||
argument to the compiler, assembler or linker.
|
||||
*/
|
||||
|
||||
int
|
||||
unsigned int
|
||||
bfd_get_gp_size (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
|
|
@ -895,7 +940,7 @@ FUNCTION
|
|||
bfd_set_gp_size
|
||||
|
||||
SYNOPSIS
|
||||
void bfd_set_gp_size(bfd *abfd, int i);
|
||||
void bfd_set_gp_size(bfd *abfd, unsigned int i);
|
||||
|
||||
DESCRIPTION
|
||||
Set the maximum size of objects to be optimized using the GP
|
||||
|
|
@ -906,11 +951,12 @@ DESCRIPTION
|
|||
void
|
||||
bfd_set_gp_size (abfd, i)
|
||||
bfd *abfd;
|
||||
int i;
|
||||
unsigned int i;
|
||||
{
|
||||
/* Don't try to set GP size on an archive or core file! */
|
||||
/* Don't try to set GP size on an archive or core file! */
|
||||
if (abfd->format != bfd_object)
|
||||
return;
|
||||
|
||||
if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
|
||||
ecoff_data (abfd)->gp_size = i;
|
||||
else if (abfd->xvec->flavour == bfd_target_elf_flavour)
|
||||
|
|
@ -925,13 +971,14 @@ bfd_vma
|
|||
_bfd_get_gp_value (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
if (abfd->format == bfd_object)
|
||||
{
|
||||
if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
|
||||
return ecoff_data (abfd)->gp;
|
||||
else if (abfd->xvec->flavour == bfd_target_elf_flavour)
|
||||
return elf_gp (abfd);
|
||||
}
|
||||
if (abfd->format != bfd_object)
|
||||
return 0;
|
||||
|
||||
if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
|
||||
return ecoff_data (abfd)->gp;
|
||||
else if (abfd->xvec->flavour == bfd_target_elf_flavour)
|
||||
return elf_gp (abfd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -944,6 +991,7 @@ _bfd_set_gp_value (abfd, v)
|
|||
{
|
||||
if (abfd->format != bfd_object)
|
||||
return;
|
||||
|
||||
if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
|
||||
ecoff_data (abfd)->gp = v;
|
||||
else if (abfd->xvec->flavour == bfd_target_elf_flavour)
|
||||
|
|
@ -955,7 +1003,7 @@ FUNCTION
|
|||
bfd_scan_vma
|
||||
|
||||
SYNOPSIS
|
||||
bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base);
|
||||
bfd_vma bfd_scan_vma(const char *string, const char **end, int base);
|
||||
|
||||
DESCRIPTION
|
||||
Convert, like <<strtoul>>, a numerical expression
|
||||
|
|
@ -972,8 +1020,8 @@ DESCRIPTION
|
|||
|
||||
bfd_vma
|
||||
bfd_scan_vma (string, end, base)
|
||||
CONST char *string;
|
||||
CONST char **end;
|
||||
const char *string;
|
||||
const char **end;
|
||||
int base;
|
||||
{
|
||||
bfd_vma value;
|
||||
|
|
@ -993,33 +1041,32 @@ bfd_scan_vma (string, end, base)
|
|||
{
|
||||
if ((string[1] == 'x') || (string[1] == 'X'))
|
||||
base = 16;
|
||||
/* XXX should we also allow "0b" or "0B" to set base to 2? */
|
||||
/* XXX should we also allow "0b" or "0B" to set base to 2? */
|
||||
else
|
||||
base = 8;
|
||||
}
|
||||
else
|
||||
base = 10;
|
||||
}
|
||||
|
||||
if ((base == 16) &&
|
||||
(string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X')))
|
||||
string += 2;
|
||||
/* XXX should we also skip over "0b" or "0B" if base is 2? */
|
||||
/* XXX should we also skip over "0b" or "0B" if base is 2? */
|
||||
|
||||
/* Speed could be improved with a table like hex_value[] in gas. */
|
||||
#define HEX_VALUE(c) \
|
||||
(isxdigit ((unsigned char) c) \
|
||||
? (isdigit ((unsigned char) c) \
|
||||
(ISXDIGIT (c) \
|
||||
? (ISDIGIT (c) \
|
||||
? (c - '0') \
|
||||
: (10 + c - (islower ((unsigned char) c) ? 'a' : 'A'))) \
|
||||
: (10 + c - (ISLOWER (c) ? 'a' : 'A'))) \
|
||||
: 42)
|
||||
|
||||
for (value = 0; (digit = HEX_VALUE(*string)) < base; string++)
|
||||
{
|
||||
value = value * base + digit;
|
||||
}
|
||||
for (value = 0; (digit = HEX_VALUE (* string)) < base; string ++)
|
||||
value = value * base + digit;
|
||||
|
||||
if (end)
|
||||
*end = string;
|
||||
* end = string;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
@ -1126,6 +1173,9 @@ DESCRIPTION
|
|||
.#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_link_hash_table_create(abfd) \
|
||||
. BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
|
||||
.
|
||||
|
|
@ -1179,11 +1229,12 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
|
|||
if (link_order->type == bfd_indirect_link_order)
|
||||
{
|
||||
abfd2 = link_order->u.indirect.section->owner;
|
||||
if (abfd2 == 0)
|
||||
if (abfd2 == NULL)
|
||||
abfd2 = abfd;
|
||||
}
|
||||
else
|
||||
abfd2 = abfd;
|
||||
|
||||
fn = abfd2->xvec->_bfd_get_relocated_section_contents;
|
||||
|
||||
return (*fn) (abfd, link_info, link_order, data, relocateable, symbols);
|
||||
|
|
@ -1206,14 +1257,14 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
|
|||
asection **secs;
|
||||
{
|
||||
struct elf_segment_map *m, **pm;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
|
||||
return true;
|
||||
|
||||
m = ((struct elf_segment_map *)
|
||||
bfd_alloc (abfd,
|
||||
(sizeof (struct elf_segment_map)
|
||||
+ ((size_t) count - 1) * sizeof (asection *))));
|
||||
amt = sizeof (struct elf_segment_map);
|
||||
amt += ((bfd_size_type) count - 1) * sizeof (asection *);
|
||||
m = (struct elf_segment_map *) bfd_alloc (abfd, amt);
|
||||
if (m == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -1235,3 +1286,82 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
bfd_sprintf_vma (abfd, buf, value)
|
||||
bfd *abfd;
|
||||
char *buf;
|
||||
bfd_vma value;
|
||||
{
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
||||
get_elf_backend_data (abfd)->elf_backend_sprintf_vma (abfd, buf, value);
|
||||
else
|
||||
sprintf_vma (buf, value);
|
||||
}
|
||||
|
||||
void
|
||||
bfd_fprintf_vma (abfd, stream, value)
|
||||
bfd *abfd;
|
||||
PTR 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);
|
||||
else
|
||||
fprintf_vma ((FILE *) stream, value);
|
||||
}
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
bfd_alt_mach_code
|
||||
|
||||
SYNOPSIS
|
||||
boolean bfd_alt_mach_code(bfd *abfd, int index);
|
||||
|
||||
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 (index == 0) and any others. Currently,
|
||||
only ELF supports this feature, with up to two alternate
|
||||
machine codes.
|
||||
*/
|
||||
|
||||
boolean
|
||||
bfd_alt_mach_code (abfd, index)
|
||||
bfd *abfd;
|
||||
int index;
|
||||
{
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
||||
{
|
||||
int code;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
code = get_elf_backend_data (abfd)->elf_machine_code;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
code = get_elf_backend_data (abfd)->elf_machine_alt1;
|
||||
if (code == 0)
|
||||
return false;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
code = get_elf_backend_data (abfd)->elf_machine_alt2;
|
||||
if (code == 0)
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
elf_elfheader (abfd)->e_machine = code;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for binary objects.
|
||||
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
|
||||
|
||||
|
|
@ -32,10 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
the file. objcopy cooperates by specially setting the start
|
||||
address to zero by default. */
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "safe-ctype.h"
|
||||
#include "libbfd.h"
|
||||
|
||||
/* Any bfd we create by reading a binary file has three symbols:
|
||||
|
|
@ -49,12 +48,15 @@ static boolean binary_get_section_contents
|
|||
static long binary_get_symtab_upper_bound PARAMS ((bfd *));
|
||||
static char *mangle_name PARAMS ((bfd *, char *));
|
||||
static long binary_get_symtab PARAMS ((bfd *, asymbol **));
|
||||
static asymbol *binary_make_empty_symbol PARAMS ((bfd *));
|
||||
static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
|
||||
static boolean binary_set_section_contents
|
||||
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
|
||||
static int binary_sizeof_headers PARAMS ((bfd *, boolean));
|
||||
|
||||
/* Set by external programs - specifies the BFD architecture
|
||||
to use when creating binary BFDs. */
|
||||
enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown;
|
||||
|
||||
/* Create a binary object. Invoked via bfd_set_format. */
|
||||
|
||||
static boolean
|
||||
|
|
@ -101,6 +103,13 @@ binary_object_p (abfd)
|
|||
|
||||
abfd->tdata.any = (PTR) sec;
|
||||
|
||||
if (bfd_get_arch_info (abfd) != NULL)
|
||||
{
|
||||
if ((bfd_get_arch_info (abfd)->arch == bfd_arch_unknown)
|
||||
&& (bfd_external_binary_architecture != bfd_arch_unknown))
|
||||
bfd_set_arch_info (abfd, bfd_lookup_arch (bfd_external_binary_architecture, 0));
|
||||
}
|
||||
|
||||
return abfd->xvec;
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +128,7 @@ binary_get_section_contents (abfd, section, location, offset, count)
|
|||
bfd_size_type count;
|
||||
{
|
||||
if (bfd_seek (abfd, offset, SEEK_SET) != 0
|
||||
|| bfd_read (location, 1, count, abfd) != count)
|
||||
|| bfd_bread (location, count, abfd) != count)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -140,7 +149,7 @@ mangle_name (abfd, suffix)
|
|||
bfd *abfd;
|
||||
char *suffix;
|
||||
{
|
||||
int size;
|
||||
bfd_size_type size;
|
||||
char *buf;
|
||||
char *p;
|
||||
|
||||
|
|
@ -156,7 +165,7 @@ mangle_name (abfd, suffix)
|
|||
|
||||
/* Change any non-alphanumeric characters to underscores. */
|
||||
for (p = buf; *p; p++)
|
||||
if (! isalnum ((unsigned char) *p))
|
||||
if (! ISALNUM (*p))
|
||||
*p = '_';
|
||||
|
||||
return buf;
|
||||
|
|
@ -172,8 +181,9 @@ binary_get_symtab (abfd, alocation)
|
|||
asection *sec = (asection *) abfd->tdata.any;
|
||||
asymbol *syms;
|
||||
unsigned int i;
|
||||
bfd_size_type amt = BIN_SYMS * sizeof (asymbol);
|
||||
|
||||
syms = (asymbol *) bfd_alloc (abfd, BIN_SYMS * sizeof (asymbol));
|
||||
syms = (asymbol *) bfd_alloc (abfd, amt);
|
||||
if (syms == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -208,15 +218,7 @@ binary_get_symtab (abfd, alocation)
|
|||
return BIN_SYMS;
|
||||
}
|
||||
|
||||
/* Make an empty symbol. */
|
||||
|
||||
static asymbol *
|
||||
binary_make_empty_symbol (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
return (asymbol *) bfd_alloc (abfd, sizeof (asymbol));
|
||||
}
|
||||
|
||||
#define binary_make_empty_symbol _bfd_generic_make_empty_symbol
|
||||
#define binary_print_symbol _bfd_nosymbols_print_symbol
|
||||
|
||||
/* Get information about a symbol. */
|
||||
|
|
@ -334,6 +336,7 @@ binary_sizeof_headers (abfd, exec)
|
|||
bfd_generic_get_relocated_section_contents
|
||||
#define binary_bfd_relax_section bfd_generic_relax_section
|
||||
#define binary_bfd_gc_sections bfd_generic_gc_sections
|
||||
#define binary_bfd_merge_sections bfd_generic_merge_sections
|
||||
#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
|
||||
#define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
||||
#define binary_bfd_final_link _bfd_generic_final_link
|
||||
|
|
|
|||
|
|
@ -364,7 +364,9 @@ bfd_cache_lookup_worker (abfd)
|
|||
{
|
||||
if (bfd_open_file (abfd) == NULL)
|
||||
return NULL;
|
||||
if (fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0)
|
||||
if (abfd->where != (unsigned long) abfd->where)
|
||||
return NULL;
|
||||
if (fseek ((FILE *) abfd->iostream, (long) abfd->where, SEEK_SET) != 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,32 +76,32 @@ static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex));
|
|||
symbol, and lineno ones. Give them ecoff names. Define some
|
||||
accessor macros for the large sizes used for Alpha ECOFF. */
|
||||
|
||||
#define GET_FILEHDR_SYMPTR bfd_h_get_64
|
||||
#define PUT_FILEHDR_SYMPTR bfd_h_put_64
|
||||
#define GET_AOUTHDR_TSIZE bfd_h_get_64
|
||||
#define PUT_AOUTHDR_TSIZE bfd_h_put_64
|
||||
#define GET_AOUTHDR_DSIZE bfd_h_get_64
|
||||
#define PUT_AOUTHDR_DSIZE bfd_h_put_64
|
||||
#define GET_AOUTHDR_BSIZE bfd_h_get_64
|
||||
#define PUT_AOUTHDR_BSIZE bfd_h_put_64
|
||||
#define GET_AOUTHDR_ENTRY bfd_h_get_64
|
||||
#define PUT_AOUTHDR_ENTRY bfd_h_put_64
|
||||
#define GET_AOUTHDR_TEXT_START bfd_h_get_64
|
||||
#define PUT_AOUTHDR_TEXT_START bfd_h_put_64
|
||||
#define GET_AOUTHDR_DATA_START bfd_h_get_64
|
||||
#define PUT_AOUTHDR_DATA_START bfd_h_put_64
|
||||
#define GET_SCNHDR_PADDR bfd_h_get_64
|
||||
#define PUT_SCNHDR_PADDR bfd_h_put_64
|
||||
#define GET_SCNHDR_VADDR bfd_h_get_64
|
||||
#define PUT_SCNHDR_VADDR bfd_h_put_64
|
||||
#define GET_SCNHDR_SIZE bfd_h_get_64
|
||||
#define PUT_SCNHDR_SIZE bfd_h_put_64
|
||||
#define GET_SCNHDR_SCNPTR bfd_h_get_64
|
||||
#define PUT_SCNHDR_SCNPTR bfd_h_put_64
|
||||
#define GET_SCNHDR_RELPTR bfd_h_get_64
|
||||
#define PUT_SCNHDR_RELPTR bfd_h_put_64
|
||||
#define GET_SCNHDR_LNNOPTR bfd_h_get_64
|
||||
#define PUT_SCNHDR_LNNOPTR bfd_h_put_64
|
||||
#define GET_FILEHDR_SYMPTR H_GET_64
|
||||
#define PUT_FILEHDR_SYMPTR H_PUT_64
|
||||
#define GET_AOUTHDR_TSIZE H_GET_64
|
||||
#define PUT_AOUTHDR_TSIZE H_PUT_64
|
||||
#define GET_AOUTHDR_DSIZE H_GET_64
|
||||
#define PUT_AOUTHDR_DSIZE H_PUT_64
|
||||
#define GET_AOUTHDR_BSIZE H_GET_64
|
||||
#define PUT_AOUTHDR_BSIZE H_PUT_64
|
||||
#define GET_AOUTHDR_ENTRY H_GET_64
|
||||
#define PUT_AOUTHDR_ENTRY H_PUT_64
|
||||
#define GET_AOUTHDR_TEXT_START H_GET_64
|
||||
#define PUT_AOUTHDR_TEXT_START H_PUT_64
|
||||
#define GET_AOUTHDR_DATA_START H_GET_64
|
||||
#define PUT_AOUTHDR_DATA_START H_PUT_64
|
||||
#define GET_SCNHDR_PADDR H_GET_64
|
||||
#define PUT_SCNHDR_PADDR H_PUT_64
|
||||
#define GET_SCNHDR_VADDR H_GET_64
|
||||
#define PUT_SCNHDR_VADDR H_PUT_64
|
||||
#define GET_SCNHDR_SIZE H_GET_64
|
||||
#define PUT_SCNHDR_SIZE H_PUT_64
|
||||
#define GET_SCNHDR_SCNPTR H_GET_64
|
||||
#define PUT_SCNHDR_SCNPTR H_PUT_64
|
||||
#define GET_SCNHDR_RELPTR H_GET_64
|
||||
#define PUT_SCNHDR_RELPTR H_PUT_64
|
||||
#define GET_SCNHDR_LNNOPTR H_GET_64
|
||||
#define PUT_SCNHDR_LNNOPTR H_PUT_64
|
||||
|
||||
#define ALPHAECOFF
|
||||
|
||||
|
|
@ -530,8 +530,8 @@ alpha_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
|
|||
{
|
||||
const RELOC *ext = (RELOC *) ext_ptr;
|
||||
|
||||
intern->r_vaddr = bfd_h_get_64 (abfd, (bfd_byte *) ext->r_vaddr);
|
||||
intern->r_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->r_symndx);
|
||||
intern->r_vaddr = H_GET_64 (abfd, ext->r_vaddr);
|
||||
intern->r_symndx = H_GET_32 (abfd, ext->r_symndx);
|
||||
|
||||
BFD_ASSERT (bfd_header_little_endian (abfd));
|
||||
|
||||
|
|
@ -603,8 +603,8 @@ alpha_ecoff_swap_reloc_out (abfd, intern, dst)
|
|||
BFD_ASSERT (intern->r_extern
|
||||
|| (intern->r_symndx >= 0 && intern->r_symndx <= 14));
|
||||
|
||||
bfd_h_put_64 (abfd, intern->r_vaddr, (bfd_byte *) ext->r_vaddr);
|
||||
bfd_h_put_32 (abfd, symndx, (bfd_byte *) ext->r_symndx);
|
||||
H_PUT_64 (abfd, intern->r_vaddr, ext->r_vaddr);
|
||||
H_PUT_32 (abfd, symndx, ext->r_symndx);
|
||||
|
||||
BFD_ASSERT (bfd_header_little_endian (abfd));
|
||||
|
||||
|
|
@ -771,7 +771,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|
|||
|
||||
if (reloc_size < 0)
|
||||
goto error_return;
|
||||
reloc_vector = (arelent **) bfd_malloc (reloc_size);
|
||||
reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
|
||||
if (reloc_vector == NULL && reloc_size != 0)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1277,7 +1277,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
|
|||
hsec = h->root.u.def.section;
|
||||
name = bfd_get_section_name (output_bfd, hsec->output_section);
|
||||
|
||||
r_symndx = -1;
|
||||
r_symndx = (unsigned long) -1;
|
||||
switch (name[1])
|
||||
{
|
||||
case 'A':
|
||||
|
|
@ -1334,7 +1334,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
|
|||
break;
|
||||
}
|
||||
|
||||
if (r_symndx == -1)
|
||||
if (r_symndx == (unsigned long) -1)
|
||||
abort ();
|
||||
|
||||
/* Add the section VMA and the symbol value. */
|
||||
|
|
@ -1347,7 +1347,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
|
|||
/* Change the symndx value to the right one for
|
||||
the output BFD. */
|
||||
r_symndx = h->indx;
|
||||
if (r_symndx == -1)
|
||||
if (r_symndx == (unsigned long) -1)
|
||||
{
|
||||
/* Caller must give an error. */
|
||||
r_symndx = 0;
|
||||
|
|
@ -1356,8 +1356,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
|
|||
}
|
||||
|
||||
/* Write out the new r_symndx value. */
|
||||
bfd_h_put_32 (input_bfd, (bfd_vma) r_symndx,
|
||||
(bfd_byte *) ext_rel->r_symndx);
|
||||
H_PUT_32 (input_bfd, r_symndx, ext_rel->r_symndx);
|
||||
|
||||
return relocation;
|
||||
}
|
||||
|
|
@ -1384,6 +1383,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
int tos = 0;
|
||||
struct external_reloc *ext_rel;
|
||||
struct external_reloc *ext_rel_end;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* We keep a table mapping the symndx found in an internal reloc to
|
||||
the appropriate section. This is faster than looking up the
|
||||
|
|
@ -1391,10 +1391,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
symndx_to_section = ecoff_data (input_bfd)->symndx_to_section;
|
||||
if (symndx_to_section == (asection **) NULL)
|
||||
{
|
||||
symndx_to_section = ((asection **)
|
||||
bfd_alloc (input_bfd,
|
||||
(NUM_RELOC_SECTIONS
|
||||
* sizeof (asection *))));
|
||||
amt = NUM_RELOC_SECTIONS * sizeof (asection *);
|
||||
symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
|
||||
if (!symndx_to_section)
|
||||
return false;
|
||||
|
||||
|
|
@ -1451,9 +1449,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
lita_sec_data = ecoff_section_data (input_bfd, lita_sec);
|
||||
if (lita_sec_data == NULL)
|
||||
{
|
||||
amt = sizeof (struct ecoff_section_tdata);
|
||||
lita_sec_data = ((struct ecoff_section_tdata *)
|
||||
bfd_zalloc (input_bfd,
|
||||
sizeof (struct ecoff_section_tdata)));
|
||||
bfd_zalloc (input_bfd, amt));
|
||||
ecoff_section_data (input_bfd, lita_sec) = lita_sec_data;
|
||||
}
|
||||
|
||||
|
|
@ -1522,8 +1520,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
boolean gp_usedp;
|
||||
bfd_vma addend;
|
||||
|
||||
r_vaddr = bfd_h_get_64 (input_bfd, (bfd_byte *) ext_rel->r_vaddr);
|
||||
r_symndx = bfd_h_get_32 (input_bfd, (bfd_byte *) ext_rel->r_symndx);
|
||||
r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr);
|
||||
r_symndx = H_GET_32 (input_bfd, ext_rel->r_symndx);
|
||||
|
||||
r_type = ((ext_rel->r_bits[0] & RELOC_BITS0_TYPE_LITTLE)
|
||||
>> RELOC_BITS0_TYPE_SH_LITTLE);
|
||||
|
|
@ -1552,9 +1550,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
address of the relocation does not appear to include the
|
||||
section VMA, unlike the other relocation types. */
|
||||
if (info->relocateable)
|
||||
bfd_h_put_64 (input_bfd,
|
||||
input_section->output_offset + r_vaddr,
|
||||
(bfd_byte *) ext_rel->r_vaddr);
|
||||
H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
|
||||
ext_rel->r_vaddr);
|
||||
adjust_addrp = false;
|
||||
break;
|
||||
|
||||
|
|
@ -1751,8 +1748,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (info->relocateable)
|
||||
{
|
||||
/* Adjust r_vaddr by the addend. */
|
||||
bfd_h_put_64 (input_bfd, addend,
|
||||
(bfd_byte *) ext_rel->r_vaddr);
|
||||
H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1979,18 +1975,18 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (info->relocateable && adjust_addrp)
|
||||
{
|
||||
/* Change the address of the relocation. */
|
||||
bfd_h_put_64 (input_bfd,
|
||||
(input_section->output_section->vma
|
||||
+ input_section->output_offset
|
||||
- input_section->vma
|
||||
+ r_vaddr),
|
||||
(bfd_byte *) ext_rel->r_vaddr);
|
||||
H_PUT_64 (input_bfd,
|
||||
(input_section->output_section->vma
|
||||
+ input_section->output_offset
|
||||
- input_section->vma
|
||||
+ r_vaddr),
|
||||
ext_rel->r_vaddr);
|
||||
}
|
||||
|
||||
if (gp_usedp && gp_undefined)
|
||||
{
|
||||
if (! ((*info->callbacks->reloc_dangerous)
|
||||
(info, _("GP relative relocation when GP not defined"),
|
||||
(info, _("GP relative relocation used when GP not defined"),
|
||||
input_bfd, input_section, r_vaddr - input_section->vma)))
|
||||
return false;
|
||||
/* Only give the error once per link. */
|
||||
|
|
@ -2062,12 +2058,12 @@ alpha_ecoff_read_ar_hdr (abfd)
|
|||
|
||||
/* This is a compressed file. We must set the size correctly.
|
||||
The size is the eight bytes after the dummy file header. */
|
||||
if (bfd_seek (abfd, FILHSZ, SEEK_CUR) != 0
|
||||
|| bfd_read (ab, 1, 8, abfd) != 8
|
||||
|| bfd_seek (abfd, - (FILHSZ + 8), SEEK_CUR) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) FILHSZ, SEEK_CUR) != 0
|
||||
|| bfd_bread (ab, (bfd_size_type) 8, abfd) != 8
|
||||
|| bfd_seek (abfd, (file_ptr) (- (FILHSZ + 8)), SEEK_CUR) != 0)
|
||||
return NULL;
|
||||
|
||||
ret->parsed_size = bfd_h_get_64 (abfd, ab);
|
||||
ret->parsed_size = H_GET_64 (abfd, ab);
|
||||
}
|
||||
|
||||
return (PTR) ret;
|
||||
|
|
@ -2105,20 +2101,20 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
|||
return nbfd;
|
||||
|
||||
/* We must uncompress this element. We do this by copying it into a
|
||||
memory buffer, and making bfd_read and bfd_seek use that buffer.
|
||||
memory buffer, and making bfd_bread and bfd_seek use that buffer.
|
||||
This can use a lot of memory, but it's simpler than getting a
|
||||
temporary file, making that work with the file descriptor caching
|
||||
code, and making sure that it is deleted at all appropriate
|
||||
times. It can be changed if it ever becomes important. */
|
||||
|
||||
/* The compressed file starts with a dummy ECOFF file header. */
|
||||
if (bfd_seek (nbfd, FILHSZ, SEEK_SET) != 0)
|
||||
if (bfd_seek (nbfd, (file_ptr) FILHSZ, SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
|
||||
/* The next eight bytes are the real file size. */
|
||||
if (bfd_read (ab, 1, 8, nbfd) != 8)
|
||||
if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8)
|
||||
goto error_return;
|
||||
size = bfd_h_get_64 (nbfd, ab);
|
||||
size = H_GET_64 (nbfd, ab);
|
||||
|
||||
if (size == 0)
|
||||
buf = NULL;
|
||||
|
|
@ -2137,7 +2133,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
|||
left = size;
|
||||
|
||||
/* I don't know what the next eight bytes are for. */
|
||||
if (bfd_read (ab, 1, 8, nbfd) != 8)
|
||||
if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8)
|
||||
goto error_return;
|
||||
|
||||
/* This is the uncompression algorithm. It's a simple
|
||||
|
|
@ -2148,7 +2144,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
|||
next eight bytes in the output stream. */
|
||||
memset (dict, 0, sizeof dict);
|
||||
h = 0;
|
||||
while (bfd_read (&b, 1, 1, nbfd) == 1)
|
||||
while (bfd_bread (&b, (bfd_size_type) 1, nbfd) == 1)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
|
@ -2160,7 +2156,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
|||
n = dict[h];
|
||||
else
|
||||
{
|
||||
if (! bfd_read (&n, 1, 1, nbfd))
|
||||
if (! bfd_bread (&n, (bfd_size_type) 1, nbfd))
|
||||
goto error_return;
|
||||
dict[h] = n;
|
||||
}
|
||||
|
|
@ -2183,7 +2179,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
|||
|
||||
/* Now the uncompressed file contents are in buf. */
|
||||
bim = ((struct bfd_in_memory *)
|
||||
bfd_alloc (nbfd, sizeof (struct bfd_in_memory)));
|
||||
bfd_alloc (nbfd, (bfd_size_type) sizeof (struct bfd_in_memory)));
|
||||
if (bim == NULL)
|
||||
goto error_return;
|
||||
bim->size = size;
|
||||
|
|
@ -2359,6 +2355,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
|
|||
/* Relaxing sections is generic. */
|
||||
#define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
|
||||
#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
|
||||
#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
|
||||
|
||||
const bfd_target ecoffalpha_little_vec =
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -157,7 +157,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
|
|||
{
|
||||
short x = bfd_get_16 (abfd, addr);
|
||||
DOIT (x);
|
||||
bfd_put_16 (abfd, x, addr);
|
||||
bfd_put_16 (abfd, (bfd_vma) x, addr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
|
|||
{
|
||||
long x = bfd_get_32 (abfd, addr);
|
||||
DOIT (x);
|
||||
bfd_put_32 (abfd, x, addr);
|
||||
bfd_put_32 (abfd, (bfd_vma) x, addr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ static reloc_howto_type howto_table[] =
|
|||
/* Return true if this relocation should
|
||||
appear in the output .reloc section. */
|
||||
|
||||
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
|
||||
|
||||
static boolean
|
||||
in_reloc_p(abfd, howto)
|
||||
bfd * abfd ATTRIBUTE_UNUSED;
|
||||
|
|
@ -63,6 +65,8 @@ in_reloc_p(abfd, howto)
|
|||
|
||||
#include "coffcode.h"
|
||||
|
||||
static const bfd_target *ia64coff_object_p PARAMS ((bfd *));
|
||||
|
||||
static const bfd_target *
|
||||
ia64coff_object_p (abfd)
|
||||
bfd *abfd;
|
||||
|
|
@ -73,9 +77,9 @@ ia64coff_object_p (abfd)
|
|||
struct external_PEI_IMAGE_hdr image_hdr;
|
||||
file_ptr offset;
|
||||
|
||||
if (bfd_seek (abfd, 0x00, SEEK_SET) != 0
|
||||
|| bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd)
|
||||
!= sizeof (dos_hdr))
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|
||||
|| (bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd)
|
||||
!= sizeof (dos_hdr)))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -92,23 +96,23 @@ ia64coff_object_p (abfd)
|
|||
this routine can only be called correctly for a PEI file, check
|
||||
the e_magic number here, and, if it doesn't match, clobber the
|
||||
f_magic number so that we don't get a false match. */
|
||||
if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC)
|
||||
if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC)
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew);
|
||||
if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0
|
||||
|| bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd)
|
||||
!= sizeof (image_hdr))
|
||||
offset = H_GET_32 (abfd, dos_hdr.e_lfanew);
|
||||
if (bfd_seek (abfd, offset, SEEK_SET) != 0
|
||||
|| (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd)
|
||||
!= sizeof (image_hdr)))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature)
|
||||
if (H_GET_32 (abfd, image_hdr.nt_signature)
|
||||
!= 0x4550)
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -118,10 +122,7 @@ ia64coff_object_p (abfd)
|
|||
/* Here is the hack. coff_object_p wants to read filhsz bytes to
|
||||
pick up the COFF header for PE, see "struct external_PEI_filehdr"
|
||||
in include/coff/pe.h. We adjust so that that will work. */
|
||||
if (bfd_seek (abfd,
|
||||
(file_ptr) (offset - sizeof (dos_hdr)),
|
||||
SEEK_SET)
|
||||
!= 0)
|
||||
if (bfd_seek (abfd, offset - sizeof (dos_hdr), SEEK_SET) != 0)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
|
|||
|
|
@ -202,9 +202,9 @@ ppc_coff_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct ppc_coff_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct ppc_coff_link_hash_table);
|
||||
|
||||
ret = ((struct ppc_coff_link_hash_table *)
|
||||
bfd_alloc (abfd, sizeof (struct ppc_coff_link_hash_table)));
|
||||
ret = (struct ppc_coff_link_hash_table *) bfd_alloc (abfd, amt);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
if (! ppc_coff_link_hash_table_init (ret, abfd,
|
||||
|
|
@ -833,7 +833,7 @@ enum ref_category
|
|||
{
|
||||
priv,
|
||||
pub,
|
||||
data
|
||||
tocdata
|
||||
};
|
||||
|
||||
struct list_ele
|
||||
|
|
@ -849,18 +849,19 @@ extern struct list_ele *head;
|
|||
extern struct list_ele *tail;
|
||||
|
||||
static void record_toc
|
||||
PARAMS ((asection *, int, enum ref_category, const char *));
|
||||
PARAMS ((asection *, bfd_signed_vma, enum ref_category, const char *));
|
||||
|
||||
static void
|
||||
record_toc (toc_section, our_toc_offset, cat, name)
|
||||
asection *toc_section;
|
||||
int our_toc_offset;
|
||||
bfd_signed_vma our_toc_offset;
|
||||
enum ref_category cat;
|
||||
const char *name;
|
||||
{
|
||||
/* add this entry to our toc addr-offset-name list */
|
||||
struct list_ele *t;
|
||||
t = (struct list_ele *) bfd_malloc (sizeof (struct list_ele));
|
||||
bfd_size_type amt = sizeof (struct list_ele);
|
||||
struct list_ele *t = (struct list_ele *) bfd_malloc (amt);
|
||||
|
||||
if (t == NULL)
|
||||
abort ();
|
||||
t->next = 0;
|
||||
|
|
@ -916,16 +917,16 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
|
|||
if (local_syms == 0)
|
||||
{
|
||||
unsigned int i;
|
||||
bfd_size_type amt;
|
||||
/* allocate a table */
|
||||
local_syms =
|
||||
(int *) bfd_zalloc (abfd,
|
||||
obj_raw_syment_count(abfd) * sizeof (int));
|
||||
amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int);
|
||||
local_syms = (int *) bfd_zalloc (abfd, amt);
|
||||
if (local_syms == 0)
|
||||
return false;
|
||||
obj_coff_local_toc_table(abfd) = local_syms;
|
||||
for (i = 0; i < obj_raw_syment_count(abfd); ++i)
|
||||
obj_coff_local_toc_table (abfd) = local_syms;
|
||||
for (i = 0; i < obj_raw_syment_count (abfd); ++i)
|
||||
{
|
||||
SET_UNALLOCATED(local_syms[i]);
|
||||
SET_UNALLOCATED (local_syms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1194,12 +1195,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
default:
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: unsupported relocation type 0x%02x"),
|
||||
bfd_get_filename (input_bfd), r_type);
|
||||
bfd_archive_filename (input_bfd), r_type);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
case IMAGE_REL_PPC_TOCREL16:
|
||||
{
|
||||
bfd_vma our_toc_offset;
|
||||
bfd_signed_vma our_toc_offset;
|
||||
int fixit;
|
||||
|
||||
DUMP_RELOC2(howto->name, rel);
|
||||
|
|
@ -1246,13 +1247,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
else
|
||||
{
|
||||
/* write out the toc entry */
|
||||
record_toc(toc_section,
|
||||
our_toc_offset,
|
||||
priv,
|
||||
strdup(name));
|
||||
record_toc (toc_section, our_toc_offset, priv,
|
||||
strdup (name));
|
||||
|
||||
bfd_put_32 (output_bfd,
|
||||
val,
|
||||
bfd_put_32 (output_bfd, val,
|
||||
toc_section->contents + our_toc_offset);
|
||||
|
||||
MARK_AS_WRITTEN(local_toc_table[symndx]);
|
||||
|
|
@ -1282,21 +1280,22 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
the IAT to be part of the toc, thus saving a load.
|
||||
*/
|
||||
|
||||
our_toc_offset = val -
|
||||
(toc_section->output_section->vma +
|
||||
toc_section->output_offset);
|
||||
our_toc_offset = val - (toc_section->output_section->vma
|
||||
+ toc_section->output_offset);
|
||||
|
||||
/* The size must still fit in a 16bit displacment */
|
||||
if (our_toc_offset >= 65535)
|
||||
if ((bfd_vma) our_toc_offset >= 65535)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: Relocation for %s of %x exceeds Toc size limit"),
|
||||
bfd_get_filename (input_bfd), name, our_toc_offset);
|
||||
(_("%s: Relocation for %s of %lx exceeds Toc size limit"),
|
||||
bfd_archive_filename (input_bfd), name,
|
||||
(unsigned long) our_toc_offset);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
}
|
||||
|
||||
record_toc(toc_section, our_toc_offset, pub, strdup(name));
|
||||
record_toc (toc_section, our_toc_offset, pub,
|
||||
strdup (name));
|
||||
}
|
||||
else if (IS_WRITTEN(our_toc_offset))
|
||||
{
|
||||
|
|
@ -1308,11 +1307,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else
|
||||
{
|
||||
record_toc(toc_section, our_toc_offset, pub, strdup(name));
|
||||
record_toc(toc_section, our_toc_offset, pub,
|
||||
strdup (name));
|
||||
|
||||
/* write out the toc entry */
|
||||
bfd_put_32 (output_bfd,
|
||||
val,
|
||||
bfd_put_32 (output_bfd, val,
|
||||
toc_section->contents + our_toc_offset);
|
||||
|
||||
MARK_AS_WRITTEN(h->toc_offset);
|
||||
|
|
@ -1331,8 +1330,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
isn't absolute - we output the address here
|
||||
to a file */
|
||||
|
||||
bfd_vma addr = toc_section->output_section->vma
|
||||
+ toc_section->output_offset + our_toc_offset;
|
||||
bfd_vma addr = (toc_section->output_section->vma
|
||||
+ toc_section->output_offset + our_toc_offset);
|
||||
|
||||
if (coff_data(output_bfd)->pe)
|
||||
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
|
||||
|
|
@ -1341,23 +1340,20 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
|
||||
/* FIXME: this test is conservative */
|
||||
if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN &&
|
||||
our_toc_offset > toc_section->_raw_size)
|
||||
if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN
|
||||
&& (bfd_vma) our_toc_offset > toc_section->_raw_size)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: Relocation exceeds allocated TOC (%x)"),
|
||||
bfd_get_filename (input_bfd),
|
||||
toc_section->_raw_size);
|
||||
(_("%s: Relocation exceeds allocated TOC (%lx)"),
|
||||
bfd_archive_filename (input_bfd),
|
||||
(unsigned long) toc_section->_raw_size);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Now we know the relocation for this toc reference */
|
||||
relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT;
|
||||
rstat = _bfd_relocate_contents (howto,
|
||||
input_bfd,
|
||||
relocation,
|
||||
loc);
|
||||
rstat = _bfd_relocate_contents (howto, input_bfd, relocation, loc);
|
||||
}
|
||||
break;
|
||||
case IMAGE_REL_PPC_IFGLUE:
|
||||
|
|
@ -1377,7 +1373,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (h->symbol_is_glue == 1)
|
||||
{
|
||||
x = bfd_get_32 (input_bfd, loc);
|
||||
bfd_put_32 (input_bfd, h->glue_insn, loc);
|
||||
bfd_put_32 (input_bfd, (bfd_vma) h->glue_insn, loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1406,7 +1402,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
fprintf (stderr,
|
||||
_("Warning: unsupported reloc %s <file %s, section %s>\n"),
|
||||
howto->name,
|
||||
bfd_get_filename(input_bfd),
|
||||
bfd_archive_filename(input_bfd),
|
||||
input_section->name);
|
||||
|
||||
fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
|
||||
|
|
@ -1425,14 +1421,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: Out of order IMGLUE reloc for %s"),
|
||||
bfd_get_filename (input_bfd), my_name);
|
||||
bfd_archive_filename (input_bfd), my_name);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
}
|
||||
|
||||
case IMAGE_REL_PPC_ADDR32NB:
|
||||
{
|
||||
struct coff_link_hash_entry *myh = 0;
|
||||
const char *name = 0;
|
||||
DUMP_RELOC2(howto->name, rel);
|
||||
|
||||
|
|
@ -1440,7 +1435,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
/* set magic values */
|
||||
int idata5offset;
|
||||
struct coff_link_hash_entry *myh = 0;
|
||||
struct coff_link_hash_entry *myh;
|
||||
myh = coff_link_hash_lookup (coff_hash_table (info),
|
||||
"__idata5_magic__",
|
||||
false, false, true);
|
||||
|
|
@ -1480,7 +1475,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
if (target != 0)
|
||||
{
|
||||
myh = 0;
|
||||
struct coff_link_hash_entry *myh;
|
||||
|
||||
myh = coff_link_hash_lookup (coff_hash_table (info),
|
||||
target,
|
||||
|
|
@ -1654,7 +1649,7 @@ dump_toc (vfile)
|
|||
cat = _("private ");
|
||||
else if (t->cat == pub)
|
||||
cat = _("public ");
|
||||
else if (t->cat == data)
|
||||
else if (t->cat == tocdata)
|
||||
cat = _("data-in-toc ");
|
||||
|
||||
if (t->offset > global_toc_size)
|
||||
|
|
@ -1665,7 +1660,8 @@ dump_toc (vfile)
|
|||
{
|
||||
fprintf (file,
|
||||
_("**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n"),
|
||||
global_toc_size, global_toc_size, thunk_size, thunk_size);
|
||||
global_toc_size, global_toc_size,
|
||||
thunk_size, thunk_size);
|
||||
cat = _("Out of bounds!");
|
||||
}
|
||||
}
|
||||
|
|
@ -1687,6 +1683,7 @@ ppc_allocate_toc_section (info)
|
|||
{
|
||||
asection *s;
|
||||
bfd_byte *foo;
|
||||
bfd_size_type amt;
|
||||
static char test_char = '1';
|
||||
|
||||
if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
|
||||
|
|
@ -1705,8 +1702,9 @@ ppc_allocate_toc_section (info)
|
|||
abort ();
|
||||
}
|
||||
|
||||
foo = (bfd_byte *) bfd_alloc(bfd_of_toc_owner, global_toc_size);
|
||||
memset(foo, test_char, global_toc_size);
|
||||
amt = global_toc_size;
|
||||
foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt);
|
||||
memset(foo, test_char, (size_t) global_toc_size);
|
||||
|
||||
s->_raw_size = s->_cooked_size = global_toc_size;
|
||||
s->contents = foo;
|
||||
|
|
@ -2178,10 +2176,6 @@ ppc_coff_reloc_type_lookup (abfd, code)
|
|||
|
||||
#define RTYPE2HOWTO(cache_ptr, dst) ppc_coff_rtype2howto (cache_ptr, dst)
|
||||
|
||||
#ifndef COFF_IMAGE_WITH_PE
|
||||
static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
|
||||
#endif
|
||||
|
||||
/* We use the special COFF backend linker, with our own special touch. */
|
||||
|
||||
#define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup
|
||||
|
|
@ -2191,8 +2185,10 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
|
|||
|
||||
#ifndef COFF_IMAGE_WITH_PE
|
||||
/* FIXME: This no longer works. */
|
||||
#if 0
|
||||
#define coff_swap_sym_in_hook ppc_coff_swap_sym_in_hook
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SELECT_RELOC(internal, howto) {internal.r_type=howto->type;}
|
||||
|
||||
|
|
@ -2220,6 +2216,8 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
|
|||
#include "coffcode.h"
|
||||
|
||||
#ifndef COFF_IMAGE_WITH_PE
|
||||
/* FIXME: This no longer works. */
|
||||
#if 0
|
||||
/* FIXME:
|
||||
What we're trying to do here is allocate a toc section (early), and attach
|
||||
it to the last bfd to be processed. This avoids the problem of having a toc
|
||||
|
|
@ -2233,6 +2231,7 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
|
|||
3. Doing it on a "swap in" hook depends on when the "swap in" is called,
|
||||
and how often, etc. It's not clear to me that there isn't a hole here.
|
||||
*/
|
||||
static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
|
||||
|
||||
static void
|
||||
ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
|
||||
|
|
@ -2275,6 +2274,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef COFF_IMAGE_WITH_PE
|
||||
|
||||
|
|
@ -2321,11 +2321,11 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
boolean debug_merge_allocated;
|
||||
asection *o;
|
||||
struct bfd_link_order *p;
|
||||
size_t max_sym_count;
|
||||
size_t max_lineno_count;
|
||||
size_t max_reloc_count;
|
||||
size_t max_output_reloc_count;
|
||||
size_t max_contents_size;
|
||||
bfd_size_type max_sym_count;
|
||||
bfd_size_type max_lineno_count;
|
||||
bfd_size_type max_reloc_count;
|
||||
bfd_size_type max_output_reloc_count;
|
||||
bfd_size_type max_contents_size;
|
||||
file_ptr rel_filepos;
|
||||
unsigned int relsz;
|
||||
file_ptr line_filepos;
|
||||
|
|
@ -2333,6 +2333,7 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
bfd *sub;
|
||||
bfd_byte *external_relocs = NULL;
|
||||
char strbuf[STRING_SIZE_SIZE];
|
||||
bfd_size_type amt;
|
||||
|
||||
symesz = bfd_coff_symesz (abfd);
|
||||
|
||||
|
|
@ -2433,10 +2434,9 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
|
||||
/* We use section_count + 1, rather than section_count, because
|
||||
the target_index fields are 1 based. */
|
||||
finfo.section_info =
|
||||
((struct coff_link_section_info *)
|
||||
bfd_malloc ((abfd->section_count + 1)
|
||||
* sizeof (struct coff_link_section_info)));
|
||||
amt = abfd->section_count + 1;
|
||||
amt *= sizeof (struct coff_link_section_info);
|
||||
finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
|
||||
if (finfo.section_info == NULL)
|
||||
goto error_return;
|
||||
for (i = 0; i <= abfd->section_count; i++)
|
||||
|
|
@ -2477,13 +2477,14 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
but only when doing a relocateable link, which is not the
|
||||
common case. */
|
||||
BFD_ASSERT (info->relocateable);
|
||||
amt = o->reloc_count;
|
||||
amt *= sizeof (struct internal_reloc);
|
||||
finfo.section_info[o->target_index].relocs =
|
||||
((struct internal_reloc *)
|
||||
bfd_malloc (o->reloc_count * sizeof (struct internal_reloc)));
|
||||
(struct internal_reloc *) bfd_malloc (amt);
|
||||
amt = o->reloc_count;
|
||||
amt *= sizeof (struct coff_link_hash_entry *);
|
||||
finfo.section_info[o->target_index].rel_hashes =
|
||||
((struct coff_link_hash_entry **)
|
||||
bfd_malloc (o->reloc_count
|
||||
* sizeof (struct coff_link_hash_entry *)));
|
||||
(struct coff_link_hash_entry **) bfd_malloc (amt);
|
||||
if (finfo.section_info[o->target_index].relocs == NULL
|
||||
|| finfo.section_info[o->target_index].rel_hashes == NULL)
|
||||
goto error_return;
|
||||
|
|
@ -2506,7 +2507,7 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
max_sym_count = 0;
|
||||
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
|
||||
{
|
||||
size_t sz;
|
||||
bfd_size_type sz;
|
||||
|
||||
sub->output_has_begun = false;
|
||||
sz = obj_raw_syment_count (sub);
|
||||
|
|
@ -2515,22 +2516,23 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
}
|
||||
|
||||
/* Allocate some buffers used while linking. */
|
||||
finfo.internal_syms = ((struct internal_syment *)
|
||||
bfd_malloc (max_sym_count
|
||||
* sizeof (struct internal_syment)));
|
||||
finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count
|
||||
* sizeof (asection *));
|
||||
finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long));
|
||||
finfo.outsyms = ((bfd_byte *)
|
||||
bfd_malloc ((size_t) ((max_sym_count + 1) * symesz)));
|
||||
finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count
|
||||
* bfd_coff_linesz (abfd));
|
||||
amt = max_sym_count * sizeof (struct internal_syment);
|
||||
finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt);
|
||||
amt = max_sym_count * sizeof (asection *);
|
||||
finfo.sec_ptrs = (asection **) bfd_malloc (amt);
|
||||
amt = max_sym_count * sizeof (long);
|
||||
finfo.sym_indices = (long *) bfd_malloc (amt);
|
||||
amt = (max_sym_count + 1) * symesz;
|
||||
finfo.outsyms = (bfd_byte *) bfd_malloc (amt);
|
||||
amt = max_lineno_count * bfd_coff_linesz (abfd);
|
||||
finfo.linenos = (bfd_byte *) bfd_malloc (amt);
|
||||
finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
|
||||
finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz);
|
||||
if (! info->relocateable)
|
||||
finfo.internal_relocs = ((struct internal_reloc *)
|
||||
bfd_malloc (max_reloc_count
|
||||
* sizeof (struct internal_reloc)));
|
||||
{
|
||||
amt = max_reloc_count * sizeof (struct internal_reloc);
|
||||
finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
|
||||
}
|
||||
if ((finfo.internal_syms == NULL && max_sym_count > 0)
|
||||
|| (finfo.sec_ptrs == NULL && max_sym_count > 0)
|
||||
|| (finfo.sym_indices == NULL && max_sym_count > 0)
|
||||
|
|
@ -2649,14 +2651,14 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
if (finfo.last_file_index != -1
|
||||
&& (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd))
|
||||
{
|
||||
file_ptr pos;
|
||||
|
||||
finfo.last_file.n_value = obj_raw_syment_count (abfd);
|
||||
bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file,
|
||||
(PTR) finfo.outsyms);
|
||||
if (bfd_seek (abfd,
|
||||
(obj_sym_filepos (abfd)
|
||||
+ finfo.last_file_index * symesz),
|
||||
SEEK_SET) != 0
|
||||
|| bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz)
|
||||
pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2679,8 +2681,8 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
/* Now that we have written out all the global symbols, we know
|
||||
the symbol indices to use for relocs against them, and we can
|
||||
finally write out the relocs. */
|
||||
external_relocs = ((bfd_byte *)
|
||||
bfd_malloc (max_output_reloc_count * relsz));
|
||||
amt = max_output_reloc_count * relsz;
|
||||
external_relocs = (bfd_byte *) bfd_malloc (amt);
|
||||
if (external_relocs == NULL)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -2708,9 +2710,9 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel);
|
||||
}
|
||||
|
||||
amt = relsz * o->reloc_count;
|
||||
if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
|
||||
|| bfd_write ((PTR) external_relocs, relsz, o->reloc_count,
|
||||
abfd) != relsz * o->reloc_count)
|
||||
|| bfd_bwrite ((PTR) external_relocs, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
|
|
@ -2744,21 +2746,22 @@ ppc_bfd_coff_final_link (abfd, info)
|
|||
/* Write out the string table. */
|
||||
if (obj_raw_syment_count (abfd) != 0)
|
||||
{
|
||||
if (bfd_seek (abfd,
|
||||
(obj_sym_filepos (abfd)
|
||||
+ obj_raw_syment_count (abfd) * symesz),
|
||||
SEEK_SET) != 0)
|
||||
file_ptr pos;
|
||||
|
||||
pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0)
|
||||
return false;
|
||||
|
||||
#if STRING_SIZE_SIZE == 4
|
||||
bfd_h_put_32 (abfd,
|
||||
_bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
|
||||
(bfd_byte *) strbuf);
|
||||
H_PUT_32 (abfd,
|
||||
_bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
|
||||
strbuf);
|
||||
#else
|
||||
#error Change bfd_h_put_32
|
||||
#error Change H_PUT_32 above
|
||||
#endif
|
||||
|
||||
if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE)
|
||||
if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd)
|
||||
!= STRING_SIZE_SIZE)
|
||||
return false;
|
||||
|
||||
if (! _bfd_stringtab_emit (abfd, finfo.strtab))
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for Sparc COFF files.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
|
|
@ -33,6 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
/* The page size is a guess based on ELF. */
|
||||
#define COFF_PAGE_SIZE 0x10000
|
||||
|
||||
|
||||
static reloc_howto_type *coff_sparc_reloc_type_lookup
|
||||
PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
|
||||
|
||||
enum reloc_type
|
||||
{
|
||||
R_SPARC_NONE = 0,
|
||||
|
|
@ -52,7 +57,7 @@ enum reloc_type
|
|||
};
|
||||
|
||||
#if 0
|
||||
static CONST char *CONST reloc_type_names[] =
|
||||
static const char *const reloc_type_names[] =
|
||||
{
|
||||
"R_SPARC_NONE",
|
||||
"R_SPARC_8", "R_SPARC_16", "R_SPARC_32",
|
||||
|
|
@ -129,7 +134,7 @@ struct coff_reloc_map {
|
|||
unsigned char coff_reloc_val;
|
||||
};
|
||||
|
||||
static CONST struct coff_reloc_map sparc_reloc_map[] =
|
||||
static const struct coff_reloc_map sparc_reloc_map[] =
|
||||
{
|
||||
{ BFD_RELOC_NONE, R_SPARC_NONE, },
|
||||
{ BFD_RELOC_16, R_SPARC_16, },
|
||||
|
|
@ -183,8 +188,8 @@ rtype2howto (cache_ptr, dst)
|
|||
|
||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
|
||||
|
||||
#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
|
||||
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
||||
#define SWAP_IN_RELOC_OFFSET H_GET_32
|
||||
#define SWAP_OUT_RELOC_OFFSET H_PUT_32
|
||||
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
|
||||
cache_ptr->addend = reloc.r_offset;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -47,13 +47,13 @@ static void coff_fix_symbol_name
|
|||
PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
|
||||
asection **, bfd_size_type *));
|
||||
static boolean coff_write_symbol
|
||||
PARAMS ((bfd *, asymbol *, combined_entry_type *, unsigned int *,
|
||||
PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *,
|
||||
bfd_size_type *, asection **, bfd_size_type *));
|
||||
static boolean coff_write_alien_symbol
|
||||
PARAMS ((bfd *, asymbol *, unsigned int *, bfd_size_type *,
|
||||
PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *,
|
||||
asection **, bfd_size_type *));
|
||||
static boolean coff_write_native_symbol
|
||||
PARAMS ((bfd *, coff_symbol_type *, unsigned int *, bfd_size_type *,
|
||||
PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *,
|
||||
asection **, bfd_size_type *));
|
||||
static void coff_pointerize_aux
|
||||
PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
|
||||
|
|
@ -68,7 +68,7 @@ static void fixup_symbol_value
|
|||
static char *build_debug_section
|
||||
PARAMS ((bfd *));
|
||||
static char *copy_name
|
||||
PARAMS ((bfd *, char *, int));
|
||||
PARAMS ((bfd *, char *, size_t));
|
||||
|
||||
#define STRING_SIZE_SIZE (4)
|
||||
|
||||
|
|
@ -82,6 +82,8 @@ make_a_section_from_file (abfd, hdr, target_index)
|
|||
{
|
||||
asection *return_section;
|
||||
char *name;
|
||||
boolean result = true;
|
||||
flagword flags;
|
||||
|
||||
name = NULL;
|
||||
|
||||
|
|
@ -106,7 +108,7 @@ make_a_section_from_file (abfd, hdr, target_index)
|
|||
strindex does not run us past the end, but right now we
|
||||
don't know the length of the string table. */
|
||||
strings += strindex;
|
||||
name = bfd_alloc (abfd, strlen (strings) + 1);
|
||||
name = bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1);
|
||||
if (name == NULL)
|
||||
return false;
|
||||
strcpy (name, strings);
|
||||
|
|
@ -116,7 +118,7 @@ make_a_section_from_file (abfd, hdr, target_index)
|
|||
if (name == NULL)
|
||||
{
|
||||
/* Assorted wastage to null-terminate the name, thanks AT&T! */
|
||||
name = bfd_alloc (abfd, sizeof (hdr->s_name) + 1);
|
||||
name = bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1);
|
||||
if (name == NULL)
|
||||
return false;
|
||||
strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name));
|
||||
|
|
@ -142,8 +144,12 @@ make_a_section_from_file (abfd, hdr, target_index)
|
|||
return_section->userdata = NULL;
|
||||
return_section->next = (asection *) NULL;
|
||||
return_section->target_index = target_index;
|
||||
return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name,
|
||||
return_section);
|
||||
|
||||
if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section,
|
||||
& flags))
|
||||
result = false;
|
||||
|
||||
return_section->flags = flags;
|
||||
|
||||
/* At least on i386-coff, the line number count for a shared library
|
||||
section must be ignored. */
|
||||
|
|
@ -155,7 +161,8 @@ make_a_section_from_file (abfd, hdr, target_index)
|
|||
/* FIXME: should this check 'hdr->s_size > 0' */
|
||||
if (hdr->s_scnptr != 0)
|
||||
return_section->flags |= SEC_HAS_CONTENTS;
|
||||
return true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Read in a COFF object and make it into a BFD. This is used by
|
||||
|
|
@ -171,7 +178,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a)
|
|||
flagword oflags = abfd->flags;
|
||||
bfd_vma ostart = bfd_get_start_address (abfd);
|
||||
PTR tdata;
|
||||
size_t readsize; /* length of file_info */
|
||||
bfd_size_type readsize; /* length of file_info */
|
||||
unsigned int scnhsz;
|
||||
char *external_sections;
|
||||
|
||||
|
|
@ -204,12 +211,12 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a)
|
|||
return 0;
|
||||
|
||||
scnhsz = bfd_coff_scnhsz (abfd);
|
||||
readsize = nscns * scnhsz;
|
||||
readsize = (bfd_size_type) nscns * scnhsz;
|
||||
external_sections = (char *) bfd_alloc (abfd, readsize);
|
||||
if (!external_sections)
|
||||
goto fail;
|
||||
|
||||
if (bfd_read ((PTR) external_sections, 1, readsize, abfd) != readsize)
|
||||
if (bfd_bread ((PTR) external_sections, readsize, abfd) != readsize)
|
||||
goto fail;
|
||||
|
||||
/* Set the arch/mach *before* swapping in sections; section header swapping
|
||||
|
|
@ -250,9 +257,9 @@ const bfd_target *
|
|||
coff_object_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
unsigned int filhsz;
|
||||
unsigned int aoutsz;
|
||||
int nscns;
|
||||
bfd_size_type filhsz;
|
||||
bfd_size_type aoutsz;
|
||||
unsigned int nscns;
|
||||
PTR filehdr;
|
||||
struct internal_filehdr internal_f;
|
||||
struct internal_aouthdr internal_a;
|
||||
|
|
@ -264,7 +271,7 @@ coff_object_p (abfd)
|
|||
filehdr = bfd_alloc (abfd, filhsz);
|
||||
if (filehdr == NULL)
|
||||
return 0;
|
||||
if (bfd_read (filehdr, 1, filhsz, abfd) != filhsz)
|
||||
if (bfd_bread (filehdr, filhsz, abfd) != filhsz)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -273,7 +280,16 @@ coff_object_p (abfd)
|
|||
bfd_coff_swap_filehdr_in (abfd, filehdr, &internal_f);
|
||||
bfd_release (abfd, filehdr);
|
||||
|
||||
if (bfd_coff_bad_format_hook (abfd, &internal_f) == false)
|
||||
/* The XCOFF format has two sizes for the f_opthdr. SMALL_AOUTSZ
|
||||
(less than aoutsz) used in object files and AOUTSZ (equal to
|
||||
aoutsz) in executables. The bfd_coff_swap_aouthdr_in function
|
||||
expects this header to be aoutsz bytes in length, so we use that
|
||||
value in the call to bfd_alloc below. But we must be careful to
|
||||
only read in f_opthdr bytes in the call to bfd_bread. We should
|
||||
also attempt to catch corrupt or non-COFF binaries with a strange
|
||||
value for f_opthdr. */
|
||||
if (bfd_coff_bad_format_hook (abfd, &internal_f) == false
|
||||
|| internal_f.f_opthdr > aoutsz)
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return 0;
|
||||
|
|
@ -286,8 +302,8 @@ coff_object_p (abfd)
|
|||
|
||||
opthdr = bfd_alloc (abfd, aoutsz);
|
||||
if (opthdr == NULL)
|
||||
return 0;;
|
||||
if (bfd_read (opthdr, 1, internal_f.f_opthdr, abfd)
|
||||
return 0;
|
||||
if (bfd_bread (opthdr, (bfd_size_type) internal_f.f_opthdr, abfd)
|
||||
!= internal_f.f_opthdr)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -424,6 +440,7 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
|
|||
bfd_byte *erel;
|
||||
bfd_byte *erel_end;
|
||||
struct internal_reloc *irel;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (coff_section_data (abfd, sec) != NULL
|
||||
&& coff_section_data (abfd, sec)->relocs != NULL)
|
||||
|
|
@ -437,24 +454,24 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
|
|||
|
||||
relsz = bfd_coff_relsz (abfd);
|
||||
|
||||
amt = sec->reloc_count * relsz;
|
||||
if (external_relocs == NULL)
|
||||
{
|
||||
free_external = (bfd_byte *) bfd_malloc (sec->reloc_count * relsz);
|
||||
free_external = (bfd_byte *) bfd_malloc (amt);
|
||||
if (free_external == NULL && sec->reloc_count > 0)
|
||||
goto error_return;
|
||||
external_relocs = free_external;
|
||||
}
|
||||
|
||||
if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0
|
||||
|| (bfd_read (external_relocs, relsz, sec->reloc_count, abfd)
|
||||
!= relsz * sec->reloc_count))
|
||||
|| bfd_bread (external_relocs, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
|
||||
if (internal_relocs == NULL)
|
||||
{
|
||||
free_internal = ((struct internal_reloc *)
|
||||
bfd_malloc (sec->reloc_count
|
||||
* sizeof (struct internal_reloc)));
|
||||
amt = sec->reloc_count;
|
||||
amt *= sizeof (struct internal_reloc);
|
||||
free_internal = (struct internal_reloc *) bfd_malloc (amt);
|
||||
if (free_internal == NULL && sec->reloc_count > 0)
|
||||
goto error_return;
|
||||
internal_relocs = free_internal;
|
||||
|
|
@ -477,9 +494,8 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
|
|||
{
|
||||
if (coff_section_data (abfd, sec) == NULL)
|
||||
{
|
||||
sec->used_by_bfd =
|
||||
(PTR) bfd_zalloc (abfd,
|
||||
sizeof (struct coff_section_tdata));
|
||||
amt = sizeof (struct coff_section_tdata);
|
||||
sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
|
||||
if (sec->used_by_bfd == NULL)
|
||||
goto error_return;
|
||||
coff_section_data (abfd, sec)->contents = NULL;
|
||||
|
|
@ -539,15 +555,18 @@ coff_count_linenumbers (abfd)
|
|||
section's linenumber count. */
|
||||
alent *l = q->lineno;
|
||||
|
||||
++q->symbol.section->output_section->lineno_count;
|
||||
++total;
|
||||
++l;
|
||||
while (l->line_number != 0)
|
||||
do
|
||||
{
|
||||
asection * sec = q->symbol.section->output_section;
|
||||
|
||||
/* Do not try to update fields in read-only sections. */
|
||||
if (! bfd_is_const_section (sec))
|
||||
sec->lineno_count ++;
|
||||
|
||||
++total;
|
||||
++q->symbol.section->output_section->lineno_count;
|
||||
++l;
|
||||
}
|
||||
while (l->line_number != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -654,9 +673,10 @@ coff_renumber_symbols (bfd_ptr, first_undef)
|
|||
{
|
||||
asymbol **newsyms;
|
||||
unsigned int i;
|
||||
bfd_size_type amt;
|
||||
|
||||
newsyms = (asymbol **) bfd_alloc (bfd_ptr,
|
||||
sizeof (asymbol *) * (symbol_count + 1));
|
||||
amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1);
|
||||
newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt);
|
||||
if (!newsyms)
|
||||
return false;
|
||||
bfd_ptr->outsymbols = newsyms;
|
||||
|
|
@ -750,7 +770,8 @@ coff_mangle_symbols (bfd_ptr)
|
|||
{
|
||||
/* FIXME: We should use a union here. */
|
||||
s->u.syment.n_value =
|
||||
((combined_entry_type *) s->u.syment.n_value)->offset;
|
||||
(bfd_vma)((combined_entry_type *)
|
||||
((unsigned long) s->u.syment.n_value))->offset;
|
||||
s->fix_value = 0;
|
||||
}
|
||||
if (s->fix_line)
|
||||
|
|
@ -868,7 +889,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
|
|||
}
|
||||
else
|
||||
{
|
||||
long filepos;
|
||||
file_ptr filepos;
|
||||
bfd_byte buf[4];
|
||||
int prefix_len = bfd_coff_debug_string_prefix_length (abfd);
|
||||
|
||||
|
|
@ -881,9 +902,9 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
|
|||
*debug_string_section_p = bfd_get_section_by_name (abfd, ".debug");
|
||||
filepos = bfd_tell (abfd);
|
||||
if (prefix_len == 4)
|
||||
bfd_put_32 (abfd, name_length + 1, buf);
|
||||
bfd_put_32 (abfd, (bfd_vma) (name_length + 1), buf);
|
||||
else
|
||||
bfd_put_16 (abfd, name_length + 1, buf);
|
||||
bfd_put_16 (abfd, (bfd_vma) (name_length + 1), buf);
|
||||
|
||||
if (!bfd_set_section_contents (abfd,
|
||||
*debug_string_section_p,
|
||||
|
|
@ -893,8 +914,8 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
|
|||
|| !bfd_set_section_contents (abfd,
|
||||
*debug_string_section_p,
|
||||
(PTR) symbol->name,
|
||||
((file_ptr) *debug_string_size_p
|
||||
+ prefix_len),
|
||||
(file_ptr) (*debug_string_size_p
|
||||
+ prefix_len),
|
||||
(bfd_size_type) name_length + 1))
|
||||
abort ();
|
||||
if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
|
||||
|
|
@ -921,7 +942,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
|
|||
bfd *abfd;
|
||||
asymbol *symbol;
|
||||
combined_entry_type *native;
|
||||
unsigned int *written;
|
||||
bfd_vma *written;
|
||||
bfd_size_type *string_size_p;
|
||||
asection **debug_string_section_p;
|
||||
bfd_size_type *debug_string_size_p;
|
||||
|
|
@ -962,7 +983,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
|
|||
if (!buf)
|
||||
return false;
|
||||
bfd_coff_swap_sym_out (abfd, &native->u.syment, buf);
|
||||
if (bfd_write (buf, 1, symesz, abfd) != symesz)
|
||||
if (bfd_bwrite (buf, symesz, abfd) != symesz)
|
||||
return false;
|
||||
bfd_release (abfd, buf);
|
||||
|
||||
|
|
@ -981,10 +1002,10 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
|
|||
&((native + j + 1)->u.auxent),
|
||||
type,
|
||||
class,
|
||||
j,
|
||||
(int) j,
|
||||
native->u.syment.n_numaux,
|
||||
buf);
|
||||
if (bfd_write (buf, 1, auxesz, abfd) != auxesz)
|
||||
if (bfd_bwrite (buf, auxesz, abfd) != auxesz)
|
||||
return false;
|
||||
}
|
||||
bfd_release (abfd, buf);
|
||||
|
|
@ -1006,7 +1027,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
|
|||
debug_string_section_p, debug_string_size_p)
|
||||
bfd *abfd;
|
||||
asymbol *symbol;
|
||||
unsigned int *written;
|
||||
bfd_vma *written;
|
||||
bfd_size_type *string_size_p;
|
||||
asection **debug_string_section_p;
|
||||
bfd_size_type *debug_string_size_p;
|
||||
|
|
@ -1045,7 +1066,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
|
|||
if (! obj_pe (abfd))
|
||||
native->u.syment.n_value += symbol->section->output_section->vma;
|
||||
|
||||
/* Copy the any flags from the the file header into the symbol.
|
||||
/* Copy the any flags from the file header into the symbol.
|
||||
FIXME: Why? */
|
||||
{
|
||||
coff_symbol_type *c = coff_symbol_from (abfd, symbol);
|
||||
|
|
@ -1074,7 +1095,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p,
|
|||
debug_string_section_p, debug_string_size_p)
|
||||
bfd *abfd;
|
||||
coff_symbol_type *symbol;
|
||||
unsigned int *written;
|
||||
bfd_vma *written;
|
||||
bfd_size_type *string_size_p;
|
||||
asection **debug_string_section_p;
|
||||
bfd_size_type *debug_string_size_p;
|
||||
|
|
@ -1127,8 +1148,9 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p,
|
|||
}
|
||||
symbol->done_lineno = true;
|
||||
|
||||
symbol->symbol.section->output_section->moving_line_filepos +=
|
||||
count * bfd_coff_linesz (abfd);
|
||||
if (! bfd_is_const_section (symbol->symbol.section->output_section))
|
||||
symbol->symbol.section->output_section->moving_line_filepos +=
|
||||
count * bfd_coff_linesz (abfd);
|
||||
}
|
||||
|
||||
return coff_write_symbol (abfd, &(symbol->symbol), native, written,
|
||||
|
|
@ -1147,7 +1169,7 @@ coff_write_symbols (abfd)
|
|||
bfd_size_type debug_string_size;
|
||||
unsigned int i;
|
||||
unsigned int limit = bfd_get_symcount (abfd);
|
||||
unsigned int written = 0;
|
||||
bfd_signed_vma written = 0;
|
||||
asymbol **p;
|
||||
|
||||
string_size = 0;
|
||||
|
|
@ -1211,11 +1233,12 @@ coff_write_symbols (abfd)
|
|||
bfd_byte buffer[STRING_SIZE_SIZE];
|
||||
|
||||
#if STRING_SIZE_SIZE == 4
|
||||
bfd_h_put_32 (abfd, size, buffer);
|
||||
H_PUT_32 (abfd, size, buffer);
|
||||
#else
|
||||
#error Change bfd_h_put_32
|
||||
#error Change H_PUT_32
|
||||
#endif
|
||||
if (bfd_write ((PTR) buffer, 1, sizeof (buffer), abfd) != sizeof (buffer))
|
||||
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd)
|
||||
!= sizeof (buffer))
|
||||
return false;
|
||||
|
||||
/* Handle long section names. This code must handle section
|
||||
|
|
@ -1231,7 +1254,8 @@ coff_write_symbols (abfd)
|
|||
len = strlen (o->name);
|
||||
if (len > SCNNMLEN)
|
||||
{
|
||||
if (bfd_write (o->name, 1, len + 1, abfd) != len + 1)
|
||||
if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd)
|
||||
!= len + 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1271,7 +1295,10 @@ coff_write_symbols (abfd)
|
|||
&& c_symbol->native->u.syment.n_numaux > 0)
|
||||
{
|
||||
if (bfd_coff_force_symnames_in_strings (abfd))
|
||||
bfd_write (".file", 1, 6, abfd);
|
||||
{
|
||||
if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6)
|
||||
return false;
|
||||
}
|
||||
maxlen = bfd_coff_filnmlen (abfd);
|
||||
}
|
||||
else
|
||||
|
|
@ -1279,8 +1306,8 @@ coff_write_symbols (abfd)
|
|||
|
||||
if (name_length > maxlen)
|
||||
{
|
||||
if (bfd_write ((PTR) (q->name), 1, name_length + 1, abfd)
|
||||
!= name_length + 1)
|
||||
if (bfd_bwrite ((PTR) (q->name), (bfd_size_type) name_length + 1,
|
||||
abfd) != name_length + 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1294,11 +1321,11 @@ coff_write_symbols (abfd)
|
|||
bfd_byte buffer[STRING_SIZE_SIZE];
|
||||
|
||||
#if STRING_SIZE_SIZE == 4
|
||||
bfd_h_put_32 (abfd, size, buffer);
|
||||
H_PUT_32 (abfd, size, buffer);
|
||||
#else
|
||||
#error Change bfd_h_put_32
|
||||
#error Change H_PUT_32
|
||||
#endif
|
||||
if (bfd_write ((PTR) buffer, 1, STRING_SIZE_SIZE, abfd)
|
||||
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd)
|
||||
!= STRING_SIZE_SIZE)
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1353,7 +1380,8 @@ coff_write_linenumbers (abfd)
|
|||
out.l_lnno = 0;
|
||||
out.l_addr.l_symndx = l->u.offset;
|
||||
bfd_coff_swap_lineno_out (abfd, &out, buff);
|
||||
if (bfd_write (buff, 1, linesz, abfd) != linesz)
|
||||
if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd)
|
||||
!= linesz)
|
||||
return false;
|
||||
l++;
|
||||
while (l->line_number)
|
||||
|
|
@ -1361,7 +1389,8 @@ coff_write_linenumbers (abfd)
|
|||
out.l_lnno = l->line_number;
|
||||
out.l_addr.l_symndx = l->u.offset;
|
||||
bfd_coff_swap_lineno_out (abfd, &out, buff);
|
||||
if (bfd_write (buff, 1, linesz, abfd) != linesz)
|
||||
if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd)
|
||||
!= linesz)
|
||||
return false;
|
||||
l++;
|
||||
}
|
||||
|
|
@ -1409,7 +1438,7 @@ coff_section_symbol (abfd, name)
|
|||
combined_entry_type e[10];
|
||||
};
|
||||
struct foo *f;
|
||||
f = (struct foo *) bfd_alloc (abfd, sizeof (*f));
|
||||
f = (struct foo *) bfd_alloc (abfd, (bfd_size_type) sizeof (*f));
|
||||
if (!f)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_error);
|
||||
|
|
@ -1492,7 +1521,8 @@ build_debug_section (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
char *debug_section;
|
||||
long position;
|
||||
file_ptr position;
|
||||
bfd_size_type sec_size;
|
||||
|
||||
asection *sect = bfd_get_section_by_name (abfd, ".debug");
|
||||
|
||||
|
|
@ -1502,8 +1532,8 @@ build_debug_section (abfd)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
debug_section = (PTR) bfd_alloc (abfd,
|
||||
bfd_get_section_size_before_reloc (sect));
|
||||
sec_size = bfd_get_section_size_before_reloc (sect);
|
||||
debug_section = (PTR) bfd_alloc (abfd, sec_size);
|
||||
if (debug_section == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1513,9 +1543,7 @@ build_debug_section (abfd)
|
|||
|
||||
position = bfd_tell (abfd);
|
||||
if (bfd_seek (abfd, sect->filepos, SEEK_SET) != 0
|
||||
|| (bfd_read (debug_section,
|
||||
bfd_get_section_size_before_reloc (sect), 1, abfd)
|
||||
!= bfd_get_section_size_before_reloc (sect))
|
||||
|| bfd_bread (debug_section, sec_size, abfd) != sec_size
|
||||
|| bfd_seek (abfd, position, SEEK_SET) != 0)
|
||||
return NULL;
|
||||
return debug_section;
|
||||
|
|
@ -1528,9 +1556,9 @@ static char *
|
|||
copy_name (abfd, name, maxlen)
|
||||
bfd *abfd;
|
||||
char *name;
|
||||
int maxlen;
|
||||
size_t maxlen;
|
||||
{
|
||||
int len;
|
||||
size_t len;
|
||||
char *newname;
|
||||
|
||||
for (len = 0; len < maxlen; ++len)
|
||||
|
|
@ -1541,7 +1569,7 @@ copy_name (abfd, name, maxlen)
|
|||
}
|
||||
}
|
||||
|
||||
if ((newname = (PTR) bfd_alloc (abfd, len + 1)) == NULL)
|
||||
if ((newname = (PTR) bfd_alloc (abfd, (bfd_size_type) len + 1)) == NULL)
|
||||
return (NULL);
|
||||
strncpy (newname, name, len);
|
||||
newname[len] = '\0';
|
||||
|
|
@ -1555,7 +1583,7 @@ _bfd_coff_get_external_symbols (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
bfd_size_type symesz;
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
PTR syms;
|
||||
|
||||
if (obj_coff_external_syms (abfd) != NULL)
|
||||
|
|
@ -1570,7 +1598,7 @@ _bfd_coff_get_external_symbols (abfd)
|
|||
return false;
|
||||
|
||||
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|
||||
|| bfd_read (syms, size, 1, abfd) != size)
|
||||
|| bfd_bread (syms, size, abfd) != size)
|
||||
{
|
||||
if (syms != NULL)
|
||||
free (syms);
|
||||
|
|
@ -1591,8 +1619,9 @@ _bfd_coff_read_string_table (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
char extstrsize[STRING_SIZE_SIZE];
|
||||
size_t strsize;
|
||||
bfd_size_type strsize;
|
||||
char *strings;
|
||||
file_ptr pos;
|
||||
|
||||
if (obj_coff_strings (abfd) != NULL)
|
||||
return obj_coff_strings (abfd);
|
||||
|
|
@ -1603,13 +1632,13 @@ _bfd_coff_read_string_table (abfd)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (bfd_seek (abfd,
|
||||
(obj_sym_filepos (abfd)
|
||||
+ obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd)),
|
||||
SEEK_SET) != 0)
|
||||
pos = obj_sym_filepos (abfd);
|
||||
pos += obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0)
|
||||
return NULL;
|
||||
|
||||
if (bfd_read (extstrsize, sizeof extstrsize, 1, abfd) != sizeof extstrsize)
|
||||
if (bfd_bread (extstrsize, (bfd_size_type) sizeof extstrsize, abfd)
|
||||
!= sizeof extstrsize)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_file_truncated)
|
||||
return NULL;
|
||||
|
|
@ -1620,16 +1649,16 @@ _bfd_coff_read_string_table (abfd)
|
|||
else
|
||||
{
|
||||
#if STRING_SIZE_SIZE == 4
|
||||
strsize = bfd_h_get_32 (abfd, (bfd_byte *) extstrsize);
|
||||
strsize = H_GET_32 (abfd, extstrsize);
|
||||
#else
|
||||
#error Change bfd_h_get_32
|
||||
#error Change H_GET_32
|
||||
#endif
|
||||
}
|
||||
|
||||
if (strsize < STRING_SIZE_SIZE)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: bad string table size %lu"), bfd_get_filename (abfd),
|
||||
(_("%s: bad string table size %lu"), bfd_archive_filename (abfd),
|
||||
(unsigned long) strsize);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return NULL;
|
||||
|
|
@ -1639,8 +1668,7 @@ _bfd_coff_read_string_table (abfd)
|
|||
if (strings == NULL)
|
||||
return NULL;
|
||||
|
||||
if (bfd_read (strings + STRING_SIZE_SIZE,
|
||||
strsize - STRING_SIZE_SIZE, 1, abfd)
|
||||
if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd)
|
||||
!= strsize - STRING_SIZE_SIZE)
|
||||
{
|
||||
free (strings);
|
||||
|
|
@ -1686,12 +1714,12 @@ coff_get_normalized_symtab (abfd)
|
|||
combined_entry_type *internal_ptr;
|
||||
combined_entry_type *symbol_ptr;
|
||||
combined_entry_type *internal_end;
|
||||
bfd_size_type symesz;
|
||||
size_t symesz;
|
||||
char *raw_src;
|
||||
char *raw_end;
|
||||
const char *string_table = NULL;
|
||||
char *debug_section = NULL;
|
||||
unsigned long size;
|
||||
bfd_size_type size;
|
||||
|
||||
if (obj_raw_syments (abfd) != NULL)
|
||||
return obj_raw_syments (abfd);
|
||||
|
|
@ -1734,7 +1762,7 @@ coff_get_normalized_symtab (abfd)
|
|||
bfd_coff_swap_aux_in (abfd, (PTR) raw_src,
|
||||
symbol_ptr->u.syment.n_type,
|
||||
symbol_ptr->u.syment.n_sclass,
|
||||
i, symbol_ptr->u.syment.n_numaux,
|
||||
(int) i, symbol_ptr->u.syment.n_numaux,
|
||||
&(internal_ptr->u.auxent));
|
||||
coff_pointerize_aux (abfd, internal, symbol_ptr, i,
|
||||
internal_ptr);
|
||||
|
|
@ -1789,7 +1817,7 @@ coff_get_normalized_symtab (abfd)
|
|||
((long)
|
||||
copy_name (abfd,
|
||||
(internal_ptr + 1)->u.auxent.x_file.x_fname,
|
||||
bfd_coff_filnmlen (abfd)));
|
||||
(size_t) bfd_coff_filnmlen (abfd)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1798,23 +1826,20 @@ coff_get_normalized_symtab (abfd)
|
|||
if (internal_ptr->u.syment._n._n_n._n_zeroes != 0)
|
||||
{
|
||||
/* This is a "short" name. Make it long. */
|
||||
unsigned long i = 0;
|
||||
char *newstring = NULL;
|
||||
size_t i;
|
||||
char *newstring;
|
||||
|
||||
/* find the length of this string without walking into memory
|
||||
that isn't ours. */
|
||||
for (i = 0; i < 8; ++i)
|
||||
{
|
||||
if (internal_ptr->u.syment._n._n_name[i] == '\0')
|
||||
{
|
||||
break;
|
||||
} /* if end of string */
|
||||
} /* possible lengths of this string. */
|
||||
if (internal_ptr->u.syment._n._n_name[i] == '\0')
|
||||
break;
|
||||
|
||||
if ((newstring = (PTR) bfd_alloc (abfd, ++i)) == NULL)
|
||||
newstring = (PTR) bfd_alloc (abfd, (bfd_size_type) (i + 1));
|
||||
if (newstring == NULL)
|
||||
return (NULL);
|
||||
memset (newstring, 0, i);
|
||||
strncpy (newstring, internal_ptr->u.syment._n._n_name, i - 1);
|
||||
memset (newstring, 0, i + 1);
|
||||
strncpy (newstring, internal_ptr->u.syment._n._n_name, i);
|
||||
internal_ptr->u.syment._n._n_n._n_offset = (long int) newstring;
|
||||
internal_ptr->u.syment._n._n_n._n_zeroes = 0;
|
||||
}
|
||||
|
|
@ -1871,7 +1896,8 @@ asymbol *
|
|||
coff_make_empty_symbol (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type));
|
||||
bfd_size_type amt = sizeof (coff_symbol_type);
|
||||
coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, amt);
|
||||
if (new == NULL)
|
||||
return (NULL);
|
||||
memset (new, 0, sizeof *new);
|
||||
|
|
@ -1891,12 +1917,14 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz)
|
|||
PTR ptr ATTRIBUTE_UNUSED;
|
||||
unsigned long sz ATTRIBUTE_UNUSED;
|
||||
{
|
||||
coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type));
|
||||
bfd_size_type amt = sizeof (coff_symbol_type);
|
||||
coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, amt);
|
||||
if (new == NULL)
|
||||
return (NULL);
|
||||
/* @@ The 10 is a guess at a plausible maximum number of aux entries
|
||||
(but shouldn't be a constant). */
|
||||
new->native = (combined_entry_type *) bfd_zalloc (abfd, sizeof (combined_entry_type) * 10);
|
||||
amt = sizeof (combined_entry_type) * 10;
|
||||
new->native = (combined_entry_type *) bfd_zalloc (abfd, amt);
|
||||
if (!new->native)
|
||||
return (NULL);
|
||||
new->symbol.section = bfd_abs_section_ptr;
|
||||
|
|
@ -1917,11 +1945,8 @@ coff_get_symbol_info (abfd, symbol, ret)
|
|||
if (coffsymbol (symbol)->native != NULL
|
||||
&& coffsymbol (symbol)->native->fix_value)
|
||||
{
|
||||
combined_entry_type *psym;
|
||||
|
||||
psym = ((combined_entry_type *)
|
||||
coffsymbol (symbol)->native->u.syment.n_value);
|
||||
ret->value = (bfd_vma) (psym - obj_raw_syments (abfd));
|
||||
ret->value = coffsymbol (symbol)->native->u.syment.n_value -
|
||||
(unsigned long) obj_raw_syments (abfd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1945,8 +1970,8 @@ bfd_coff_get_syment (abfd, symbol, psyment)
|
|||
*psyment = csym->native->u.syment;
|
||||
|
||||
if (csym->native->fix_value)
|
||||
psyment->n_value = ((combined_entry_type *) psyment->n_value
|
||||
- obj_raw_syments (abfd));
|
||||
psyment->n_value = psyment->n_value -
|
||||
(unsigned long) obj_raw_syments (abfd);
|
||||
|
||||
/* FIXME: We should handle fix_line here. */
|
||||
|
||||
|
|
@ -2023,7 +2048,7 @@ coff_print_symbol (abfd, filep, symbol, how)
|
|||
case bfd_print_symbol_all:
|
||||
if (coffsymbol (symbol)->native)
|
||||
{
|
||||
unsigned long val;
|
||||
bfd_vma val;
|
||||
unsigned int aux;
|
||||
combined_entry_type *combined = coffsymbol (symbol)->native;
|
||||
combined_entry_type *root = obj_raw_syments (abfd);
|
||||
|
|
@ -2032,12 +2057,11 @@ coff_print_symbol (abfd, filep, symbol, how)
|
|||
fprintf (file, "[%3ld]", (long) (combined - root));
|
||||
|
||||
if (! combined->fix_value)
|
||||
val = (unsigned long) combined->u.syment.n_value;
|
||||
val = (bfd_vma) combined->u.syment.n_value;
|
||||
else
|
||||
val = ((unsigned long)
|
||||
((combined_entry_type *) combined->u.syment.n_value
|
||||
- root));
|
||||
val = combined->u.syment.n_value - (unsigned long) root;
|
||||
|
||||
#ifndef XCOFF64
|
||||
fprintf (file,
|
||||
"(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%08lx %s",
|
||||
combined->u.syment.n_scnum,
|
||||
|
|
@ -2045,8 +2069,20 @@ coff_print_symbol (abfd, filep, symbol, how)
|
|||
combined->u.syment.n_type,
|
||||
combined->u.syment.n_sclass,
|
||||
combined->u.syment.n_numaux,
|
||||
(unsigned long) val,
|
||||
symbol->name);
|
||||
#else
|
||||
/* Print out the wide, 64 bit, symbol value */
|
||||
fprintf (file,
|
||||
"(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%016llx %s",
|
||||
combined->u.syment.n_scnum,
|
||||
combined->u.syment.n_flags,
|
||||
combined->u.syment.n_type,
|
||||
combined->u.syment.n_sclass,
|
||||
combined->u.syment.n_numaux,
|
||||
val,
|
||||
symbol->name);
|
||||
#endif
|
||||
|
||||
for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
|
||||
{
|
||||
|
|
@ -2090,16 +2126,18 @@ coff_print_symbol (abfd, filep, symbol, how)
|
|||
case C_EXT:
|
||||
if (ISFCN (combined->u.syment.n_type))
|
||||
{
|
||||
long next, llnos;
|
||||
|
||||
if (auxp->fix_end)
|
||||
next = (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p
|
||||
- root);
|
||||
else
|
||||
next = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l;
|
||||
llnos = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr;
|
||||
fprintf (file,
|
||||
_("AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"),
|
||||
tagndx,
|
||||
auxp->u.auxent.x_sym.x_misc.x_fsize,
|
||||
auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr,
|
||||
(auxp->fix_end
|
||||
? ((long)
|
||||
(auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p
|
||||
- root))
|
||||
: auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l));
|
||||
"AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld",
|
||||
tagndx, auxp->u.auxent.x_sym.x_misc.x_fsize,
|
||||
llnos, next);
|
||||
break;
|
||||
}
|
||||
/* else fall through */
|
||||
|
|
@ -2133,7 +2171,7 @@ coff_print_symbol (abfd, filep, symbol, how)
|
|||
}
|
||||
else
|
||||
{
|
||||
bfd_print_symbol_vandf ((PTR) file, symbol);
|
||||
bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
|
||||
fprintf (file, " %-5s %s %s %s",
|
||||
symbol->section->name,
|
||||
coffsymbol (symbol)->native ? "n" : "g",
|
||||
|
|
@ -2167,8 +2205,8 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
|
|||
asection *section;
|
||||
asymbol **symbols;
|
||||
bfd_vma offset;
|
||||
CONST char **filename_ptr;
|
||||
CONST char **functionname_ptr;
|
||||
const char **filename_ptr;
|
||||
const char **functionname_ptr;
|
||||
unsigned int *line_ptr;
|
||||
{
|
||||
boolean found;
|
||||
|
|
@ -2180,6 +2218,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
|
|||
combined_entry_type *pend;
|
||||
alent *l;
|
||||
struct coff_section_tdata *sec_data;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Before looking through the symbol table, try to use a .stab
|
||||
section to find the information. */
|
||||
|
|
@ -2264,7 +2303,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
|
|||
|
||||
/* Avoid endless loops on erroneous files by ensuring that
|
||||
we always move forward in the file. */
|
||||
if (p - cof->raw_syments >= p->u.syment.n_value)
|
||||
if (p >= cof->raw_syments + p->u.syment.n_value)
|
||||
break;
|
||||
|
||||
p = cof->raw_syments + p->u.syment.n_value;
|
||||
|
|
@ -2354,9 +2393,8 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
|
|||
/* Cache the results for the next call. */
|
||||
if (sec_data == NULL && section->owner == abfd)
|
||||
{
|
||||
section->used_by_bfd =
|
||||
((PTR) bfd_zalloc (abfd,
|
||||
sizeof (struct coff_section_tdata)));
|
||||
amt = sizeof (struct coff_section_tdata);
|
||||
section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
|
||||
sec_data = (struct coff_section_tdata *) section->used_by_bfd;
|
||||
}
|
||||
if (sec_data != NULL)
|
||||
|
|
@ -2413,8 +2451,9 @@ bfd_coff_set_symbol_class (abfd, symbol, class)
|
|||
coff_write_alien_symbol(). */
|
||||
|
||||
combined_entry_type * native;
|
||||
bfd_size_type amt = sizeof (* native);
|
||||
|
||||
native = (combined_entry_type *) bfd_alloc (abfd, sizeof (* native));
|
||||
native = (combined_entry_type *) bfd_alloc (abfd, amt);
|
||||
if (native == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -2442,7 +2481,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class)
|
|||
if (! obj_pe (abfd))
|
||||
native->u.syment.n_value += symbol->section->output_section->vma;
|
||||
|
||||
/* Copy the any flags from the the file header into the symbol.
|
||||
/* Copy the any flags from the file header into the symbol.
|
||||
FIXME: Why? */
|
||||
native->u.syment.n_flags = bfd_asymbol_bfd (& csym->symbol)->flags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ _bfd_coff_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct coff_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct coff_link_hash_table);
|
||||
|
||||
ret = ((struct coff_link_hash_table *)
|
||||
bfd_alloc (abfd, sizeof (struct coff_link_hash_table)));
|
||||
ret = (struct coff_link_hash_table *) bfd_alloc (abfd, amt);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
if (! _bfd_coff_link_hash_table_init (ret, abfd,
|
||||
|
|
@ -277,6 +277,16 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
|
|||
return false;
|
||||
h = bfd_link_hash_lookup (info->hash, name, false, false, true);
|
||||
|
||||
/* auto import */
|
||||
if (!h && info->pei386_auto_import)
|
||||
{
|
||||
if (!strncmp (name,"__imp_", 6))
|
||||
{
|
||||
h =
|
||||
bfd_link_hash_lookup (info->hash, name + 6, false, false,
|
||||
true);
|
||||
}
|
||||
}
|
||||
/* We are only interested in symbols that are currently
|
||||
undefined. If a symbol is currently known to be common,
|
||||
COFF linkers do not bring in an object file which defines
|
||||
|
|
@ -315,6 +325,7 @@ coff_link_add_symbols (abfd, info)
|
|||
bfd_size_type symesz;
|
||||
bfd_byte *esym;
|
||||
bfd_byte *esym_end;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Keep the symbols during this function, in case the linker needs
|
||||
to read the generic symbols in order to report an error message. */
|
||||
|
|
@ -330,10 +341,8 @@ coff_link_add_symbols (abfd, info)
|
|||
|
||||
/* We keep a list of the linker hash table entries that correspond
|
||||
to particular symbols. */
|
||||
sym_hash = ((struct coff_link_hash_entry **)
|
||||
bfd_alloc (abfd,
|
||||
((size_t) symcount
|
||||
* sizeof (struct coff_link_hash_entry *))));
|
||||
amt = symcount * sizeof (struct coff_link_hash_entry *);
|
||||
sym_hash = (struct coff_link_hash_entry **) bfd_alloc (abfd, amt);
|
||||
if (sym_hash == NULL && symcount != 0)
|
||||
goto error_return;
|
||||
obj_coff_sym_hashes (abfd) = sym_hash;
|
||||
|
|
@ -433,7 +442,7 @@ coff_link_add_symbols (abfd, info)
|
|||
|
||||
/* The Microsoft Visual C compiler does string pooling by
|
||||
hashing the constants to an internal symbol name, and
|
||||
relying on the the linker comdat support to discard
|
||||
relying on the linker comdat support to discard
|
||||
duplicate names. However, if one string is a literal and
|
||||
one is a data initializer, one will end up in the .data
|
||||
section and one will end up in the .rdata section. The
|
||||
|
|
@ -526,7 +535,7 @@ coff_link_add_symbols (abfd, info)
|
|||
(*_bfd_error_handler)
|
||||
(_("Warning: type of symbol `%s' changed from %d to %d in %s"),
|
||||
name, (*sym_hash)->type, sym.n_type,
|
||||
bfd_get_filename (abfd));
|
||||
bfd_archive_filename (abfd));
|
||||
|
||||
/* We don't want to change from a meaningful
|
||||
base type to a null one, but if we know
|
||||
|
|
@ -554,8 +563,8 @@ coff_link_add_symbols (abfd, info)
|
|||
i < sym.n_numaux;
|
||||
i++, eaux += symesz, iaux++)
|
||||
bfd_coff_swap_aux_in (abfd, (PTR) eaux, sym.n_type,
|
||||
sym.n_sclass, i, sym.n_numaux,
|
||||
(PTR) iaux);
|
||||
sym.n_sclass, (int) i,
|
||||
sym.n_numaux, (PTR) iaux);
|
||||
(*sym_hash)->aux = alloc;
|
||||
}
|
||||
}
|
||||
|
|
@ -608,9 +617,8 @@ coff_link_add_symbols (abfd, info)
|
|||
secdata = coff_section_data (abfd, stab);
|
||||
if (secdata == NULL)
|
||||
{
|
||||
stab->used_by_bfd =
|
||||
(PTR) bfd_zalloc (abfd,
|
||||
sizeof (struct coff_section_tdata));
|
||||
amt = sizeof (struct coff_section_tdata);
|
||||
stab->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
|
||||
if (stab->used_by_bfd == NULL)
|
||||
goto error_return;
|
||||
secdata = coff_section_data (abfd, stab);
|
||||
|
|
@ -648,11 +656,11 @@ _bfd_coff_final_link (abfd, info)
|
|||
boolean long_section_names;
|
||||
asection *o;
|
||||
struct bfd_link_order *p;
|
||||
size_t max_sym_count;
|
||||
size_t max_lineno_count;
|
||||
size_t max_reloc_count;
|
||||
size_t max_output_reloc_count;
|
||||
size_t max_contents_size;
|
||||
bfd_size_type max_sym_count;
|
||||
bfd_size_type max_lineno_count;
|
||||
bfd_size_type max_reloc_count;
|
||||
bfd_size_type max_output_reloc_count;
|
||||
bfd_size_type max_contents_size;
|
||||
file_ptr rel_filepos;
|
||||
unsigned int relsz;
|
||||
file_ptr line_filepos;
|
||||
|
|
@ -660,6 +668,7 @@ _bfd_coff_final_link (abfd, info)
|
|||
bfd *sub;
|
||||
bfd_byte *external_relocs = NULL;
|
||||
char strbuf[STRING_SIZE_SIZE];
|
||||
bfd_size_type amt;
|
||||
|
||||
symesz = bfd_coff_symesz (abfd);
|
||||
|
||||
|
|
@ -775,10 +784,9 @@ _bfd_coff_final_link (abfd, info)
|
|||
|
||||
/* We use section_count + 1, rather than section_count, because
|
||||
the target_index fields are 1 based. */
|
||||
finfo.section_info =
|
||||
((struct coff_link_section_info *)
|
||||
bfd_malloc ((abfd->section_count + 1)
|
||||
* sizeof (struct coff_link_section_info)));
|
||||
amt = abfd->section_count + 1;
|
||||
amt *= sizeof (struct coff_link_section_info);
|
||||
finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
|
||||
if (finfo.section_info == NULL)
|
||||
goto error_return;
|
||||
for (i = 0; i <= abfd->section_count; i++)
|
||||
|
|
@ -819,13 +827,14 @@ _bfd_coff_final_link (abfd, info)
|
|||
but only when doing a relocateable link, which is not the
|
||||
common case. */
|
||||
BFD_ASSERT (info->relocateable);
|
||||
amt = o->reloc_count;
|
||||
amt *= sizeof (struct internal_reloc);
|
||||
finfo.section_info[o->target_index].relocs =
|
||||
((struct internal_reloc *)
|
||||
bfd_malloc (o->reloc_count * sizeof (struct internal_reloc)));
|
||||
(struct internal_reloc *) bfd_malloc (amt);
|
||||
amt = o->reloc_count;
|
||||
amt *= sizeof (struct coff_link_hash_entry *);
|
||||
finfo.section_info[o->target_index].rel_hashes =
|
||||
((struct coff_link_hash_entry **)
|
||||
bfd_malloc (o->reloc_count
|
||||
* sizeof (struct coff_link_hash_entry *)));
|
||||
(struct coff_link_hash_entry **) bfd_malloc (amt);
|
||||
if (finfo.section_info[o->target_index].relocs == NULL
|
||||
|| finfo.section_info[o->target_index].rel_hashes == NULL)
|
||||
goto error_return;
|
||||
|
|
@ -857,22 +866,23 @@ _bfd_coff_final_link (abfd, info)
|
|||
}
|
||||
|
||||
/* Allocate some buffers used while linking. */
|
||||
finfo.internal_syms = ((struct internal_syment *)
|
||||
bfd_malloc (max_sym_count
|
||||
* sizeof (struct internal_syment)));
|
||||
finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count
|
||||
* sizeof (asection *));
|
||||
finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long));
|
||||
finfo.outsyms = ((bfd_byte *)
|
||||
bfd_malloc ((size_t) ((max_sym_count + 1) * symesz)));
|
||||
finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count
|
||||
* bfd_coff_linesz (abfd));
|
||||
amt = max_sym_count * sizeof (struct internal_syment);
|
||||
finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt);
|
||||
amt = max_sym_count * sizeof (asection *);
|
||||
finfo.sec_ptrs = (asection **) bfd_malloc (amt);
|
||||
amt = max_sym_count * sizeof (long);
|
||||
finfo.sym_indices = (long *) bfd_malloc (amt);
|
||||
finfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz);
|
||||
amt = max_lineno_count * bfd_coff_linesz (abfd);
|
||||
finfo.linenos = (bfd_byte *) bfd_malloc (amt);
|
||||
finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
|
||||
finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz);
|
||||
amt = max_reloc_count * relsz;
|
||||
finfo.external_relocs = (bfd_byte *) bfd_malloc (amt);
|
||||
if (! info->relocateable)
|
||||
finfo.internal_relocs = ((struct internal_reloc *)
|
||||
bfd_malloc (max_reloc_count
|
||||
* sizeof (struct internal_reloc)));
|
||||
{
|
||||
amt = max_reloc_count * sizeof (struct internal_reloc);
|
||||
finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
|
||||
}
|
||||
if ((finfo.internal_syms == NULL && max_sym_count > 0)
|
||||
|| (finfo.sec_ptrs == NULL && max_sym_count > 0)
|
||||
|| (finfo.sym_indices == NULL && max_sym_count > 0)
|
||||
|
|
@ -977,14 +987,15 @@ _bfd_coff_final_link (abfd, info)
|
|||
if (finfo.last_file_index != -1
|
||||
&& (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd))
|
||||
{
|
||||
file_ptr pos;
|
||||
|
||||
finfo.last_file.n_value = obj_raw_syment_count (abfd);
|
||||
bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file,
|
||||
(PTR) finfo.outsyms);
|
||||
if (bfd_seek (abfd,
|
||||
(obj_sym_filepos (abfd)
|
||||
+ finfo.last_file_index * symesz),
|
||||
SEEK_SET) != 0
|
||||
|| bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz)
|
||||
|
||||
pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1019,8 +1030,8 @@ _bfd_coff_final_link (abfd, info)
|
|||
/* Now that we have written out all the global symbols, we know
|
||||
the symbol indices to use for relocs against them, and we can
|
||||
finally write out the relocs. */
|
||||
external_relocs = ((bfd_byte *)
|
||||
bfd_malloc (max_output_reloc_count * relsz));
|
||||
amt = max_output_reloc_count * relsz;
|
||||
external_relocs = (bfd_byte *) bfd_malloc (amt);
|
||||
if (external_relocs == NULL)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1049,8 +1060,9 @@ _bfd_coff_final_link (abfd, info)
|
|||
}
|
||||
|
||||
if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
|
||||
|| bfd_write ((PTR) external_relocs, relsz, o->reloc_count,
|
||||
abfd) != relsz * o->reloc_count)
|
||||
|| (bfd_bwrite ((PTR) external_relocs,
|
||||
(bfd_size_type) relsz * o->reloc_count, abfd)
|
||||
!= (bfd_size_type) relsz * o->reloc_count))
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
|
|
@ -1084,21 +1096,22 @@ _bfd_coff_final_link (abfd, info)
|
|||
/* Write out the string table. */
|
||||
if (obj_raw_syment_count (abfd) != 0 || long_section_names)
|
||||
{
|
||||
if (bfd_seek (abfd,
|
||||
(obj_sym_filepos (abfd)
|
||||
+ obj_raw_syment_count (abfd) * symesz),
|
||||
SEEK_SET) != 0)
|
||||
file_ptr pos;
|
||||
|
||||
pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0)
|
||||
return false;
|
||||
|
||||
#if STRING_SIZE_SIZE == 4
|
||||
bfd_h_put_32 (abfd,
|
||||
_bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
|
||||
(bfd_byte *) strbuf);
|
||||
H_PUT_32 (abfd,
|
||||
_bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
|
||||
strbuf);
|
||||
#else
|
||||
#error Change bfd_h_put_32
|
||||
#error Change H_PUT_32 above
|
||||
#endif
|
||||
|
||||
if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE)
|
||||
if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd)
|
||||
!= STRING_SIZE_SIZE)
|
||||
return false;
|
||||
|
||||
if (! _bfd_stringtab_emit (abfd, finfo.strtab))
|
||||
|
|
@ -1166,17 +1179,17 @@ dores_com (ptr, output_bfd, heap)
|
|||
{
|
||||
int val = strtoul (ptr, &ptr, 0);
|
||||
if (heap)
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve =val;
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve = val;
|
||||
else
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve =val;
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve = val;
|
||||
|
||||
if (ptr[0] == ',')
|
||||
{
|
||||
int val = strtoul (ptr+1, &ptr, 0);
|
||||
val = strtoul (ptr+1, &ptr, 0);
|
||||
if (heap)
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit =val;
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit = val;
|
||||
else
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit =val;
|
||||
pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit = val;
|
||||
}
|
||||
}
|
||||
return ptr;
|
||||
|
|
@ -1210,10 +1223,10 @@ process_embedded_commands (output_bfd, info, abfd)
|
|||
if (!sec)
|
||||
return 1;
|
||||
|
||||
copy = bfd_malloc ((size_t) sec->_raw_size);
|
||||
copy = bfd_malloc (sec->_raw_size);
|
||||
if (!copy)
|
||||
return 0;
|
||||
if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size))
|
||||
if (! bfd_get_section_contents(abfd, sec, copy, (bfd_vma) 0, sec->_raw_size))
|
||||
{
|
||||
free (copy);
|
||||
return 0;
|
||||
|
|
@ -1501,6 +1514,19 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef COFF_WITH_PE
|
||||
/* Skip section symbols for sections which are not going to be
|
||||
emitted. */
|
||||
if (!skip
|
||||
&& isym.n_sclass == C_STAT
|
||||
&& isym.n_type == T_NULL
|
||||
&& isym.n_numaux > 0)
|
||||
{
|
||||
if ((*secpp)->output_section == bfd_abs_section_ptr)
|
||||
skip = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If we stripping debugging symbols, and this is a debugging
|
||||
symbol, then skip it. FIXME: gas sets the section to N_ABS
|
||||
for some types of debugging symbols; I don't know if this is
|
||||
|
|
@ -1561,6 +1587,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
struct coff_debug_merge_element **epp;
|
||||
bfd_byte *esl, *eslend;
|
||||
struct internal_syment *islp;
|
||||
bfd_size_type amt;
|
||||
|
||||
name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf);
|
||||
if (name == NULL)
|
||||
|
|
@ -1581,9 +1608,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
/* Allocate memory to hold type information. If this turns
|
||||
out to be a duplicate, we pass this address to
|
||||
bfd_release. */
|
||||
mt = ((struct coff_debug_merge_type *)
|
||||
bfd_alloc (input_bfd,
|
||||
sizeof (struct coff_debug_merge_type)));
|
||||
amt = sizeof (struct coff_debug_merge_type);
|
||||
mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt);
|
||||
if (mt == NULL)
|
||||
return false;
|
||||
mt->class = isym.n_sclass;
|
||||
|
|
@ -1609,9 +1635,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
|
||||
bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp);
|
||||
|
||||
amt = sizeof (struct coff_debug_merge_element);
|
||||
*epp = ((struct coff_debug_merge_element *)
|
||||
bfd_alloc (input_bfd,
|
||||
sizeof (struct coff_debug_merge_element)));
|
||||
bfd_alloc (input_bfd, amt));
|
||||
if (*epp == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -1620,8 +1646,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
if (elename == NULL)
|
||||
return false;
|
||||
|
||||
name_copy = (char *) bfd_alloc (input_bfd,
|
||||
strlen (elename) + 1);
|
||||
amt = strlen (elename) + 1;
|
||||
name_copy = (char *) bfd_alloc (input_bfd, amt);
|
||||
if (name_copy == NULL)
|
||||
return false;
|
||||
strcpy (name_copy, elename);
|
||||
|
|
@ -1804,7 +1830,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
have to write the symbol out twice. */
|
||||
|
||||
if (finfo->last_file_index != -1
|
||||
&& finfo->last_file.n_value != (long) output_index)
|
||||
&& finfo->last_file.n_value != (bfd_vma) output_index)
|
||||
{
|
||||
/* We must correct the value of the last C_FILE
|
||||
entry. */
|
||||
|
|
@ -1821,18 +1847,18 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
}
|
||||
else
|
||||
{
|
||||
file_ptr pos;
|
||||
|
||||
/* We have already written out the last C_FILE
|
||||
symbol. We need to write it out again. We
|
||||
borrow *outsym temporarily. */
|
||||
bfd_coff_swap_sym_out (output_bfd,
|
||||
(PTR) &finfo->last_file,
|
||||
(PTR) outsym);
|
||||
if (bfd_seek (output_bfd,
|
||||
(obj_sym_filepos (output_bfd)
|
||||
+ finfo->last_file_index * osymesz),
|
||||
SEEK_SET) != 0
|
||||
|| (bfd_write (outsym, osymesz, 1, output_bfd)
|
||||
!= osymesz))
|
||||
pos = obj_sym_filepos (output_bfd);
|
||||
pos += finfo->last_file_index * osymesz;
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (outsym, osymesz, output_bfd) != osymesz)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -2054,6 +2080,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
}
|
||||
else
|
||||
{
|
||||
file_ptr pos;
|
||||
|
||||
/* We have already written out the last
|
||||
.bf aux entry. We need to write it
|
||||
out again. We borrow *outsym
|
||||
|
|
@ -2065,12 +2093,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
isymp->n_sclass,
|
||||
0, isymp->n_numaux,
|
||||
(PTR) outsym);
|
||||
if (bfd_seek (output_bfd,
|
||||
(obj_sym_filepos (output_bfd)
|
||||
+ finfo->last_bf_index * osymesz),
|
||||
SEEK_SET) != 0
|
||||
|| bfd_write (outsym, osymesz, 1,
|
||||
output_bfd) != osymesz)
|
||||
pos = obj_sym_filepos (output_bfd);
|
||||
pos += finfo->last_bf_index * osymesz;
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| (bfd_bwrite (outsym, osymesz, output_bfd)
|
||||
!= osymesz))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -2118,6 +2145,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
bfd_byte *elineend;
|
||||
bfd_byte *oeline;
|
||||
boolean skipping;
|
||||
file_ptr pos;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* FIXME: If SEC_HAS_CONTENTS is not for the section, then
|
||||
build_link_order in ldwrite.c will not have created a
|
||||
|
|
@ -2133,7 +2162,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
continue;
|
||||
|
||||
if (bfd_seek (input_bfd, o->line_filepos, SEEK_SET) != 0
|
||||
|| bfd_read (finfo->linenos, linesz, o->lineno_count,
|
||||
|| bfd_bread (finfo->linenos, linesz * o->lineno_count,
|
||||
input_bfd) != linesz * o->lineno_count)
|
||||
return false;
|
||||
|
||||
|
|
@ -2221,17 +2250,14 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
}
|
||||
}
|
||||
|
||||
if (bfd_seek (output_bfd,
|
||||
(o->output_section->line_filepos
|
||||
+ o->output_section->lineno_count * linesz),
|
||||
SEEK_SET) != 0
|
||||
|| (bfd_write (finfo->linenos, 1, oeline - finfo->linenos,
|
||||
output_bfd)
|
||||
!= (bfd_size_type) (oeline - finfo->linenos)))
|
||||
pos = o->output_section->line_filepos;
|
||||
pos += o->output_section->lineno_count * linesz;
|
||||
amt = oeline - finfo->linenos;
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (finfo->linenos, amt, output_bfd) != amt)
|
||||
return false;
|
||||
|
||||
o->output_section->lineno_count +=
|
||||
(oeline - finfo->linenos) / linesz;
|
||||
o->output_section->lineno_count += amt / linesz;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2252,12 +2278,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
/* Write the modified symbols to the output file. */
|
||||
if (outsym > finfo->outsyms)
|
||||
{
|
||||
if (bfd_seek (output_bfd,
|
||||
obj_sym_filepos (output_bfd) + syment_base * osymesz,
|
||||
SEEK_SET) != 0
|
||||
|| (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1,
|
||||
output_bfd)
|
||||
!= (bfd_size_type) (outsym - finfo->outsyms)))
|
||||
file_ptr pos;
|
||||
bfd_size_type amt;
|
||||
|
||||
pos = obj_sym_filepos (output_bfd) + syment_base * osymesz;
|
||||
amt = outsym - finfo->outsyms;
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt)
|
||||
return false;
|
||||
|
||||
BFD_ASSERT ((obj_raw_syment_count (output_bfd)
|
||||
|
|
@ -2288,7 +2315,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
{
|
||||
((*_bfd_error_handler)
|
||||
(_("%s: relocs in section `%s', but it has no contents"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
bfd_get_section_name (input_bfd, o)));
|
||||
bfd_set_error (bfd_error_no_contents);
|
||||
return false;
|
||||
|
|
@ -2429,14 +2456,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
|
|||
/* Write out the modified section contents. */
|
||||
if (secdata == NULL || secdata->stab_info == NULL)
|
||||
{
|
||||
file_ptr loc = o->output_offset * bfd_octets_per_byte (output_bfd);
|
||||
bfd_size_type amt = (o->_cooked_size != 0
|
||||
? o->_cooked_size : o->_raw_size);
|
||||
if (! bfd_set_section_contents (output_bfd, o->output_section,
|
||||
contents,
|
||||
(file_ptr)
|
||||
(o->output_offset *
|
||||
bfd_octets_per_byte (output_bfd)),
|
||||
(o->_cooked_size != 0
|
||||
? o->_cooked_size
|
||||
: o->_raw_size)))
|
||||
contents, loc, amt))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
@ -2469,6 +2493,7 @@ _bfd_coff_write_global_sym (h, data)
|
|||
struct internal_syment isym;
|
||||
bfd_size_type symesz;
|
||||
unsigned int i;
|
||||
file_ptr pos;
|
||||
|
||||
output_bfd = finfo->output_bfd;
|
||||
|
||||
|
|
@ -2577,11 +2602,10 @@ _bfd_coff_write_global_sym (h, data)
|
|||
|
||||
symesz = bfd_coff_symesz (output_bfd);
|
||||
|
||||
if (bfd_seek (output_bfd,
|
||||
(obj_sym_filepos (output_bfd)
|
||||
+ obj_raw_syment_count (output_bfd) * symesz),
|
||||
SEEK_SET) != 0
|
||||
|| bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz)
|
||||
pos = obj_sym_filepos (output_bfd);
|
||||
pos += obj_raw_syment_count (output_bfd) * symesz;
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz)
|
||||
{
|
||||
finfo->failed = true;
|
||||
return false;
|
||||
|
|
@ -2649,9 +2673,9 @@ _bfd_coff_write_global_sym (h, data)
|
|||
}
|
||||
|
||||
bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type,
|
||||
isym.n_sclass, i, isym.n_numaux,
|
||||
isym.n_sclass, (int) i, isym.n_numaux,
|
||||
(PTR) finfo->outsyms);
|
||||
if (bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz)
|
||||
if (bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz)
|
||||
{
|
||||
finfo->failed = true;
|
||||
return false;
|
||||
|
|
@ -2719,6 +2743,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
|
|||
bfd_byte *buf;
|
||||
bfd_reloc_status_type rstat;
|
||||
boolean ok;
|
||||
file_ptr loc;
|
||||
|
||||
size = bfd_get_reloc_size (howto);
|
||||
buf = (bfd_byte *) bfd_zmalloc (size);
|
||||
|
|
@ -2726,7 +2751,8 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
|
|||
return false;
|
||||
|
||||
rstat = _bfd_relocate_contents (howto, output_bfd,
|
||||
link_order->u.reloc.p->addend, buf);
|
||||
(bfd_vma) link_order->u.reloc.p->addend,\
|
||||
buf);
|
||||
switch (rstat)
|
||||
{
|
||||
case bfd_reloc_ok:
|
||||
|
|
@ -2749,10 +2775,9 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
|
|||
}
|
||||
break;
|
||||
}
|
||||
loc = link_order->offset * bfd_octets_per_byte (output_bfd);
|
||||
ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf,
|
||||
(file_ptr)
|
||||
(link_order->offset *
|
||||
bfd_octets_per_byte (output_bfd)), size);
|
||||
loc, size);
|
||||
free (buf);
|
||||
if (! ok)
|
||||
return false;
|
||||
|
|
@ -2868,7 +2893,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
("%s: illegal symbol index %ld in relocs",
|
||||
bfd_get_filename (input_bfd), symndx);
|
||||
bfd_archive_filename (input_bfd), symndx);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
@ -2990,7 +3015,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
|
|||
case bfd_reloc_outofrange:
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: bad reloc address 0x%lx in section `%s'"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
(unsigned long) rel->r_vaddr,
|
||||
bfd_get_section_name (input_bfd, input_section));
|
||||
return false;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,8 @@
|
|||
# Sets the following shell variables:
|
||||
# targ_defvec Default vector for this target
|
||||
# targ_selvecs Vectors to build for this target
|
||||
# targ64_selvecs Vectors to build if --enable-64-bit-bfd is given
|
||||
# or if host is 64 bit.
|
||||
# targ_archs Architectures for this target
|
||||
# targ_cflags $(CFLAGS) for this target (FIXME: pretty bogus)
|
||||
# targ_underscore Whether underscores are used: yes or no
|
||||
|
|
@ -23,34 +25,38 @@
|
|||
|
||||
targ_defvec=
|
||||
targ_selvecs=
|
||||
targ64_selvecs=
|
||||
targ_cflags=
|
||||
targ_underscore=no
|
||||
|
||||
targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
case "${targ_cpu}" in
|
||||
alpha*) targ_archs=bfd_alpha_arch ;;
|
||||
arm*) targ_archs=bfd_arm_arch ;;
|
||||
strongarm*) targ_archs=bfd_arm_arch ;;
|
||||
thumb*) targ_archs=bfd_arm_arch ;;
|
||||
xscale*) targ_archs=bfd_arm_arch ;;
|
||||
c30*) targ_archs=bfd_tic30_arch ;;
|
||||
c54x*) targ_archs=bfd_tic54x_arch ;;
|
||||
hppa*) targ_archs=bfd_hppa_arch ;;
|
||||
x86_64) targ_archs=bfd_i386_arch ;;
|
||||
i[3456]86) targ_archs=bfd_i386_arch ;;
|
||||
i370) targ_archs=bfd_i370_arch ;;
|
||||
alpha*) targ_archs=bfd_alpha_arch ;;
|
||||
arm*) targ_archs=bfd_arm_arch ;;
|
||||
c30*) targ_archs=bfd_tic30_arch ;;
|
||||
c54x*) targ_archs=bfd_tic54x_arch ;;
|
||||
hppa*) targ_archs=bfd_hppa_arch ;;
|
||||
i[3456]86) targ_archs=bfd_i386_arch ;;
|
||||
i370) targ_archs=bfd_i370_arch ;;
|
||||
m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;;
|
||||
m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;;
|
||||
m68*) targ_archs=bfd_m68k_arch ;;
|
||||
m88*) targ_archs=bfd_m88k_arch ;;
|
||||
mips*) targ_archs=bfd_mips_arch ;;
|
||||
pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
|
||||
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
|
||||
rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
|
||||
sparc*) targ_archs=bfd_sparc_arch ;;
|
||||
v850*) targ_archs=bfd_v850_arch ;;
|
||||
z8k*) targ_archs=bfd_z8k_arch ;;
|
||||
*) targ_archs=bfd_${targ_cpu}_arch ;;
|
||||
m68*) targ_archs=bfd_m68k_arch ;;
|
||||
m88*) targ_archs=bfd_m88k_arch ;;
|
||||
mips*) targ_archs=bfd_mips_arch ;;
|
||||
pdp11*) targ_archs=bfd_pdp11_arch ;;
|
||||
pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
|
||||
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
|
||||
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 ;;
|
||||
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 ;;
|
||||
xscale*) targ_archs=bfd_arm_arch ;;
|
||||
z8k*) targ_archs=bfd_z8k_arch ;;
|
||||
*) targ_archs=bfd_${targ_cpu}_arch ;;
|
||||
esac
|
||||
|
||||
|
||||
|
|
@ -84,13 +90,17 @@ case "${targ}" in
|
|||
alpha*-*-*)
|
||||
targ_defvec=ecoffalpha_little_vec
|
||||
;;
|
||||
ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
|
||||
ia64*-*-aix*)
|
||||
targ_defvec=bfd_elf64_ia64_aix_little_vec
|
||||
targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec"
|
||||
;;
|
||||
ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
|
||||
targ_defvec=bfd_elf64_ia64_little_vec
|
||||
targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
|
||||
;;
|
||||
ia64*-*-hpux*)
|
||||
targ_defvec=bfd_elf64_ia64_big_vec
|
||||
targ_selvecs="bfd_elf32_ia64_big_vec"
|
||||
targ_defvec=bfd_elf32_ia64_hpux_big_vec
|
||||
targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
|
||||
;;
|
||||
sparc64-*-freebsd* | sparc64-*-netbsd*)
|
||||
targ_defvec=bfd_elf64_sparc_vec
|
||||
|
|
@ -103,7 +113,11 @@ case "${targ}" in
|
|||
targ_selvecs=bfd_elf32_bigarc_vec
|
||||
;;
|
||||
|
||||
arm-*-netbsd*)
|
||||
arm-*-netbsdelf*)
|
||||
targ_defvec=bfd_elf32_littlearm_vec
|
||||
targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
|
||||
;;
|
||||
arm-*-netbsd* | arm-*-openbsd*)
|
||||
targ_defvec=armnetbsd_vec
|
||||
targ_underscore=yes
|
||||
;;
|
||||
|
|
@ -114,6 +128,7 @@ case "${targ}" in
|
|||
targ_defvec=arm_epoc_pe_little_vec
|
||||
targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
|
||||
targ_underscore=no
|
||||
targ_cflags=-DARM_COFF_BUGFIX
|
||||
;;
|
||||
arm-wince-pe | arm-*-wince)
|
||||
targ_defvec=armpe_little_vec
|
||||
|
|
@ -134,16 +149,16 @@ case "${targ}" in
|
|||
targ_defvec=aout_arm_big_vec
|
||||
targ_selvecs=aout_arm_little_vec
|
||||
;;
|
||||
arm-*-coff)
|
||||
targ_defvec=armcoff_little_vec
|
||||
targ_selvecs=armcoff_big_vec
|
||||
targ_underscore=yes
|
||||
;;
|
||||
arm-*-vxworks*)
|
||||
targ_defvec=armcoff_little_vec
|
||||
targ_selvecs=armcoff_big_vec
|
||||
targ_underscore=yes
|
||||
targ_cflags=-DVXWORKS
|
||||
targ_cflags=-DARM_COFF_BUGFIX
|
||||
;;
|
||||
arm-*-coff)
|
||||
targ_defvec=armcoff_little_vec
|
||||
targ_selvecs=armcoff_big_vec
|
||||
targ_underscore=yes
|
||||
;;
|
||||
arm-*-rtems*)
|
||||
targ_defvec=bfd_elf32_littlearm_vec
|
||||
|
|
@ -157,6 +172,10 @@ case "${targ}" in
|
|||
targ_defvec=bfd_elf32_littlearm_vec
|
||||
targ_selvecs=bfd_elf32_bigarm_vec
|
||||
;;
|
||||
arm9e-*-elf)
|
||||
targ_defvec=bfd_elf32_littlearm_vec
|
||||
targ_selvecs=bfd_elf32_bigarm_vec
|
||||
;;
|
||||
arm-*-oabi)
|
||||
targ_defvec=bfd_elf32_littlearm_oabi_vec
|
||||
targ_selvecs=bfd_elf32_bigarm_oabi_vec
|
||||
|
|
@ -251,6 +270,11 @@ case "${targ}" in
|
|||
;;
|
||||
|
||||
|
||||
h8300*-*-elf)
|
||||
targ_defvec=bfd_elf32_h8300_vec
|
||||
targ_underscore=yes
|
||||
;;
|
||||
|
||||
h8300*-*-*)
|
||||
targ_defvec=h8300coff_vec
|
||||
targ_underscore=yes
|
||||
|
|
@ -369,11 +393,15 @@ case "${targ}" in
|
|||
targ_defvec=bfd_elf32_i386_vec
|
||||
targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
|
||||
;;
|
||||
#ifdef BFD64
|
||||
#ifdef BFD64
|
||||
x86_64-*-freebsd*)
|
||||
targ_defvec=bfd_elf64_x86_64_vec
|
||||
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
|
||||
;;
|
||||
x86_64-*-netbsd*)
|
||||
targ_defvec=bfd_elf64_x86_64_vec
|
||||
targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
|
||||
;;
|
||||
x86_64-*-linux-gnu*)
|
||||
targ_defvec=bfd_elf64_x86_64_vec
|
||||
targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
|
||||
|
|
@ -544,7 +572,16 @@ case "${targ}" in
|
|||
targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
|
||||
targ_underscore=yes
|
||||
;;
|
||||
m68*-*-netbsd* | m68*-*-openbsd*)
|
||||
m68*-*-netbsdelf*)
|
||||
targ_defvec=bfd_elf32_m68k_vec
|
||||
targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
|
||||
;;
|
||||
m68*-*-netbsdaout* | m68*-*-netbsd*)
|
||||
targ_defvec=m68knetbsd_vec
|
||||
targ_selvecs="m68k4knetbsd_vec bfd_elf32_m68k_vec hp300bsd_vec sunos_big_vec"
|
||||
targ_underscore=yes
|
||||
;;
|
||||
m68*-*-openbsd*)
|
||||
targ_defvec=m68knetbsd_vec
|
||||
targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
|
||||
targ_underscore=yes
|
||||
|
|
@ -598,11 +635,11 @@ case "${targ}" in
|
|||
targ_defvec=ecoff_big_vec
|
||||
targ_selvecs=ecoff_little_vec
|
||||
;;
|
||||
mips-dec-netbsd* | mips*el*-*-netbsd*)
|
||||
mips*el-*-netbsd*)
|
||||
targ_defvec=bfd_elf32_littlemips_vec
|
||||
targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
|
||||
;;
|
||||
mips*-*-netbsd*)
|
||||
mips*-*-netbsd*)
|
||||
targ_defvec=bfd_elf32_bigmips_vec
|
||||
targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
|
||||
;;
|
||||
|
|
@ -622,10 +659,12 @@ case "${targ}" in
|
|||
targ_defvec=ecoff_big_vec
|
||||
targ_selvecs=ecoff_little_vec
|
||||
;;
|
||||
#ifdef BFD64
|
||||
mips*-*-irix6*)
|
||||
targ_defvec=bfd_elf32_bigmips_vec
|
||||
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
|
||||
;;
|
||||
#endif
|
||||
mips*-*-irix5*)
|
||||
targ_defvec=bfd_elf32_bigmips_vec
|
||||
targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
|
||||
|
|
@ -667,23 +706,38 @@ case "${targ}" in
|
|||
targ_defvec=bfd_elf32_bigmips_vec
|
||||
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
|
||||
;;
|
||||
mips*el*-*-openbsd*)
|
||||
mips*el-*-openbsd*)
|
||||
targ_defvec=bfd_elf32_littlemips_vec
|
||||
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
|
||||
;;
|
||||
mips*el*-*-linux-gnu*)
|
||||
targ_defvec=bfd_elf32_tradlittlemips_vec
|
||||
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
|
||||
;;
|
||||
mips*-*-openbsd*)
|
||||
targ_defvec=bfd_elf32_bigmips_vec
|
||||
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
|
||||
;;
|
||||
mips*-*-linux-gnu*)
|
||||
#ifdef BFD64
|
||||
mips64*el-*-linux*)
|
||||
targ_defvec=bfd_elf32_tradlittlemips_vec
|
||||
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
|
||||
;;
|
||||
mips64*-*-linux*)
|
||||
targ_defvec=bfd_elf32_tradbigmips_vec
|
||||
targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
|
||||
;;
|
||||
#endif
|
||||
mips*el-*-linux*)
|
||||
targ_defvec=bfd_elf32_tradlittlemips_vec
|
||||
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
|
||||
;;
|
||||
mips*-*-linux*)
|
||||
targ_defvec=bfd_elf32_tradbigmips_vec
|
||||
targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
|
||||
;;
|
||||
|
||||
#ifdef BFD64
|
||||
mmix-*-*)
|
||||
targ_defvec=bfd_elf64_mmix_vec
|
||||
targ_selvecs=bfd_mmo_vec
|
||||
;;
|
||||
#endif
|
||||
mn10200-*-*)
|
||||
targ_defvec=bfd_elf32_mn10200_vec
|
||||
;;
|
||||
|
|
@ -701,6 +755,15 @@ case "${targ}" in
|
|||
targ_underscore=yes
|
||||
;;
|
||||
|
||||
openrisc-*-elf)
|
||||
targ_defvec=bfd_elf32_openrisc_vec
|
||||
;;
|
||||
|
||||
pdp11-*-*)
|
||||
targ_defvec=pdp11_aout_vec
|
||||
targ_underscore=yes
|
||||
;;
|
||||
|
||||
pj-*-*)
|
||||
targ_defvec=bfd_elf32_pj_vec
|
||||
targ_selvecs="bfd_elf32_pj_vec bfd_elf32_pjl_vec"
|
||||
|
|
@ -711,15 +774,34 @@ case "${targ}" in
|
|||
targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec"
|
||||
;;
|
||||
|
||||
powerpc-*-aix* | powerpc-*-beos*)
|
||||
powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*)
|
||||
targ_defvec=rs6000coff_vec
|
||||
targ_selvecs="rs6000coff64_vec"
|
||||
targ64_selvecs=rs6000coff64_vec
|
||||
case "${targ}" in
|
||||
*-*-aix4.[3456789]* | *-*-aix[56789]*)
|
||||
want64=true;;
|
||||
esac
|
||||
;;
|
||||
#ifdef BFD64
|
||||
powerpc64-*-aix*)
|
||||
targ_defvec=rs6000coff64_vec
|
||||
targ_selvecs=rs6000coff_vec
|
||||
;;
|
||||
powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*)
|
||||
targ_defvec=bfd_elf64_powerpc_vec
|
||||
targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec"
|
||||
;;
|
||||
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"
|
||||
;;
|
||||
#endif
|
||||
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
|
||||
powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
|
||||
powerpc-*-chorus* | powerpc-*-vxworks*)
|
||||
targ_defvec=bfd_elf32_powerpc_vec
|
||||
targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
|
||||
targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
|
||||
;;
|
||||
powerpc-*-macos* | powerpc-*-mpw*)
|
||||
targ_defvec=pmac_xcoff_vec
|
||||
|
|
@ -733,6 +815,7 @@ case "${targ}" in
|
|||
powerpcle-*-rtems*)
|
||||
targ_defvec=bfd_elf32_powerpcle_vec
|
||||
targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
|
||||
targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
|
||||
;;
|
||||
|
||||
powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
|
||||
|
|
@ -740,14 +823,34 @@ case "${targ}" in
|
|||
targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec"
|
||||
;;
|
||||
|
||||
rs6000-*-*)
|
||||
targ_defvec=rs6000coff_vec
|
||||
s390-*-linux*)
|
||||
targ_defvec=bfd_elf32_s390_vec
|
||||
;;
|
||||
#ifdef BFD64
|
||||
s390x-*-linux*)
|
||||
targ_defvec=bfd_elf64_s390_vec
|
||||
;;
|
||||
#endif
|
||||
|
||||
sh-*-linux*)
|
||||
targ_defvec=bfd_elf32_shblin_vec
|
||||
targ_selvecs=bfd_elf32_shlin_vec
|
||||
;;
|
||||
sh*eb-*-linux*)
|
||||
targ_defvec=bfd_elf32_shblin_vec
|
||||
;;
|
||||
sh*-*-linux*)
|
||||
targ_defvec=bfd_elf32_shlin_vec
|
||||
;;
|
||||
|
||||
sh*le-*-netbsdelf*)
|
||||
targ_defvec=bfd_elf32_shlnbsd_vec
|
||||
targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
|
||||
;;
|
||||
sh*-*-netbsdelf*)
|
||||
targ_defvec=bfd_elf32_shnbsd_vec
|
||||
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
|
||||
;;
|
||||
|
||||
sh-*-elf* | sh-*-rtemself*)
|
||||
targ_defvec=bfd_elf32_sh_vec
|
||||
|
|
@ -895,6 +998,10 @@ case "${targ}" in
|
|||
targ_defvec=w65_vec
|
||||
;;
|
||||
|
||||
xstormy16-*-elf)
|
||||
targ_defvec=bfd_elf32_xstormy16_vec
|
||||
;;
|
||||
|
||||
z8k*-*-*)
|
||||
targ_defvec=z8kcoff_vec
|
||||
targ_underscore=yes
|
||||
|
|
@ -926,6 +1033,12 @@ case "${targ}" in
|
|||
;;
|
||||
esac
|
||||
|
||||
case "${host64}${want64}" in
|
||||
*true*)
|
||||
targ_selvecs="${targ_selvecs} ${targ64_selvecs}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# If we support any ELF target, then automatically add support for the
|
||||
# generic ELF targets. This permits an objdump with some ELF support
|
||||
# to be used on an arbitrary ELF file for anything other than
|
||||
|
|
|
|||
953
contrib/binutils/bfd/configure
vendored
953
contrib/binutils/bfd/configure
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -21,19 +21,23 @@ case "${host}" in
|
|||
|
||||
alpha*-*-*) host64=true; HOST_64BIT_TYPE=long ;;
|
||||
|
||||
hppa*64*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX;
|
||||
host64=true; HOST_64BIT_TYPE=long ;;
|
||||
hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;;
|
||||
hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
|
||||
hppa*64*-*-linux*) host64=true; HOST_64BIT_TYPE=long ;;
|
||||
hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;;
|
||||
hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
|
||||
hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
|
||||
|
||||
ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;;
|
||||
ia64-*-aix*) host64=true; HOST_64BIT_TYPE=long ;;
|
||||
|
||||
i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;;
|
||||
i[3456]86-sequent-sysv4*) ;;
|
||||
i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;;
|
||||
|
||||
mips*-dec-netbsd*) ;;
|
||||
mips*-*-netbsd*) ;;
|
||||
mips*-*-openbsd*) ;;
|
||||
mips*-dec-*) HDEFINES="-G 4" ;;
|
||||
mips*-sgi-irix3*) HDEFINES="-G 4" ;;
|
||||
|
|
@ -42,6 +46,10 @@ mips*-sgi-irix6*) host64=true
|
|||
HOST_64BIT_TYPE="long long";
|
||||
HOST_U_64BIT_TYPE="unsigned long long";
|
||||
;;
|
||||
mips64*-*-linux*) host64=true
|
||||
HOST_64BIT_TYPE="long long";
|
||||
HOST_U_64BIT_TYPE="unsigned long long";
|
||||
;;
|
||||
mips*-*-sysv4*) ;;
|
||||
mips*-*-sysv*) HDEFINES="-G 4" ;;
|
||||
mips*-*-riscos*) HDEFINES="-G 4" ;;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,27 @@ AC_INIT(libbfd.c)
|
|||
AC_CANONICAL_SYSTEM
|
||||
AC_ISC_POSIX
|
||||
|
||||
AM_INIT_AUTOMAKE(bfd, 2.11.2)
|
||||
AM_INIT_AUTOMAKE(bfd, 2.11.93)
|
||||
# Uncomment the next line to remove the date from the reported bfd version
|
||||
#is_release=y
|
||||
|
||||
changequote(,)dnl
|
||||
bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
|
||||
changequote([,])dnl
|
||||
|
||||
bfd_version_string="\"${VERSION}\""
|
||||
bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h`
|
||||
if test x${is_release} = x; then
|
||||
dnl Sad, but we can't use XSTRING here to pick up the date from version.h
|
||||
dnl because traditional C doesn't allow it.
|
||||
bfd_version_string="\"${VERSION} ${bfd_version_date}\""
|
||||
fi
|
||||
dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
|
||||
dnl we may as well substitute for bfd_version_date too. That way we don't
|
||||
dnl need to #include version.h
|
||||
AC_SUBST(bfd_version)
|
||||
AC_SUBST(bfd_version_date)
|
||||
AC_SUBST(bfd_version_string)
|
||||
|
||||
dnl These must be called before AM_PROG_LIBTOOL, because it may want
|
||||
dnl to call AC_CHECK_PROG.
|
||||
|
|
@ -50,7 +70,7 @@ AC_ARG_WITH(mmap,
|
|||
*) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
|
||||
esac],[want_mmap=false])dnl
|
||||
|
||||
build_warnings="-W -Wall"
|
||||
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
|
||||
AC_ARG_ENABLE(build-warnings,
|
||||
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
|
||||
[case "${enableval}" in
|
||||
|
|
@ -76,19 +96,19 @@ AM_CONFIG_HEADER(config.h:config.in)
|
|||
if test -z "$target" ; then
|
||||
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
|
||||
fi
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AC_EXEEXT
|
||||
|
||||
host64=false
|
||||
target64=false
|
||||
bfd_default_target_size=32
|
||||
|
||||
# host stuff:
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
ALL_LINGUAS=
|
||||
ALL_LINGUAS="fr tr ja es sv"
|
||||
CY_GNU_GETTEXT
|
||||
|
||||
# Permit host specific settings.
|
||||
|
|
@ -145,13 +165,14 @@ if test "${target}" = "${host}"; then
|
|||
alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
|
||||
alpha*-*-*) COREFILE=osf-core.lo ;;
|
||||
arm-*-freebsd*) COREFILE='' ;;
|
||||
arm-*-netbsd*) COREFILE=netbsd-core.lo ;;
|
||||
arm-*-riscix) COREFILE=trad-core.lo ;;
|
||||
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
|
||||
hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
|
||||
hppa*-*-mpeix*) COREFILE=hpux-core.lo ;;
|
||||
hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
|
||||
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
|
||||
i370-*-*)
|
||||
i370-*-*)
|
||||
COREFILE=trad-core.lo
|
||||
TRAD_HEADER='"hosts/i370linux.h"'
|
||||
;;
|
||||
|
|
@ -169,6 +190,11 @@ changequote([,])dnl
|
|||
COREFILE=trad-core.lo
|
||||
TRAD_HEADER='"hosts/symmetry.h"'
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3456]86-*-bsdi)
|
||||
changequote([,])dnl
|
||||
COREFILE=
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*)
|
||||
changequote([,])dnl
|
||||
|
|
@ -310,6 +336,8 @@ changequote([,])dnl
|
|||
powerpc-*-freebsd*) COREFILE='' ;;
|
||||
powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
|
||||
powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
|
||||
s390*-*-*) COREFILE=trad-core.lo ;;
|
||||
sh*-*-netbsd*) COREFILE=netbsd-core.lo ;;
|
||||
sparc-*-netbsd* | sparc-*-openbsd*)
|
||||
COREFILE=netbsd-core.lo
|
||||
;;
|
||||
|
|
@ -329,6 +357,7 @@ changequote([,])dnl
|
|||
COREFILE=trad-core.lo
|
||||
TRAD_HEADER='"hosts/vaxbsd.h"'
|
||||
;;
|
||||
x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;;
|
||||
esac
|
||||
|
||||
case "$COREFILE" in
|
||||
|
|
@ -384,6 +413,27 @@ case "${host}" in
|
|||
WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
|
||||
fi
|
||||
;;
|
||||
*-*-linux*)
|
||||
# We borrow WIN32LIBADD so that the shared libbfd won't depend on
|
||||
# libiberty.a.
|
||||
case "${host}" in
|
||||
mips*-*-linux*)
|
||||
# Linux/MIPS uses PIC by default.
|
||||
if test "$enable_shared" = "yes"; then
|
||||
WIN32LIBADD="-L../libiberty -liberty"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
PICFLAG=
|
||||
changequote(,)dnl
|
||||
eval `grep "^[ ]*PICFLAG[ ]*=" ../libiberty/Makefile | sed -e "s/[ ]*//g"`
|
||||
changequote([,])dnl
|
||||
if test -n "$PICFLAG"; then
|
||||
WIN32LIBADD="-L../libiberty/pic -liberty"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(WIN32LDFLAGS)
|
||||
AC_SUBST(WIN32LIBADD)
|
||||
|
|
@ -456,76 +506,63 @@ selarchs="$f"
|
|||
# Target backend .o files.
|
||||
tb=
|
||||
|
||||
elf="elf.lo elflink.lo dwarf1.lo"
|
||||
elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo"
|
||||
|
||||
for vec in $selvecs
|
||||
do
|
||||
target_size=32
|
||||
case "$vec" in
|
||||
# This list is alphabetized to make it easy to compare
|
||||
# with the two vector lists in targets.c.
|
||||
# with the two vector lists in targets.c. For the same reason,
|
||||
# use one entry per line, even though this leads to long lines.
|
||||
a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
|
||||
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
|
||||
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
|
||||
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
|
||||
armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
|
||||
armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
|
||||
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
|
||||
aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
|
||||
aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
|
||||
apollocoff_vec) tb="$tb coff-apollo.lo" ;;
|
||||
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
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 " ;;
|
||||
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" ;;
|
||||
armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
|
||||
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_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"
|
||||
target64=true ;;
|
||||
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
|
||||
tb="$tb elf64-hppa.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
|
||||
bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
|
||||
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
|
||||
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
|
||||
target64=true ;;
|
||||
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
|
||||
tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
|
||||
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";;
|
||||
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
|
||||
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
|
||||
target64=true ;;
|
||||
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
|
||||
|
|
@ -535,38 +572,57 @@ do
|
|||
bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.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_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
|
||||
bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
|
||||
bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
|
||||
bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.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_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
|
||||
bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
|
||||
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
|
||||
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
|
||||
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
|
||||
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
|
||||
bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
|
||||
bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
|
||||
bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
|
||||
target64=true ;;
|
||||
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"
|
||||
target64=true ;;
|
||||
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"
|
||||
target64=true ;;
|
||||
bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
|
||||
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
|
||||
bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
|
||||
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
|
||||
bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
|
||||
bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;;
|
||||
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; 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" ;;
|
||||
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
|
||||
cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
|
||||
cris_aout_vec) tb="$tb aout-cris.lo" ;;
|
||||
demo_64_vec) tb="$tb demo64.lo aout64.lo"
|
||||
target64=true ;;
|
||||
demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
|
||||
ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
|
||||
ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
|
||||
ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
|
||||
ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
|
||||
target64=true ;;
|
||||
ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
|
||||
ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
|
||||
go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
|
||||
go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
|
||||
h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
|
||||
|
|
@ -579,82 +635,76 @@ do
|
|||
i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
|
||||
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
|
||||
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
|
||||
i386msdos_vec) tb="$tb i386msdos.lo" ;;
|
||||
i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
|
||||
i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
|
||||
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
|
||||
i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
|
||||
i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
|
||||
i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
|
||||
i386msdos_vec) tb="$tb i386msdos.lo" ;;
|
||||
i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
|
||||
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" ;;
|
||||
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" ;;
|
||||
ieee_vec) tb="$tb ieee.lo" ;;
|
||||
m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
|
||||
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
|
||||
m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
|
||||
m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
|
||||
m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
|
||||
m68klynx_aout_vec) tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
|
||||
m68klynx_coff_vec) tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
|
||||
m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
|
||||
m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
|
||||
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
|
||||
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
|
||||
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
|
||||
mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
|
||||
mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
|
||||
mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
|
||||
mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
|
||||
mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
|
||||
mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
|
||||
mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
|
||||
mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
|
||||
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
|
||||
nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
|
||||
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
|
||||
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"
|
||||
target64=true ;;
|
||||
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
|
||||
nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
|
||||
target64=true ;;
|
||||
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
|
||||
nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
|
||||
pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
|
||||
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
|
||||
pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
|
||||
pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
|
||||
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
|
||||
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
|
||||
pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
|
||||
pdp11_aout_vec) tb="$tb pdp11.lo" ;;
|
||||
pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
|
||||
ppcboot_vec) tb="$tb ppcboot.lo" ;;
|
||||
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
|
||||
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"; target_size=64 ;;
|
||||
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
|
||||
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
|
||||
shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
|
||||
shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
|
||||
som_vec) tb="$tb som.lo" ;;
|
||||
sparccoff_vec) tb="$tb coff-sparc.lo" ;;
|
||||
sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
|
||||
sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
|
||||
sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
|
||||
sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
|
||||
sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
|
||||
sparccoff_vec) tb="$tb coff-sparc.lo" ;;
|
||||
srec_vec) tb="$tb srec.lo" ;;
|
||||
sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
|
||||
symbolsrec_vec) tb="$tb srec.lo" ;;
|
||||
tekhex_vec) tb="$tb tekhex.lo" ;;
|
||||
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
|
||||
tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
|
||||
tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
|
||||
tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
|
||||
versados_vec) tb="$tb versados.lo" ;;
|
||||
vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
|
||||
target64=true ;;
|
||||
vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;;
|
||||
vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
|
||||
w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
|
||||
we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
|
||||
|
|
@ -663,6 +713,13 @@ do
|
|||
"") ;;
|
||||
*) AC_MSG_ERROR(*** unknown target vector $vec) ;;
|
||||
esac
|
||||
|
||||
if test ${target_size} = 64; then
|
||||
target64=true
|
||||
fi
|
||||
if test x"${vec}" = x"${defvec}"; then
|
||||
bfd_default_target_size=${target_size}
|
||||
fi
|
||||
done
|
||||
|
||||
# Target architecture .o files.
|
||||
|
|
@ -712,22 +769,38 @@ fi # all_targets is true
|
|||
case ${host64}-${target64}-${want64} in
|
||||
*true*)
|
||||
wordsize=64
|
||||
bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)'
|
||||
all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
|
||||
if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
|
||||
AC_MSG_WARN([You have requested a 64 bit BFD configuration, but])
|
||||
AC_MSG_WARN([your compiler may not have a 64 bit integral type])
|
||||
fi
|
||||
if test -n "$GCC" ; then
|
||||
bad_64bit_gcc=no;
|
||||
AC_MSG_CHECKING([for gcc version with buggy 64-bit support])
|
||||
# Add more tests for gcc versions with non-working 64-bit support here.
|
||||
AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:],
|
||||
bad_64bit_gcc=yes;
|
||||
AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]),
|
||||
AC_MSG_RESULT(no))
|
||||
if test $bad_64bit_gcc = yes ; then
|
||||
AC_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
false-false-false)
|
||||
wordsize=32
|
||||
bfd_libs='$(BFD32_LIBS)'
|
||||
all_backends='$(BFD32_BACKENDS)'
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(wordsize)
|
||||
AC_SUBST(bfd_libs)
|
||||
AC_SUBST(all_backends)
|
||||
AC_SUBST(bfd_backends)
|
||||
AC_SUBST(bfd_machines)
|
||||
AC_SUBST(bfd_default_target_size)
|
||||
|
||||
tdefaults=""
|
||||
test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Core file generic interface routines for BFD.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 2000
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ FUNCTION
|
|||
bfd_core_file_failing_command
|
||||
|
||||
SYNOPSIS
|
||||
CONST char *bfd_core_file_failing_command(bfd *abfd);
|
||||
const char *bfd_core_file_failing_command(bfd *abfd);
|
||||
|
||||
DESCRIPTION
|
||||
Return a read-only string explaining which program was running
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ const bfd_arch_info_type bfd_arc_arch =
|
|||
/* Given cpu type NAME, return its bfd_mach_arc_xxx value.
|
||||
Returns -1 if not found. */
|
||||
|
||||
int arc_get_mach PARAMS ((char *));
|
||||
|
||||
int
|
||||
arc_get_mach (name)
|
||||
char *name;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
|
|||
8, /* 8 bits in a byte */
|
||||
bfd_arch_i386,
|
||||
bfd_mach_x86_64_intel_syntax,
|
||||
"x86_64:intel",
|
||||
"x86_64:intel",
|
||||
"x86-64:intel",
|
||||
"x86-64:intel",
|
||||
3,
|
||||
true,
|
||||
bfd_default_compatible,
|
||||
|
|
@ -75,8 +75,8 @@ const bfd_arch_info_type bfd_x86_64_arch =
|
|||
8, /* 8 bits in a byte */
|
||||
bfd_arch_i386,
|
||||
bfd_mach_x86_64,
|
||||
"x86_64",
|
||||
"x86_64",
|
||||
"x86-64",
|
||||
"x86-64",
|
||||
3,
|
||||
true,
|
||||
bfd_default_compatible,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
/* Logically, this code should be part of libopcode but since some of
|
||||
the operand insertion/extraction functions help bfd to implement
|
||||
relocations, this code is included as part of elf64-ia64.c. This
|
||||
relocations, this code is included as part of cpu-ia64.c. This
|
||||
avoids circular dependencies between libopcode and libbfd and also
|
||||
obviates the need for applications to link in libopcode when all
|
||||
they really want is libbfd.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD PowerPC CPU definition
|
||||
Copyright 1994, 1995, 1996, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1994, 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
|
||||
Contributed by Ian Lance Taylor, Cygnus Support.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -128,7 +128,7 @@ static const bfd_arch_info_type arch_info_struct[] =
|
|||
"powerpc",
|
||||
"powerpc:620",
|
||||
3,
|
||||
false, /* not the default */
|
||||
BFD_DEFAULT_TARGET_SIZE == 64, /* default for 64 bit target */
|
||||
powerpc_compatible,
|
||||
bfd_default_scan,
|
||||
&arch_info_struct[6]
|
||||
|
|
@ -229,7 +229,7 @@ const bfd_arch_info_type bfd_powerpc_arch =
|
|||
"powerpc",
|
||||
"powerpc:common",
|
||||
3,
|
||||
true, /* the default */
|
||||
BFD_DEFAULT_TARGET_SIZE != 64, /* default for 32 bit target */
|
||||
powerpc_compatible,
|
||||
bfd_default_scan,
|
||||
&arch_info_struct[0]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* BFD backend for demonstration 64-bit a.out binaries.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -19,6 +20,11 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define ARCH_SIZE 64
|
||||
#define MY(OP) CAT(demo_64_,OP)
|
||||
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (demo_64_,OP)
|
||||
|
||||
#define TARGETNAME "demo64"
|
||||
#include "aoutf1.h"
|
||||
|
|
|
|||
|
|
@ -9,12 +9,13 @@ s!@INCDIR@!$(INCDIR)!g
|
|||
s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g
|
||||
s!@SRCDIR@/!!g
|
||||
s! hosts/[^ ]*\.h! !g
|
||||
s/ sysdep.h//g
|
||||
s! sysdep.h!!g
|
||||
s! \.\./bfd/sysdep.h!!g
|
||||
s/ libbfd.h//g
|
||||
s/ config.h//g
|
||||
s! libbfd.h!!g
|
||||
s! config.h!!g
|
||||
s! \$(INCDIR)/fopen-[^ ]*\.h!!g
|
||||
s! \$(INCDIR)/ansidecl\.h!!g
|
||||
s! \$(INCDIR)/symcat\.h!!g
|
||||
|
||||
s/\\\n */ /g
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,57 @@
|
|||
2001-06-11 Alan Modra <amodra@bigpond.net.au>
|
||||
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* bfdint.texi (BFD target vector miscellaneous): --oformat, not
|
||||
-oformat.
|
||||
* doc/bfdint.texi (BFD target vector miscellaneous): Add
|
||||
bfd_target_mmo_flavour.
|
||||
* doc/bfd.texinfo (BFD back ends): Add entry for mmo.
|
||||
* doc/Makefile.am (DOCFILES): Add mmo.texi.
|
||||
(SRCDOC): Add mmo.c.
|
||||
(s-mmo, mmo.texi): New rules.
|
||||
|
||||
2001-10-29 Kazu Hirata <kazu@hxi.com>
|
||||
|
||||
* bfdsumm.texi: Fix a typo.
|
||||
|
||||
2001-10-26 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* bfd.texinfo: Change footer to refer to FSF. Change subtitle
|
||||
to refer to original creation date.
|
||||
|
||||
2001-10-03 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.am (BFD_H_DEP): Add ../version.h.
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2001-10-02 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2001-10-01 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* header.sed: New file, adds header to generated files.
|
||||
* Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and
|
||||
bfd.h, using above. Add missing elf.c dependecy for libbfd.h.
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2001-09-21 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2001-09-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* bfdint.texi: Replace reference to bfd_read with bfd_bread.
|
||||
Likewise for bfd_write.
|
||||
|
||||
2001-07-24 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2001-06-21 Hans-Peter Nilsson <hp@axis.com>
|
||||
|
||||
* bfdint.texi (BFD relocation functions) <different formats>:
|
||||
Mention that the GNU linker is aware of input-output format
|
||||
restrictions when generating relocatable output. Make new
|
||||
paragraph for final-link case.
|
||||
(BFD target vector swap): Fix typo.
|
||||
|
||||
2001-01-25 Kazu Hirata <kazu@hxi.com>
|
||||
|
||||
|
|
@ -240,7 +290,7 @@ Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
|||
Wed Jan 12 18:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* bfd.texinfo: Added Linker Functions node.
|
||||
* doc/Makefile.in (DOCFILES): Added linker.texi.
|
||||
* Makefile.in (DOCFILES): Added linker.texi.
|
||||
(SRCDOC): Added linker.c.
|
||||
(linker.texi): New target.
|
||||
|
||||
|
|
@ -355,9 +405,9 @@ Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com)
|
|||
|
||||
Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS.
|
||||
|
||||
* doc/chew.c (exfunstuff): Eliminate.
|
||||
* chew.c (exfunstuff): Eliminate.
|
||||
(paramstuff): Replace exfunstuff with function to generate PARAMS.
|
||||
* doc/proto.str: Use paramstuff rather than exfunstuff.
|
||||
* proto.str: Use paramstuff rather than exfunstuff.
|
||||
|
||||
Mon Aug 17 12:40:32 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
|
|||
bfdt.texi cache.texi coffcode.texi \
|
||||
core.texi elf.texi elfcode.texi format.texi libbfd.texi \
|
||||
opncls.texi reloc.texi section.texi \
|
||||
syms.texi targets.texi init.texi hash.texi linker.texi
|
||||
syms.texi targets.texi init.texi hash.texi linker.texi \
|
||||
mmo.texi
|
||||
|
||||
PROTOS = archive.p archures.p bfd.p \
|
||||
core.p format.p \
|
||||
|
|
@ -27,7 +28,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
|
|||
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
|
||||
$(srcdir)/../reloc.c $(srcdir)/../section.c \
|
||||
$(srcdir)/../syms.c $(srcdir)/../targets.c \
|
||||
$(srcdir)/../hash.c $(srcdir)/../linker.c
|
||||
$(srcdir)/../hash.c $(srcdir)/../linker.c \
|
||||
$(srcdir)/../mmo.c
|
||||
|
||||
SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
|
||||
$(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
|
||||
|
|
@ -123,6 +125,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
|
|||
touch s-elfcode
|
||||
elfcode.texi: s-elfcode
|
||||
|
||||
s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str
|
||||
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
|
||||
$(srcdir)/../../move-if-change mmo.tmp mmo.texi
|
||||
touch s-mmo
|
||||
mmo.texi: s-mmo
|
||||
|
||||
s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
|
||||
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
|
||||
$(srcdir)/../../move-if-change format.tmp format.texi
|
||||
|
|
@ -183,30 +191,47 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
|
|||
touch s-linker
|
||||
linker.texi: s-linker
|
||||
|
||||
libbfd.h: $(srcdir)/../libbfd-in.h \
|
||||
LIBBFD_H_DEP = \
|
||||
$(srcdir)/../libbfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
$(srcdir)/../cache.c \
|
||||
$(srcdir)/../reloc.c \
|
||||
$(srcdir)/../archures.c \
|
||||
$(srcdir)/../elf.c \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../libbfd-in.h >libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
|
||||
|
||||
libcoff.h: $(srcdir)/../libcoff-in.h \
|
||||
libbfd.h: $(LIBBFD_H_DEP)
|
||||
echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(LIBBFD_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
LIBCOFF_H_DEP = \
|
||||
$(srcdir)/../libcoff-in.h \
|
||||
$(srcdir)/../coffcode.h \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../libcoff-in.h >libcoff.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
|
||||
|
||||
bfd.h: $(srcdir)/../bfd-in.h \
|
||||
libcoff.h: $(LIBCOFF_H_DEP)
|
||||
echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(LIBCOFF_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
BFD_H_DEP = \
|
||||
$(srcdir)/../bfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../opncls.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
|
|
@ -219,25 +244,24 @@ bfd.h: $(srcdir)/../bfd-in.h \
|
|||
$(srcdir)/../corefile.c \
|
||||
$(srcdir)/../targets.c \
|
||||
$(srcdir)/../format.c \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(srcdir)/../version.h \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../bfd-in.h >bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
|
||||
echo "#ifdef __cplusplus" >>bfd.h
|
||||
echo "}" >>bfd.h
|
||||
echo "#endif" >>bfd.h
|
||||
echo "#endif" >>bfd.h
|
||||
|
||||
bfd.h: $(BFD_H_DEP)
|
||||
echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(BFD_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
echo "#ifdef __cplusplus" >> $@
|
||||
echo "}" >> $@
|
||||
echo "#endif" >> $@
|
||||
echo "#endif" >> $@
|
||||
|
||||
noinst_TEXINFOS = bfdint.texi
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,11 @@ WIN32LDFLAGS = @WIN32LDFLAGS@
|
|||
WIN32LIBADD = @WIN32LIBADD@
|
||||
all_backends = @all_backends@
|
||||
bfd_backends = @bfd_backends@
|
||||
bfd_default_target_size = @bfd_default_target_size@
|
||||
bfd_machines = @bfd_machines@
|
||||
bfd_version = @bfd_version@
|
||||
bfd_version_date = @bfd_version_date@
|
||||
bfd_version_string = @bfd_version_string@
|
||||
l = @l@
|
||||
tdefaults = @tdefaults@
|
||||
wordsize = @wordsize@
|
||||
|
|
@ -126,7 +130,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
|
|||
bfdt.texi cache.texi coffcode.texi \
|
||||
core.texi elf.texi elfcode.texi format.texi libbfd.texi \
|
||||
opncls.texi reloc.texi section.texi \
|
||||
syms.texi targets.texi init.texi hash.texi linker.texi
|
||||
syms.texi targets.texi init.texi hash.texi linker.texi \
|
||||
mmo.texi
|
||||
|
||||
|
||||
PROTOS = archive.p archures.p bfd.p \
|
||||
|
|
@ -149,7 +154,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
|
|||
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
|
||||
$(srcdir)/../reloc.c $(srcdir)/../section.c \
|
||||
$(srcdir)/../syms.c $(srcdir)/../targets.c \
|
||||
$(srcdir)/../hash.c $(srcdir)/../linker.c
|
||||
$(srcdir)/../hash.c $(srcdir)/../linker.c \
|
||||
$(srcdir)/../mmo.c
|
||||
|
||||
|
||||
SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
|
||||
|
|
@ -172,6 +178,47 @@ info_TEXINFOS = bfd.texinfo
|
|||
|
||||
MKDOC = chew$(EXEEXT_FOR_BUILD)
|
||||
|
||||
LIBBFD_H_DEP = \
|
||||
$(srcdir)/../libbfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
$(srcdir)/../cache.c \
|
||||
$(srcdir)/../reloc.c \
|
||||
$(srcdir)/../archures.c \
|
||||
$(srcdir)/../elf.c \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
|
||||
|
||||
LIBCOFF_H_DEP = \
|
||||
$(srcdir)/../libcoff-in.h \
|
||||
$(srcdir)/../coffcode.h \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
|
||||
|
||||
BFD_H_DEP = \
|
||||
$(srcdir)/../bfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../opncls.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
$(srcdir)/../section.c \
|
||||
$(srcdir)/../archures.c \
|
||||
$(srcdir)/../reloc.c \
|
||||
$(srcdir)/../syms.c \
|
||||
$(srcdir)/../bfd.c \
|
||||
$(srcdir)/../archive.c \
|
||||
$(srcdir)/../corefile.c \
|
||||
$(srcdir)/../targets.c \
|
||||
$(srcdir)/../format.c \
|
||||
$(srcdir)/header.sed \
|
||||
$(srcdir)/proto.str \
|
||||
$(srcdir)/../version.h \
|
||||
$(MKDOC)
|
||||
|
||||
|
||||
noinst_TEXINFOS = bfdint.texi
|
||||
|
||||
MOSTLYCLEANFILES = $(MKDOC) *.o
|
||||
|
|
@ -194,7 +241,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
|
|||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
|
|
@ -484,6 +531,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
|
|||
touch s-elfcode
|
||||
elfcode.texi: s-elfcode
|
||||
|
||||
s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str
|
||||
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
|
||||
$(srcdir)/../../move-if-change mmo.tmp mmo.texi
|
||||
touch s-mmo
|
||||
mmo.texi: s-mmo
|
||||
|
||||
s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
|
||||
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
|
||||
$(srcdir)/../../move-if-change format.tmp format.texi
|
||||
|
|
@ -544,61 +597,39 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
|
|||
touch s-linker
|
||||
linker.texi: s-linker
|
||||
|
||||
libbfd.h: $(srcdir)/../libbfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
$(srcdir)/../cache.c \
|
||||
$(srcdir)/../reloc.c \
|
||||
$(srcdir)/../archures.c \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../libbfd-in.h >libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
|
||||
libbfd.h: $(LIBBFD_H_DEP)
|
||||
echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(LIBBFD_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
libcoff.h: $(srcdir)/../libcoff-in.h \
|
||||
$(srcdir)/../coffcode.h \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../libcoff-in.h >libcoff.h
|
||||
./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
|
||||
libcoff.h: $(LIBCOFF_H_DEP)
|
||||
echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(LIBCOFF_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
bfd.h: $(srcdir)/../bfd-in.h \
|
||||
$(srcdir)/../init.c \
|
||||
$(srcdir)/../opncls.c \
|
||||
$(srcdir)/../libbfd.c \
|
||||
$(srcdir)/../section.c \
|
||||
$(srcdir)/../archures.c \
|
||||
$(srcdir)/../reloc.c \
|
||||
$(srcdir)/../syms.c \
|
||||
$(srcdir)/../bfd.c \
|
||||
$(srcdir)/../archive.c \
|
||||
$(srcdir)/../corefile.c \
|
||||
$(srcdir)/../targets.c \
|
||||
$(srcdir)/../format.c \
|
||||
$(srcdir)/proto.str \
|
||||
$(MKDOC)
|
||||
cat $(srcdir)/../bfd-in.h >bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
|
||||
./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
|
||||
echo "#ifdef __cplusplus" >>bfd.h
|
||||
echo "}" >>bfd.h
|
||||
echo "#endif" >>bfd.h
|
||||
echo "#endif" >>bfd.h
|
||||
bfd.h: $(BFD_H_DEP)
|
||||
echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
|
||||
for file in $(BFD_H_DEP); do \
|
||||
case $$file in \
|
||||
*-in.h) cat $$file >> $@ ;; \
|
||||
*/header.sed) break ;; \
|
||||
*) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \
|
||||
esac; \
|
||||
done
|
||||
echo "#ifdef __cplusplus" >> $@
|
||||
echo "}" >> $@
|
||||
echo "#endif" >> $@
|
||||
echo "#endif" >> $@
|
||||
|
||||
# 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.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ END-INFO-DIR-ENTRY
|
|||
@ifinfo
|
||||
This file documents the BFD library.
|
||||
|
||||
Copyright (C) 1991, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 2000, 2001 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
|
||||
|
|
@ -56,18 +56,18 @@ 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
|
||||
@subtitle April 1991
|
||||
@subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-)
|
||||
@subtitle Original Document Created: April 1991
|
||||
@author {Steve Chamberlain}
|
||||
@author {Cygnus Support}
|
||||
@page
|
||||
|
||||
@tex
|
||||
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
|
||||
\xdef\manvers{\$Revision: 1.2.2.1 $} % For use in headers, footers too
|
||||
\xdef\manvers{\$Revision: 1.5 $} % For use in headers, footers too
|
||||
{\parskip=0pt
|
||||
\hfill Cygnus Support\par
|
||||
\hfill sac\@cygnus.com\par
|
||||
\hfill Free Software Foundation\par
|
||||
\hfill sac\@www.gnu.org\par
|
||||
\hfill {\it BFD}, \manvers\par
|
||||
\hfill \TeX{}info \texinfoversion\par
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ notice identical to this one except for the removal of this paragraph
|
|||
@end tex
|
||||
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1991 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1991, 2001 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
|
||||
|
|
@ -298,6 +298,7 @@ structures.
|
|||
* aout :: a.out backends
|
||||
* coff :: coff backends
|
||||
* elf :: elf backends
|
||||
* mmo :: mmo backend
|
||||
@ignore
|
||||
* oasys :: oasys backends
|
||||
* ieee :: ieee backend
|
||||
|
|
@ -313,11 +314,14 @@ All of BFD lives in one directory.
|
|||
@node coff, elf, aout, BFD back ends
|
||||
@include coffcode.texi
|
||||
|
||||
@node elf, , coff, BFD back ends
|
||||
@node elf, mmo, coff, BFD back ends
|
||||
@include elf.texi
|
||||
@c Leave this out until the file has some actual contents...
|
||||
@c @include elfcode.texi
|
||||
|
||||
@node mmo, , elf, BFD back ends
|
||||
@include mmo.texi
|
||||
|
||||
@node GNU Free Documentation License, Index, BFD back ends, Top
|
||||
@chapter GNU Free Documentation License
|
||||
@cindex GNU Free Documentation License
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
\input texinfo
|
||||
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
|
||||
@c 2000
|
||||
@c 2000, 2001
|
||||
@c Free Software Foundation, Inc.
|
||||
@setfilename bfdint.info
|
||||
|
||||
|
|
@ -335,6 +335,8 @@ VERSAdos.
|
|||
MS-DOS.
|
||||
@item bfd_target_evax_flavour
|
||||
openVMS.
|
||||
@item bfd_target_mmo_flavour
|
||||
Donald Knuth's MMIXware object format.
|
||||
@end table
|
||||
|
||||
@item byteorder
|
||||
|
|
@ -379,7 +381,7 @@ vectors which use the same sets of functions.
|
|||
@node BFD target vector swap
|
||||
@subsection Swapping functions
|
||||
|
||||
Every target vector has fuction pointers used for swapping information
|
||||
Every target vector has function pointers used for swapping information
|
||||
in and out of the target representation. There are two sets of
|
||||
functions: one for data information, and one for header information.
|
||||
Each set has three sizes: 64-bit, 32-bit, and 16-bit. Each size has
|
||||
|
|
@ -503,7 +505,7 @@ corresponds to an actual section in an actual BFD.
|
|||
Get the contents of a section. This is called from
|
||||
@samp{bfd_get_section_contents}. Most targets set this to
|
||||
@samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek}
|
||||
based on the section's @samp{filepos} field and a @samp{bfd_read}. The
|
||||
based on the section's @samp{filepos} field and a @samp{bfd_bread}. The
|
||||
corresponding field in the target vector is named
|
||||
@samp{_bfd_get_section_contents}.
|
||||
|
||||
|
|
@ -636,7 +638,7 @@ always uses extended name tables anyhow. The corresponding field in the
|
|||
target vector is named @samp{_bfd_truncate_arname}.
|
||||
|
||||
@item _write_armap
|
||||
Write out the archive symbol table using calls to @samp{bfd_write}.
|
||||
Write out the archive symbol table using calls to @samp{bfd_bwrite}.
|
||||
This is normally called from the archive @samp{write_contents} routine.
|
||||
The corresponding field in the target vector is named @samp{write_armap}
|
||||
(no leading underscore).
|
||||
|
|
@ -1291,10 +1293,13 @@ doing a link in which the output object file format is S-records.
|
|||
@item
|
||||
Using the linker to generate relocateable output in a different object
|
||||
file format is impossible in the general case, so you generally don't
|
||||
have to worry about that. Linking input files of different object file
|
||||
formats together is quite unusual, but if you're really dedicated you
|
||||
may want to consider testing this case, both when the output object file
|
||||
format is the same as your format, and when it is different.
|
||||
have to worry about that. The GNU linker makes sure to stop that from
|
||||
happening when an input file in a different format has relocations.
|
||||
|
||||
Linking input files of different object file formats together is quite
|
||||
unusual, but if you're really dedicated you may want to consider testing
|
||||
this case, both when the output object file format is the same as your
|
||||
format, and when it is different.
|
||||
@end itemize
|
||||
|
||||
@node BFD relocation codes
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ the format of the input object file. They then build a descriptor in
|
|||
memory with pointers to routines that will be used to access elements of
|
||||
the object file's data structures.
|
||||
|
||||
As different information from the the object files is required,
|
||||
As different information from the object files is required,
|
||||
BFD reads from different sections of the file and processes them.
|
||||
For example, a very common operation for the linker is processing symbol
|
||||
tables. Each BFD back end provides a routine for converting
|
||||
|
|
|
|||
12
contrib/binutils/bfd/doc/header.sed
Normal file
12
contrib/binutils/bfd/doc/header.sed
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
s|\(.*\) [^ ]*header.sed.*|\1|
|
||||
s|[^ ]*/||g
|
||||
s|^ *|"|
|
||||
s| |", "|g
|
||||
s|$|"|
|
||||
s|, \([^ ]*\)$| and \1|
|
||||
s|^|/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from |
|
||||
s|\(.\{60\}[^ ]* \)|\1\
|
||||
|g
|
||||
s|$|.\
|
||||
Run "make headers" in your build bfd/ to regenerate. */\
|
||||
|
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
|
||||
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
|
||||
|
||||
|
|
@ -126,6 +126,18 @@ struct linenumber {
|
|||
/* Find the form of an attr, from the attr field. */
|
||||
#define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */
|
||||
|
||||
static struct dwarf1_unit *alloc_dwarf1_unit PARAMS ((struct dwarf1_debug *));
|
||||
static struct dwarf1_func *alloc_dwarf1_func
|
||||
PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *));
|
||||
static boolean parse_die PARAMS ((bfd *, struct die_info *, char *, char *));
|
||||
static boolean parse_line_table
|
||||
PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *));
|
||||
static boolean parse_functions_in_unit
|
||||
PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *));
|
||||
static boolean dwarf1_unit_find_nearest_line
|
||||
PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *, unsigned long,
|
||||
const char **, const char **, unsigned int *));
|
||||
|
||||
/* Return a newly allocated dwarf1_unit. It should be cleared and
|
||||
then attached into the 'stash' at 'stash->lastUnit'. */
|
||||
|
||||
|
|
@ -133,9 +145,9 @@ static struct dwarf1_unit*
|
|||
alloc_dwarf1_unit (stash)
|
||||
struct dwarf1_debug* stash;
|
||||
{
|
||||
struct dwarf1_unit* x =
|
||||
(struct dwarf1_unit*) bfd_zalloc (stash->abfd,
|
||||
sizeof (struct dwarf1_unit));
|
||||
bfd_size_type amt = sizeof (struct dwarf1_unit);
|
||||
|
||||
struct dwarf1_unit* x = (struct dwarf1_unit*) bfd_zalloc (stash->abfd, amt);
|
||||
x->prev = stash->lastUnit;
|
||||
stash->lastUnit = x;
|
||||
|
||||
|
|
@ -150,9 +162,9 @@ alloc_dwarf1_func (stash, aUnit)
|
|||
struct dwarf1_debug* stash;
|
||||
struct dwarf1_unit* aUnit;
|
||||
{
|
||||
struct dwarf1_func* x =
|
||||
(struct dwarf1_func*) bfd_zalloc (stash->abfd,
|
||||
sizeof (struct dwarf1_func));
|
||||
bfd_size_type amt = sizeof (struct dwarf1_func);
|
||||
|
||||
struct dwarf1_func* x = (struct dwarf1_func*) bfd_zalloc (stash->abfd, amt);
|
||||
x->prev = aUnit->func_list;
|
||||
aUnit->func_list = x;
|
||||
|
||||
|
|
@ -167,10 +179,11 @@ alloc_dwarf1_func (stash, aUnit)
|
|||
Return false if the die is invalidly formatted; true otherwise. */
|
||||
|
||||
static boolean
|
||||
parse_die (abfd, aDieInfo, aDiePtr)
|
||||
parse_die (abfd, aDieInfo, aDiePtr, aDiePtrEnd)
|
||||
bfd* abfd;
|
||||
struct die_info* aDieInfo;
|
||||
char* aDiePtr;
|
||||
char* aDiePtrEnd;
|
||||
{
|
||||
char* this_die = aDiePtr;
|
||||
char* xptr = this_die;
|
||||
|
|
@ -180,7 +193,8 @@ parse_die (abfd, aDieInfo, aDiePtr)
|
|||
/* First comes the length. */
|
||||
aDieInfo->length = bfd_get_32 (abfd, (bfd_byte *) xptr);
|
||||
xptr += 4;
|
||||
if (aDieInfo->length == 0)
|
||||
if (aDieInfo->length == 0
|
||||
|| (this_die + aDieInfo->length) >= aDiePtrEnd)
|
||||
return false;
|
||||
if (aDieInfo->length < 6)
|
||||
{
|
||||
|
|
@ -263,7 +277,7 @@ parse_line_table (stash, aUnit)
|
|||
if (stash->line_section == 0)
|
||||
{
|
||||
asection *msec;
|
||||
unsigned long size;
|
||||
bfd_size_type size;
|
||||
|
||||
msec = bfd_get_section_by_name (stash->abfd, ".line");
|
||||
if (! msec)
|
||||
|
|
@ -275,7 +289,8 @@ parse_line_table (stash, aUnit)
|
|||
if (! stash->line_section)
|
||||
return false;
|
||||
|
||||
if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section, 0, size))
|
||||
if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section,
|
||||
(bfd_vma) 0, size))
|
||||
{
|
||||
stash->line_section = 0;
|
||||
return false;
|
||||
|
|
@ -288,9 +303,9 @@ parse_line_table (stash, aUnit)
|
|||
if (xptr < stash->line_section_end)
|
||||
{
|
||||
unsigned long eachLine;
|
||||
|
||||
char* tblend;
|
||||
char *tblend;
|
||||
unsigned long base;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* First comes the length. */
|
||||
tblend = bfd_get_32 (stash->abfd, (bfd_byte *) xptr) + xptr;
|
||||
|
|
@ -305,9 +320,9 @@ parse_line_table (stash, aUnit)
|
|||
aUnit->line_count = (tblend - xptr) / 10;
|
||||
|
||||
/* Allocate an array for the entries. */
|
||||
aUnit->linenumber_table = (struct linenumber *)
|
||||
bfd_alloc (stash->abfd,
|
||||
sizeof (struct linenumber) * aUnit->line_count);
|
||||
amt = sizeof (struct linenumber) * aUnit->line_count;
|
||||
aUnit->linenumber_table = ((struct linenumber *)
|
||||
bfd_alloc (stash->abfd, amt));
|
||||
|
||||
for (eachLine = 0; eachLine < aUnit->line_count; eachLine++)
|
||||
{
|
||||
|
|
@ -348,7 +363,8 @@ parse_functions_in_unit (stash, aUnit)
|
|||
{
|
||||
struct die_info eachDieInfo;
|
||||
|
||||
if (! parse_die (stash->abfd, &eachDieInfo, eachDie))
|
||||
if (! parse_die (stash->abfd, &eachDieInfo, eachDie,
|
||||
stash->debug_section_end))
|
||||
return false;
|
||||
|
||||
if (eachDieInfo.tag == TAG_global_subroutine
|
||||
|
|
@ -467,10 +483,10 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
|
|||
if (! stash)
|
||||
{
|
||||
asection *msec;
|
||||
unsigned long size;
|
||||
bfd_size_type size = sizeof (struct dwarf1_debug);
|
||||
|
||||
stash = elf_tdata (abfd)->dwarf1_find_line_info =
|
||||
(struct dwarf1_debug*) bfd_zalloc (abfd, sizeof (struct dwarf1_debug));
|
||||
stash = elf_tdata (abfd)->dwarf1_find_line_info
|
||||
= (struct dwarf1_debug *) bfd_zalloc (abfd, size);
|
||||
|
||||
if (! stash)
|
||||
return false;
|
||||
|
|
@ -490,7 +506,8 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
|
|||
if (! stash->debug_section)
|
||||
return false;
|
||||
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->debug_section, 0, size))
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->debug_section,
|
||||
(bfd_vma) 0, size))
|
||||
{
|
||||
stash->debug_section = 0;
|
||||
return false;
|
||||
|
|
@ -522,7 +539,8 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
|
|||
{
|
||||
struct die_info aDieInfo;
|
||||
|
||||
if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie))
|
||||
if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie,
|
||||
stash->debug_section_end))
|
||||
return false;
|
||||
|
||||
if (aDieInfo.tag == TAG_compile_unit)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
struct line_head
|
||||
{
|
||||
unsigned int total_length;
|
||||
bfd_vma total_length;
|
||||
unsigned short version;
|
||||
unsigned int prologue_length;
|
||||
unsigned char minimum_instruction_length;
|
||||
|
|
@ -96,6 +96,14 @@ struct dwarf2_debug
|
|||
/* Pointer to the end of the .debug_info section memory buffer. */
|
||||
char* info_ptr_end;
|
||||
|
||||
/* Pointer to the section and address of the beginning of the
|
||||
section. */
|
||||
asection* sec;
|
||||
char* sec_info_ptr;
|
||||
|
||||
/* Pointer to the symbol table. */
|
||||
asymbol** syms;
|
||||
|
||||
/* Pointer to the .debug_abbrev section loaded into memory. */
|
||||
char* dwarf_abbrev_buffer;
|
||||
|
||||
|
|
@ -107,6 +115,12 @@ struct dwarf2_debug
|
|||
|
||||
/* Length of the loaded .debug_line section. */
|
||||
unsigned long dwarf_line_size;
|
||||
|
||||
/* Pointer to the .debug_str section loaded into memory. */
|
||||
char* dwarf_str_buffer;
|
||||
|
||||
/* Length of the loaded .debug_str section. */
|
||||
unsigned long dwarf_str_size;
|
||||
};
|
||||
|
||||
struct arange
|
||||
|
|
@ -161,10 +175,86 @@ struct comp_unit
|
|||
/* A list of the functions found in this comp. unit. */
|
||||
struct funcinfo* function_table;
|
||||
|
||||
/* Pointer to dwarf2_debug structure. */
|
||||
struct dwarf2_debug *stash;
|
||||
|
||||
/* Address size for this unit - from unit header. */
|
||||
unsigned char addr_size;
|
||||
|
||||
/* Offset size for this unit - from unit header. */
|
||||
unsigned char offset_size;
|
||||
};
|
||||
|
||||
/* This data structure holds the information of an abbrev. */
|
||||
struct abbrev_info
|
||||
{
|
||||
unsigned int number; /* Number identifying abbrev. */
|
||||
enum dwarf_tag tag; /* DWARF tag. */
|
||||
int has_children; /* Boolean. */
|
||||
unsigned int num_attrs; /* Number of attributes. */
|
||||
struct attr_abbrev *attrs; /* An array of attribute descriptions. */
|
||||
struct abbrev_info *next; /* Next in chain. */
|
||||
};
|
||||
|
||||
struct attr_abbrev
|
||||
{
|
||||
enum dwarf_attribute name;
|
||||
enum dwarf_form form;
|
||||
};
|
||||
|
||||
#ifndef ABBREV_HASH_SIZE
|
||||
#define ABBREV_HASH_SIZE 121
|
||||
#endif
|
||||
#ifndef ATTR_ALLOC_CHUNK
|
||||
#define ATTR_ALLOC_CHUNK 4
|
||||
#endif
|
||||
|
||||
static unsigned int read_1_byte PARAMS ((bfd *, char *));
|
||||
static int read_1_signed_byte PARAMS ((bfd *, char *));
|
||||
static unsigned int read_2_bytes PARAMS ((bfd *, char *));
|
||||
static unsigned int read_4_bytes PARAMS ((bfd *, char *));
|
||||
static bfd_vma read_8_bytes PARAMS ((bfd *, char *));
|
||||
static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int));
|
||||
static char *read_string PARAMS ((bfd *, char *, unsigned int *));
|
||||
static char *read_indirect_string PARAMS ((struct comp_unit *, char *, unsigned int *));
|
||||
static unsigned int read_unsigned_leb128
|
||||
PARAMS ((bfd *, char *, unsigned int *));
|
||||
static int read_signed_leb128
|
||||
PARAMS ((bfd *, char *, unsigned int *));
|
||||
static bfd_vma read_address PARAMS ((struct comp_unit *, char *));
|
||||
static struct abbrev_info *lookup_abbrev
|
||||
PARAMS ((unsigned int, struct abbrev_info **));
|
||||
static struct abbrev_info **read_abbrevs
|
||||
PARAMS ((bfd *, unsigned int, struct dwarf2_debug *));
|
||||
static char *read_attribute
|
||||
PARAMS ((struct attribute *, struct attr_abbrev *,
|
||||
struct comp_unit *, char *));
|
||||
static char *read_attribute_value
|
||||
PARAMS ((struct attribute *, unsigned,
|
||||
struct comp_unit *, char *));
|
||||
static void add_line_info
|
||||
PARAMS ((struct line_info_table *, bfd_vma, char *,
|
||||
unsigned int, unsigned int, int));
|
||||
static char *concat_filename PARAMS ((struct line_info_table *, unsigned int));
|
||||
static void arange_add PARAMS ((struct comp_unit *, bfd_vma, bfd_vma));
|
||||
static struct line_info_table *decode_line_info
|
||||
PARAMS ((struct comp_unit *, struct dwarf2_debug *));
|
||||
static boolean lookup_address_in_line_info_table
|
||||
PARAMS ((struct line_info_table *, bfd_vma, const char **, unsigned int *));
|
||||
static boolean lookup_address_in_function_table
|
||||
PARAMS ((struct funcinfo *, bfd_vma, const char **));
|
||||
static boolean scan_unit_for_functions PARAMS ((struct comp_unit *));
|
||||
static bfd_vma find_rela_addend
|
||||
PARAMS ((bfd *, asection *, bfd_size_type, asymbol**));
|
||||
static struct comp_unit *parse_comp_unit
|
||||
PARAMS ((bfd *, struct dwarf2_debug *, bfd_vma, unsigned int));
|
||||
static boolean comp_unit_contains_address
|
||||
PARAMS ((struct comp_unit *, bfd_vma));
|
||||
static boolean comp_unit_find_nearest_line
|
||||
PARAMS ((struct comp_unit *, bfd_vma, const char **, const char **,
|
||||
unsigned int *, struct dwarf2_debug *));
|
||||
static asection *find_debug_info PARAMS ((bfd *, asection *));
|
||||
|
||||
/* VERBATIM
|
||||
The following function up to the END VERBATIM mark are
|
||||
copied directly from dwarf2read.c. */
|
||||
|
|
@ -227,7 +317,7 @@ read_4_signed_bytes (abfd, buf)
|
|||
|
||||
#endif
|
||||
|
||||
static unsigned int
|
||||
static bfd_vma
|
||||
read_8_bytes (abfd, buf)
|
||||
bfd *abfd;
|
||||
char *buf;
|
||||
|
|
@ -253,9 +343,7 @@ read_string (abfd, buf, bytes_read_ptr)
|
|||
char *buf;
|
||||
unsigned int *bytes_read_ptr;
|
||||
{
|
||||
/* If the size of a host char is 8 bits, we can return a pointer
|
||||
to the string, otherwise we have to copy the string to a buffer
|
||||
allocated on the temporary obstack. */
|
||||
/* Return a pointer to the embedded string. */
|
||||
if (*buf == '\0')
|
||||
{
|
||||
*bytes_read_ptr = 1;
|
||||
|
|
@ -266,6 +354,59 @@ read_string (abfd, buf, bytes_read_ptr)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static char *
|
||||
read_indirect_string (unit, buf, bytes_read_ptr)
|
||||
struct comp_unit* unit;
|
||||
char *buf;
|
||||
unsigned int *bytes_read_ptr;
|
||||
{
|
||||
bfd_vma offset;
|
||||
struct dwarf2_debug *stash = unit->stash;
|
||||
|
||||
if (unit->offset_size == 4)
|
||||
offset = read_4_bytes (unit->abfd, buf);
|
||||
else
|
||||
offset = read_8_bytes (unit->abfd, buf);
|
||||
*bytes_read_ptr = unit->offset_size;
|
||||
|
||||
if (! stash->dwarf_str_buffer)
|
||||
{
|
||||
asection *msec;
|
||||
bfd *abfd = unit->abfd;
|
||||
|
||||
msec = bfd_get_section_by_name (abfd, ".debug_str");
|
||||
if (! msec)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("Dwarf Error: Can't find .debug_str section."));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
stash->dwarf_str_size = msec->_raw_size;
|
||||
stash->dwarf_str_buffer = (char*) bfd_alloc (abfd, msec->_raw_size);
|
||||
if (! stash->dwarf_abbrev_buffer)
|
||||
return NULL;
|
||||
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->dwarf_str_buffer,
|
||||
(bfd_vma) 0, msec->_raw_size))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (offset >= stash->dwarf_str_size)
|
||||
{
|
||||
(*_bfd_error_handler) (_("Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)."),
|
||||
offset, stash->dwarf_str_size );
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = stash->dwarf_str_buffer + offset;
|
||||
if (*buf == '\0')
|
||||
return NULL;
|
||||
return buf;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
|
|
@ -349,30 +490,6 @@ read_address (unit, buf)
|
|||
}
|
||||
}
|
||||
|
||||
/* This data structure holds the information of an abbrev. */
|
||||
struct abbrev_info
|
||||
{
|
||||
unsigned int number; /* Number identifying abbrev. */
|
||||
enum dwarf_tag tag; /* DWARF tag. */
|
||||
int has_children; /* Boolean. */
|
||||
unsigned int num_attrs; /* Number of attributes. */
|
||||
struct attr_abbrev *attrs; /* An array of attribute descriptions. */
|
||||
struct abbrev_info *next; /* Next in chain. */
|
||||
};
|
||||
|
||||
struct attr_abbrev
|
||||
{
|
||||
enum dwarf_attribute name;
|
||||
enum dwarf_form form;
|
||||
};
|
||||
|
||||
#ifndef ABBREV_HASH_SIZE
|
||||
#define ABBREV_HASH_SIZE 121
|
||||
#endif
|
||||
#ifndef ATTR_ALLOC_CHUNK
|
||||
#define ATTR_ALLOC_CHUNK 4
|
||||
#endif
|
||||
|
||||
/* Lookup an abbrev_info structure in the abbrev hash table. */
|
||||
|
||||
static struct abbrev_info *
|
||||
|
|
@ -413,6 +530,7 @@ read_abbrevs (abfd, offset, stash)
|
|||
struct abbrev_info *cur_abbrev;
|
||||
unsigned int abbrev_number, bytes_read, abbrev_name;
|
||||
unsigned int abbrev_form, hash_number;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (! stash->dwarf_abbrev_buffer)
|
||||
{
|
||||
|
|
@ -427,13 +545,12 @@ read_abbrevs (abfd, offset, stash)
|
|||
}
|
||||
|
||||
stash->dwarf_abbrev_size = msec->_raw_size;
|
||||
stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
|
||||
stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, msec->_raw_size);
|
||||
if (! stash->dwarf_abbrev_buffer)
|
||||
return 0;
|
||||
|
||||
if (! bfd_get_section_contents (abfd, msec,
|
||||
stash->dwarf_abbrev_buffer, 0,
|
||||
stash->dwarf_abbrev_size))
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->dwarf_abbrev_buffer,
|
||||
(bfd_vma) 0, msec->_raw_size))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -445,7 +562,8 @@ read_abbrevs (abfd, offset, stash)
|
|||
return 0;
|
||||
}
|
||||
|
||||
abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE);
|
||||
amt = sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE;
|
||||
abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, amt);
|
||||
|
||||
abbrev_ptr = stash->dwarf_abbrev_buffer + offset;
|
||||
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
|
||||
|
|
@ -454,7 +572,8 @@ read_abbrevs (abfd, offset, stash)
|
|||
/* Loop until we reach an abbrev number of 0. */
|
||||
while (abbrev_number)
|
||||
{
|
||||
cur_abbrev = (struct abbrev_info*)bfd_zalloc (abfd, sizeof (struct abbrev_info));
|
||||
amt = sizeof (struct abbrev_info);
|
||||
cur_abbrev = (struct abbrev_info *) bfd_zalloc (abfd, amt);
|
||||
|
||||
/* Read in abbrev header. */
|
||||
cur_abbrev->number = abbrev_number;
|
||||
|
|
@ -473,10 +592,10 @@ read_abbrevs (abfd, offset, stash)
|
|||
{
|
||||
if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0)
|
||||
{
|
||||
cur_abbrev->attrs = (struct attr_abbrev *)
|
||||
bfd_realloc (cur_abbrev->attrs,
|
||||
(cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK)
|
||||
* sizeof (struct attr_abbrev));
|
||||
amt = cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK;
|
||||
amt *= sizeof (struct attr_abbrev);
|
||||
cur_abbrev->attrs = ((struct attr_abbrev *)
|
||||
bfd_realloc (cur_abbrev->attrs, amt));
|
||||
if (! cur_abbrev->attrs)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -512,31 +631,33 @@ read_abbrevs (abfd, offset, stash)
|
|||
return abbrevs;
|
||||
}
|
||||
|
||||
/* Read an attribute described by an abbreviated attribute. */
|
||||
/* Read an attribute value described by an attribute form. */
|
||||
|
||||
static char *
|
||||
read_attribute (attr, abbrev, unit, info_ptr)
|
||||
read_attribute_value (attr, form, unit, info_ptr)
|
||||
struct attribute *attr;
|
||||
struct attr_abbrev *abbrev;
|
||||
unsigned form;
|
||||
struct comp_unit *unit;
|
||||
char *info_ptr;
|
||||
{
|
||||
bfd *abfd = unit->abfd;
|
||||
unsigned int bytes_read;
|
||||
struct dwarf_block *blk;
|
||||
bfd_size_type amt;
|
||||
|
||||
attr->name = abbrev->name;
|
||||
attr->form = abbrev->form;
|
||||
attr->form = form;
|
||||
|
||||
switch (abbrev->form)
|
||||
switch (form)
|
||||
{
|
||||
case DW_FORM_addr:
|
||||
/* FIXME: DWARF3 draft sais DW_FORM_ref_addr is offset_size. */
|
||||
case DW_FORM_ref_addr:
|
||||
DW_ADDR (attr) = read_address (unit, info_ptr);
|
||||
info_ptr += unit->addr_size;
|
||||
break;
|
||||
case DW_FORM_block2:
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
|
||||
amt = sizeof (struct dwarf_block);
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, amt);
|
||||
blk->size = read_2_bytes (abfd, info_ptr);
|
||||
info_ptr += 2;
|
||||
blk->data = read_n_bytes (abfd, info_ptr, blk->size);
|
||||
|
|
@ -544,7 +665,8 @@ read_attribute (attr, abbrev, unit, info_ptr)
|
|||
DW_BLOCK (attr) = blk;
|
||||
break;
|
||||
case DW_FORM_block4:
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
|
||||
amt = sizeof (struct dwarf_block);
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, amt);
|
||||
blk->size = read_4_bytes (abfd, info_ptr);
|
||||
info_ptr += 4;
|
||||
blk->data = read_n_bytes (abfd, info_ptr, blk->size);
|
||||
|
|
@ -567,8 +689,13 @@ read_attribute (attr, abbrev, unit, info_ptr)
|
|||
DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
break;
|
||||
case DW_FORM_strp:
|
||||
DW_STRING (attr) = read_indirect_string (unit, info_ptr, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
break;
|
||||
case DW_FORM_block:
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
|
||||
amt = sizeof (struct dwarf_block);
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, amt);
|
||||
blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
blk->data = read_n_bytes (abfd, info_ptr, blk->size);
|
||||
|
|
@ -576,7 +703,8 @@ read_attribute (attr, abbrev, unit, info_ptr)
|
|||
DW_BLOCK (attr) = blk;
|
||||
break;
|
||||
case DW_FORM_block1:
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
|
||||
amt = sizeof (struct dwarf_block);
|
||||
blk = (struct dwarf_block *) bfd_alloc (abfd, amt);
|
||||
blk->size = read_1_byte (abfd, info_ptr);
|
||||
info_ptr += 1;
|
||||
blk->data = read_n_bytes (abfd, info_ptr, blk->size);
|
||||
|
|
@ -619,16 +747,33 @@ read_attribute (attr, abbrev, unit, info_ptr)
|
|||
DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
break;
|
||||
case DW_FORM_strp:
|
||||
case DW_FORM_indirect:
|
||||
form = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
info_ptr = read_attribute_value (attr, form, unit, info_ptr);
|
||||
break;
|
||||
default:
|
||||
(*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %d."),
|
||||
abbrev->form);
|
||||
form);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
}
|
||||
return info_ptr;
|
||||
}
|
||||
|
||||
/* Read an attribute described by an abbreviated attribute. */
|
||||
|
||||
static char *
|
||||
read_attribute (attr, abbrev, unit, info_ptr)
|
||||
struct attribute *attr;
|
||||
struct attr_abbrev *abbrev;
|
||||
struct comp_unit *unit;
|
||||
char *info_ptr;
|
||||
{
|
||||
attr->name = abbrev->name;
|
||||
info_ptr = read_attribute_value (attr, abbrev->form, unit, info_ptr);
|
||||
return info_ptr;
|
||||
}
|
||||
|
||||
/* Source line information table routines. */
|
||||
|
||||
#define FILE_ALLOC_CHUNK 5
|
||||
|
|
@ -672,8 +817,8 @@ add_line_info (table, address, filename, line, column, end_sequence)
|
|||
unsigned int column;
|
||||
int end_sequence;
|
||||
{
|
||||
struct line_info* info = (struct line_info*)
|
||||
bfd_alloc (table->abfd, sizeof (struct line_info));
|
||||
bfd_size_type amt = sizeof (struct line_info);
|
||||
struct line_info* info = (struct line_info*) bfd_alloc (table->abfd, amt);
|
||||
|
||||
info->prev_line = table->last_line;
|
||||
table->last_line = info;
|
||||
|
|
@ -749,7 +894,7 @@ arange_add (unit, low_pc, high_pc)
|
|||
}
|
||||
|
||||
/* Need to allocate a new arange and insert it into the arange list. */
|
||||
arange = bfd_zalloc (unit->abfd, sizeof (*arange));
|
||||
arange = bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange));
|
||||
arange->low = low_pc;
|
||||
arange->high = high_pc;
|
||||
|
||||
|
|
@ -769,9 +914,10 @@ decode_line_info (unit, stash)
|
|||
char *line_ptr;
|
||||
char *line_end;
|
||||
struct line_head lh;
|
||||
unsigned int i, bytes_read;
|
||||
unsigned int i, bytes_read, offset_size;
|
||||
char *cur_file, *cur_dir;
|
||||
unsigned char op_code, extended_op, adj_opcode;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (! stash->dwarf_line_buffer)
|
||||
{
|
||||
|
|
@ -786,13 +932,12 @@ decode_line_info (unit, stash)
|
|||
}
|
||||
|
||||
stash->dwarf_line_size = msec->_raw_size;
|
||||
stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, stash->dwarf_line_size);
|
||||
stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, msec->_raw_size);
|
||||
if (! stash->dwarf_line_buffer)
|
||||
return 0;
|
||||
|
||||
if (! bfd_get_section_contents (abfd, msec,
|
||||
stash->dwarf_line_buffer, 0,
|
||||
stash->dwarf_line_size))
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->dwarf_line_buffer,
|
||||
(bfd_vma) 0, msec->_raw_size))
|
||||
return 0;
|
||||
|
||||
/* FIXME: We ought to apply the relocs against this section before
|
||||
|
|
@ -810,8 +955,8 @@ decode_line_info (unit, stash)
|
|||
return 0;
|
||||
}
|
||||
|
||||
table = (struct line_info_table*) bfd_alloc (abfd,
|
||||
sizeof (struct line_info_table));
|
||||
amt = sizeof (struct line_info_table);
|
||||
table = (struct line_info_table*) bfd_alloc (abfd, amt);
|
||||
table->abfd = abfd;
|
||||
table->comp_dir = unit->comp_dir;
|
||||
|
||||
|
|
@ -829,11 +974,21 @@ decode_line_info (unit, stash)
|
|||
/* Read in the prologue. */
|
||||
lh.total_length = read_4_bytes (abfd, line_ptr);
|
||||
line_ptr += 4;
|
||||
offset_size = 4;
|
||||
if (lh.total_length == 0xffffffff)
|
||||
{
|
||||
lh.total_length = read_8_bytes (abfd, line_ptr);
|
||||
line_ptr += 8;
|
||||
offset_size = 8;
|
||||
}
|
||||
line_end = line_ptr + lh.total_length;
|
||||
lh.version = read_2_bytes (abfd, line_ptr);
|
||||
line_ptr += 2;
|
||||
lh.prologue_length = read_4_bytes (abfd, line_ptr);
|
||||
line_ptr += 4;
|
||||
if (offset_size == 4)
|
||||
lh.prologue_length = read_4_bytes (abfd, line_ptr);
|
||||
else
|
||||
lh.prologue_length = read_8_bytes (abfd, line_ptr);
|
||||
line_ptr += offset_size;
|
||||
lh.minimum_instruction_length = read_1_byte (abfd, line_ptr);
|
||||
line_ptr += 1;
|
||||
lh.default_is_stmt = read_1_byte (abfd, line_ptr);
|
||||
|
|
@ -844,8 +999,8 @@ decode_line_info (unit, stash)
|
|||
line_ptr += 1;
|
||||
lh.opcode_base = read_1_byte (abfd, line_ptr);
|
||||
line_ptr += 1;
|
||||
lh.standard_opcode_lengths = (unsigned char *)
|
||||
bfd_alloc (abfd, lh.opcode_base * sizeof (unsigned char));
|
||||
amt = lh.opcode_base * sizeof (unsigned char);
|
||||
lh.standard_opcode_lengths = (unsigned char *) bfd_alloc (abfd, amt);
|
||||
|
||||
lh.standard_opcode_lengths[0] = 1;
|
||||
|
||||
|
|
@ -862,9 +1017,9 @@ decode_line_info (unit, stash)
|
|||
|
||||
if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0)
|
||||
{
|
||||
table->dirs = (char **)
|
||||
bfd_realloc (table->dirs,
|
||||
(table->num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
|
||||
amt = table->num_dirs + DIR_ALLOC_CHUNK;
|
||||
amt *= sizeof (char *);
|
||||
table->dirs = (char **) bfd_realloc (table->dirs, amt);
|
||||
if (! table->dirs)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -881,10 +1036,9 @@ decode_line_info (unit, stash)
|
|||
|
||||
if ((table->num_files % FILE_ALLOC_CHUNK) == 0)
|
||||
{
|
||||
table->files = (struct fileinfo *)
|
||||
bfd_realloc (table->files,
|
||||
(table->num_files + FILE_ALLOC_CHUNK)
|
||||
* sizeof (struct fileinfo));
|
||||
amt = table->num_files + FILE_ALLOC_CHUNK;
|
||||
amt *= sizeof (struct fileinfo);
|
||||
table->files = (struct fileinfo *) bfd_realloc (table->files, amt);
|
||||
if (! table->files)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -923,7 +1077,22 @@ decode_line_info (unit, stash)
|
|||
op_code = read_1_byte (abfd, line_ptr);
|
||||
line_ptr += 1;
|
||||
|
||||
switch (op_code)
|
||||
if (op_code >= lh.opcode_base)
|
||||
{ /* Special operand. */
|
||||
adj_opcode = op_code - lh.opcode_base;
|
||||
address += (adj_opcode / lh.line_range)
|
||||
* lh.minimum_instruction_length;
|
||||
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 (need_low_pc)
|
||||
{
|
||||
need_low_pc = 0;
|
||||
low_pc = address;
|
||||
}
|
||||
}
|
||||
else switch (op_code)
|
||||
{
|
||||
case DW_LNS_extended_op:
|
||||
line_ptr += 1; /* Ignore length. */
|
||||
|
|
@ -951,10 +1120,10 @@ decode_line_info (unit, stash)
|
|||
line_ptr += bytes_read;
|
||||
if ((table->num_files % FILE_ALLOC_CHUNK) == 0)
|
||||
{
|
||||
table->files = (struct fileinfo *)
|
||||
bfd_realloc (table->files,
|
||||
(table->num_files + FILE_ALLOC_CHUNK)
|
||||
* sizeof (struct fileinfo));
|
||||
amt = table->num_files + FILE_ALLOC_CHUNK;
|
||||
amt *= sizeof (struct fileinfo);
|
||||
table->files =
|
||||
(struct fileinfo *) bfd_realloc (table->files, amt);
|
||||
if (! table->files)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1023,19 +1192,15 @@ decode_line_info (unit, stash)
|
|||
address += read_2_bytes (abfd, line_ptr);
|
||||
line_ptr += 2;
|
||||
break;
|
||||
default: /* Special operand. */
|
||||
adj_opcode = op_code - lh.opcode_base;
|
||||
address += (adj_opcode / lh.line_range)
|
||||
* lh.minimum_instruction_length;
|
||||
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 (need_low_pc)
|
||||
{
|
||||
need_low_pc = 0;
|
||||
low_pc = address;
|
||||
}
|
||||
default:
|
||||
{ /* Unknown standard opcode, ignore it. */
|
||||
int i;
|
||||
for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++)
|
||||
{
|
||||
(void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
|
||||
line_ptr += bytes_read;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1158,7 +1323,8 @@ scan_unit_for_functions (unit)
|
|||
|
||||
if (abbrev->tag == DW_TAG_subprogram)
|
||||
{
|
||||
func = (struct funcinfo*) bfd_zalloc (abfd, sizeof (struct funcinfo));
|
||||
bfd_size_type amt = sizeof (struct funcinfo);
|
||||
func = (struct funcinfo *) bfd_zalloc (abfd, amt);
|
||||
func->prev_func = unit->function_table;
|
||||
unit->function_table = func;
|
||||
}
|
||||
|
|
@ -1219,22 +1385,75 @@ scan_unit_for_functions (unit)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Look for a RELA relocation to be applied on OFFSET of section SEC,
|
||||
and return the addend if such a relocation is found. Since this is
|
||||
only used to find relocations referring to the .debug_abbrev
|
||||
section, we make sure the relocation refers to this section, but
|
||||
this is not strictly necessary, and it can probably be safely
|
||||
removed if needed. However, it is important to note that this
|
||||
function only returns the addend, it doesn't serve the purpose of
|
||||
applying a generic relocation.
|
||||
|
||||
If no suitable relocation is found, or if it is not a real RELA
|
||||
relocation, this function returns 0. */
|
||||
|
||||
static bfd_vma
|
||||
find_rela_addend (abfd, sec, offset, syms)
|
||||
bfd* abfd;
|
||||
asection* sec;
|
||||
bfd_size_type offset;
|
||||
asymbol** syms;
|
||||
{
|
||||
long reloc_size = bfd_get_reloc_upper_bound (abfd, sec);
|
||||
arelent **relocs = NULL;
|
||||
long reloc_count, relc;
|
||||
|
||||
if (reloc_size <= 0)
|
||||
return 0;
|
||||
|
||||
relocs = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
|
||||
if (relocs == NULL)
|
||||
return 0;
|
||||
|
||||
reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, syms);
|
||||
|
||||
if (reloc_count <= 0)
|
||||
{
|
||||
free (relocs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (relc = 0; relc < reloc_count; relc++)
|
||||
if (relocs[relc]->address == offset
|
||||
&& (*relocs[relc]->sym_ptr_ptr)->flags & BSF_SECTION_SYM
|
||||
&& strcmp ((*relocs[relc]->sym_ptr_ptr)->name,
|
||||
".debug_abbrev") == 0)
|
||||
{
|
||||
bfd_vma addend = (relocs[relc]->howto->partial_inplace
|
||||
? 0 : relocs[relc]->addend);
|
||||
free (relocs);
|
||||
return addend;
|
||||
}
|
||||
|
||||
free (relocs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Parse a DWARF2 compilation unit starting at INFO_PTR. This
|
||||
includes the compilation unit header that proceeds the DIE's, but
|
||||
does not include the length field that preceeds each compilation
|
||||
unit header. END_PTR points one past the end of this comp unit.
|
||||
If ABBREV_LENGTH is 0, then the length of the abbreviation offset
|
||||
is assumed to be four bytes. Otherwise, it it is the size given.
|
||||
OFFSET_SIZE is the size of DWARF2 offsets (either 4 or 8 bytes).
|
||||
|
||||
This routine does not read the whole compilation unit; only enough
|
||||
to get to the line number information for the compilation unit. */
|
||||
|
||||
static struct comp_unit *
|
||||
parse_comp_unit (abfd, stash, unit_length, abbrev_length)
|
||||
parse_comp_unit (abfd, stash, unit_length, offset_size)
|
||||
bfd* abfd;
|
||||
struct dwarf2_debug *stash;
|
||||
bfd_vma unit_length;
|
||||
unsigned int abbrev_length;
|
||||
unsigned int offset_size;
|
||||
{
|
||||
struct comp_unit* unit;
|
||||
|
||||
|
|
@ -1249,17 +1468,23 @@ parse_comp_unit (abfd, stash, unit_length, abbrev_length)
|
|||
|
||||
char *info_ptr = stash->info_ptr;
|
||||
char *end_ptr = info_ptr + unit_length;
|
||||
bfd_size_type amt;
|
||||
bfd_size_type off;
|
||||
|
||||
version = read_2_bytes (abfd, info_ptr);
|
||||
info_ptr += 2;
|
||||
BFD_ASSERT (abbrev_length == 0
|
||||
|| abbrev_length == 4
|
||||
|| abbrev_length == 8);
|
||||
if (abbrev_length == 0 || abbrev_length == 4)
|
||||
BFD_ASSERT (offset_size == 4 || offset_size == 8);
|
||||
if (offset_size == 4)
|
||||
abbrev_offset = read_4_bytes (abfd, info_ptr);
|
||||
else if (abbrev_length == 8)
|
||||
else
|
||||
abbrev_offset = read_8_bytes (abfd, info_ptr);
|
||||
info_ptr += abbrev_length;
|
||||
/* The abbrev offset is generally a relocation pointing to
|
||||
.debug_abbrev+offset. On RELA targets, we have to find the
|
||||
relocation and extract the addend to obtain the actual
|
||||
abbrev_offset, so do it here. */
|
||||
off = info_ptr - stash->sec_info_ptr;
|
||||
abbrev_offset += find_rela_addend (abfd, stash->sec, off, stash->syms);
|
||||
info_ptr += offset_size;
|
||||
addr_size = read_1_byte (abfd, info_ptr);
|
||||
info_ptr += 1;
|
||||
|
||||
|
|
@ -1310,11 +1535,14 @@ parse_comp_unit (abfd, stash, unit_length, abbrev_length)
|
|||
return 0;
|
||||
}
|
||||
|
||||
unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit));
|
||||
amt = sizeof (struct comp_unit);
|
||||
unit = (struct comp_unit*) bfd_zalloc (abfd, amt);
|
||||
unit->abfd = abfd;
|
||||
unit->addr_size = addr_size;
|
||||
unit->offset_size = offset_size;
|
||||
unit->abbrevs = abbrevs;
|
||||
unit->end_ptr = end_ptr;
|
||||
unit->stash = stash;
|
||||
|
||||
for (i = 0; i < abbrev->num_attrs; ++i)
|
||||
{
|
||||
|
|
@ -1499,7 +1727,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
|
|||
addr_size, pinfo)
|
||||
bfd *abfd;
|
||||
asection *section;
|
||||
asymbol **symbols ATTRIBUTE_UNUSED;
|
||||
asymbol **symbols;
|
||||
bfd_vma offset;
|
||||
const char **filename_ptr;
|
||||
const char **functionname_ptr;
|
||||
|
|
@ -1535,11 +1763,11 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
|
|||
|
||||
if (! stash)
|
||||
{
|
||||
unsigned long total_size;
|
||||
bfd_size_type total_size;
|
||||
asection *msec;
|
||||
bfd_size_type amt = sizeof (struct dwarf2_debug);
|
||||
|
||||
stash =
|
||||
(struct dwarf2_debug*) bfd_zalloc (abfd, sizeof (struct dwarf2_debug));
|
||||
stash = (struct dwarf2_debug*) bfd_zalloc (abfd, amt);
|
||||
if (! stash)
|
||||
return false;
|
||||
|
||||
|
|
@ -1570,8 +1798,8 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
|
|||
msec;
|
||||
msec = find_debug_info (abfd, msec))
|
||||
{
|
||||
unsigned long size;
|
||||
unsigned long start;
|
||||
bfd_size_type size;
|
||||
bfd_size_type start;
|
||||
|
||||
size = msec->_raw_size;
|
||||
if (size == 0)
|
||||
|
|
@ -1579,13 +1807,18 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
|
|||
|
||||
start = stash->info_ptr_end - stash->info_ptr;
|
||||
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, 0, size))
|
||||
if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start,
|
||||
(bfd_vma) 0, size))
|
||||
continue;
|
||||
|
||||
stash->info_ptr_end = stash->info_ptr + start + size;
|
||||
}
|
||||
|
||||
BFD_ASSERT (stash->info_ptr_end = stash->info_ptr + total_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;
|
||||
}
|
||||
|
||||
/* FIXME: There is a problem with the contents of the
|
||||
|
|
@ -1618,21 +1851,36 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
|
|||
/* Read each remaining comp. units checking each as they are read. */
|
||||
while (stash->info_ptr < stash->info_ptr_end)
|
||||
{
|
||||
struct comp_unit* each;
|
||||
bfd_vma length;
|
||||
boolean found;
|
||||
unsigned int offset_size = addr_size;
|
||||
|
||||
if (addr_size == 4)
|
||||
length = read_4_bytes (abfd, stash->info_ptr);
|
||||
{
|
||||
length = read_4_bytes (abfd, stash->info_ptr);
|
||||
if (length == 0xffffffff)
|
||||
{
|
||||
offset_size = 8;
|
||||
length = read_8_bytes (abfd, stash->info_ptr + 4);
|
||||
stash->info_ptr += 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
length = read_8_bytes (abfd, stash->info_ptr);
|
||||
stash->info_ptr += addr_size;
|
||||
|
||||
if (length > 0)
|
||||
{
|
||||
each = parse_comp_unit (abfd, stash, length, addr_size);
|
||||
each = parse_comp_unit (abfd, stash, length, offset_size);
|
||||
stash->info_ptr += length;
|
||||
|
||||
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
|
||||
== stash->sec->_raw_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;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ static boolean ecoff_compute_section_file_positions PARAMS ((bfd *abfd));
|
|||
static bfd_size_type ecoff_compute_reloc_file_positions PARAMS ((bfd *abfd));
|
||||
static boolean ecoff_get_extr PARAMS ((asymbol *, EXTR *));
|
||||
static void ecoff_set_index PARAMS ((asymbol *, bfd_size_type));
|
||||
static unsigned int ecoff_armap_hash PARAMS ((CONST char *s,
|
||||
static unsigned int ecoff_armap_hash PARAMS ((const char *s,
|
||||
unsigned int *rehash,
|
||||
unsigned int size,
|
||||
unsigned int hlog));
|
||||
|
|
@ -78,7 +78,7 @@ static asection bfd_debug_section =
|
|||
"*DEBUG*", 0, 0, NULL, 0, 0, 0,
|
||||
/* linker_mark, linker_has_input, gc_mark, segment_mark, */
|
||||
0, 0, 0, 0,
|
||||
/* vma, lma, _cooked_size, _raw_size, */
|
||||
/* vma, lma, _cooked_size, _raw_size, */
|
||||
0, 0, 0, 0,
|
||||
/* output_offset, output_section, alignment_power, */
|
||||
0, NULL, 0,
|
||||
|
|
@ -86,8 +86,8 @@ static asection bfd_debug_section =
|
|||
NULL, NULL, 0, 0, 0,
|
||||
/* line_filepos, userdata, contents, lineno, lineno_count, */
|
||||
0, NULL, NULL, NULL, 0,
|
||||
/* comdat, kept_section, moving_line_filepos, */
|
||||
NULL, NULL, 0,
|
||||
/* entsize, comdat, moving_line_filepos, */
|
||||
0, NULL, 0,
|
||||
/* target_index, used_by_bfd, constructor_chain, owner, */
|
||||
0, NULL, NULL, NULL,
|
||||
/* symbol, */
|
||||
|
|
@ -104,8 +104,8 @@ boolean
|
|||
_bfd_ecoff_mkobject (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
abfd->tdata.ecoff_obj_data = ((struct ecoff_tdata *)
|
||||
bfd_zalloc (abfd, sizeof (ecoff_data_type)));
|
||||
bfd_size_type amt = sizeof (ecoff_data_type);
|
||||
abfd->tdata.ecoff_obj_data = (struct ecoff_tdata *) bfd_zalloc (abfd, amt);
|
||||
if (abfd->tdata.ecoff_obj_data == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -371,16 +371,17 @@ ecoff_sec_to_styp_flags (name, flags)
|
|||
|
||||
/* Get the BFD flags to use for a section. */
|
||||
|
||||
flagword
|
||||
_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section)
|
||||
boolean
|
||||
_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
PTR hdr;
|
||||
const char *name ATTRIBUTE_UNUSED;
|
||||
asection *section ATTRIBUTE_UNUSED;
|
||||
flagword * flags_ptr;
|
||||
{
|
||||
struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
|
||||
long styp_flags = internal_s->s_flags;
|
||||
flagword sec_flags=0;
|
||||
flagword sec_flags = 0;
|
||||
|
||||
if (styp_flags & STYP_NOLOAD)
|
||||
sec_flags |= SEC_NEVER_LOAD;
|
||||
|
|
@ -422,29 +423,20 @@ _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section)
|
|||
}
|
||||
else if ((styp_flags & STYP_BSS)
|
||||
|| (styp_flags & STYP_SBSS))
|
||||
{
|
||||
sec_flags |= SEC_ALLOC;
|
||||
}
|
||||
sec_flags |= SEC_ALLOC;
|
||||
else if ((styp_flags & STYP_INFO) || styp_flags == STYP_COMMENT)
|
||||
{
|
||||
sec_flags |= SEC_NEVER_LOAD;
|
||||
}
|
||||
sec_flags |= SEC_NEVER_LOAD;
|
||||
else if ((styp_flags & STYP_LITA)
|
||||
|| (styp_flags & STYP_LIT8)
|
||||
|| (styp_flags & STYP_LIT4))
|
||||
{
|
||||
sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
|
||||
}
|
||||
sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
|
||||
else if (styp_flags & STYP_ECOFF_LIB)
|
||||
{
|
||||
sec_flags |= SEC_COFF_SHARED_LIBRARY;
|
||||
}
|
||||
sec_flags |= SEC_COFF_SHARED_LIBRARY;
|
||||
else
|
||||
{
|
||||
sec_flags |= SEC_ALLOC | SEC_LOAD;
|
||||
}
|
||||
sec_flags |= SEC_ALLOC | SEC_LOAD;
|
||||
|
||||
return sec_flags;
|
||||
* flags_ptr = sec_flags;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Read in the symbolic header for an ECOFF object file. */
|
||||
|
|
@ -482,13 +474,12 @@ ecoff_slurp_symbolic_header (abfd)
|
|||
}
|
||||
|
||||
/* Read the symbolic information header. */
|
||||
raw = (PTR) bfd_malloc ((size_t) external_hdr_size);
|
||||
raw = (PTR) bfd_malloc (external_hdr_size);
|
||||
if (raw == NULL)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, ecoff_data (abfd)->sym_filepos, SEEK_SET) == -1
|
||||
|| (bfd_read (raw, external_hdr_size, 1, abfd)
|
||||
!= external_hdr_size))
|
||||
if (bfd_seek (abfd, ecoff_data (abfd)->sym_filepos, SEEK_SET) != 0
|
||||
|| bfd_bread (raw, external_hdr_size, abfd) != external_hdr_size)
|
||||
goto error_return;
|
||||
internal_symhdr = &ecoff_data (abfd)->debug_info.symbolic_header;
|
||||
(*backend->debug_swap.swap_hdr_in) (abfd, raw, internal_symhdr);
|
||||
|
|
@ -533,6 +524,8 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug)
|
|||
struct fdr *fdr_ptr;
|
||||
bfd_size_type raw_end;
|
||||
bfd_size_type cb_end;
|
||||
bfd_size_type amt;
|
||||
file_ptr pos;
|
||||
|
||||
BFD_ASSERT (debug == &ecoff_data (abfd)->debug_info);
|
||||
|
||||
|
|
@ -591,11 +584,11 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug)
|
|||
raw = (PTR) bfd_alloc (abfd, raw_size);
|
||||
if (raw == NULL)
|
||||
return false;
|
||||
if (bfd_seek (abfd,
|
||||
(ecoff_data (abfd)->sym_filepos
|
||||
+ backend->debug_swap.external_hdr_size),
|
||||
SEEK_SET) != 0
|
||||
|| bfd_read (raw, raw_size, 1, abfd) != raw_size)
|
||||
|
||||
pos = ecoff_data (abfd)->sym_filepos;
|
||||
pos += backend->debug_swap.external_hdr_size;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bread (raw, raw_size, abfd) != raw_size)
|
||||
{
|
||||
bfd_release (abfd, raw);
|
||||
return false;
|
||||
|
|
@ -632,9 +625,9 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug)
|
|||
|
||||
We need to look at the fdr to deal with a lot of information in
|
||||
the symbols, so we swap them here. */
|
||||
debug->fdr = (struct fdr *) bfd_alloc (abfd,
|
||||
(internal_symhdr->ifdMax *
|
||||
sizeof (struct fdr)));
|
||||
amt = internal_symhdr->ifdMax;
|
||||
amt *= sizeof (struct fdr);
|
||||
debug->fdr = (struct fdr *) bfd_alloc (abfd, amt);
|
||||
if (debug->fdr == NULL)
|
||||
return false;
|
||||
external_fdr_size = backend->debug_swap.external_fdr_size;
|
||||
|
|
@ -666,8 +659,9 @@ _bfd_ecoff_make_empty_symbol (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
ecoff_symbol_type *new;
|
||||
bfd_size_type amt = sizeof (ecoff_symbol_type);
|
||||
|
||||
new = (ecoff_symbol_type *) bfd_alloc (abfd, sizeof (ecoff_symbol_type));
|
||||
new = (ecoff_symbol_type *) bfd_alloc (abfd, amt);
|
||||
if (new == (ecoff_symbol_type *) NULL)
|
||||
return (asymbol *) NULL;
|
||||
memset ((PTR) new, 0, sizeof *new);
|
||||
|
|
@ -866,6 +860,7 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak)
|
|||
asection *section;
|
||||
arelent_chain *reloc_chain;
|
||||
unsigned int bitsize;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Get a section with the same name as the symbol (usually
|
||||
__CTOR_LIST__ or __DTOR_LIST__). FIXME: gcc uses the
|
||||
|
|
@ -885,7 +880,8 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak)
|
|||
{
|
||||
char *copy;
|
||||
|
||||
copy = (char *) bfd_alloc (abfd, strlen (name) + 1);
|
||||
amt = strlen (name) + 1;
|
||||
copy = (char *) bfd_alloc (abfd, amt);
|
||||
if (!copy)
|
||||
return false;
|
||||
strcpy (copy, name);
|
||||
|
|
@ -893,8 +889,8 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak)
|
|||
}
|
||||
|
||||
/* Build a reloc pointing to this constructor. */
|
||||
reloc_chain =
|
||||
(arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain));
|
||||
amt = sizeof (arelent_chain);
|
||||
reloc_chain = (arelent_chain *) bfd_alloc (abfd, amt);
|
||||
if (!reloc_chain)
|
||||
return false;
|
||||
reloc_chain->relent.sym_ptr_ptr =
|
||||
|
|
@ -966,7 +962,8 @@ _bfd_ecoff_slurp_symbol_table (abfd)
|
|||
if (bfd_get_symcount (abfd) == 0)
|
||||
return true;
|
||||
|
||||
internal_size = bfd_get_symcount (abfd) * sizeof (ecoff_symbol_type);
|
||||
internal_size = bfd_get_symcount (abfd);
|
||||
internal_size *= sizeof (ecoff_symbol_type);
|
||||
internal = (ecoff_symbol_type *) bfd_alloc (abfd, internal_size);
|
||||
if (internal == NULL)
|
||||
return false;
|
||||
|
|
@ -1671,7 +1668,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols)
|
|||
const struct ecoff_backend_data * const backend = ecoff_backend (abfd);
|
||||
arelent *internal_relocs;
|
||||
bfd_size_type external_reloc_size;
|
||||
bfd_size_type external_relocs_size;
|
||||
bfd_size_type amt;
|
||||
char *external_relocs;
|
||||
arelent *rptr;
|
||||
unsigned int i;
|
||||
|
|
@ -1684,19 +1681,19 @@ ecoff_slurp_reloc_table (abfd, section, symbols)
|
|||
if (_bfd_ecoff_slurp_symbol_table (abfd) == false)
|
||||
return false;
|
||||
|
||||
internal_relocs = (arelent *) bfd_alloc (abfd,
|
||||
(sizeof (arelent)
|
||||
* section->reloc_count));
|
||||
amt = section->reloc_count;
|
||||
amt *= sizeof (arelent);
|
||||
internal_relocs = (arelent *) bfd_alloc (abfd, amt);
|
||||
|
||||
external_reloc_size = backend->external_reloc_size;
|
||||
external_relocs_size = external_reloc_size * section->reloc_count;
|
||||
external_relocs = (char *) bfd_alloc (abfd, external_relocs_size);
|
||||
amt = external_reloc_size * section->reloc_count;
|
||||
external_relocs = (char *) bfd_alloc (abfd, amt);
|
||||
if (internal_relocs == (arelent *) NULL
|
||||
|| external_relocs == (char *) NULL)
|
||||
return false;
|
||||
if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0)
|
||||
return false;
|
||||
if (bfd_read (external_relocs, 1, external_relocs_size, abfd)
|
||||
!= external_relocs_size)
|
||||
if (bfd_bread (external_relocs, amt, abfd) != amt)
|
||||
return false;
|
||||
|
||||
for (i = 0, rptr = internal_relocs; i < section->reloc_count; i++, rptr++)
|
||||
|
|
@ -1725,7 +1722,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols)
|
|||
}
|
||||
else
|
||||
{
|
||||
CONST char *sec_name;
|
||||
const char *sec_name;
|
||||
asection *sec;
|
||||
|
||||
/* r_symndx is a section key. */
|
||||
|
|
@ -1822,8 +1819,8 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset,
|
|||
asection *section;
|
||||
asymbol **ignore_symbols ATTRIBUTE_UNUSED;
|
||||
bfd_vma offset;
|
||||
CONST char **filename_ptr;
|
||||
CONST char **functionname_ptr;
|
||||
const char **filename_ptr;
|
||||
const char **functionname_ptr;
|
||||
unsigned int *retline_ptr;
|
||||
{
|
||||
const struct ecoff_debug_swap * const debug_swap
|
||||
|
|
@ -1838,9 +1835,9 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset,
|
|||
|
||||
if (ecoff_data (abfd)->find_line_info == NULL)
|
||||
{
|
||||
ecoff_data (abfd)->find_line_info =
|
||||
((struct ecoff_find_line *)
|
||||
bfd_zalloc (abfd, sizeof (struct ecoff_find_line)));
|
||||
bfd_size_type amt = sizeof (struct ecoff_find_line);
|
||||
ecoff_data (abfd)->find_line_info
|
||||
= (struct ecoff_find_line *) bfd_zalloc (abfd, amt);
|
||||
if (ecoff_data (abfd)->find_line_info == NULL)
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2065,13 +2062,15 @@ ecoff_compute_section_file_positions (abfd)
|
|||
boolean rdata_in_text;
|
||||
boolean first_data, first_nonalloc;
|
||||
const bfd_vma round = ecoff_backend (abfd)->round;
|
||||
bfd_size_type amt;
|
||||
|
||||
sofar = _bfd_ecoff_sizeof_headers (abfd, false);
|
||||
file_sofar = sofar;
|
||||
|
||||
/* Sort the sections by VMA. */
|
||||
sorted_hdrs = (asection **) bfd_malloc (abfd->section_count
|
||||
* sizeof (asection *));
|
||||
amt = abfd->section_count;
|
||||
amt *= sizeof (asection *);
|
||||
sorted_hdrs = (asection **) bfd_malloc (amt);
|
||||
if (sorted_hdrs == NULL)
|
||||
return false;
|
||||
for (current = abfd->sections, i = 0;
|
||||
|
|
@ -2265,6 +2264,8 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count)
|
|||
file_ptr offset;
|
||||
bfd_size_type count;
|
||||
{
|
||||
file_ptr pos;
|
||||
|
||||
/* This must be done first, because bfd_set_section_contents is
|
||||
going to set output_has_begun to true. */
|
||||
if (abfd->output_has_begun == false)
|
||||
|
|
@ -2293,8 +2294,9 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count)
|
|||
if (count == 0)
|
||||
return true;
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0
|
||||
|| bfd_write (location, 1, count, abfd) != count)
|
||||
pos = section->filepos + offset;
|
||||
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|
||||
|| bfd_bwrite (location, count, abfd) != count)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -2521,7 +2523,7 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
siz = filhsz;
|
||||
if (siz < aoutsz)
|
||||
siz = aoutsz;
|
||||
buff = (PTR) bfd_malloc ((size_t) siz);
|
||||
buff = (PTR) bfd_malloc (siz);
|
||||
if (buff == NULL)
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -2581,7 +2583,7 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
current->flags);
|
||||
|
||||
if (bfd_coff_swap_scnhdr_out (abfd, (PTR) §ion, buff) == 0
|
||||
|| bfd_write (buff, 1, scnhsz, abfd) != scnhsz)
|
||||
|| bfd_bwrite (buff, scnhsz, abfd) != scnhsz)
|
||||
goto error_return;
|
||||
|
||||
if ((section.s_flags & STYP_TEXT) != 0
|
||||
|
|
@ -2732,11 +2734,11 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
goto error_return;
|
||||
|
||||
bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, buff);
|
||||
if (bfd_write (buff, 1, filhsz, abfd) != filhsz)
|
||||
if (bfd_bwrite (buff, filhsz, abfd) != filhsz)
|
||||
goto error_return;
|
||||
|
||||
bfd_coff_swap_aouthdr_out (abfd, (PTR) &internal_a, buff);
|
||||
if (bfd_write (buff, 1, aoutsz, abfd) != aoutsz)
|
||||
if (bfd_bwrite (buff, aoutsz, abfd) != aoutsz)
|
||||
goto error_return;
|
||||
|
||||
/* Build the external symbol information. This must be done before
|
||||
|
|
@ -2764,12 +2766,13 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
arelent **reloc_ptr_ptr;
|
||||
arelent **reloc_end;
|
||||
char *out_ptr;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (current->reloc_count == 0)
|
||||
continue;
|
||||
|
||||
reloc_buff =
|
||||
bfd_alloc (abfd, current->reloc_count * external_reloc_size);
|
||||
amt = current->reloc_count * external_reloc_size;
|
||||
reloc_buff = bfd_alloc (abfd, amt);
|
||||
if (reloc_buff == NULL)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -2800,7 +2803,7 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
}
|
||||
else
|
||||
{
|
||||
CONST char *name;
|
||||
const char *name;
|
||||
|
||||
name = bfd_get_section_name (abfd, bfd_get_section (sym));
|
||||
if (strcmp (name, ".text") == 0)
|
||||
|
|
@ -2845,9 +2848,8 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
|
||||
if (bfd_seek (abfd, current->rel_filepos, SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
if (bfd_write (reloc_buff,
|
||||
external_reloc_size, current->reloc_count, abfd)
|
||||
!= external_reloc_size * current->reloc_count)
|
||||
amt = current->reloc_count * external_reloc_size;
|
||||
if (bfd_bwrite (reloc_buff, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
bfd_release (abfd, reloc_buff);
|
||||
reloc_buff = NULL;
|
||||
|
|
@ -2877,12 +2879,12 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
if (bfd_seek (abfd, (file_ptr) ecoff_data (abfd)->sym_filepos - 1,
|
||||
SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
if (bfd_read (&c, 1, 1, abfd) == 0)
|
||||
if (bfd_bread (&c, (bfd_size_type) 1, abfd) == 0)
|
||||
c = 0;
|
||||
if (bfd_seek (abfd, (file_ptr) ecoff_data (abfd)->sym_filepos - 1,
|
||||
SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
if (bfd_write (&c, 1, 1, abfd) != 1)
|
||||
if (bfd_bwrite (&c, (bfd_size_type) 1, abfd) != 1)
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
|
|
@ -2950,7 +2952,7 @@ _bfd_ecoff_write_object_contents (abfd)
|
|||
|
||||
static unsigned int
|
||||
ecoff_armap_hash (s, rehash, size, hlog)
|
||||
CONST char *s;
|
||||
const char *s;
|
||||
unsigned int *rehash;
|
||||
unsigned int size;
|
||||
unsigned int hlog;
|
||||
|
|
@ -2983,9 +2985,10 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
char *raw_ptr;
|
||||
struct symdef *symdef_ptr;
|
||||
char *stringbase;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Get the name of the first element. */
|
||||
i = bfd_read ((PTR) nextname, 1, 16, abfd);
|
||||
i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
|
||||
if (i == 0)
|
||||
return true;
|
||||
if (i != 16)
|
||||
|
|
@ -3040,7 +3043,7 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
if (raw_armap == (char *) NULL)
|
||||
return false;
|
||||
|
||||
if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)
|
||||
if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_malformed_archive);
|
||||
|
|
@ -3050,7 +3053,7 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
|
||||
ardata->tdata = (PTR) raw_armap;
|
||||
|
||||
count = bfd_h_get_32 (abfd, (PTR) raw_armap);
|
||||
count = H_GET_32 (abfd, raw_armap);
|
||||
|
||||
ardata->symdef_count = 0;
|
||||
ardata->cache = (struct ar_cache *) NULL;
|
||||
|
|
@ -3077,8 +3080,8 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
unsigned int name_offset, file_offset;
|
||||
unsigned int hash, rehash, srch;
|
||||
|
||||
name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr);
|
||||
file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4));
|
||||
name_offset = H_GET_32 (abfd, raw_ptr);
|
||||
file_offset = H_GET_32 (abfd, (raw_ptr + 4));
|
||||
if (file_offset == 0)
|
||||
continue;
|
||||
hash = ecoff_armap_hash (stringbase + name_offset, &rehash, count,
|
||||
|
|
@ -3090,8 +3093,7 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
for (srch = (hash + rehash) & (count - 1);
|
||||
srch != hash && srch != i;
|
||||
srch = (srch + rehash) & (count - 1))
|
||||
BFD_ASSERT (bfd_h_get_32 (abfd, (PTR) (raw_armap + 8 + srch * 8))
|
||||
!= 0);
|
||||
BFD_ASSERT (H_GET_32 (abfd, (raw_armap + 8 + srch * 8)) != 0);
|
||||
BFD_ASSERT (srch == i);
|
||||
}
|
||||
}
|
||||
|
|
@ -3100,12 +3102,12 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
|
||||
raw_ptr = raw_armap + 4;
|
||||
for (i = 0; i < count; i++, raw_ptr += 8)
|
||||
if (bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)) != 0)
|
||||
if (H_GET_32 (abfd, (raw_ptr + 4)) != 0)
|
||||
++ardata->symdef_count;
|
||||
|
||||
symdef_ptr = ((struct symdef *)
|
||||
bfd_alloc (abfd,
|
||||
ardata->symdef_count * sizeof (struct symdef)));
|
||||
amt = ardata->symdef_count;
|
||||
amt *= sizeof (struct symdef);
|
||||
symdef_ptr = (struct symdef *) bfd_alloc (abfd, amt);
|
||||
if (!symdef_ptr)
|
||||
return false;
|
||||
|
||||
|
|
@ -3116,10 +3118,10 @@ _bfd_ecoff_slurp_armap (abfd)
|
|||
{
|
||||
unsigned int name_offset, file_offset;
|
||||
|
||||
file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4));
|
||||
file_offset = H_GET_32 (abfd, (raw_ptr + 4));
|
||||
if (file_offset == 0)
|
||||
continue;
|
||||
name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr);
|
||||
name_offset = H_GET_32 (abfd, raw_ptr);
|
||||
symdef_ptr->s.name = stringbase + name_offset;
|
||||
symdef_ptr->file_offset = file_offset;
|
||||
++symdef_ptr;
|
||||
|
|
@ -3145,7 +3147,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
int stridx;
|
||||
{
|
||||
unsigned int hashsize, hashlog;
|
||||
unsigned int symdefsize;
|
||||
bfd_size_type symdefsize;
|
||||
int padit;
|
||||
unsigned int stringsize;
|
||||
unsigned int mapsize;
|
||||
|
|
@ -3218,12 +3220,12 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
if (((char *) (&hdr))[i] == '\0')
|
||||
(((char *) (&hdr))[i]) = ' ';
|
||||
|
||||
if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd)
|
||||
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), abfd)
|
||||
!= sizeof (struct ar_hdr))
|
||||
return false;
|
||||
|
||||
bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp);
|
||||
if (bfd_write ((PTR) temp, 1, 4, abfd) != 4)
|
||||
H_PUT_32 (abfd, hashsize, temp);
|
||||
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4)
|
||||
return false;
|
||||
|
||||
hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize);
|
||||
|
|
@ -3238,7 +3240,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
|
||||
/* Advance firstreal to the file position of this archive
|
||||
element. */
|
||||
if (((bfd *) map[i].pos) != last_elt)
|
||||
if (map[i].u.abfd != last_elt)
|
||||
{
|
||||
do
|
||||
{
|
||||
|
|
@ -3246,13 +3248,13 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
firstreal += firstreal % 2;
|
||||
current = current->next;
|
||||
}
|
||||
while (current != (bfd *) map[i].pos);
|
||||
while (current != map[i].u.abfd);
|
||||
}
|
||||
|
||||
last_elt = current;
|
||||
|
||||
hash = ecoff_armap_hash (*map[i].name, &rehash, hashsize, hashlog);
|
||||
if (bfd_h_get_32 (abfd, (PTR) (hashtable + (hash * 8) + 4)) != 0)
|
||||
if (H_GET_32 (abfd, (hashtable + (hash * 8) + 4)) != 0)
|
||||
{
|
||||
unsigned int srch;
|
||||
|
||||
|
|
@ -3260,7 +3262,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
for (srch = (hash + rehash) & (hashsize - 1);
|
||||
srch != hash;
|
||||
srch = (srch + rehash) & (hashsize - 1))
|
||||
if (bfd_h_get_32 (abfd, (PTR) (hashtable + (srch * 8) + 4)) == 0)
|
||||
if (H_GET_32 (abfd, (hashtable + (srch * 8) + 4)) == 0)
|
||||
break;
|
||||
|
||||
BFD_ASSERT (srch != hash);
|
||||
|
|
@ -3268,27 +3270,25 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
hash = srch;
|
||||
}
|
||||
|
||||
bfd_h_put_32 (abfd, (bfd_vma) map[i].namidx,
|
||||
(PTR) (hashtable + hash * 8));
|
||||
bfd_h_put_32 (abfd, (bfd_vma) firstreal,
|
||||
(PTR) (hashtable + hash * 8 + 4));
|
||||
H_PUT_32 (abfd, map[i].namidx, (hashtable + hash * 8));
|
||||
H_PUT_32 (abfd, firstreal, (hashtable + hash * 8 + 4));
|
||||
}
|
||||
|
||||
if (bfd_write ((PTR) hashtable, 1, symdefsize, abfd) != symdefsize)
|
||||
if (bfd_bwrite ((PTR) hashtable, symdefsize, abfd) != symdefsize)
|
||||
return false;
|
||||
|
||||
bfd_release (abfd, hashtable);
|
||||
|
||||
/* Now write the strings. */
|
||||
bfd_h_put_32 (abfd, (bfd_vma) stringsize, temp);
|
||||
if (bfd_write ((PTR) temp, 1, 4, abfd) != 4)
|
||||
H_PUT_32 (abfd, stringsize, temp);
|
||||
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4)
|
||||
return false;
|
||||
for (i = 0; i < orl_count; i++)
|
||||
{
|
||||
bfd_size_type len;
|
||||
|
||||
len = strlen (*map[i].name) + 1;
|
||||
if (bfd_write ((PTR) (*map[i].name), 1, len, abfd) != len)
|
||||
if (bfd_bwrite ((PTR) (*map[i].name), len, abfd) != len)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -3296,7 +3296,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
|
|||
bug-compatible for DECstation ar we use a null. */
|
||||
if (padit)
|
||||
{
|
||||
if (bfd_write ("", 1, 1, abfd) != 1)
|
||||
if (bfd_bwrite ("", (bfd_size_type) 1, abfd) != 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -3312,10 +3312,11 @@ _bfd_ecoff_archive_p (abfd)
|
|||
{
|
||||
struct artdata *tdata_hold;
|
||||
char armag[SARMAG + 1];
|
||||
bfd_size_type amt;
|
||||
|
||||
tdata_hold = abfd->tdata.aout_ar_data;
|
||||
|
||||
if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG)
|
||||
if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -3331,8 +3332,8 @@ _bfd_ecoff_archive_p (abfd)
|
|||
/* We are setting bfd_ardata(abfd) here, but since bfd_ardata
|
||||
involves a cast, we can't do it as the left operand of
|
||||
assignment. */
|
||||
abfd->tdata.aout_ar_data =
|
||||
(struct artdata *) bfd_zalloc (abfd, sizeof (struct artdata));
|
||||
amt = sizeof (struct artdata);
|
||||
abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
|
||||
|
||||
if (bfd_ardata (abfd) == (struct artdata *) NULL)
|
||||
{
|
||||
|
|
@ -3449,9 +3450,9 @@ _bfd_ecoff_bfd_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct ecoff_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct ecoff_link_hash_table);
|
||||
|
||||
ret = ((struct ecoff_link_hash_table *)
|
||||
bfd_alloc (abfd, sizeof (struct ecoff_link_hash_table)));
|
||||
ret = (struct ecoff_link_hash_table *) bfd_alloc (abfd, amt);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
if (! _bfd_link_hash_table_init (&ret->root, abfd,
|
||||
|
|
@ -3541,7 +3542,7 @@ ecoff_link_add_archive_symbols (abfd, info)
|
|||
return (_bfd_generic_link_add_archive_symbols
|
||||
(abfd, info, ecoff_link_check_archive_element));
|
||||
|
||||
armap_count = bfd_h_get_32 (abfd, raw_armap);
|
||||
armap_count = H_GET_32 (abfd, raw_armap);
|
||||
|
||||
armap_log = 0;
|
||||
for (i = 1; i < armap_count; i <<= 1)
|
||||
|
|
@ -3594,7 +3595,7 @@ ecoff_link_add_archive_symbols (abfd, info)
|
|||
hash = ecoff_armap_hash (h->root.string, &rehash, armap_count,
|
||||
armap_log);
|
||||
|
||||
file_offset = bfd_h_get_32 (abfd, hashtable + (hash * 8) + 4);
|
||||
file_offset = H_GET_32 (abfd, hashtable + (hash * 8) + 4);
|
||||
if (file_offset == 0)
|
||||
{
|
||||
/* Nothing in this slot. */
|
||||
|
|
@ -3602,7 +3603,7 @@ ecoff_link_add_archive_symbols (abfd, info)
|
|||
continue;
|
||||
}
|
||||
|
||||
name = stringbase + bfd_h_get_32 (abfd, hashtable + (hash * 8));
|
||||
name = stringbase + H_GET_32 (abfd, hashtable + (hash * 8));
|
||||
if (name[0] != h->root.string[0]
|
||||
|| strcmp (name, h->root.string) != 0)
|
||||
{
|
||||
|
|
@ -3615,10 +3616,10 @@ ecoff_link_add_archive_symbols (abfd, info)
|
|||
srch != hash;
|
||||
srch = (srch + rehash) & (armap_count - 1))
|
||||
{
|
||||
file_offset = bfd_h_get_32 (abfd, hashtable + (srch * 8) + 4);
|
||||
file_offset = H_GET_32 (abfd, hashtable + (srch * 8) + 4);
|
||||
if (file_offset == 0)
|
||||
break;
|
||||
name = stringbase + bfd_h_get_32 (abfd, hashtable + (srch * 8));
|
||||
name = stringbase + H_GET_32 (abfd, hashtable + (srch * 8));
|
||||
if (name[0] == h->root.string[0]
|
||||
&& strcmp (name, h->root.string) == 0)
|
||||
{
|
||||
|
|
@ -3636,7 +3637,7 @@ ecoff_link_add_archive_symbols (abfd, info)
|
|||
hash = srch;
|
||||
}
|
||||
|
||||
element = (*backend->get_elt_at_filepos) (abfd, file_offset);
|
||||
element = (*backend->get_elt_at_filepos) (abfd, (file_ptr) file_offset);
|
||||
if (element == (bfd *) NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -3672,7 +3673,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded)
|
|||
HDRR *symhdr;
|
||||
bfd_size_type external_ext_size;
|
||||
PTR external_ext = NULL;
|
||||
size_t esize;
|
||||
bfd_size_type esize;
|
||||
char *ssext = NULL;
|
||||
char *ext_ptr;
|
||||
char *ext_end;
|
||||
|
|
@ -3695,17 +3696,17 @@ ecoff_link_check_archive_element (abfd, info, pneeded)
|
|||
if (external_ext == NULL && esize != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, symhdr->cbExtOffset, SEEK_SET) != 0
|
||||
|| bfd_read (external_ext, 1, esize, abfd) != esize)
|
||||
if (bfd_seek (abfd, (file_ptr) symhdr->cbExtOffset, SEEK_SET) != 0
|
||||
|| bfd_bread (external_ext, esize, abfd) != esize)
|
||||
goto error_return;
|
||||
|
||||
ssext = (char *) bfd_malloc (symhdr->issExtMax);
|
||||
ssext = (char *) bfd_malloc ((bfd_size_type) symhdr->issExtMax);
|
||||
if (ssext == NULL && symhdr->issExtMax != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, symhdr->cbSsExtOffset, SEEK_SET) != 0
|
||||
|| (bfd_read (ssext, 1, symhdr->issExtMax, abfd) !=
|
||||
(bfd_size_type) symhdr->issExtMax))
|
||||
if (bfd_seek (abfd, (file_ptr) symhdr->cbSsExtOffset, SEEK_SET) != 0
|
||||
|| (bfd_bread (ssext, (bfd_size_type) symhdr->issExtMax, abfd)
|
||||
!= (bfd_size_type) symhdr->issExtMax))
|
||||
goto error_return;
|
||||
|
||||
/* Look through the external symbols to see if they define some
|
||||
|
|
@ -3795,7 +3796,7 @@ ecoff_link_add_object_symbols (abfd, info)
|
|||
HDRR *symhdr;
|
||||
bfd_size_type external_ext_size;
|
||||
PTR external_ext = NULL;
|
||||
size_t esize;
|
||||
bfd_size_type esize;
|
||||
char *ssext = NULL;
|
||||
boolean result;
|
||||
|
||||
|
|
@ -3815,16 +3816,16 @@ ecoff_link_add_object_symbols (abfd, info)
|
|||
if (external_ext == NULL && esize != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, symhdr->cbExtOffset, SEEK_SET) != 0
|
||||
|| bfd_read (external_ext, 1, esize, abfd) != esize)
|
||||
if (bfd_seek (abfd, (file_ptr) symhdr->cbExtOffset, SEEK_SET) != 0
|
||||
|| bfd_bread (external_ext, esize, abfd) != esize)
|
||||
goto error_return;
|
||||
|
||||
ssext = (char *) bfd_malloc (symhdr->issExtMax);
|
||||
ssext = (char *) bfd_malloc ((bfd_size_type) symhdr->issExtMax);
|
||||
if (ssext == NULL && symhdr->issExtMax != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, symhdr->cbSsExtOffset, SEEK_SET) != 0
|
||||
|| (bfd_read (ssext, 1, symhdr->issExtMax, abfd)
|
||||
if (bfd_seek (abfd, (file_ptr) symhdr->cbSsExtOffset, SEEK_SET) != 0
|
||||
|| (bfd_bread (ssext, (bfd_size_type) symhdr->issExtMax, abfd)
|
||||
!= (bfd_size_type) symhdr->issExtMax))
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -3865,12 +3866,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
|
|||
struct ecoff_link_hash_entry **sym_hash;
|
||||
char *ext_ptr;
|
||||
char *ext_end;
|
||||
bfd_size_type amt;
|
||||
|
||||
ext_count = ecoff_data (abfd)->debug_info.symbolic_header.iextMax;
|
||||
|
||||
sym_hash = ((struct ecoff_link_hash_entry **)
|
||||
bfd_alloc (abfd,
|
||||
ext_count * sizeof (struct bfd_link_hash_entry *)));
|
||||
amt = ext_count;
|
||||
amt *= sizeof (struct bfd_link_hash_entry *);
|
||||
sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt);
|
||||
if (!sym_hash)
|
||||
return false;
|
||||
ecoff_data (abfd)->sym_hashes = sym_hash;
|
||||
|
|
@ -4007,7 +4009,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
|
|||
h = NULL;
|
||||
if (! (_bfd_generic_link_add_one_symbol
|
||||
(info, abfd, name,
|
||||
esym.weakext ? BSF_WEAK : BSF_GLOBAL,
|
||||
(flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL),
|
||||
section, value, (const char *) NULL, true, true,
|
||||
(struct bfd_link_hash_entry **) &h)))
|
||||
return false;
|
||||
|
|
@ -4296,25 +4298,24 @@ ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle)
|
|||
HDRR *symhdr = &debug->symbolic_header;
|
||||
boolean ret;
|
||||
|
||||
#define READ(ptr, offset, count, size, type) \
|
||||
if (symhdr->count == 0) \
|
||||
debug->ptr = NULL; \
|
||||
else \
|
||||
{ \
|
||||
debug->ptr = (type) bfd_malloc ((size_t) (size * symhdr->count)); \
|
||||
if (debug->ptr == NULL) \
|
||||
{ \
|
||||
ret = false; \
|
||||
goto return_something; \
|
||||
} \
|
||||
if ((bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) \
|
||||
!= 0) \
|
||||
|| (bfd_read (debug->ptr, size, symhdr->count, \
|
||||
input_bfd) != size * symhdr->count)) \
|
||||
{ \
|
||||
ret = false; \
|
||||
goto return_something; \
|
||||
} \
|
||||
#define READ(ptr, offset, count, size, type) \
|
||||
if (symhdr->count == 0) \
|
||||
debug->ptr = NULL; \
|
||||
else \
|
||||
{ \
|
||||
bfd_size_type amt = (bfd_size_type) size * symhdr->count; \
|
||||
debug->ptr = (type) bfd_malloc (amt); \
|
||||
if (debug->ptr == NULL) \
|
||||
{ \
|
||||
ret = false; \
|
||||
goto return_something; \
|
||||
} \
|
||||
if (bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \
|
||||
|| bfd_bread (debug->ptr, amt, input_bfd) != amt) \
|
||||
{ \
|
||||
ret = false; \
|
||||
goto return_something; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* If raw_syments is not NULL, then the data was already by read by
|
||||
|
|
@ -4536,6 +4537,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order)
|
|||
bfd_size_type external_reloc_size;
|
||||
bfd_size_type external_relocs_size;
|
||||
PTR external_relocs = NULL;
|
||||
bfd_size_type amt;
|
||||
|
||||
BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0);
|
||||
|
||||
|
|
@ -4557,10 +4559,9 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order)
|
|||
|
||||
/* Get the section contents. We allocate memory for the larger of
|
||||
the size before relocating and the size after relocating. */
|
||||
contents = (bfd_byte *) bfd_malloc (raw_size >= cooked_size
|
||||
? (size_t) raw_size
|
||||
: (size_t) cooked_size);
|
||||
if (contents == NULL && raw_size != 0)
|
||||
amt = raw_size >= cooked_size ? raw_size : cooked_size;
|
||||
contents = (bfd_byte *) bfd_malloc (amt);
|
||||
if (contents == NULL && amt != 0)
|
||||
goto error_return;
|
||||
|
||||
/* If we are relaxing, the contents may have already been read into
|
||||
|
|
@ -4587,12 +4588,12 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order)
|
|||
external_relocs = section_tdata->external_relocs;
|
||||
else
|
||||
{
|
||||
external_relocs = (PTR) bfd_malloc ((size_t) external_relocs_size);
|
||||
external_relocs = (PTR) bfd_malloc (external_relocs_size);
|
||||
if (external_relocs == NULL && external_relocs_size != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
|
||||
|| (bfd_read (external_relocs, 1, external_relocs_size, input_bfd)
|
||||
|| (bfd_bread (external_relocs, external_relocs_size, input_bfd)
|
||||
!= external_relocs_size))
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -4607,7 +4608,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order)
|
|||
if (! bfd_set_section_contents (output_bfd,
|
||||
output_section,
|
||||
(PTR) contents,
|
||||
input_section->output_offset,
|
||||
(file_ptr) input_section->output_offset,
|
||||
cooked_size))
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -4617,11 +4618,10 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order)
|
|||
have output so far. */
|
||||
if (info->relocateable)
|
||||
{
|
||||
if (bfd_seek (output_bfd,
|
||||
(output_section->rel_filepos +
|
||||
output_section->reloc_count * external_reloc_size),
|
||||
SEEK_SET) != 0
|
||||
|| (bfd_write (external_relocs, 1, external_relocs_size, output_bfd)
|
||||
file_ptr pos = (output_section->rel_filepos
|
||||
+ output_section->reloc_count * external_reloc_size);
|
||||
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
|
||||
|| (bfd_bwrite (external_relocs, external_relocs_size, output_bfd)
|
||||
!= external_relocs_size))
|
||||
goto error_return;
|
||||
output_section->reloc_count += input_section->reloc_count;
|
||||
|
|
@ -4661,6 +4661,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||
bfd_size_type external_reloc_size;
|
||||
bfd_byte *rbuf;
|
||||
boolean ok;
|
||||
file_ptr pos;
|
||||
|
||||
type = link_order->type;
|
||||
section = NULL;
|
||||
|
|
@ -4720,13 +4721,13 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||
bfd_size_type size;
|
||||
bfd_reloc_status_type rstat;
|
||||
bfd_byte *buf;
|
||||
boolean ok;
|
||||
|
||||
size = bfd_get_reloc_size (rel.howto);
|
||||
buf = (bfd_byte *) bfd_zmalloc (size);
|
||||
if (buf == (bfd_byte *) NULL)
|
||||
return false;
|
||||
rstat = _bfd_relocate_contents (rel.howto, output_bfd, addend, buf);
|
||||
rstat = _bfd_relocate_contents (rel.howto, output_bfd,
|
||||
(bfd_vma) addend, buf);
|
||||
switch (rstat)
|
||||
{
|
||||
case bfd_reloc_ok:
|
||||
|
|
@ -4757,7 +4758,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||
|
||||
rel.addend = 0;
|
||||
|
||||
/* Move the information into a internal_reloc structure. */
|
||||
/* Move the information into an internal_reloc structure. */
|
||||
in.r_vaddr = (rel.address
|
||||
+ bfd_get_section_vma (output_bfd, output_section));
|
||||
in.r_type = rel.howto->type;
|
||||
|
|
@ -4785,7 +4786,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||
}
|
||||
else
|
||||
{
|
||||
CONST char *name;
|
||||
const char *name;
|
||||
|
||||
name = bfd_get_section_name (output_bfd, section);
|
||||
if (strcmp (name, ".text") == 0)
|
||||
|
|
@ -4828,17 +4829,16 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||
|
||||
/* Get some memory and swap out the reloc. */
|
||||
external_reloc_size = ecoff_backend (output_bfd)->external_reloc_size;
|
||||
rbuf = (bfd_byte *) bfd_malloc ((size_t) external_reloc_size);
|
||||
rbuf = (bfd_byte *) bfd_malloc (external_reloc_size);
|
||||
if (rbuf == (bfd_byte *) NULL)
|
||||
return false;
|
||||
|
||||
(*ecoff_backend (output_bfd)->swap_reloc_out) (output_bfd, &in, (PTR) rbuf);
|
||||
|
||||
ok = (bfd_seek (output_bfd,
|
||||
(output_section->rel_filepos +
|
||||
output_section->reloc_count * external_reloc_size),
|
||||
SEEK_SET) == 0
|
||||
&& (bfd_write ((PTR) rbuf, 1, external_reloc_size, output_bfd)
|
||||
pos = (output_section->rel_filepos
|
||||
+ output_section->reloc_count * external_reloc_size);
|
||||
ok = (bfd_seek (output_bfd, pos, SEEK_SET) == 0
|
||||
&& (bfd_bwrite ((PTR) rbuf, external_reloc_size, output_bfd)
|
||||
== external_reloc_size));
|
||||
|
||||
if (ok)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Routines to link ECOFF debugging information.
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 2000
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ ecoff_add_bytes (buf, bufend, need)
|
|||
if (want < ALLOC_SIZE)
|
||||
want = ALLOC_SIZE;
|
||||
}
|
||||
newbuf = (char *) bfd_realloc (*buf, have + want);
|
||||
newbuf = (char *) bfd_realloc (*buf, (bfd_size_type) have + want);
|
||||
if (newbuf == NULL)
|
||||
return false;
|
||||
*buf = newbuf;
|
||||
|
|
@ -497,8 +497,9 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
|
|||
struct bfd_link_info *info;
|
||||
{
|
||||
struct accumulate *ainfo;
|
||||
bfd_size_type amt = sizeof (struct accumulate);
|
||||
|
||||
ainfo = (struct accumulate *) bfd_malloc (sizeof (struct accumulate));
|
||||
ainfo = (struct accumulate *) bfd_malloc (amt);
|
||||
if (!ainfo)
|
||||
return NULL;
|
||||
if (! bfd_hash_table_init_n (&ainfo->fdr_hash.table, string_hash_newfunc,
|
||||
|
|
@ -621,6 +622,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
long newrfdbase = 0;
|
||||
long oldrfdbase = 0;
|
||||
bfd_byte *fdr_out;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Use section_adjust to hold the value to add to a symbol in a
|
||||
particular section. */
|
||||
|
|
@ -661,9 +663,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
}
|
||||
fdr_end = fdr_start + input_symhdr->ifdMax * fdr_add;
|
||||
|
||||
input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd,
|
||||
(input_symhdr->ifdMax
|
||||
* sizeof (RFDT)));
|
||||
amt = input_symhdr->ifdMax;
|
||||
amt *= sizeof (RFDT);
|
||||
input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd, amt);
|
||||
|
||||
sz = (input_symhdr->crfd + input_symhdr->ifdMax) * external_rfd_size;
|
||||
rfd_out = (bfd_byte *) objalloc_alloc (ainfo->memory, sz);
|
||||
|
|
@ -712,7 +714,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
merged. */
|
||||
name = input_debug->ss + fdr.issBase + fdr.rss;
|
||||
|
||||
lookup = (char *) bfd_malloc (strlen (name) + 20);
|
||||
lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20);
|
||||
if (lookup == NULL)
|
||||
return false;
|
||||
sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux);
|
||||
|
|
@ -937,10 +939,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
stabs are adjusted correctly. */
|
||||
if (fdr.cbLine > 0)
|
||||
{
|
||||
file_ptr pos = input_symhdr->cbLineOffset + fdr.cbLineOffset;
|
||||
if (!add_file_shuffle (ainfo, &ainfo->line, &ainfo->line_end,
|
||||
input_bfd,
|
||||
input_symhdr->cbLineOffset + fdr.cbLineOffset,
|
||||
fdr.cbLine))
|
||||
input_bfd, pos, (unsigned long) fdr.cbLine))
|
||||
return false;
|
||||
fdr.ilineBase = output_symhdr->ilineMax;
|
||||
fdr.cbLineOffset = output_symhdr->cbLine;
|
||||
|
|
@ -949,10 +950,10 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
}
|
||||
if (fdr.caux > 0)
|
||||
{
|
||||
file_ptr pos = (input_symhdr->cbAuxOffset
|
||||
+ fdr.iauxBase * sizeof (union aux_ext));
|
||||
if (!add_file_shuffle (ainfo, &ainfo->aux, &ainfo->aux_end,
|
||||
input_bfd,
|
||||
(input_symhdr->cbAuxOffset
|
||||
+ fdr.iauxBase * sizeof (union aux_ext)),
|
||||
input_bfd, pos,
|
||||
fdr.caux * sizeof (union aux_ext)))
|
||||
return false;
|
||||
fdr.iauxBase = output_symhdr->iauxMax;
|
||||
|
|
@ -970,10 +971,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
}
|
||||
else if (fdr.cbSs > 0)
|
||||
{
|
||||
file_ptr pos = input_symhdr->cbSsOffset + fdr.issBase;
|
||||
if (!add_file_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end,
|
||||
input_bfd,
|
||||
input_symhdr->cbSsOffset + fdr.issBase,
|
||||
fdr.cbSs))
|
||||
input_bfd, pos, (unsigned long) fdr.cbSs))
|
||||
return false;
|
||||
fdr.issBase = output_symhdr->issMax;
|
||||
output_symhdr->issMax += fdr.cbSs;
|
||||
|
|
@ -989,21 +989,21 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
|
|||
BFD_ASSERT (external_pdr_size == input_swap->external_pdr_size);
|
||||
if (fdr.cpd > 0)
|
||||
{
|
||||
file_ptr pos = (input_symhdr->cbPdOffset
|
||||
+ fdr.ipdFirst * external_pdr_size);
|
||||
unsigned long size = fdr.cpd * external_pdr_size;
|
||||
if (!add_file_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end,
|
||||
input_bfd,
|
||||
(input_symhdr->cbPdOffset
|
||||
+ fdr.ipdFirst * external_pdr_size),
|
||||
fdr.cpd * external_pdr_size))
|
||||
input_bfd, pos, size))
|
||||
return false;
|
||||
}
|
||||
BFD_ASSERT (external_opt_size == input_swap->external_opt_size);
|
||||
if (fdr.copt > 0)
|
||||
{
|
||||
file_ptr pos = (input_symhdr->cbOptOffset
|
||||
+ fdr.ioptBase * external_opt_size);
|
||||
unsigned long size = fdr.copt * external_opt_size;
|
||||
if (!add_file_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end,
|
||||
input_bfd,
|
||||
(input_symhdr->cbOptOffset
|
||||
+ fdr.ioptBase * external_opt_size),
|
||||
fdr.copt * external_opt_size))
|
||||
input_bfd, pos, size))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1201,7 +1201,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
|
|||
fdr.issBase = output_symhdr->issMax;
|
||||
fdr.cbSs = 0;
|
||||
fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr,
|
||||
bfd_get_filename (input_bfd));
|
||||
bfd_archive_filename (input_bfd));
|
||||
if (fdr.rss == -1)
|
||||
return false;
|
||||
fdr.isymBase = output_symhdr->isymMax;
|
||||
|
|
@ -1210,7 +1210,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
|
|||
symsize = bfd_get_symtab_upper_bound (input_bfd);
|
||||
if (symsize < 0)
|
||||
return false;
|
||||
symbols = (asymbol **) bfd_alloc (output_bfd, symsize);
|
||||
symbols = (asymbol **) bfd_alloc (output_bfd, (bfd_size_type) symsize);
|
||||
if (symbols == (asymbol **) NULL)
|
||||
return false;
|
||||
symcount = bfd_canonicalize_symtab (input_bfd, symbols);
|
||||
|
|
@ -1254,7 +1254,8 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
|
|||
}
|
||||
(*swap_sym_out) (output_bfd, &internal_sym, external_sym);
|
||||
add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end,
|
||||
external_sym, output_swap->external_sym_size);
|
||||
external_sym,
|
||||
(unsigned long) output_swap->external_sym_size);
|
||||
++fdr.csym;
|
||||
++output_symhdr->isymMax;
|
||||
}
|
||||
|
|
@ -1274,7 +1275,8 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
|
|||
}
|
||||
(*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr);
|
||||
add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end,
|
||||
external_fdr, output_swap->external_fdr_size);
|
||||
external_fdr,
|
||||
(unsigned long) output_swap->external_fdr_size);
|
||||
|
||||
++output_symhdr->ifdMax;
|
||||
|
||||
|
|
@ -1386,7 +1388,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
|
|||
{
|
||||
if (ecoff_add_bytes ((char **) &debug->external_ext,
|
||||
(char **) &debug->external_ext_end,
|
||||
(symhdr->iextMax + 1) * external_ext_size)
|
||||
(symhdr->iextMax + 1) * (size_t) external_ext_size)
|
||||
== false)
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1546,12 +1548,12 @@ ecoff_write_symhdr (abfd, debug, swap, where)
|
|||
SET (cbExtOffset, iextMax, swap->external_ext_size);
|
||||
#undef SET
|
||||
|
||||
buff = (PTR) bfd_malloc ((size_t) swap->external_hdr_size);
|
||||
buff = (PTR) bfd_malloc (swap->external_hdr_size);
|
||||
if (buff == NULL && swap->external_hdr_size != 0)
|
||||
goto error_return;
|
||||
|
||||
(*swap->swap_hdr_out) (abfd, symhdr, buff);
|
||||
if (bfd_write (buff, 1, swap->external_hdr_size, abfd)
|
||||
if (bfd_bwrite (buff, swap->external_hdr_size, abfd)
|
||||
!= swap->external_hdr_size)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1585,7 +1587,7 @@ bfd_ecoff_write_debug (abfd, debug, swap, where)
|
|||
#define WRITE(ptr, count, size, offset) \
|
||||
BFD_ASSERT (symhdr->offset == 0 \
|
||||
|| (bfd_vma) bfd_tell (abfd) == symhdr->offset); \
|
||||
if (bfd_write ((PTR) debug->ptr, size, symhdr->count, abfd) \
|
||||
if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\
|
||||
!= size * symhdr->count) \
|
||||
return false;
|
||||
|
||||
|
|
@ -1594,7 +1596,8 @@ bfd_ecoff_write_debug (abfd, debug, swap, where)
|
|||
WRITE (external_pdr, ipdMax, swap->external_pdr_size, cbPdOffset);
|
||||
WRITE (external_sym, isymMax, swap->external_sym_size, cbSymOffset);
|
||||
WRITE (external_opt, ioptMax, swap->external_opt_size, cbOptOffset);
|
||||
WRITE (external_aux, iauxMax, sizeof (union aux_ext), cbAuxOffset);
|
||||
WRITE (external_aux, iauxMax, (bfd_size_type) sizeof (union aux_ext),
|
||||
cbAuxOffset);
|
||||
WRITE (ss, issMax, sizeof (char), cbSsOffset);
|
||||
WRITE (ssext, issExtMax, sizeof (char), cbSsExtOffset);
|
||||
WRITE (external_fdr, ifdMax, swap->external_fdr_size, cbFdOffset);
|
||||
|
|
@ -1626,14 +1629,16 @@ ecoff_write_shuffle (abfd, swap, shuffle, space)
|
|||
{
|
||||
if (! l->filep)
|
||||
{
|
||||
if (bfd_write (l->u.memory, 1, l->size, abfd) != l->size)
|
||||
if (bfd_bwrite (l->u.memory, (bfd_size_type) l->size, abfd)
|
||||
!= l->size)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0
|
||||
|| bfd_read (space, 1, l->size, l->u.file.input_bfd) != l->size
|
||||
|| bfd_write (space, 1, l->size, abfd) != l->size)
|
||||
|| bfd_bread (space, (bfd_size_type) l->size,
|
||||
l->u.file.input_bfd) != l->size
|
||||
|| bfd_bwrite (space, (bfd_size_type) l->size, abfd) != l->size)
|
||||
return false;
|
||||
}
|
||||
total += l->size;
|
||||
|
|
@ -1645,12 +1650,12 @@ ecoff_write_shuffle (abfd, swap, shuffle, space)
|
|||
bfd_byte *s;
|
||||
|
||||
i = swap->debug_align - (total & (swap->debug_align - 1));
|
||||
s = (bfd_byte *) bfd_malloc (i);
|
||||
s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
|
||||
if (s == NULL && i != 0)
|
||||
return false;
|
||||
|
||||
memset ((PTR) s, 0, i);
|
||||
if (bfd_write ((PTR) s, 1, i, abfd) != i)
|
||||
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
|
||||
{
|
||||
free (s);
|
||||
return false;
|
||||
|
|
@ -1675,11 +1680,13 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
{
|
||||
struct accumulate *ainfo = (struct accumulate *) handle;
|
||||
PTR space = NULL;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (! ecoff_write_symhdr (abfd, debug, swap, where))
|
||||
goto error_return;
|
||||
|
||||
space = (PTR) bfd_malloc (ainfo->largest_file_shuffle);
|
||||
amt = ainfo->largest_file_shuffle;
|
||||
space = (PTR) bfd_malloc (amt);
|
||||
if (space == NULL && ainfo->largest_file_shuffle != 0)
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1706,7 +1713,7 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
|
||||
BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL);
|
||||
null = 0;
|
||||
if (bfd_write ((PTR) &null, 1, 1, abfd) != 1)
|
||||
if (bfd_bwrite ((PTR) &null, (bfd_size_type) 1, abfd) != 1)
|
||||
goto error_return;
|
||||
total = 1;
|
||||
BFD_ASSERT (ainfo->ss_hash == NULL || ainfo->ss_hash->val == 1);
|
||||
|
|
@ -1717,7 +1724,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
size_t len;
|
||||
|
||||
len = strlen (sh->root.string);
|
||||
if (bfd_write ((PTR) sh->root.string, 1, len + 1, abfd) != len + 1)
|
||||
amt = len + 1;
|
||||
if (bfd_bwrite ((PTR) sh->root.string, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
total += len + 1;
|
||||
}
|
||||
|
|
@ -1728,11 +1736,11 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
bfd_byte *s;
|
||||
|
||||
i = swap->debug_align - (total & (swap->debug_align - 1));
|
||||
s = (bfd_byte *) bfd_malloc (i);
|
||||
s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
|
||||
if (s == NULL && i != 0)
|
||||
goto error_return;
|
||||
memset ((PTR) s, 0, i);
|
||||
if (bfd_write ((PTR) s, 1, i, abfd) != i)
|
||||
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
|
||||
{
|
||||
free (s);
|
||||
goto error_return;
|
||||
|
|
@ -1743,8 +1751,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
|
||||
/* The external strings and symbol are not converted over to using
|
||||
shuffles. FIXME: They probably should be. */
|
||||
if (bfd_write (debug->ssext, 1, debug->symbolic_header.issExtMax, abfd)
|
||||
!= (bfd_size_type) debug->symbolic_header.issExtMax)
|
||||
amt = debug->symbolic_header.issExtMax;
|
||||
if (bfd_bwrite (debug->ssext, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
if ((debug->symbolic_header.issExtMax & (swap->debug_align - 1)) != 0)
|
||||
{
|
||||
|
|
@ -1753,11 +1761,11 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
|
||||
i = (swap->debug_align
|
||||
- (debug->symbolic_header.issExtMax & (swap->debug_align - 1)));
|
||||
s = (bfd_byte *) bfd_malloc (i);
|
||||
s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
|
||||
if (s == NULL && i != 0)
|
||||
goto error_return;
|
||||
memset ((PTR) s, 0, i);
|
||||
if (bfd_write ((PTR) s, 1, i, abfd) != i)
|
||||
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
|
||||
{
|
||||
free (s);
|
||||
goto error_return;
|
||||
|
|
@ -1773,9 +1781,8 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
|
|||
|| (debug->symbolic_header.cbExtOffset
|
||||
== (bfd_vma) bfd_tell (abfd)));
|
||||
|
||||
if (bfd_write (debug->external_ext, swap->external_ext_size,
|
||||
debug->symbolic_header.iextMax, abfd)
|
||||
!= debug->symbolic_header.iextMax * swap->external_ext_size)
|
||||
amt = debug->symbolic_header.iextMax * swap->external_ext_size;
|
||||
if (bfd_bwrite (debug->external_ext, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
|
||||
if (space != NULL)
|
||||
|
|
@ -1829,6 +1836,7 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info)
|
|||
FDR *fdr_end;
|
||||
boolean stabs;
|
||||
long len;
|
||||
bfd_size_type amt;
|
||||
|
||||
fdr_start = debug_info->fdr;
|
||||
fdr_end = fdr_start + debug_info->symbolic_header.ifdMax;
|
||||
|
|
@ -1843,9 +1851,8 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info)
|
|||
|
||||
/* Now, create and fill in the table: */
|
||||
|
||||
line_info->fdrtab = ((struct ecoff_fdrtab_entry*)
|
||||
bfd_zalloc (abfd,
|
||||
len * sizeof (struct ecoff_fdrtab_entry)));
|
||||
amt = (bfd_size_type) len * sizeof (struct ecoff_fdrtab_entry);
|
||||
line_info->fdrtab = (struct ecoff_fdrtab_entry*) bfd_zalloc (abfd, amt);
|
||||
if (line_info->fdrtab == NULL)
|
||||
return false;
|
||||
line_info->fdrtab_len = len;
|
||||
|
|
@ -1902,7 +1909,7 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info)
|
|||
The table is mostly sorted already, but there are cases (e.g.,
|
||||
static functions in include files), where this does not hold.
|
||||
Use "odump -PFv" to verify... */
|
||||
qsort ((PTR) line_info->fdrtab, len,
|
||||
qsort ((PTR) line_info->fdrtab, (size_t) len,
|
||||
sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry);
|
||||
|
||||
return true;
|
||||
|
|
@ -2004,7 +2011,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
|
|||
char *pdr_ptr;
|
||||
char *best_pdr = NULL;
|
||||
FDR *best_fdr;
|
||||
bfd_vma best_dist = ~0;
|
||||
bfd_vma best_dist = ~(bfd_vma) 0;
|
||||
PDR pdr;
|
||||
unsigned char *line_ptr;
|
||||
unsigned char *line_end;
|
||||
|
|
@ -2330,7 +2337,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
|
|||
{
|
||||
if (line_info->find_buffer != NULL)
|
||||
free (line_info->find_buffer);
|
||||
buffer = (char *) bfd_malloc (len);
|
||||
buffer = (char *) bfd_malloc ((bfd_size_type) len);
|
||||
if (buffer == NULL)
|
||||
return false;
|
||||
line_info->find_buffer = buffer;
|
||||
|
|
@ -2429,7 +2436,8 @@ ecoff_collect_shuffle (l, buff)
|
|||
else
|
||||
{
|
||||
if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0
|
||||
|| bfd_read (buff, 1, l->size, l->u.file.input_bfd) != l->size)
|
||||
|| (bfd_bread (buff, (bfd_size_type) l->size, l->u.file.input_bfd)
|
||||
!= l->size))
|
||||
return false;
|
||||
}
|
||||
total += l->size;
|
||||
|
|
|
|||
|
|
@ -45,20 +45,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
with the proper byte sex and such. */
|
||||
|
||||
#ifdef ECOFF_32
|
||||
#define ecoff_get_off bfd_h_get_32
|
||||
#define ecoff_put_off bfd_h_put_32
|
||||
#define ECOFF_GET_OFF H_GET_32
|
||||
#define ECOFF_PUT_OFF H_PUT_32
|
||||
#endif
|
||||
#ifdef ECOFF_64
|
||||
#define ecoff_get_off bfd_h_get_64
|
||||
#define ecoff_put_off bfd_h_put_64
|
||||
#define ECOFF_GET_OFF H_GET_64
|
||||
#define ECOFF_PUT_OFF H_PUT_64
|
||||
#endif
|
||||
#ifdef ECOFF_SIGNED_32
|
||||
#define ecoff_get_off bfd_h_get_signed_32
|
||||
#define ecoff_put_off bfd_h_put_signed_32
|
||||
#define ECOFF_GET_OFF H_GET_S32
|
||||
#define ECOFF_PUT_OFF H_PUT_S32
|
||||
#endif
|
||||
#ifdef ECOFF_SIGNED_64
|
||||
#define ecoff_get_off bfd_h_get_signed_64
|
||||
#define ecoff_put_off bfd_h_put_signed_64
|
||||
#define ECOFF_GET_OFF H_GET_S64
|
||||
#define ECOFF_PUT_OFF H_PUT_S64
|
||||
#endif
|
||||
|
||||
/* ECOFF auxiliary information swapping routines. These are the same
|
||||
|
|
@ -104,31 +104,31 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern)
|
|||
|
||||
*ext = *(struct hdr_ext *) ext_copy;
|
||||
|
||||
intern->magic = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->h_magic);
|
||||
intern->vstamp = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->h_vstamp);
|
||||
intern->ilineMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ilineMax);
|
||||
intern->cbLine = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbLine);
|
||||
intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbLineOffset);
|
||||
intern->idnMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_idnMax);
|
||||
intern->cbDnOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbDnOffset);
|
||||
intern->ipdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ipdMax);
|
||||
intern->cbPdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbPdOffset);
|
||||
intern->isymMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_isymMax);
|
||||
intern->cbSymOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSymOffset);
|
||||
intern->ioptMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ioptMax);
|
||||
intern->cbOptOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbOptOffset);
|
||||
intern->iauxMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iauxMax);
|
||||
intern->cbAuxOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbAuxOffset);
|
||||
intern->issMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issMax);
|
||||
intern->cbSsOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSsOffset);
|
||||
intern->issExtMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issExtMax);
|
||||
intern->cbSsExtOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbSsExtOffset);
|
||||
intern->ifdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ifdMax);
|
||||
intern->cbFdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbFdOffset);
|
||||
intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_crfd);
|
||||
intern->cbRfdOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbRfdOffset);
|
||||
intern->iextMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iextMax);
|
||||
intern->cbExtOffset = ecoff_get_off (abfd, (bfd_byte *)ext->h_cbExtOffset);
|
||||
intern->magic = H_GET_S16 (abfd, ext->h_magic);
|
||||
intern->vstamp = H_GET_S16 (abfd, ext->h_vstamp);
|
||||
intern->ilineMax = H_GET_32 (abfd, ext->h_ilineMax);
|
||||
intern->cbLine = ECOFF_GET_OFF (abfd, ext->h_cbLine);
|
||||
intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->h_cbLineOffset);
|
||||
intern->idnMax = H_GET_32 (abfd, ext->h_idnMax);
|
||||
intern->cbDnOffset = ECOFF_GET_OFF (abfd, ext->h_cbDnOffset);
|
||||
intern->ipdMax = H_GET_32 (abfd, ext->h_ipdMax);
|
||||
intern->cbPdOffset = ECOFF_GET_OFF (abfd, ext->h_cbPdOffset);
|
||||
intern->isymMax = H_GET_32 (abfd, ext->h_isymMax);
|
||||
intern->cbSymOffset = ECOFF_GET_OFF (abfd, ext->h_cbSymOffset);
|
||||
intern->ioptMax = H_GET_32 (abfd, ext->h_ioptMax);
|
||||
intern->cbOptOffset = ECOFF_GET_OFF (abfd, ext->h_cbOptOffset);
|
||||
intern->iauxMax = H_GET_32 (abfd, ext->h_iauxMax);
|
||||
intern->cbAuxOffset = ECOFF_GET_OFF (abfd, ext->h_cbAuxOffset);
|
||||
intern->issMax = H_GET_32 (abfd, ext->h_issMax);
|
||||
intern->cbSsOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsOffset);
|
||||
intern->issExtMax = H_GET_32 (abfd, ext->h_issExtMax);
|
||||
intern->cbSsExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsExtOffset);
|
||||
intern->ifdMax = H_GET_32 (abfd, ext->h_ifdMax);
|
||||
intern->cbFdOffset = ECOFF_GET_OFF (abfd, ext->h_cbFdOffset);
|
||||
intern->crfd = H_GET_32 (abfd, ext->h_crfd);
|
||||
intern->cbRfdOffset = ECOFF_GET_OFF (abfd, ext->h_cbRfdOffset);
|
||||
intern->iextMax = H_GET_32 (abfd, ext->h_iextMax);
|
||||
intern->cbExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbExtOffset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -149,34 +149,34 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy;
|
||||
|
||||
bfd_h_put_signed_16 (abfd, intern->magic, (bfd_byte *)ext->h_magic);
|
||||
bfd_h_put_signed_16 (abfd, intern->vstamp, (bfd_byte *)ext->h_vstamp);
|
||||
bfd_h_put_32 (abfd, intern->ilineMax, (bfd_byte *)ext->h_ilineMax);
|
||||
ecoff_put_off (abfd, intern->cbLine, (bfd_byte *)ext->h_cbLine);
|
||||
ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->h_cbLineOffset);
|
||||
bfd_h_put_32 (abfd, intern->idnMax, (bfd_byte *)ext->h_idnMax);
|
||||
ecoff_put_off (abfd, intern->cbDnOffset, (bfd_byte *)ext->h_cbDnOffset);
|
||||
bfd_h_put_32 (abfd, intern->ipdMax, (bfd_byte *)ext->h_ipdMax);
|
||||
ecoff_put_off (abfd, intern->cbPdOffset, (bfd_byte *)ext->h_cbPdOffset);
|
||||
bfd_h_put_32 (abfd, intern->isymMax, (bfd_byte *)ext->h_isymMax);
|
||||
ecoff_put_off (abfd, intern->cbSymOffset, (bfd_byte *)ext->h_cbSymOffset);
|
||||
bfd_h_put_32 (abfd, intern->ioptMax, (bfd_byte *)ext->h_ioptMax);
|
||||
ecoff_put_off (abfd, intern->cbOptOffset, (bfd_byte *)ext->h_cbOptOffset);
|
||||
bfd_h_put_32 (abfd, intern->iauxMax, (bfd_byte *)ext->h_iauxMax);
|
||||
ecoff_put_off (abfd, intern->cbAuxOffset, (bfd_byte *)ext->h_cbAuxOffset);
|
||||
bfd_h_put_32 (abfd, intern->issMax, (bfd_byte *)ext->h_issMax);
|
||||
ecoff_put_off (abfd, intern->cbSsOffset, (bfd_byte *)ext->h_cbSsOffset);
|
||||
bfd_h_put_32 (abfd, intern->issExtMax, (bfd_byte *)ext->h_issExtMax);
|
||||
ecoff_put_off (abfd, intern->cbSsExtOffset, (bfd_byte *)ext->h_cbSsExtOffset);
|
||||
bfd_h_put_32 (abfd, intern->ifdMax, (bfd_byte *)ext->h_ifdMax);
|
||||
ecoff_put_off (abfd, intern->cbFdOffset, (bfd_byte *)ext->h_cbFdOffset);
|
||||
bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->h_crfd);
|
||||
ecoff_put_off (abfd, intern->cbRfdOffset, (bfd_byte *)ext->h_cbRfdOffset);
|
||||
bfd_h_put_32 (abfd, intern->iextMax, (bfd_byte *)ext->h_iextMax);
|
||||
ecoff_put_off (abfd, intern->cbExtOffset, (bfd_byte *)ext->h_cbExtOffset);
|
||||
H_PUT_S16 (abfd, intern->magic, ext->h_magic);
|
||||
H_PUT_S16 (abfd, intern->vstamp, ext->h_vstamp);
|
||||
H_PUT_32 (abfd, intern->ilineMax, ext->h_ilineMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLine, ext->h_cbLine);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->h_cbLineOffset);
|
||||
H_PUT_32 (abfd, intern->idnMax, ext->h_idnMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbDnOffset, ext->h_cbDnOffset);
|
||||
H_PUT_32 (abfd, intern->ipdMax, ext->h_ipdMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbPdOffset, ext->h_cbPdOffset);
|
||||
H_PUT_32 (abfd, intern->isymMax, ext->h_isymMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbSymOffset, ext->h_cbSymOffset);
|
||||
H_PUT_32 (abfd, intern->ioptMax, ext->h_ioptMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbOptOffset, ext->h_cbOptOffset);
|
||||
H_PUT_32 (abfd, intern->iauxMax, ext->h_iauxMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbAuxOffset, ext->h_cbAuxOffset);
|
||||
H_PUT_32 (abfd, intern->issMax, ext->h_issMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbSsOffset, ext->h_cbSsOffset);
|
||||
H_PUT_32 (abfd, intern->issExtMax, ext->h_issExtMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbSsExtOffset, ext->h_cbSsExtOffset);
|
||||
H_PUT_32 (abfd, intern->ifdMax, ext->h_ifdMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbFdOffset, ext->h_cbFdOffset);
|
||||
H_PUT_32 (abfd, intern->crfd, ext->h_crfd);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbRfdOffset, ext->h_cbRfdOffset);
|
||||
H_PUT_32 (abfd, intern->iextMax, ext->h_iextMax);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbExtOffset, ext->h_cbExtOffset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
if (memcmp ((char *) ext, (char *) intern, sizeof (*intern)) != 0)
|
||||
abort ();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -193,55 +193,58 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern)
|
|||
|
||||
*ext = *(struct fdr_ext *) ext_copy;
|
||||
|
||||
intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->f_adr);
|
||||
intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss);
|
||||
intern->adr = ECOFF_GET_OFF (abfd, ext->f_adr);
|
||||
intern->rss = H_GET_32 (abfd, ext->f_rss);
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
if (intern->rss == (signed long) 0xffffffff)
|
||||
intern->rss = -1;
|
||||
#endif
|
||||
intern->issBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_issBase);
|
||||
intern->cbSs = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbSs);
|
||||
intern->isymBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_isymBase);
|
||||
intern->csym = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_csym);
|
||||
intern->ilineBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ilineBase);
|
||||
intern->cline = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cline);
|
||||
intern->ioptBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ioptBase);
|
||||
intern->copt = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_copt);
|
||||
intern->issBase = H_GET_32 (abfd, ext->f_issBase);
|
||||
intern->cbSs = ECOFF_GET_OFF (abfd, ext->f_cbSs);
|
||||
intern->isymBase = H_GET_32 (abfd, ext->f_isymBase);
|
||||
intern->csym = H_GET_32 (abfd, ext->f_csym);
|
||||
intern->ilineBase = H_GET_32 (abfd, ext->f_ilineBase);
|
||||
intern->cline = H_GET_32 (abfd, ext->f_cline);
|
||||
intern->ioptBase = H_GET_32 (abfd, ext->f_ioptBase);
|
||||
intern->copt = H_GET_32 (abfd, ext->f_copt);
|
||||
#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32)
|
||||
intern->ipdFirst = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_ipdFirst);
|
||||
intern->cpd = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_cpd);
|
||||
intern->ipdFirst = H_GET_16 (abfd, ext->f_ipdFirst);
|
||||
intern->cpd = H_GET_16 (abfd, ext->f_cpd);
|
||||
#endif
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
intern->ipdFirst = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ipdFirst);
|
||||
intern->cpd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cpd);
|
||||
intern->ipdFirst = H_GET_32 (abfd, ext->f_ipdFirst);
|
||||
intern->cpd = H_GET_32 (abfd, ext->f_cpd);
|
||||
#endif
|
||||
intern->iauxBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_iauxBase);
|
||||
intern->caux = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_caux);
|
||||
intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase);
|
||||
intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd);
|
||||
intern->iauxBase = H_GET_32 (abfd, ext->f_iauxBase);
|
||||
intern->caux = H_GET_32 (abfd, ext->f_caux);
|
||||
intern->rfdBase = H_GET_32 (abfd, ext->f_rfdBase);
|
||||
intern->crfd = H_GET_32 (abfd, ext->f_crfd);
|
||||
|
||||
/* now the fun stuff... */
|
||||
if (bfd_header_big_endian (abfd)) {
|
||||
intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG)
|
||||
>> FDR_BITS1_LANG_SH_BIG;
|
||||
intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_BIG);
|
||||
intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_BIG);
|
||||
intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_BIG);
|
||||
intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_BIG)
|
||||
>> FDR_BITS2_GLEVEL_SH_BIG;
|
||||
} else {
|
||||
intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_LITTLE)
|
||||
>> FDR_BITS1_LANG_SH_LITTLE;
|
||||
intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_LITTLE);
|
||||
intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_LITTLE);
|
||||
intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_LITTLE);
|
||||
intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_LITTLE)
|
||||
>> FDR_BITS2_GLEVEL_SH_LITTLE;
|
||||
}
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
intern->lang = ((ext->f_bits1[0] & FDR_BITS1_LANG_BIG)
|
||||
>> FDR_BITS1_LANG_SH_BIG);
|
||||
intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_BIG);
|
||||
intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_BIG);
|
||||
intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_BIG);
|
||||
intern->glevel = ((ext->f_bits2[0] & FDR_BITS2_GLEVEL_BIG)
|
||||
>> FDR_BITS2_GLEVEL_SH_BIG);
|
||||
}
|
||||
else
|
||||
{
|
||||
intern->lang = ((ext->f_bits1[0] & FDR_BITS1_LANG_LITTLE)
|
||||
>> FDR_BITS1_LANG_SH_LITTLE);
|
||||
intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_LITTLE);
|
||||
intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_LITTLE);
|
||||
intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_LITTLE);
|
||||
intern->glevel = ((ext->f_bits2[0] & FDR_BITS2_GLEVEL_LITTLE)
|
||||
>> FDR_BITS2_GLEVEL_SH_LITTLE);
|
||||
}
|
||||
intern->reserved = 0;
|
||||
|
||||
intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbLineOffset);
|
||||
intern->cbLine = ecoff_get_off (abfd, (bfd_byte *)ext->f_cbLine);
|
||||
intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->f_cbLineOffset);
|
||||
intern->cbLine = ECOFF_GET_OFF (abfd, ext->f_cbLine);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -262,54 +265,57 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||
|
||||
ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->f_adr);
|
||||
bfd_h_put_32 (abfd, intern->rss, (bfd_byte *)ext->f_rss);
|
||||
bfd_h_put_32 (abfd, intern->issBase, (bfd_byte *)ext->f_issBase);
|
||||
ecoff_put_off (abfd, intern->cbSs, (bfd_byte *)ext->f_cbSs);
|
||||
bfd_h_put_32 (abfd, intern->isymBase, (bfd_byte *)ext->f_isymBase);
|
||||
bfd_h_put_32 (abfd, intern->csym, (bfd_byte *)ext->f_csym);
|
||||
bfd_h_put_32 (abfd, intern->ilineBase, (bfd_byte *)ext->f_ilineBase);
|
||||
bfd_h_put_32 (abfd, intern->cline, (bfd_byte *)ext->f_cline);
|
||||
bfd_h_put_32 (abfd, intern->ioptBase, (bfd_byte *)ext->f_ioptBase);
|
||||
bfd_h_put_32 (abfd, intern->copt, (bfd_byte *)ext->f_copt);
|
||||
ECOFF_PUT_OFF (abfd, intern->adr, ext->f_adr);
|
||||
H_PUT_32 (abfd, intern->rss, ext->f_rss);
|
||||
H_PUT_32 (abfd, intern->issBase, ext->f_issBase);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbSs, ext->f_cbSs);
|
||||
H_PUT_32 (abfd, intern->isymBase, ext->f_isymBase);
|
||||
H_PUT_32 (abfd, intern->csym, ext->f_csym);
|
||||
H_PUT_32 (abfd, intern->ilineBase, ext->f_ilineBase);
|
||||
H_PUT_32 (abfd, intern->cline, ext->f_cline);
|
||||
H_PUT_32 (abfd, intern->ioptBase, ext->f_ioptBase);
|
||||
H_PUT_32 (abfd, intern->copt, ext->f_copt);
|
||||
#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32)
|
||||
bfd_h_put_16 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst);
|
||||
bfd_h_put_16 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd);
|
||||
H_PUT_16 (abfd, intern->ipdFirst, ext->f_ipdFirst);
|
||||
H_PUT_16 (abfd, intern->cpd, ext->f_cpd);
|
||||
#endif
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
bfd_h_put_32 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst);
|
||||
bfd_h_put_32 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd);
|
||||
H_PUT_32 (abfd, intern->ipdFirst, ext->f_ipdFirst);
|
||||
H_PUT_32 (abfd, intern->cpd, ext->f_cpd);
|
||||
#endif
|
||||
bfd_h_put_32 (abfd, intern->iauxBase, (bfd_byte *)ext->f_iauxBase);
|
||||
bfd_h_put_32 (abfd, intern->caux, (bfd_byte *)ext->f_caux);
|
||||
bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase);
|
||||
bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd);
|
||||
H_PUT_32 (abfd, intern->iauxBase, ext->f_iauxBase);
|
||||
H_PUT_32 (abfd, intern->caux, ext->f_caux);
|
||||
H_PUT_32 (abfd, intern->rfdBase, ext->f_rfdBase);
|
||||
H_PUT_32 (abfd, intern->crfd, ext->f_crfd);
|
||||
|
||||
/* now the fun stuff... */
|
||||
if (bfd_header_big_endian (abfd)) {
|
||||
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG)
|
||||
& FDR_BITS1_LANG_BIG)
|
||||
| (intern->fMerge ? FDR_BITS1_FMERGE_BIG : 0)
|
||||
| (intern->fReadin ? FDR_BITS1_FREADIN_BIG : 0)
|
||||
| (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_BIG : 0));
|
||||
ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_BIG)
|
||||
& FDR_BITS2_GLEVEL_BIG);
|
||||
ext->f_bits2[1] = 0;
|
||||
ext->f_bits2[2] = 0;
|
||||
} else {
|
||||
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_LITTLE)
|
||||
& FDR_BITS1_LANG_LITTLE)
|
||||
| (intern->fMerge ? FDR_BITS1_FMERGE_LITTLE : 0)
|
||||
| (intern->fReadin ? FDR_BITS1_FREADIN_LITTLE : 0)
|
||||
| (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_LITTLE : 0));
|
||||
ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_LITTLE)
|
||||
& FDR_BITS2_GLEVEL_LITTLE);
|
||||
ext->f_bits2[1] = 0;
|
||||
ext->f_bits2[2] = 0;
|
||||
}
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG)
|
||||
& FDR_BITS1_LANG_BIG)
|
||||
| (intern->fMerge ? FDR_BITS1_FMERGE_BIG : 0)
|
||||
| (intern->fReadin ? FDR_BITS1_FREADIN_BIG : 0)
|
||||
| (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_BIG : 0));
|
||||
ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_BIG)
|
||||
& FDR_BITS2_GLEVEL_BIG);
|
||||
ext->f_bits2[1] = 0;
|
||||
ext->f_bits2[2] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_LITTLE)
|
||||
& FDR_BITS1_LANG_LITTLE)
|
||||
| (intern->fMerge ? FDR_BITS1_FMERGE_LITTLE : 0)
|
||||
| (intern->fReadin ? FDR_BITS1_FREADIN_LITTLE : 0)
|
||||
| (intern->fBigendian ? FDR_BITS1_FBIGENDIAN_LITTLE : 0));
|
||||
ext->f_bits2[0] = ((intern->glevel << FDR_BITS2_GLEVEL_SH_LITTLE)
|
||||
& FDR_BITS2_GLEVEL_LITTLE);
|
||||
ext->f_bits2[1] = 0;
|
||||
ext->f_bits2[2] = 0;
|
||||
}
|
||||
|
||||
ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->f_cbLineOffset);
|
||||
ecoff_put_off (abfd, intern->cbLine, (bfd_byte *)ext->f_cbLine);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->f_cbLineOffset);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLine, ext->f_cbLine);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -333,26 +339,23 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
|||
|
||||
memset ((PTR) intern, 0, sizeof (*intern));
|
||||
|
||||
intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr);
|
||||
intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym);
|
||||
intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline);
|
||||
intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask);
|
||||
intern->regoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_regoffset);
|
||||
intern->iopt = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->p_iopt);
|
||||
intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask);
|
||||
intern->fregoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_fregoffset);
|
||||
intern->frameoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_frameoffset);
|
||||
intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg);
|
||||
intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg);
|
||||
intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow);
|
||||
intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh);
|
||||
intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset);
|
||||
intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr);
|
||||
intern->isym = H_GET_32 (abfd, ext->p_isym);
|
||||
intern->iline = H_GET_32 (abfd, ext->p_iline);
|
||||
intern->regmask = H_GET_32 (abfd, ext->p_regmask);
|
||||
intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset);
|
||||
intern->iopt = H_GET_S32 (abfd, ext->p_iopt);
|
||||
intern->fregmask = H_GET_32 (abfd, ext->p_fregmask);
|
||||
intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset);
|
||||
intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset);
|
||||
intern->framereg = H_GET_16 (abfd, ext->p_framereg);
|
||||
intern->pcreg = H_GET_16 (abfd, ext->p_pcreg);
|
||||
intern->lnLow = H_GET_32 (abfd, ext->p_lnLow);
|
||||
intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh);
|
||||
intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset);
|
||||
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
intern->gp_prologue = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_gp_prologue);
|
||||
intern->gp_prologue = H_GET_8 (abfd, ext->p_gp_prologue);
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
intern->gp_used = 0 != (ext->p_bits1[0] & PDR_BITS1_GP_USED_BIG);
|
||||
|
|
@ -373,7 +376,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
|||
| ((ext->p_bits2[0] & PDR_BITS2_RESERVED_LITTLE)
|
||||
<< PDR_BITS2_RESERVED_SH_LEFT_LITTLE));
|
||||
}
|
||||
intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff);
|
||||
intern->localoff = H_GET_8 (abfd, ext->p_localoff);
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
|
|
@ -395,23 +398,24 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||
|
||||
ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr);
|
||||
bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym);
|
||||
bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline);
|
||||
bfd_h_put_32 (abfd, intern->regmask, (bfd_byte *)ext->p_regmask);
|
||||
bfd_h_put_32 (abfd, intern->regoffset, (bfd_byte *)ext->p_regoffset);
|
||||
bfd_h_put_32 (abfd, intern->iopt, (bfd_byte *)ext->p_iopt);
|
||||
bfd_h_put_32 (abfd, intern->fregmask, (bfd_byte *)ext->p_fregmask);
|
||||
bfd_h_put_32 (abfd, intern->fregoffset, (bfd_byte *)ext->p_fregoffset);
|
||||
bfd_h_put_32 (abfd, intern->frameoffset, (bfd_byte *)ext->p_frameoffset);
|
||||
bfd_h_put_16 (abfd, intern->framereg, (bfd_byte *)ext->p_framereg);
|
||||
bfd_h_put_16 (abfd, intern->pcreg, (bfd_byte *)ext->p_pcreg);
|
||||
bfd_h_put_32 (abfd, intern->lnLow, (bfd_byte *)ext->p_lnLow);
|
||||
bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh);
|
||||
ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset);
|
||||
ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr);
|
||||
H_PUT_32 (abfd, intern->isym, ext->p_isym);
|
||||
H_PUT_32 (abfd, intern->iline, ext->p_iline);
|
||||
H_PUT_32 (abfd, intern->regmask, ext->p_regmask);
|
||||
H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset);
|
||||
H_PUT_32 (abfd, intern->iopt, ext->p_iopt);
|
||||
H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask);
|
||||
H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset);
|
||||
H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset);
|
||||
H_PUT_16 (abfd, intern->framereg, ext->p_framereg);
|
||||
H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg);
|
||||
H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow);
|
||||
H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset);
|
||||
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
bfd_h_put_8 (abfd, intern->gp_prologue, (bfd_byte *) ext->p_gp_prologue);
|
||||
H_PUT_8 (abfd, intern->gp_prologue, ext->p_gp_prologue);
|
||||
|
||||
if (bfd_header_big_endian (abfd))
|
||||
{
|
||||
ext->p_bits1[0] = ((intern->gp_used ? PDR_BITS1_GP_USED_BIG : 0)
|
||||
|
|
@ -434,7 +438,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
|
|||
PDR_BITS2_RESERVED_SH_LEFT_LITTLE)
|
||||
& PDR_BITS2_RESERVED_LITTLE);
|
||||
}
|
||||
bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff);
|
||||
H_PUT_8 (abfd, intern->localoff, ext->p_localoff);
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
|
|
@ -458,23 +462,20 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
|||
|
||||
*ext = *(struct pdr_ext *) ext_copy;
|
||||
|
||||
intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr);
|
||||
intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym);
|
||||
intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline);
|
||||
intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask);
|
||||
intern->regoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_regoffset);
|
||||
intern->iopt = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->p_iopt);
|
||||
intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask);
|
||||
intern->fregoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_fregoffset);
|
||||
intern->frameoffset = bfd_h_get_signed_32 (abfd,
|
||||
(bfd_byte *)ext->p_frameoffset);
|
||||
intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg);
|
||||
intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg);
|
||||
intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow);
|
||||
intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh);
|
||||
intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset);
|
||||
intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr);
|
||||
intern->isym = H_GET_32 (abfd, ext->p_isym);
|
||||
intern->iline = H_GET_32 (abfd, ext->p_iline);
|
||||
intern->regmask = H_GET_32 (abfd, ext->p_regmask);
|
||||
intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset);
|
||||
intern->iopt = H_GET_S32 (abfd, ext->p_iopt);
|
||||
intern->fregmask = H_GET_32 (abfd, ext->p_fregmask);
|
||||
intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset);
|
||||
intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset);
|
||||
intern->framereg = H_GET_16 (abfd, ext->p_framereg);
|
||||
intern->pcreg = H_GET_16 (abfd, ext->p_pcreg);
|
||||
intern->lnLow = H_GET_32 (abfd, ext->p_lnLow);
|
||||
intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh);
|
||||
intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -495,20 +496,20 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||
|
||||
ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr);
|
||||
bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym);
|
||||
bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline);
|
||||
bfd_h_put_32 (abfd, intern->regmask, (bfd_byte *)ext->p_regmask);
|
||||
bfd_h_put_32 (abfd, intern->regoffset, (bfd_byte *)ext->p_regoffset);
|
||||
bfd_h_put_32 (abfd, intern->iopt, (bfd_byte *)ext->p_iopt);
|
||||
bfd_h_put_32 (abfd, intern->fregmask, (bfd_byte *)ext->p_fregmask);
|
||||
bfd_h_put_32 (abfd, intern->fregoffset, (bfd_byte *)ext->p_fregoffset);
|
||||
bfd_h_put_32 (abfd, intern->frameoffset, (bfd_byte *)ext->p_frameoffset);
|
||||
bfd_h_put_16 (abfd, intern->framereg, (bfd_byte *)ext->p_framereg);
|
||||
bfd_h_put_16 (abfd, intern->pcreg, (bfd_byte *)ext->p_pcreg);
|
||||
bfd_h_put_32 (abfd, intern->lnLow, (bfd_byte *)ext->p_lnLow);
|
||||
bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh);
|
||||
ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset);
|
||||
ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr);
|
||||
H_PUT_32 (abfd, intern->isym, ext->p_isym);
|
||||
H_PUT_32 (abfd, intern->iline, ext->p_iline);
|
||||
H_PUT_32 (abfd, intern->regmask, ext->p_regmask);
|
||||
H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset);
|
||||
H_PUT_32 (abfd, intern->iopt, ext->p_iopt);
|
||||
H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask);
|
||||
H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset);
|
||||
H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset);
|
||||
H_PUT_16 (abfd, intern->framereg, ext->p_framereg);
|
||||
H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg);
|
||||
H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow);
|
||||
H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh);
|
||||
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -529,8 +530,8 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
|
|||
|
||||
*ext = *(struct sym_ext *) ext_copy;
|
||||
|
||||
intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss);
|
||||
intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value);
|
||||
intern->iss = H_GET_32 (abfd, ext->s_iss);
|
||||
intern->value = ECOFF_GET_OFF (abfd, ext->s_value);
|
||||
|
||||
/* now the fun stuff... */
|
||||
if (bfd_header_big_endian (abfd)) {
|
||||
|
|
@ -579,8 +580,8 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||
|
||||
bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss);
|
||||
ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value);
|
||||
H_PUT_32 (abfd, intern->iss, ext->s_iss);
|
||||
ECOFF_PUT_OFF (abfd, intern->value, ext->s_value);
|
||||
|
||||
/* now the fun stuff... */
|
||||
if (bfd_header_big_endian (abfd)) {
|
||||
|
|
@ -640,10 +641,10 @@ ecoff_swap_ext_in (abfd, ext_copy, intern)
|
|||
intern->reserved = 0;
|
||||
|
||||
#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32)
|
||||
intern->ifd = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->es_ifd);
|
||||
intern->ifd = H_GET_S16 (abfd, ext->es_ifd);
|
||||
#endif
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
intern->ifd = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->es_ifd);
|
||||
intern->ifd = H_GET_S32 (abfd, ext->es_ifd);
|
||||
#endif
|
||||
|
||||
ecoff_swap_sym_in (abfd, &ext->es_asym, &intern->asym);
|
||||
|
|
@ -689,10 +690,10 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr)
|
|||
}
|
||||
|
||||
#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32)
|
||||
bfd_h_put_signed_16 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd);
|
||||
H_PUT_S16 (abfd, intern->ifd, ext->es_ifd);
|
||||
#endif
|
||||
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
|
||||
bfd_h_put_signed_32 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd);
|
||||
H_PUT_S32 (abfd, intern->ifd, ext->es_ifd);
|
||||
#endif
|
||||
|
||||
ecoff_swap_sym_out (abfd, &intern->asym, &ext->es_asym);
|
||||
|
|
@ -713,7 +714,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern)
|
|||
{
|
||||
struct rfd_ext *ext = (struct rfd_ext *) ext_ptr;
|
||||
|
||||
*intern = bfd_h_get_32 (abfd, (bfd_byte *)ext->rfd);
|
||||
*intern = H_GET_32 (abfd, ext->rfd);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -731,7 +732,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr)
|
|||
{
|
||||
struct rfd_ext *ext = (struct rfd_ext *) ext_ptr;
|
||||
|
||||
bfd_h_put_32 (abfd, *intern, (bfd_byte *)ext->rfd);
|
||||
H_PUT_32 (abfd, *intern, ext->rfd);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -772,7 +773,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern)
|
|||
_bfd_ecoff_swap_rndx_in (bfd_header_big_endian (abfd),
|
||||
&ext->o_rndx, &intern->rndx);
|
||||
|
||||
intern->offset = bfd_h_get_32 (abfd, (bfd_byte *) ext->o_offset);
|
||||
intern->offset = H_GET_32 (abfd, ext->o_offset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -811,7 +812,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr)
|
|||
_bfd_ecoff_swap_rndx_out (bfd_header_big_endian (abfd),
|
||||
&intern->rndx, &ext->o_rndx);
|
||||
|
||||
bfd_h_put_32 (abfd, intern->value, (bfd_byte *) ext->o_offset);
|
||||
H_PUT_32 (abfd, intern->value, ext->o_offset);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -831,8 +832,8 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern)
|
|||
|
||||
*ext = *(struct dnr_ext *) ext_copy;
|
||||
|
||||
intern->rfd = bfd_h_get_32 (abfd, (bfd_byte *) ext->d_rfd);
|
||||
intern->index = bfd_h_get_32 (abfd, (bfd_byte *) ext->d_index);
|
||||
intern->rfd = H_GET_32 (abfd, ext->d_rfd);
|
||||
intern->index = H_GET_32 (abfd, ext->d_index);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
@ -853,8 +854,8 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr)
|
|||
|
||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||
|
||||
bfd_h_put_32 (abfd, intern->rfd, (bfd_byte *) ext->d_rfd);
|
||||
bfd_h_put_32 (abfd, intern->index, (bfd_byte *) ext->d_index);
|
||||
H_PUT_32 (abfd, intern->rfd, ext->d_rfd);
|
||||
H_PUT_32 (abfd, intern->index, ext->d_index);
|
||||
|
||||
#ifdef TEST
|
||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
1212
contrib/binutils/bfd/elf-eh-frame.c
Normal file
1212
contrib/binutils/bfd/elf-eh-frame.c
Normal file
File diff suppressed because it is too large
Load diff
449
contrib/binutils/bfd/elf-strtab.c
Normal file
449
contrib/binutils/bfd/elf-strtab.c
Normal file
|
|
@ -0,0 +1,449 @@
|
|||
/* ELF strtab with GC and suffix merging support.
|
||||
Copyright 2001 Free Software Foundation, Inc.
|
||||
Written by Jakub Jelinek <jakub@redhat.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "hashtab.h"
|
||||
|
||||
/* An entry in the strtab hash table. */
|
||||
|
||||
struct elf_strtab_hash_entry
|
||||
{
|
||||
struct bfd_hash_entry root;
|
||||
/* Length of this entry. */
|
||||
unsigned int len;
|
||||
unsigned int refcount;
|
||||
union {
|
||||
/* Index within the merged section. */
|
||||
bfd_size_type index;
|
||||
/* Entry this is a suffix of (if len is 0). */
|
||||
struct elf_strtab_hash_entry *suffix;
|
||||
struct elf_strtab_hash_entry *next;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* The strtab hash table. */
|
||||
|
||||
struct elf_strtab_hash
|
||||
{
|
||||
struct bfd_hash_table table;
|
||||
/* Next available index. */
|
||||
bfd_size_type size;
|
||||
/* Number of array entries alloced. */
|
||||
bfd_size_type alloced;
|
||||
/* Final strtab size. */
|
||||
bfd_size_type sec_size;
|
||||
/* Array of pointers to strtab entries. */
|
||||
struct elf_strtab_hash_entry **array;
|
||||
};
|
||||
|
||||
static struct bfd_hash_entry *elf_strtab_hash_newfunc
|
||||
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
|
||||
static int cmplengthentry PARAMS ((const PTR, const PTR));
|
||||
static int last4_eq PARAMS ((const PTR, const PTR));
|
||||
|
||||
/* Routine to create an entry in a section merge hashtab. */
|
||||
|
||||
static struct bfd_hash_entry *
|
||||
elf_strtab_hash_newfunc (entry, table, string)
|
||||
struct bfd_hash_entry *entry;
|
||||
struct bfd_hash_table *table;
|
||||
const char *string;
|
||||
{
|
||||
struct elf_strtab_hash_entry *ret = (struct elf_strtab_hash_entry *) entry;
|
||||
|
||||
/* Allocate the structure if it has not already been allocated by a
|
||||
subclass. */
|
||||
if (ret == (struct elf_strtab_hash_entry *) NULL)
|
||||
ret = ((struct elf_strtab_hash_entry *)
|
||||
bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry)));
|
||||
if (ret == (struct elf_strtab_hash_entry *) NULL)
|
||||
return NULL;
|
||||
|
||||
/* Call the allocation method of the superclass. */
|
||||
ret = ((struct elf_strtab_hash_entry *)
|
||||
bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
|
||||
|
||||
if (ret)
|
||||
{
|
||||
/* Initialize the local fields. */
|
||||
ret->u.index = -1;
|
||||
ret->refcount = 0;
|
||||
ret->len = 0;
|
||||
}
|
||||
|
||||
return (struct bfd_hash_entry *)ret;
|
||||
}
|
||||
|
||||
/* Create a new hash table. */
|
||||
|
||||
struct elf_strtab_hash *
|
||||
_bfd_elf_strtab_init ()
|
||||
{
|
||||
struct elf_strtab_hash *table;
|
||||
bfd_size_type amt = sizeof (struct elf_strtab_hash);
|
||||
|
||||
table = (struct elf_strtab_hash *) bfd_malloc (amt);
|
||||
if (table == NULL)
|
||||
return NULL;
|
||||
|
||||
if (! bfd_hash_table_init (&table->table, elf_strtab_hash_newfunc))
|
||||
{
|
||||
free (table);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
table->sec_size = 0;
|
||||
table->size = 1;
|
||||
table->alloced = 64;
|
||||
amt = sizeof (struct elf_strtab_hasn_entry *);
|
||||
table->array = (struct elf_strtab_hash_entry **)
|
||||
bfd_malloc (table->alloced * amt);
|
||||
if (table->array == NULL)
|
||||
{
|
||||
free (table);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
table->array[0] = NULL;
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/* Free a strtab. */
|
||||
|
||||
void
|
||||
_bfd_elf_strtab_free (tab)
|
||||
struct elf_strtab_hash *tab;
|
||||
{
|
||||
bfd_hash_table_free (&tab->table);
|
||||
free (tab->array);
|
||||
free (tab);
|
||||
}
|
||||
|
||||
/* Get the index of an entity in a hash table, adding it if it is not
|
||||
already present. */
|
||||
|
||||
bfd_size_type
|
||||
_bfd_elf_strtab_add (tab, str, copy)
|
||||
struct elf_strtab_hash *tab;
|
||||
const char *str;
|
||||
boolean copy;
|
||||
{
|
||||
register struct elf_strtab_hash_entry *entry;
|
||||
|
||||
/* We handle this specially, since we don't want to do refcounting
|
||||
on it. */
|
||||
if (*str == '\0')
|
||||
return 0;
|
||||
|
||||
BFD_ASSERT (tab->sec_size == 0);
|
||||
entry = (struct elf_strtab_hash_entry *)
|
||||
bfd_hash_lookup (&tab->table, str, true, copy);
|
||||
|
||||
if (entry == NULL)
|
||||
return (bfd_size_type) -1;
|
||||
|
||||
entry->refcount++;
|
||||
if (entry->len == 0)
|
||||
{
|
||||
entry->len = strlen (str) + 1;
|
||||
if (tab->size == tab->alloced)
|
||||
{
|
||||
bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *);
|
||||
tab->alloced *= 2;
|
||||
tab->array = (struct elf_strtab_hash_entry **)
|
||||
bfd_realloc (tab->array, tab->alloced * amt);
|
||||
if (tab->array == NULL)
|
||||
return (bfd_size_type) -1;
|
||||
}
|
||||
|
||||
entry->u.index = tab->size++;
|
||||
tab->array[entry->u.index] = entry;
|
||||
}
|
||||
return entry->u.index;
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_elf_strtab_addref (tab, idx)
|
||||
struct elf_strtab_hash *tab;
|
||||
bfd_size_type idx;
|
||||
{
|
||||
if (idx == 0 || idx == (bfd_size_type) -1)
|
||||
return;
|
||||
BFD_ASSERT (tab->sec_size == 0);
|
||||
BFD_ASSERT (idx < tab->size);
|
||||
++tab->array[idx]->refcount;
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_elf_strtab_delref (tab, idx)
|
||||
struct elf_strtab_hash *tab;
|
||||
bfd_size_type idx;
|
||||
{
|
||||
if (idx == 0 || idx == (bfd_size_type) -1)
|
||||
return;
|
||||
BFD_ASSERT (tab->sec_size == 0);
|
||||
BFD_ASSERT (idx < tab->size);
|
||||
BFD_ASSERT (tab->array[idx]->refcount > 0);
|
||||
--tab->array[idx]->refcount;
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_elf_strtab_clear_all_refs (tab)
|
||||
struct elf_strtab_hash *tab;
|
||||
{
|
||||
bfd_size_type idx;
|
||||
|
||||
for (idx = 1; idx < tab->size; ++idx)
|
||||
tab->array[idx]->refcount = 0;
|
||||
}
|
||||
|
||||
bfd_size_type
|
||||
_bfd_elf_strtab_size (tab)
|
||||
struct elf_strtab_hash *tab;
|
||||
{
|
||||
return tab->sec_size ? tab->sec_size : tab->size;
|
||||
}
|
||||
|
||||
bfd_size_type
|
||||
_bfd_elf_strtab_offset (tab, idx)
|
||||
struct elf_strtab_hash *tab;
|
||||
bfd_size_type idx;
|
||||
{
|
||||
struct elf_strtab_hash_entry *entry;
|
||||
|
||||
if (idx == 0)
|
||||
return 0;
|
||||
BFD_ASSERT (idx < tab->size);
|
||||
BFD_ASSERT (tab->sec_size);
|
||||
entry = tab->array[idx];
|
||||
BFD_ASSERT (entry->refcount > 0);
|
||||
entry->refcount--;
|
||||
return tab->array[idx]->u.index;
|
||||
}
|
||||
|
||||
boolean
|
||||
_bfd_elf_strtab_emit (abfd, tab)
|
||||
register bfd *abfd;
|
||||
struct elf_strtab_hash *tab;
|
||||
{
|
||||
bfd_size_type off = 1, i;
|
||||
|
||||
if (bfd_bwrite ("", 1, abfd) != 1)
|
||||
return false;
|
||||
|
||||
for (i = 1; i < tab->size; ++i)
|
||||
{
|
||||
register const char *str;
|
||||
register size_t len;
|
||||
|
||||
str = tab->array[i]->root.string;
|
||||
len = tab->array[i]->len;
|
||||
BFD_ASSERT (tab->array[i]->refcount == 0);
|
||||
if (len == 0)
|
||||
continue;
|
||||
|
||||
if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len)
|
||||
return false;
|
||||
|
||||
off += len;
|
||||
}
|
||||
|
||||
BFD_ASSERT (off == tab->sec_size);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Compare two elf_strtab_hash_entry structures. This is called via qsort. */
|
||||
|
||||
static int
|
||||
cmplengthentry (a, b)
|
||||
const PTR a;
|
||||
const PTR b;
|
||||
{
|
||||
struct elf_strtab_hash_entry * A = *(struct elf_strtab_hash_entry **) a;
|
||||
struct elf_strtab_hash_entry * B = *(struct elf_strtab_hash_entry **) b;
|
||||
|
||||
if (A->len < B->len)
|
||||
return 1;
|
||||
else if (A->len > B->len)
|
||||
return -1;
|
||||
|
||||
return memcmp (A->root.string, B->root.string, A->len);
|
||||
}
|
||||
|
||||
static int
|
||||
last4_eq (a, b)
|
||||
const PTR a;
|
||||
const PTR b;
|
||||
{
|
||||
struct elf_strtab_hash_entry * A = (struct elf_strtab_hash_entry *) a;
|
||||
struct elf_strtab_hash_entry * B = (struct elf_strtab_hash_entry *) b;
|
||||
|
||||
if (memcmp (A->root.string + A->len - 5, B->root.string + B->len - 5, 4)
|
||||
!= 0)
|
||||
/* This was a hashtable collision. */
|
||||
return 0;
|
||||
|
||||
if (A->len <= B->len)
|
||||
/* B cannot be a suffix of A unless A is equal to B, which is guaranteed
|
||||
not to be equal by the hash table. */
|
||||
return 0;
|
||||
|
||||
return memcmp (A->root.string + (A->len - B->len),
|
||||
B->root.string, B->len - 5) == 0;
|
||||
}
|
||||
|
||||
/* This function assigns final string table offsets for used strings,
|
||||
merging strings matching suffixes of longer strings if possible. */
|
||||
|
||||
void
|
||||
_bfd_elf_strtab_finalize (tab)
|
||||
struct elf_strtab_hash *tab;
|
||||
{
|
||||
struct elf_strtab_hash_entry **array, **a, **end, *e;
|
||||
htab_t last4tab = NULL;
|
||||
bfd_size_type size, amt;
|
||||
struct elf_strtab_hash_entry *last[256], **last_ptr[256];
|
||||
|
||||
/* GCC 2.91.66 (egcs-1.1.2) on i386 miscompiles this function when i is
|
||||
a 64-bit bfd_size_type: a 64-bit target or --enable-64-bit-bfd.
|
||||
Besides, indexing with a long long wouldn't give anything but extra
|
||||
cycles. */
|
||||
size_t i;
|
||||
|
||||
/* Now sort the strings by length, longest first. */
|
||||
array = NULL;
|
||||
amt = tab->size * sizeof (struct elf_strtab_hash_entry *);
|
||||
array = (struct elf_strtab_hash_entry **) bfd_malloc (amt);
|
||||
if (array == NULL)
|
||||
goto alloc_failure;
|
||||
|
||||
memset (last, 0, sizeof (last));
|
||||
for (i = 0; i < 256; ++i)
|
||||
last_ptr[i] = &last[i];
|
||||
for (i = 1, a = array; i < tab->size; ++i)
|
||||
if (tab->array[i]->refcount)
|
||||
*a++ = tab->array[i];
|
||||
else
|
||||
tab->array[i]->len = 0;
|
||||
|
||||
size = a - array;
|
||||
|
||||
qsort (array, size, sizeof (struct elf_strtab_hash_entry *), cmplengthentry);
|
||||
|
||||
last4tab = htab_create (size * 4, NULL, last4_eq, NULL);
|
||||
if (last4tab == NULL)
|
||||
goto alloc_failure;
|
||||
|
||||
/* Now insert the strings into hash tables (strings with last 4 characters
|
||||
and strings with last character equal), look for longer strings which
|
||||
we're suffix of. */
|
||||
for (a = array, end = array + size; a < end; a++)
|
||||
{
|
||||
register hashval_t hash;
|
||||
unsigned int c;
|
||||
unsigned int j;
|
||||
const unsigned char *s;
|
||||
PTR *p;
|
||||
|
||||
e = *a;
|
||||
if (e->len > 4)
|
||||
{
|
||||
s = e->root.string + e->len - 1;
|
||||
hash = 0;
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
c = *--s;
|
||||
hash += c + (c << 17);
|
||||
hash ^= hash >> 2;
|
||||
}
|
||||
p = htab_find_slot_with_hash (last4tab, e, hash, INSERT);
|
||||
if (p == NULL)
|
||||
goto alloc_failure;
|
||||
if (*p)
|
||||
{
|
||||
struct elf_strtab_hash_entry *ent;
|
||||
|
||||
ent = (struct elf_strtab_hash_entry *) *p;
|
||||
e->u.suffix = ent;
|
||||
e->len = 0;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
*p = (PTR) e;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct elf_strtab_hash_entry *tem;
|
||||
|
||||
c = e->root.string[e->len - 2] & 0xff;
|
||||
|
||||
for (tem = last[c]; tem; tem = tem->u.next)
|
||||
if (tem->len > e->len
|
||||
&& memcmp (tem->root.string + (tem->len - e->len),
|
||||
e->root.string, e->len - 1) == 0)
|
||||
break;
|
||||
if (tem)
|
||||
{
|
||||
e->u.suffix = tem;
|
||||
e->len = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
c = e->root.string[e->len - 2] & 0xff;
|
||||
/* Put longest strings first. */
|
||||
*last_ptr[c] = e;
|
||||
last_ptr[c] = &e->u.next;
|
||||
e->u.next = NULL;
|
||||
}
|
||||
|
||||
alloc_failure:
|
||||
if (array)
|
||||
free (array);
|
||||
if (last4tab)
|
||||
htab_delete (last4tab);
|
||||
|
||||
/* Now assign positions to the strings we want to keep. */
|
||||
size = 1;
|
||||
for (i = 1; i < tab->size; ++i)
|
||||
{
|
||||
e = tab->array[i];
|
||||
if (e->refcount && e->len)
|
||||
{
|
||||
e->u.index = size;
|
||||
size += e->len;
|
||||
}
|
||||
}
|
||||
|
||||
tab->sec_size = size;
|
||||
|
||||
/* And now adjust the rest. */
|
||||
for (i = 1; i < tab->size; ++i)
|
||||
{
|
||||
e = tab->array[i];
|
||||
if (e->refcount && ! e->len)
|
||||
e->u.index = e->u.suffix->u.index
|
||||
+ (e->u.suffix->len - strlen (e->root.string) - 1);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -23,6 +23,7 @@
|
|||
#include "libbfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elf/arc.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
|
||||
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
|
||||
|
|
@ -32,6 +33,8 @@ static boolean arc_elf_object_p
|
|||
PARAMS ((bfd *));
|
||||
static void arc_elf_final_write_processing
|
||||
PARAMS ((bfd *, boolean));
|
||||
static bfd_reloc_status_type arc_elf_b22_pcrel
|
||||
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
||||
|
||||
/* Try to minimize the amount of space occupied by relocation tables
|
||||
on the ROM (not that the ROM won't be swamped by other ELF overhead). */
|
||||
|
|
@ -50,7 +53,7 @@ static reloc_howto_type elf_arc_howto_table[] =
|
|||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARC_NONE", /* name */
|
||||
false, /* partial_inplace */
|
||||
true, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
|
@ -65,7 +68,7 @@ static reloc_howto_type elf_arc_howto_table[] =
|
|||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARC_32", /* name */
|
||||
false, /* partial_inplace */
|
||||
true, /* partial_inplace */
|
||||
0xffffffff, /* src_mask */
|
||||
0xffffffff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
|
@ -80,7 +83,7 @@ static reloc_howto_type elf_arc_howto_table[] =
|
|||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARC_B26", /* name */
|
||||
false, /* partial_inplace */
|
||||
true, /* partial_inplace */
|
||||
0x00ffffff, /* src_mask */
|
||||
0x00ffffff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
|
@ -93,13 +96,12 @@ static reloc_howto_type elf_arc_howto_table[] =
|
|||
true, /* pc_relative */
|
||||
7, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
arc_elf_b22_pcrel, /* special_function */
|
||||
"R_ARC_B22_PCREL", /* name */
|
||||
false, /* partial_inplace */
|
||||
true, /* partial_inplace */
|
||||
0x07ffff80, /* src_mask */
|
||||
0x07ffff80, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
false), /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Map BFD reloc types to ARC ELF reloc types. */
|
||||
|
|
@ -126,11 +128,10 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
|
|||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map); i++)
|
||||
{
|
||||
if (arc_reloc_map[i].bfd_reloc_val == code)
|
||||
return &elf_arc_howto_table[arc_reloc_map[i].elf_reloc_val];
|
||||
}
|
||||
for (i = ARRAY_SIZE (arc_reloc_map); i--;)
|
||||
if (arc_reloc_map[i].bfd_reloc_val == code)
|
||||
return elf_arc_howto_table + arc_reloc_map[i].elf_reloc_val;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +156,7 @@ static boolean
|
|||
arc_elf_object_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
int mach = bfd_mach_arc_6;
|
||||
unsigned int mach = bfd_mach_arc_6;
|
||||
|
||||
if (elf_elfheader(abfd)->e_machine == EM_ARC)
|
||||
{
|
||||
|
|
@ -207,11 +208,34 @@ arc_elf_final_write_processing (abfd, linker)
|
|||
val = E_ARC_MACH_ARC8;
|
||||
break;
|
||||
}
|
||||
elf_elfheader (abfd)->e_machine = EM_ARC;
|
||||
elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH;
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
}
|
||||
|
||||
bfd_reloc_status_type
|
||||
arc_elf_b22_pcrel (abfd, reloc_entry, symbol, data, input_section,
|
||||
output_bfd, error_message)
|
||||
bfd * abfd;
|
||||
arelent * reloc_entry;
|
||||
asymbol * symbol;
|
||||
PTR data;
|
||||
asection * input_section;
|
||||
bfd * output_bfd;
|
||||
char ** error_message;
|
||||
{
|
||||
/* If linking, back up the final symbol address by the address of the
|
||||
reloc. This cannot be accomplished by setting the pcrel_offset
|
||||
field to true, as bfd_install_relocation will detect this and refuse
|
||||
to install the offset in the first place, but bfd_perform_relocation
|
||||
will still insist on removing it. */
|
||||
if (output_bfd == (bfd *) NULL)
|
||||
reloc_entry->addend -= reloc_entry->address;
|
||||
|
||||
/* Fall through to the default elf reloc handler. */
|
||||
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
|
||||
input_section, output_bfd, error_message);
|
||||
}
|
||||
|
||||
#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec
|
||||
#define TARGET_LITTLE_NAME "elf32-littlearc"
|
||||
#define TARGET_BIG_SYM bfd_elf32_bigarc_vec
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
/* Generic support for 32-bit ELF
|
||||
Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
|
@ -40,6 +40,13 @@ static reloc_howto_type dummy =
|
|||
0, /* dst_mask */
|
||||
false); /* pcrel_offset */
|
||||
|
||||
static void elf_generic_info_to_howto
|
||||
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
|
||||
static void elf_generic_info_to_howto_rel
|
||||
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
|
||||
static boolean elf32_generic_link_add_symbols
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
static void
|
||||
elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
|
|
@ -58,7 +65,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
|
|||
bfd_reloc->howto = &dummy;
|
||||
}
|
||||
|
||||
static boolean
|
||||
static boolean
|
||||
elf32_generic_link_add_symbols (abfd, info)
|
||||
bfd *abfd;
|
||||
struct bfd_link_info *info;
|
||||
|
|
@ -72,15 +79,9 @@ elf32_generic_link_add_symbols (abfd, info)
|
|||
Elf_Internal_Ehdr *ehdrp;
|
||||
|
||||
ehdrp = elf_elfheader (abfd);
|
||||
if (abfd->my_archive)
|
||||
(*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"),
|
||||
bfd_get_filename (abfd->my_archive),
|
||||
bfd_get_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
else
|
||||
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
|
||||
bfd_get_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
|
||||
bfd_archive_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -38,10 +38,12 @@ static reloc_howto_type *ppc_elf_reloc_type_lookup
|
|||
static void ppc_elf_info_to_howto
|
||||
PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst));
|
||||
static void ppc_elf_howto_init PARAMS ((void));
|
||||
static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR));
|
||||
static boolean ppc_elf_relax_section
|
||||
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
|
||||
static bfd_reloc_status_type ppc_elf_addr16_ha_reloc
|
||||
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
||||
static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword));
|
||||
static boolean ppc_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
|
||||
static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
|
||||
|
||||
static int ppc_elf_additional_program_headers PARAMS ((bfd *));
|
||||
|
|
@ -105,6 +107,12 @@ static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *,
|
|||
Elf_Internal_Sym *));
|
||||
|
||||
static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
|
||||
static enum elf_reloc_type_class ppc_elf_reloc_type_class
|
||||
PARAMS ((const Elf_Internal_Rela *));
|
||||
static boolean ppc_elf_grok_prstatus
|
||||
PARAMS ((bfd *abfd, Elf_Internal_Note *note));
|
||||
static boolean ppc_elf_grok_psinfo
|
||||
PARAMS ((bfd *abfd, Elf_Internal_Note *note));
|
||||
|
||||
#define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */
|
||||
#define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */
|
||||
|
|
@ -989,8 +997,8 @@ ppc_elf_howto_init ()
|
|||
|
||||
static int
|
||||
ppc_elf_sort_rela (arg1, arg2)
|
||||
const void *arg1;
|
||||
const void *arg2;
|
||||
const PTR arg1;
|
||||
const PTR arg2;
|
||||
{
|
||||
const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1;
|
||||
const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2;
|
||||
|
|
@ -1051,6 +1059,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
|
|||
if (isec->reloc_count)
|
||||
{
|
||||
unsigned n;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Get a copy of the native relocations. */
|
||||
internal_relocs = _bfd_elf32_link_read_relocs (
|
||||
|
|
@ -1062,8 +1071,9 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
|
|||
free_relocs = internal_relocs;
|
||||
|
||||
/* Setup a faster access method for the reloc info we need. */
|
||||
rela_comb = (Elf_Internal_Rela**)
|
||||
bfd_malloc (isec->reloc_count*sizeof (Elf_Internal_Rela*));
|
||||
amt = isec->reloc_count;
|
||||
amt *= sizeof (Elf_Internal_Rela*);
|
||||
rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt);
|
||||
if (rela_comb == NULL)
|
||||
goto error_return;
|
||||
for (n = 0; n < isec->reloc_count; ++n)
|
||||
|
|
@ -1192,7 +1202,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
|
|||
#undef BO4
|
||||
if (modified)
|
||||
{
|
||||
bfd_put_32 (abfd, insn, contents + isec_offset);
|
||||
bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset);
|
||||
section_modified = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1383,24 +1393,6 @@ ppc_elf_set_private_flags (abfd, flags)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Copy backend specific data from one object module to another */
|
||||
static boolean
|
||||
ppc_elf_copy_private_bfd_data (ibfd, obfd)
|
||||
bfd *ibfd;
|
||||
bfd *obfd;
|
||||
{
|
||||
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|
||||
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
||||
return true;
|
||||
|
||||
BFD_ASSERT (!elf_flags_init (obfd)
|
||||
|| elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
|
||||
|
||||
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
|
||||
elf_flags_init (obfd) = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Merge backend specific data from an object file to the output
|
||||
object file when linking */
|
||||
static boolean
|
||||
|
|
@ -1442,7 +1434,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: compiled with -mrelocatable and linked with modules compiled normally"),
|
||||
bfd_get_filename (ibfd));
|
||||
bfd_archive_filename (ibfd));
|
||||
}
|
||||
else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0
|
||||
&& (old_flags & EF_PPC_RELOCATABLE) != 0)
|
||||
|
|
@ -1450,7 +1442,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: compiled normally and linked with modules compiled with -mrelocatable"),
|
||||
bfd_get_filename (ibfd));
|
||||
bfd_archive_filename (ibfd));
|
||||
}
|
||||
|
||||
/* The output is -mrelocatable-lib iff both the input files are. */
|
||||
|
|
@ -1476,7 +1468,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
|
||||
bfd_get_filename (ibfd), (long) new_flags, (long) old_flags);
|
||||
bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags);
|
||||
}
|
||||
|
||||
if (error)
|
||||
|
|
@ -1786,6 +1778,8 @@ ppc_elf_adjust_dynamic_symbol (info, h)
|
|||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
|
||||
/* If this is a weak symbol, and there is a real definition, the
|
||||
processor independent code will have arranged for us to see the
|
||||
|
|
@ -1875,14 +1869,13 @@ ppc_elf_adjust_dynamic_symbol (info, h)
|
|||
|
||||
static boolean
|
||||
ppc_elf_size_dynamic_sections (output_bfd, info)
|
||||
bfd *output_bfd;
|
||||
bfd *output_bfd ATTRIBUTE_UNUSED;
|
||||
struct bfd_link_info *info;
|
||||
{
|
||||
bfd *dynobj;
|
||||
asection *s;
|
||||
boolean plt;
|
||||
boolean relocs;
|
||||
boolean reltext;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "ppc_elf_size_dynamic_sections called\n");
|
||||
|
|
@ -1927,7 +1920,6 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
|
|||
memory for them. */
|
||||
plt = false;
|
||||
relocs = false;
|
||||
reltext = false;
|
||||
for (s = dynobj->sections; s != NULL; s = s->next)
|
||||
{
|
||||
const char *name;
|
||||
|
|
@ -1973,22 +1965,9 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
|
|||
}
|
||||
else
|
||||
{
|
||||
asection *target;
|
||||
const char *outname;
|
||||
|
||||
/* Remember whether there are any relocation sections. */
|
||||
relocs = true;
|
||||
|
||||
/* If this relocation section applies to a read only
|
||||
section, then we probably need a DT_TEXTREL entry. */
|
||||
outname = bfd_get_section_name (output_bfd,
|
||||
s->output_section);
|
||||
target = bfd_get_section_by_name (output_bfd, outname + 5);
|
||||
if (target != NULL
|
||||
&& (target->flags & SEC_READONLY) != 0
|
||||
&& (target->flags & SEC_ALLOC) != 0)
|
||||
reltext = true;
|
||||
|
||||
/* We use the reloc_count field as a counter if we need
|
||||
to copy relocs into the output file. */
|
||||
s->reloc_count = 0;
|
||||
|
|
@ -2021,37 +2000,40 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
|
|||
must add the entries now so that we get the correct size for
|
||||
the .dynamic section. The DT_DEBUG entry is filled in by the
|
||||
dynamic linker and used by the debugger. */
|
||||
if (! info->shared)
|
||||
#define add_dynamic_entry(TAG, VAL) \
|
||||
bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
|
||||
|
||||
if (!info->shared)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
|
||||
if (!add_dynamic_entry (DT_DEBUG, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plt)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
|
||||
if (!add_dynamic_entry (DT_PLTGOT, 0)
|
||||
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
|
||||
|| !add_dynamic_entry (DT_PLTREL, DT_RELA)
|
||||
|| !add_dynamic_entry (DT_JMPREL, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (relocs)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT,
|
||||
sizeof (Elf32_External_Rela)))
|
||||
if (!add_dynamic_entry (DT_RELA, 0)
|
||||
|| !add_dynamic_entry (DT_RELASZ, 0)
|
||||
|| !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela)))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (reltext)
|
||||
if ((info->flags & DF_TEXTREL) != 0)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
|
||||
if (!add_dynamic_entry (DT_TEXTREL, 0))
|
||||
return false;
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
}
|
||||
#undef add_dynamic_entry
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2085,7 +2067,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
#ifdef DEBUG
|
||||
fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n",
|
||||
bfd_get_section_name (abfd, sec),
|
||||
bfd_get_filename (abfd));
|
||||
bfd_archive_filename (abfd));
|
||||
#endif
|
||||
|
||||
/* Create the linker generated sections all the time so that the
|
||||
|
|
@ -2185,7 +2167,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
|
||||
if (h != NULL)
|
||||
{
|
||||
if (h->got.refcount == -1)
|
||||
if (h->got.refcount == 0)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1)
|
||||
|
|
@ -2196,28 +2178,25 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
sgot->_raw_size += 4;
|
||||
/* Allocate relocation space. */
|
||||
srelgot->_raw_size += sizeof (Elf32_External_Rela);
|
||||
|
||||
h->got.refcount = 1;
|
||||
}
|
||||
else
|
||||
h->got.refcount++;
|
||||
h->got.refcount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a global offset table entry for a local symbol. */
|
||||
if (local_got_refcounts == NULL)
|
||||
{
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
|
||||
size = symtab_hdr->sh_info * sizeof (bfd_signed_vma);
|
||||
local_got_refcounts = (bfd_signed_vma *)
|
||||
bfd_alloc (abfd, size);
|
||||
size = symtab_hdr->sh_info;
|
||||
size *= sizeof (bfd_signed_vma);
|
||||
local_got_refcounts
|
||||
= (bfd_signed_vma *) bfd_zalloc (abfd, size);
|
||||
if (local_got_refcounts == NULL)
|
||||
return false;
|
||||
elf_local_got_refcounts (abfd) = local_got_refcounts;
|
||||
memset (local_got_refcounts, -1, size);
|
||||
}
|
||||
if (local_got_refcounts[r_symndx] == -1)
|
||||
if (local_got_refcounts[r_symndx] == 0)
|
||||
{
|
||||
sgot->_raw_size += 4;
|
||||
|
||||
|
|
@ -2226,11 +2205,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
dynamic linker can adjust this GOT entry. */
|
||||
if (info->shared)
|
||||
srelgot->_raw_size += sizeof (Elf32_External_Rela);
|
||||
|
||||
local_got_refcounts[r_symndx] = 1;
|
||||
}
|
||||
else
|
||||
local_got_refcounts[r_symndx]++;
|
||||
local_got_refcounts[r_symndx]++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -2240,7 +2216,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
{
|
||||
((*_bfd_error_handler)
|
||||
(_("%s: relocation %s cannot be used when making a shared object"),
|
||||
bfd_get_filename (abfd), "R_PPC_EMB_SDAI16"));
|
||||
bfd_archive_filename (abfd), "R_PPC_EMB_SDAI16"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2274,7 +2250,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
{
|
||||
((*_bfd_error_handler)
|
||||
(_("%s: relocation %s cannot be used when making a shared object"),
|
||||
bfd_get_filename (abfd), "R_PPC_EMB_SDA2I16"));
|
||||
bfd_archive_filename (abfd), "R_PPC_EMB_SDA2I16"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2309,7 +2285,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
{
|
||||
((*_bfd_error_handler)
|
||||
(_("%s: relocation %s cannot be used when making a shared object"),
|
||||
bfd_get_filename (abfd),
|
||||
bfd_archive_filename (abfd),
|
||||
ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2343,13 +2319,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
if (! bfd_elf32_link_record_dynamic_symbol (info, h))
|
||||
return false;
|
||||
}
|
||||
if (h->plt.refcount == -1)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->plt.refcount = 1;
|
||||
}
|
||||
else
|
||||
h->plt.refcount++;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->plt.refcount++;
|
||||
break;
|
||||
|
||||
/* The following relocations don't need to propagate the
|
||||
|
|
@ -2430,6 +2401,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
|
|||
|| ! bfd_set_section_alignment (dynobj, sreloc, 2))
|
||||
return false;
|
||||
}
|
||||
if (sec->flags & SEC_READONLY)
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
|
||||
sreloc->_raw_size += sizeof (Elf32_External_Rela);
|
||||
|
|
@ -2485,13 +2458,7 @@ ppc_elf_gc_mark_hook (abfd, info, rel, h, sym)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(elf_bad_symtab (abfd)
|
||||
&& ELF_ST_BIND (sym->st_info) != STB_LOCAL)
|
||||
&& ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
|
||||
&& sym->st_shndx != SHN_COMMON))
|
||||
{
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
@ -2575,7 +2542,7 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
{
|
||||
if (sym->st_shndx == SHN_COMMON
|
||||
&& !info->relocateable
|
||||
&& sym->st_size <= (bfd_vma) bfd_get_gp_size (abfd))
|
||||
&& sym->st_size <= elf_gp_size (abfd))
|
||||
{
|
||||
/* Common symbols less than or equal to -G nn bytes are automatically
|
||||
put into .sdata. */
|
||||
|
|
@ -2584,21 +2551,24 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
|
||||
if (!sdata->bss_section)
|
||||
{
|
||||
bfd_size_type amt;
|
||||
|
||||
/* We don't go through bfd_make_section, because we don't
|
||||
want to attach this common section to DYNOBJ. The linker
|
||||
will move the symbols to the appropriate output section
|
||||
when it defines common symbols. */
|
||||
sdata->bss_section = ((asection *)
|
||||
bfd_zalloc (abfd, sizeof (asection)));
|
||||
amt = sizeof (asection);
|
||||
sdata->bss_section = (asection *) bfd_zalloc (abfd, amt);
|
||||
if (sdata->bss_section == NULL)
|
||||
return false;
|
||||
sdata->bss_section->name = sdata->bss_name;
|
||||
sdata->bss_section->flags = SEC_IS_COMMON;
|
||||
sdata->bss_section->output_section = sdata->bss_section;
|
||||
sdata->bss_section->symbol =
|
||||
(asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
|
||||
amt = sizeof (asymbol);
|
||||
sdata->bss_section->symbol = (asymbol *) bfd_zalloc (abfd, amt);
|
||||
amt = sizeof (asymbol *);
|
||||
sdata->bss_section->symbol_ptr_ptr =
|
||||
(asymbol **) bfd_zalloc (abfd, sizeof (asymbol *));
|
||||
(asymbol **) bfd_zalloc (abfd, amt);
|
||||
if (sdata->bss_section->symbol == NULL
|
||||
|| sdata->bss_section->symbol_ptr_ptr == NULL)
|
||||
return false;
|
||||
|
|
@ -2702,7 +2672,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
|
||||
rela.r_offset = (sgot->output_section->vma
|
||||
+ sgot->output_offset
|
||||
+ (h->got.offset &~ 1));
|
||||
+ (h->got.offset &~ (bfd_vma) 1));
|
||||
|
||||
/* If this is a -Bsymbolic link, and the symbol is defined
|
||||
locally, we just want to emit a RELATIVE reloc. The entry in
|
||||
|
|
@ -2847,7 +2817,7 @@ ppc_elf_finish_dynamic_sections (output_bfd, info)
|
|||
if (sgot)
|
||||
{
|
||||
unsigned char *contents = sgot->contents;
|
||||
bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents);
|
||||
|
||||
if (sdyn == NULL)
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
|
||||
|
|
@ -2919,7 +2889,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n",
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
bfd_section_name(input_bfd, input_section),
|
||||
(long) input_section->reloc_count,
|
||||
(info->relocateable) ? " (relocatable)" : "");
|
||||
|
|
@ -2958,7 +2928,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|| !ppc_elf_howto_table[(int) r_type])
|
||||
{
|
||||
(*_bfd_error_handler) (_("%s: unknown relocation type %d"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
(int) r_type);
|
||||
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
|
|
@ -3003,9 +2973,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
sec = local_sections[r_symndx];
|
||||
sym_name = "<local symbol>";
|
||||
|
||||
relocation = (sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ sym->st_value);
|
||||
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
|
||||
addend = rel->r_addend;
|
||||
/* Relocs to local symbols are always resolved. */
|
||||
will_become_local = 1;
|
||||
}
|
||||
|
|
@ -3091,7 +3060,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
|
||||
bfd_get_filename (input_bfd), h->root.root.string,
|
||||
bfd_archive_filename (input_bfd), h->root.root.string,
|
||||
bfd_get_section_name (input_bfd, input_section));
|
||||
relocation = 0;
|
||||
}
|
||||
|
|
@ -3102,7 +3071,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else if (h->root.type == bfd_link_hash_undefweak)
|
||||
relocation = 0;
|
||||
else if (info->shared && !info->symbolic && !info->no_undefined
|
||||
else if (info->shared
|
||||
&& (!info->symbolic || info->allow_shlib_undefined)
|
||||
&& !info->no_undefined
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
|
||||
relocation = 0;
|
||||
else
|
||||
|
|
@ -3124,13 +3095,16 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
default:
|
||||
(*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
(int) r_type, sym_name);
|
||||
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
ret = false;
|
||||
continue;
|
||||
|
||||
case (int) R_PPC_NONE:
|
||||
continue;
|
||||
|
||||
/* Relocations that need no special processing. */
|
||||
case (int) R_PPC_LOCAL24PC:
|
||||
/* It makes no sense to point a local relocation
|
||||
|
|
@ -3166,7 +3140,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
/* Relocations that always need to be propagated if this is a shared
|
||||
object. */
|
||||
case (int) R_PPC_NONE:
|
||||
case (int) R_PPC_ADDR32:
|
||||
case (int) R_PPC_ADDR24:
|
||||
case (int) R_PPC_ADDR16:
|
||||
|
|
@ -3176,7 +3149,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
case (int) R_PPC_ADDR14:
|
||||
case (int) R_PPC_UADDR32:
|
||||
case (int) R_PPC_UADDR16:
|
||||
if (info->shared)
|
||||
if (info->shared && r_symndx != 0)
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
boolean skip;
|
||||
|
|
@ -3212,22 +3185,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
skip = false;
|
||||
|
||||
if (elf_section_data (input_section)->stab_info == NULL)
|
||||
outrel.r_offset = rel->r_offset;
|
||||
else
|
||||
{
|
||||
bfd_vma off;
|
||||
|
||||
off = (_bfd_stab_section_offset
|
||||
(output_bfd, &elf_hash_table (info)->stab_info,
|
||||
input_section,
|
||||
&elf_section_data (input_section)->stab_info,
|
||||
rel->r_offset));
|
||||
if (off == (bfd_vma) -1)
|
||||
skip = true;
|
||||
outrel.r_offset = off;
|
||||
}
|
||||
|
||||
outrel.r_offset =
|
||||
_bfd_elf_section_offset (output_bfd, info, input_section,
|
||||
rel->r_offset);
|
||||
if (outrel.r_offset == (bfd_vma) -1)
|
||||
skip = true;
|
||||
outrel.r_offset += (input_section->output_section->vma
|
||||
+ input_section->output_offset);
|
||||
|
||||
|
|
@ -3325,7 +3287,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
insn &= ~BRANCH_PREDICT_BIT;
|
||||
else
|
||||
insn |= BRANCH_PREDICT_BIT;
|
||||
bfd_put_32 (output_bfd, insn, contents + offset);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
|
||||
break;
|
||||
|
||||
/* branch not taken predicition relocations */
|
||||
|
|
@ -3336,7 +3298,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
insn |= BRANCH_PREDICT_BIT;
|
||||
else
|
||||
insn &= ~BRANCH_PREDICT_BIT;
|
||||
bfd_put_32 (output_bfd, insn, contents + offset);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
|
||||
break;
|
||||
|
||||
/* GOT16 relocations */
|
||||
|
|
@ -3488,7 +3450,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
&& strcmp (name, ".sbss") != 0)
|
||||
{
|
||||
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
sym_name,
|
||||
ppc_elf_howto_table[(int) r_type]->name,
|
||||
name);
|
||||
|
|
@ -3509,7 +3471,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (strcmp (name, ".sdata2") != 0 && strcmp (name, ".sbss2") != 0)
|
||||
{
|
||||
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
sym_name,
|
||||
ppc_elf_howto_table[(int) r_type]->name,
|
||||
name);
|
||||
|
|
@ -3559,7 +3521,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
else
|
||||
{
|
||||
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
sym_name,
|
||||
ppc_elf_howto_table[(int) r_type]->name,
|
||||
name);
|
||||
|
|
@ -3573,7 +3535,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{ /* fill in register field */
|
||||
insn = bfd_get_32 (output_bfd, contents + offset);
|
||||
insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
|
||||
bfd_put_32 (output_bfd, insn, contents + offset);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -3625,7 +3587,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
case (int) R_PPC_EMB_RELST_HA:
|
||||
case (int) R_PPC_EMB_BIT_FLD:
|
||||
(*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."),
|
||||
bfd_get_filename (input_bfd),
|
||||
bfd_archive_filename (input_bfd),
|
||||
ppc_elf_howto_table[(int) r_type]->name,
|
||||
sym_name);
|
||||
|
||||
|
|
@ -3709,6 +3671,90 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static enum elf_reloc_type_class
|
||||
ppc_elf_reloc_type_class (rela)
|
||||
const Elf_Internal_Rela *rela;
|
||||
{
|
||||
switch ((int) ELF32_R_TYPE (rela->r_info))
|
||||
{
|
||||
case R_PPC_RELATIVE:
|
||||
return reloc_class_relative;
|
||||
case R_PPC_REL24:
|
||||
case R_PPC_ADDR24:
|
||||
case R_PPC_JMP_SLOT:
|
||||
return reloc_class_plt;
|
||||
case R_PPC_COPY:
|
||||
return reloc_class_copy;
|
||||
default:
|
||||
return reloc_class_normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* Support for core dump NOTE sections */
|
||||
static boolean
|
||||
ppc_elf_grok_prstatus (abfd, note)
|
||||
bfd *abfd;
|
||||
Elf_Internal_Note *note;
|
||||
{
|
||||
int offset;
|
||||
unsigned int raw_size;
|
||||
|
||||
switch (note->descsz)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
|
||||
case 268: /* Linux/PPC */
|
||||
/* pr_cursig */
|
||||
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
|
||||
|
||||
/* pr_pid */
|
||||
elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
|
||||
|
||||
/* pr_reg */
|
||||
offset = 72;
|
||||
raw_size = 192;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make a ".reg/999" section. */
|
||||
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
|
||||
raw_size, note->descpos + offset);
|
||||
}
|
||||
|
||||
static boolean
|
||||
ppc_elf_grok_psinfo (abfd, note)
|
||||
bfd *abfd;
|
||||
Elf_Internal_Note *note;
|
||||
{
|
||||
switch (note->descsz)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
|
||||
case 128: /* Linux/PPC elf_prpsinfo */
|
||||
elf_tdata (abfd)->core_program
|
||||
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
|
||||
elf_tdata (abfd)->core_command
|
||||
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
|
||||
}
|
||||
|
||||
/* Note that for some reason, a spurious space is tacked
|
||||
onto the end of the args in some (at least one anyway)
|
||||
implementations, so strip it off if it exists. */
|
||||
|
||||
{
|
||||
char *command = elf_tdata (abfd)->core_command;
|
||||
int n = strlen (command);
|
||||
|
||||
if (0 < n && command[n - 1] == ' ')
|
||||
command[n - 1] = '\0';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec
|
||||
#define TARGET_LITTLE_NAME "elf32-powerpcle"
|
||||
|
|
@ -3730,10 +3776,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
#define elf_backend_plt_not_loaded 1
|
||||
#define elf_backend_got_symbol_offset 4
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_can_refcount 1
|
||||
#define elf_backend_got_header_size 12
|
||||
#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE
|
||||
|
||||
#define bfd_elf32_bfd_copy_private_bfd_data ppc_elf_copy_private_bfd_data
|
||||
#define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data
|
||||
#define bfd_elf32_bfd_relax_section ppc_elf_relax_section
|
||||
#define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup
|
||||
|
|
@ -3754,5 +3800,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
#define elf_backend_fake_sections ppc_elf_fake_sections
|
||||
#define elf_backend_additional_program_headers ppc_elf_additional_program_headers
|
||||
#define elf_backend_modify_segment_map ppc_elf_modify_segment_map
|
||||
#define elf_backend_grok_prstatus ppc_elf_grok_prstatus
|
||||
#define elf_backend_grok_psinfo ppc_elf_grok_psinfo
|
||||
#define elf_backend_reloc_type_class ppc_elf_reloc_type_class
|
||||
|
||||
#include "elf32-target.h"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,14 @@ static boolean elf32_sparc_object_p
|
|||
PARAMS ((bfd *));
|
||||
static void elf32_sparc_final_write_processing
|
||||
PARAMS ((bfd *, boolean));
|
||||
static enum elf_reloc_type_class elf32_sparc_reloc_type_class
|
||||
PARAMS ((const Elf_Internal_Rela *));
|
||||
static asection * elf32_sparc_gc_mark_hook
|
||||
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
|
||||
struct elf_link_hash_entry *, Elf_Internal_Sym *));
|
||||
static boolean elf32_sparc_gc_sweep_hook
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *,
|
||||
const Elf_Internal_Rela *));
|
||||
|
||||
/* The relocation "howto" table. */
|
||||
|
||||
|
|
@ -68,7 +76,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true),
|
||||
HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true),
|
||||
HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0x00ffffff,true),
|
||||
HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true),
|
||||
HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true),
|
||||
HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true),
|
||||
|
|
@ -86,7 +94,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PLT32", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true),
|
||||
|
|
@ -120,7 +128,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_UA64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", false,0,(~ (bfd_vma)0), true),
|
||||
HOWTO(R_SPARC_UA64, 0,0, 0,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_UA64", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_UA16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", false,0,0x0000ffff,true),
|
||||
HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true),
|
||||
};
|
||||
|
|
@ -134,10 +142,11 @@ struct elf_reloc_map {
|
|||
unsigned char elf_reloc_val;
|
||||
};
|
||||
|
||||
static CONST struct elf_reloc_map sparc_reloc_map[] =
|
||||
static const struct elf_reloc_map sparc_reloc_map[] =
|
||||
{
|
||||
{ BFD_RELOC_NONE, R_SPARC_NONE, },
|
||||
{ BFD_RELOC_16, R_SPARC_16, },
|
||||
{ BFD_RELOC_16_PCREL, R_SPARC_DISP16 },
|
||||
{ BFD_RELOC_8, R_SPARC_8 },
|
||||
{ BFD_RELOC_8_PCREL, R_SPARC_DISP8 },
|
||||
{ BFD_RELOC_CTOR, R_SPARC_32 },
|
||||
|
|
@ -146,6 +155,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] =
|
|||
{ BFD_RELOC_HI22, R_SPARC_HI22 },
|
||||
{ BFD_RELOC_LO10, R_SPARC_LO10, },
|
||||
{ BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 },
|
||||
{ BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 },
|
||||
{ BFD_RELOC_SPARC22, R_SPARC_22 },
|
||||
{ BFD_RELOC_SPARC13, R_SPARC_13 },
|
||||
{ BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 },
|
||||
|
|
@ -447,10 +457,11 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
symbol. */
|
||||
if (local_got_offsets == NULL)
|
||||
{
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
register unsigned int i;
|
||||
|
||||
size = symtab_hdr->sh_info * sizeof (bfd_vma);
|
||||
size = symtab_hdr->sh_info;
|
||||
size *= sizeof (bfd_vma);
|
||||
local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
|
||||
if (local_got_offsets == NULL)
|
||||
return false;
|
||||
|
|
@ -485,6 +496,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
|
||||
break;
|
||||
|
||||
case R_SPARC_PLT32:
|
||||
case R_SPARC_WPLT30:
|
||||
/* This symbol requires a procedure linkage table entry. We
|
||||
actually build the entry in adjust_dynamic_symbol,
|
||||
|
|
@ -498,6 +510,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
reloc for a local symbol if you assemble a call from
|
||||
one section to another when using -K pic. We treat
|
||||
it as WDISP30. */
|
||||
if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30)
|
||||
goto r_sparc_plt32;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -510,6 +524,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
|
||||
if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30)
|
||||
goto r_sparc_plt32;
|
||||
break;
|
||||
|
||||
case R_SPARC_PC10:
|
||||
|
|
@ -554,11 +570,11 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
case R_SPARC_LO10:
|
||||
case R_SPARC_UA16:
|
||||
case R_SPARC_UA32:
|
||||
case R_SPARC_UA64:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
|
||||
if (info->shared)
|
||||
r_sparc_plt32:
|
||||
if (info->shared && (sec->flags & SEC_ALLOC))
|
||||
{
|
||||
/* When creating a shared object, we must copy these
|
||||
relocs into the output file. We create a reloc
|
||||
|
|
@ -593,6 +609,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
|||
|| ! bfd_set_section_alignment (dynobj, sreloc, 2))
|
||||
return false;
|
||||
}
|
||||
if (sec->flags & SEC_READONLY)
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
|
||||
sreloc->_raw_size += sizeof (Elf32_External_Rela);
|
||||
|
|
@ -652,14 +670,8 @@ elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(elf_bad_symtab (abfd)
|
||||
&& ELF_ST_BIND (sym->st_info) != STB_LOCAL)
|
||||
&& ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
|
||||
&& sym->st_shndx != SHN_COMMON))
|
||||
{
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
}
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -910,12 +922,11 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
|||
|
||||
static boolean
|
||||
elf32_sparc_size_dynamic_sections (output_bfd, info)
|
||||
bfd *output_bfd;
|
||||
bfd *output_bfd ATTRIBUTE_UNUSED;
|
||||
struct bfd_link_info *info;
|
||||
{
|
||||
bfd *dynobj;
|
||||
asection *s;
|
||||
boolean reltext;
|
||||
boolean relplt;
|
||||
|
||||
dynobj = elf_hash_table (info)->dynobj;
|
||||
|
|
@ -953,7 +964,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
|
|||
/* The check_relocs and adjust_dynamic_symbol entry points have
|
||||
determined the sizes of the various dynamic sections. Allocate
|
||||
memory for them. */
|
||||
reltext = false;
|
||||
relplt = false;
|
||||
for (s = dynobj->sections; s != NULL; s = s->next)
|
||||
{
|
||||
|
|
@ -986,19 +996,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
|
|||
}
|
||||
else
|
||||
{
|
||||
const char *outname;
|
||||
asection *target;
|
||||
|
||||
/* If this relocation section applies to a read only
|
||||
section, then we probably need a DT_TEXTREL entry. */
|
||||
outname = bfd_get_section_name (output_bfd,
|
||||
s->output_section);
|
||||
target = bfd_get_section_by_name (output_bfd, outname + 5);
|
||||
if (target != NULL
|
||||
&& (target->flags & SEC_READONLY) != 0
|
||||
&& (target->flags & SEC_ALLOC) != 0)
|
||||
reltext = true;
|
||||
|
||||
if (strcmp (name, ".rela.plt") == 0)
|
||||
relplt = true;
|
||||
|
||||
|
|
@ -1038,34 +1035,36 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
|
|||
must add the entries now so that we get the correct size for
|
||||
the .dynamic section. The DT_DEBUG entry is filled in by the
|
||||
dynamic linker and used by the debugger. */
|
||||
if (! info->shared)
|
||||
#define add_dynamic_entry(TAG, VAL) \
|
||||
bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
|
||||
|
||||
if (!info->shared)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
|
||||
if (!add_dynamic_entry (DT_DEBUG, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (relplt)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
|
||||
if (!add_dynamic_entry (DT_PLTGOT, 0)
|
||||
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
|
||||
|| !add_dynamic_entry (DT_PLTREL, DT_RELA)
|
||||
|| !add_dynamic_entry (DT_JMPREL, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0)
|
||||
|| ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT,
|
||||
sizeof (Elf32_External_Rela)))
|
||||
if (!add_dynamic_entry (DT_RELA, 0)
|
||||
|| !add_dynamic_entry (DT_RELASZ, 0)
|
||||
|| !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela)))
|
||||
return false;
|
||||
|
||||
if (reltext)
|
||||
if (info->flags & DF_TEXTREL)
|
||||
{
|
||||
if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
|
||||
if (!add_dynamic_entry (DT_TEXTREL, 0))
|
||||
return false;
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
}
|
||||
#undef add_dynamic_entry
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1136,6 +1135,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
asection *sec;
|
||||
bfd_vma relocation;
|
||||
bfd_reloc_status_type r;
|
||||
boolean is_plt = false;
|
||||
|
||||
r_type = ELF32_R_TYPE (rel->r_info);
|
||||
|
||||
|
|
@ -1179,9 +1179,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
sym = local_syms + r_symndx;
|
||||
sec = local_sections[r_symndx];
|
||||
relocation = (sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ sym->st_value);
|
||||
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1193,7 +1191,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|| h->root.type == bfd_link_hash_defweak)
|
||||
{
|
||||
sec = h->root.u.def.section;
|
||||
if ((r_type == R_SPARC_WPLT30
|
||||
if (((r_type == R_SPARC_WPLT30
|
||||
|| r_type == R_SPARC_PLT32)
|
||||
&& h->plt.offset != (bfd_vma) -1)
|
||||
|| ((r_type == R_SPARC_GOT10
|
||||
|| r_type == R_SPARC_GOT13
|
||||
|
|
@ -1223,11 +1222,18 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|| r_type == R_SPARC_LO10
|
||||
|| r_type == R_SPARC_UA16
|
||||
|| r_type == R_SPARC_UA32
|
||||
|| r_type == R_SPARC_UA64
|
||||
|| ((r_type == R_SPARC_PC10
|
||||
|| r_type == R_SPARC_PC22)
|
||||
&& strcmp (h->root.root.string,
|
||||
"_GLOBAL_OFFSET_TABLE_") != 0))))
|
||||
"_GLOBAL_OFFSET_TABLE_") != 0))
|
||||
&& ((input_section->flags & SEC_ALLOC) != 0
|
||||
/* DWARF will emit R_SPARC_32 relocations in its
|
||||
sections against symbols defined externally
|
||||
in shared libraries. We can't do anything
|
||||
with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
|
||||
{
|
||||
/* In these cases, we don't need the relocation
|
||||
value. We check specially because in some
|
||||
|
|
@ -1241,7 +1247,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else if (h->root.type == bfd_link_hash_undefweak)
|
||||
relocation = 0;
|
||||
else if (info->shared && !info->symbolic
|
||||
else if (info->shared
|
||||
&& (!info->symbolic || info->allow_shlib_undefined)
|
||||
&& !info->no_undefined
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
|
||||
relocation = 0;
|
||||
|
|
@ -1354,6 +1361,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
break;
|
||||
|
||||
case R_SPARC_PLT32:
|
||||
if (h == NULL || h->plt.offset == (bfd_vma) -1)
|
||||
{
|
||||
r_type = R_SPARC_32;
|
||||
goto r_sparc_plt32;
|
||||
}
|
||||
/* Fall through. */
|
||||
case R_SPARC_WPLT30:
|
||||
/* Relocation is to the entry for this symbol in the
|
||||
procedure linkage table. */
|
||||
|
|
@ -1382,6 +1396,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
relocation = (splt->output_section->vma
|
||||
+ splt->output_offset
|
||||
+ h->plt.offset);
|
||||
if (r_type == R_SPARC_PLT32)
|
||||
{
|
||||
r_type = R_SPARC_32;
|
||||
is_plt = true;
|
||||
goto r_sparc_plt32;
|
||||
}
|
||||
break;
|
||||
|
||||
case R_SPARC_PC10:
|
||||
|
|
@ -1412,8 +1432,10 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
case R_SPARC_LO10:
|
||||
case R_SPARC_UA16:
|
||||
case R_SPARC_UA32:
|
||||
case R_SPARC_UA64:
|
||||
if (info->shared)
|
||||
r_sparc_plt32:
|
||||
if (info->shared
|
||||
&& r_symndx != 0
|
||||
&& (input_section->flags & SEC_ALLOC))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
boolean skip;
|
||||
|
|
@ -1444,30 +1466,41 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
skip = false;
|
||||
|
||||
if (elf_section_data (input_section)->stab_info == NULL)
|
||||
outrel.r_offset = rel->r_offset;
|
||||
else
|
||||
{
|
||||
bfd_vma off;
|
||||
|
||||
off = (_bfd_stab_section_offset
|
||||
(output_bfd, &elf_hash_table (info)->stab_info,
|
||||
input_section,
|
||||
&elf_section_data (input_section)->stab_info,
|
||||
rel->r_offset));
|
||||
if (off == (bfd_vma) -1)
|
||||
skip = true;
|
||||
outrel.r_offset = off;
|
||||
}
|
||||
|
||||
outrel.r_offset =
|
||||
_bfd_elf_section_offset (output_bfd, info, input_section,
|
||||
rel->r_offset);
|
||||
if (outrel.r_offset == (bfd_vma) -1)
|
||||
skip = true;
|
||||
outrel.r_offset += (input_section->output_section->vma
|
||||
+ input_section->output_offset);
|
||||
|
||||
/* Optimize unaligned reloc usage now that we know where
|
||||
it finally resides. */
|
||||
switch (r_type)
|
||||
{
|
||||
case R_SPARC_16:
|
||||
if (outrel.r_offset & 1)
|
||||
r_type = R_SPARC_UA16;
|
||||
break;
|
||||
case R_SPARC_UA16:
|
||||
if (!(outrel.r_offset & 1))
|
||||
r_type = R_SPARC_16;
|
||||
break;
|
||||
case R_SPARC_32:
|
||||
if (outrel.r_offset & 3)
|
||||
r_type = R_SPARC_UA32;
|
||||
break;
|
||||
case R_SPARC_UA32:
|
||||
if (!(outrel.r_offset & 3))
|
||||
r_type = R_SPARC_32;
|
||||
break;
|
||||
}
|
||||
|
||||
if (skip)
|
||||
memset (&outrel, 0, sizeof outrel);
|
||||
/* h->dynindx may be -1 if the symbol was marked to
|
||||
become local. */
|
||||
else if (h != NULL
|
||||
else if (h != NULL && ! is_plt
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|
|
@ -1487,7 +1520,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
long indx;
|
||||
|
||||
if (h == NULL)
|
||||
if (is_plt)
|
||||
sec = splt;
|
||||
else if (h == NULL)
|
||||
sec = local_sections[r_symndx];
|
||||
else
|
||||
{
|
||||
|
|
@ -1517,7 +1552,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
BFD_FAIL ();
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: probably compiled without -fPIC?"),
|
||||
bfd_get_filename (input_bfd));
|
||||
bfd_archive_filename (input_bfd));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1535,12 +1570,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
++sreloc->reloc_count;
|
||||
|
||||
/* This reloc will be computed at runtime, so there's no
|
||||
need to do anything now, unless this is a RELATIVE
|
||||
reloc in an unallocated section. */
|
||||
if (skip
|
||||
|| (input_section->flags & SEC_ALLOC) != 0
|
||||
|| ELF32_R_TYPE (outrel.r_info) != R_SPARC_RELATIVE)
|
||||
continue;
|
||||
need to do anything now. */
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -1661,7 +1692,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|| reg == G0 || reg == O7)
|
||||
break;
|
||||
|
||||
bfd_put_32 (input_bfd, INSN_NOP,
|
||||
bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP,
|
||||
contents + rel->r_offset + 4);
|
||||
}
|
||||
|
||||
|
|
@ -1748,7 +1779,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
(PLT_ENTRY_WORD1
|
||||
+ (((- (h->plt.offset + 4)) >> 2) & 0x3fffff)),
|
||||
splt->contents + h->plt.offset + 4);
|
||||
bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
|
||||
bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2,
|
||||
splt->contents + h->plt.offset + 8);
|
||||
|
||||
/* Fill in the entry in the .rela.plt section. */
|
||||
|
|
@ -1791,7 +1822,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
|
||||
rela.r_offset = (sgot->output_section->vma
|
||||
+ sgot->output_offset
|
||||
+ (h->got.offset &~ 1));
|
||||
+ (h->got.offset &~ (bfd_vma) 1));
|
||||
|
||||
/* If this is a -Bsymbolic link, and the symbol is defined
|
||||
locally, we just want to emit a RELATIVE reloc. Likewise if
|
||||
|
|
@ -1917,7 +1948,7 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info)
|
|||
if (splt->_raw_size > 0)
|
||||
{
|
||||
memset (splt->contents, 0, 4 * PLT_ENTRY_SIZE);
|
||||
bfd_put_32 (output_bfd, SPARC_NOP,
|
||||
bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
|
||||
splt->contents + splt->_raw_size - 4);
|
||||
}
|
||||
|
||||
|
|
@ -1974,7 +2005,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: compiled for a 64 bit system and target is 32 bit"),
|
||||
bfd_get_filename (ibfd));
|
||||
bfd_archive_filename (ibfd));
|
||||
}
|
||||
else if ((ibfd->flags & DYNAMIC) == 0)
|
||||
{
|
||||
|
|
@ -1988,7 +2019,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: linking little endian files with big endian files"),
|
||||
bfd_get_filename (ibfd));
|
||||
bfd_archive_filename (ibfd));
|
||||
error = true;
|
||||
}
|
||||
previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA;
|
||||
|
|
@ -2024,7 +2055,7 @@ elf32_sparc_object_p (abfd)
|
|||
}
|
||||
else if (elf_elfheader (abfd)->e_flags & EF_SPARC_LEDATA)
|
||||
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
|
||||
bfd_mach_sparc_sparclite_le);
|
||||
bfd_mach_sparc_sparclite_le);
|
||||
else
|
||||
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc);
|
||||
}
|
||||
|
|
@ -2066,6 +2097,23 @@ elf32_sparc_final_write_processing (abfd, linker)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static enum elf_reloc_type_class
|
||||
elf32_sparc_reloc_type_class (rela)
|
||||
const Elf_Internal_Rela *rela;
|
||||
{
|
||||
switch ((int) ELF32_R_TYPE (rela->r_info))
|
||||
{
|
||||
case R_SPARC_RELATIVE:
|
||||
return reloc_class_relative;
|
||||
case R_SPARC_JMP_SLOT:
|
||||
return reloc_class_plt;
|
||||
case R_SPARC_COPY:
|
||||
return reloc_class_copy;
|
||||
default:
|
||||
return reloc_class_normal;
|
||||
}
|
||||
}
|
||||
|
||||
#define TARGET_BIG_SYM bfd_elf32_sparc_vec
|
||||
#define TARGET_BIG_NAME "elf32-sparc"
|
||||
|
|
@ -2096,6 +2144,7 @@ elf32_sparc_final_write_processing (abfd, linker)
|
|||
elf32_sparc_final_write_processing
|
||||
#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook
|
||||
#define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook
|
||||
#define elf_backend_reloc_type_class elf32_sparc_reloc_type_class
|
||||
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_want_got_plt 0
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -40,6 +40,13 @@ static reloc_howto_type dummy =
|
|||
0, /* dst_mask */
|
||||
false); /* pcrel_offset */
|
||||
|
||||
static void elf_generic_info_to_howto
|
||||
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *));
|
||||
static void elf_generic_info_to_howto_rel
|
||||
PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *));
|
||||
static boolean elf64_generic_link_add_symbols
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
static void
|
||||
elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
|
|
@ -72,15 +79,9 @@ elf64_generic_link_add_symbols (abfd, info)
|
|||
Elf_Internal_Ehdr *ehdrp;
|
||||
|
||||
ehdrp = elf_elfheader (abfd);
|
||||
if (abfd->my_archive)
|
||||
(*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"),
|
||||
bfd_get_filename (abfd->my_archive),
|
||||
bfd_get_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
else
|
||||
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
|
||||
bfd_get_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
|
||||
bfd_archive_filename (abfd),
|
||||
ehdrp->e_machine);
|
||||
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
|
|
|
|||
4463
contrib/binutils/bfd/elf64-ppc.c
Normal file
4463
contrib/binutils/bfd/elf64-ppc.c
Normal file
File diff suppressed because it is too large
Load diff
22
contrib/binutils/bfd/elf64-ppc.h
Normal file
22
contrib/binutils/bfd/elf64-ppc.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* PowerPC64-specific support for 64-bit ELF.
|
||||
Copyright 2002 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
boolean ppc64_elf_set_toc PARAMS ((bfd *, struct bfd_link_info *));
|
||||
boolean ppc64_elf_size_stubs PARAMS ((bfd *, struct bfd_link_info *, int *));
|
||||
boolean ppc64_elf_build_stubs PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
|
@ -35,44 +35,55 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define MINUS_ONE (~ (bfd_vma) 0)
|
||||
|
||||
static struct bfd_link_hash_table * sparc64_elf_bfd_link_hash_table_create
|
||||
PARAMS((bfd *));
|
||||
PARAMS ((bfd *));
|
||||
static bfd_reloc_status_type init_insn_reloc
|
||||
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *,
|
||||
bfd *, bfd_vma *, bfd_vma *));
|
||||
static reloc_howto_type *sparc64_elf_reloc_type_lookup
|
||||
PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
static void sparc64_elf_info_to_howto
|
||||
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
|
||||
|
||||
static void sparc64_elf_build_plt
|
||||
PARAMS((bfd *, unsigned char *, int));
|
||||
PARAMS ((bfd *, unsigned char *, int));
|
||||
static bfd_vma sparc64_elf_plt_entry_offset
|
||||
PARAMS((int));
|
||||
PARAMS ((bfd_vma));
|
||||
static bfd_vma sparc64_elf_plt_ptr_offset
|
||||
PARAMS((int, int));
|
||||
PARAMS ((bfd_vma, bfd_vma));
|
||||
|
||||
static boolean sparc64_elf_check_relocs
|
||||
PARAMS((bfd *, struct bfd_link_info *, asection *sec,
|
||||
const Elf_Internal_Rela *));
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *sec,
|
||||
const Elf_Internal_Rela *));
|
||||
static boolean sparc64_elf_adjust_dynamic_symbol
|
||||
PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
|
||||
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
|
||||
static boolean sparc64_elf_size_dynamic_sections
|
||||
PARAMS((bfd *, struct bfd_link_info *));
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
static int sparc64_elf_get_symbol_type
|
||||
PARAMS (( Elf_Internal_Sym *, int));
|
||||
static boolean sparc64_elf_add_symbol_hook
|
||||
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
|
||||
const char **, flagword *, asection **, bfd_vma *));
|
||||
const char **, flagword *, asection **, bfd_vma *));
|
||||
static boolean sparc64_elf_output_arch_syms
|
||||
PARAMS ((bfd *, struct bfd_link_info *, PTR,
|
||||
boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *)));
|
||||
static void sparc64_elf_symbol_processing
|
||||
PARAMS ((bfd *, asymbol *));
|
||||
|
||||
static boolean sparc64_elf_copy_private_bfd_data
|
||||
PARAMS ((bfd *, bfd *));
|
||||
static boolean sparc64_elf_merge_private_bfd_data
|
||||
PARAMS ((bfd *, bfd *));
|
||||
|
||||
static const char *sparc64_elf_print_symbol_all
|
||||
PARAMS ((bfd *, PTR, asymbol *));
|
||||
static boolean sparc64_elf_relax_section
|
||||
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
|
||||
static boolean sparc64_elf_relocate_section
|
||||
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
|
||||
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
|
||||
static boolean sparc64_elf_finish_dynamic_symbol
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
|
||||
Elf_Internal_Sym *));
|
||||
static boolean sparc64_elf_finish_dynamic_sections
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
static boolean sparc64_elf_object_p PARAMS ((bfd *));
|
||||
static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *));
|
||||
static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
|
||||
|
|
@ -83,6 +94,8 @@ static boolean sparc64_elf_slurp_reloc_table
|
|||
static long sparc64_elf_canonicalize_dynamic_reloc
|
||||
PARAMS ((bfd *, arelent **, asymbol **));
|
||||
static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR));
|
||||
static enum elf_reloc_type_class sparc64_elf_reloc_type_class
|
||||
PARAMS ((const Elf_Internal_Rela *));
|
||||
|
||||
/* The relocation "howto" table. */
|
||||
|
||||
|
|
@ -103,7 +116,7 @@ static reloc_howto_type sparc64_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true),
|
||||
HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true),
|
||||
HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0x00ffffff,true),
|
||||
HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true),
|
||||
HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true),
|
||||
HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true),
|
||||
HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true),
|
||||
|
|
@ -122,8 +135,8 @@ static reloc_howto_type sparc64_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true),
|
||||
#ifndef SPARC64_OLD_RELOCS
|
||||
HOWTO(R_SPARC_PLT32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true),
|
||||
/* These aren't implemented yet. */
|
||||
HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PLT32", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true),
|
||||
HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true),
|
||||
|
|
@ -147,7 +160,7 @@ static reloc_howto_type sparc64_elf_howto_table[] =
|
|||
HOWTO(R_SPARC_5, 0,2, 5,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", false,0,0x0000001f,true),
|
||||
HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true),
|
||||
HOWTO(R_SPARC_DISP64, 0,4,64,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", false,0,MINUS_ONE, true),
|
||||
HOWTO(R_SPARC_PLT64, 0,4,64,false,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_PLT64", false,0,MINUS_ONE, false),
|
||||
HOWTO(R_SPARC_PLT64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", false,0,MINUS_ONE, true),
|
||||
HOWTO(R_SPARC_HIX22, 0,4, 0,false,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", false,0,MINUS_ONE, false),
|
||||
HOWTO(R_SPARC_LOX10, 0,4, 0,false,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", false,0,MINUS_ONE, false),
|
||||
HOWTO(R_SPARC_H44, 22,2,22,false,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", false,0,0x003fffff,false),
|
||||
|
|
@ -163,10 +176,11 @@ struct elf_reloc_map {
|
|||
unsigned char elf_reloc_val;
|
||||
};
|
||||
|
||||
static CONST struct elf_reloc_map sparc_reloc_map[] =
|
||||
static const struct elf_reloc_map sparc_reloc_map[] =
|
||||
{
|
||||
{ BFD_RELOC_NONE, R_SPARC_NONE, },
|
||||
{ BFD_RELOC_16, R_SPARC_16, },
|
||||
{ BFD_RELOC_16_PCREL, R_SPARC_DISP16 },
|
||||
{ BFD_RELOC_8, R_SPARC_8 },
|
||||
{ BFD_RELOC_8_PCREL, R_SPARC_DISP8 },
|
||||
{ BFD_RELOC_CTOR, R_SPARC_64 },
|
||||
|
|
@ -175,6 +189,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] =
|
|||
{ BFD_RELOC_HI22, R_SPARC_HI22 },
|
||||
{ BFD_RELOC_LO10, R_SPARC_LO10, },
|
||||
{ BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 },
|
||||
{ BFD_RELOC_64_PCREL, R_SPARC_DISP64 },
|
||||
{ BFD_RELOC_SPARC22, R_SPARC_22 },
|
||||
{ BFD_RELOC_SPARC13, R_SPARC_13 },
|
||||
{ BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 },
|
||||
|
|
@ -207,6 +222,9 @@ static CONST struct elf_reloc_map sparc_reloc_map[] =
|
|||
{ BFD_RELOC_SPARC_5, R_SPARC_5 },
|
||||
{ BFD_RELOC_SPARC_6, R_SPARC_6 },
|
||||
{ BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64 },
|
||||
#ifndef SPARC64_OLD_RELOCS
|
||||
{ BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 },
|
||||
#endif
|
||||
{ BFD_RELOC_SPARC_PLT64, R_SPARC_PLT64 },
|
||||
{ BFD_RELOC_SPARC_HIX22, R_SPARC_HIX22 },
|
||||
{ BFD_RELOC_SPARC_LOX10, R_SPARC_LOX10 },
|
||||
|
|
@ -280,13 +298,12 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)
|
|||
bfd_size_type count;
|
||||
arelent *relents;
|
||||
|
||||
allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
|
||||
allocated = (PTR) bfd_malloc (rel_hdr->sh_size);
|
||||
if (allocated == NULL)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
|
||||
|| (bfd_read (allocated, 1, rel_hdr->sh_size, abfd)
|
||||
!= rel_hdr->sh_size))
|
||||
|| bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size)
|
||||
goto error_return;
|
||||
|
||||
native_relocs = (bfd_byte *) allocated;
|
||||
|
|
@ -371,6 +388,7 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
|
|||
struct bfd_elf_section_data * const d = elf_section_data (asect);
|
||||
Elf_Internal_Shdr *rel_hdr;
|
||||
Elf_Internal_Shdr *rel_hdr2;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (asect->relocation != NULL)
|
||||
return true;
|
||||
|
|
@ -401,9 +419,9 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
|
|||
rel_hdr2 = NULL;
|
||||
}
|
||||
|
||||
asect->relocation = ((arelent *)
|
||||
bfd_alloc (abfd,
|
||||
asect->reloc_count * 2 * sizeof (arelent)));
|
||||
amt = asect->reloc_count;
|
||||
amt *= 2 * sizeof (arelent);
|
||||
asect->relocation = (arelent *) bfd_alloc (abfd, amt);
|
||||
if (asect->relocation == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -639,9 +657,9 @@ sparc64_elf_bfd_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct sparc64_elf_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct sparc64_elf_link_hash_table);
|
||||
|
||||
ret = ((struct sparc64_elf_link_hash_table *)
|
||||
bfd_zalloc (abfd, sizeof (struct sparc64_elf_link_hash_table)));
|
||||
ret = (struct sparc64_elf_link_hash_table *) bfd_zalloc (abfd, amt);
|
||||
if (ret == (struct sparc64_elf_link_hash_table *) NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -759,8 +777,8 @@ sparc_elf_wdisp16_reloc (abfd, reloc_entry, symbol, data, input_section,
|
|||
if (status != bfd_reloc_other)
|
||||
return status;
|
||||
|
||||
insn = (insn & ~0x303fff) | ((((relocation >> 2) & 0xc000) << 6)
|
||||
| ((relocation >> 2) & 0x3fff));
|
||||
insn &= ~ (bfd_vma) 0x303fff;
|
||||
insn |= (((relocation >> 2) & 0xc000) << 6) | ((relocation >> 2) & 0x3fff);
|
||||
bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address);
|
||||
|
||||
if ((bfd_signed_vma) relocation < - 0x40000
|
||||
|
|
@ -798,7 +816,7 @@ sparc_elf_hix22_reloc (abfd,
|
|||
return status;
|
||||
|
||||
relocation ^= MINUS_ONE;
|
||||
insn = (insn & ~0x3fffff) | ((relocation >> 10) & 0x3fffff);
|
||||
insn = (insn &~ (bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff);
|
||||
bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address);
|
||||
|
||||
if ((relocation & ~ (bfd_vma) 0xffffffff) != 0)
|
||||
|
|
@ -834,7 +852,7 @@ sparc_elf_lox10_reloc (abfd,
|
|||
if (status != bfd_reloc_other)
|
||||
return status;
|
||||
|
||||
insn = (insn & ~0x1fff) | 0x1c00 | (relocation & 0x3ff);
|
||||
insn = (insn &~ (bfd_vma) 0x1fff) | 0x1c00 | (relocation & 0x3ff);
|
||||
bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address);
|
||||
|
||||
return bfd_reloc_ok;
|
||||
|
|
@ -865,7 +883,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
|
|||
We fill them with `illtrap 0' to force ld.so to do something. */
|
||||
|
||||
for (i = 0; i < PLT_HEADER_SIZE/4; ++i)
|
||||
bfd_put_32 (output_bfd, 0, contents+i*4);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, contents+i*4);
|
||||
|
||||
/* The first 32768 entries are close enough to plt1 to get there via
|
||||
a straight branch. */
|
||||
|
|
@ -881,14 +899,14 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
|
|||
/* ba,a,pt %xcc, plt1 */
|
||||
ba = 0x30680000 | (((contents+PLT_ENTRY_SIZE) - (entry+4)) / 4 & 0x7ffff);
|
||||
|
||||
bfd_put_32 (output_bfd, sethi, entry);
|
||||
bfd_put_32 (output_bfd, ba, entry+4);
|
||||
bfd_put_32 (output_bfd, nop, entry+8);
|
||||
bfd_put_32 (output_bfd, nop, entry+12);
|
||||
bfd_put_32 (output_bfd, nop, entry+16);
|
||||
bfd_put_32 (output_bfd, nop, entry+20);
|
||||
bfd_put_32 (output_bfd, nop, entry+24);
|
||||
bfd_put_32 (output_bfd, nop, entry+28);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) sethi, entry);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) ba, entry + 4);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 8);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 12);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 16);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 20);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 24);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 28);
|
||||
}
|
||||
|
||||
/* Now the tricky bit. Entries 32768 and higher are grouped in blocks of
|
||||
|
|
@ -906,17 +924,23 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
|
|||
entry = contents + i*PLT_ENTRY_SIZE + j*4*6;
|
||||
ptr = contents + i*PLT_ENTRY_SIZE + block*4*6 + j*8;
|
||||
|
||||
/* ldx [%o7 + ptr - entry+4], %g1 */
|
||||
ldx = 0xc25be000 | ((ptr - entry+4) & 0x1fff);
|
||||
/* ldx [%o7 + ptr - (entry+4)], %g1 */
|
||||
ldx = 0xc25be000 | ((ptr - (entry+4)) & 0x1fff);
|
||||
|
||||
bfd_put_32 (output_bfd, 0x8a10000f, entry); /* mov %o7,%g5 */
|
||||
bfd_put_32 (output_bfd, 0x40000002, entry+4); /* call .+8 */
|
||||
bfd_put_32 (output_bfd, nop, entry+8); /* nop */
|
||||
bfd_put_32 (output_bfd, ldx, entry+12); /* ldx [%o7+P],%g1 */
|
||||
bfd_put_32 (output_bfd, 0x83c3c001, entry+16); /* jmpl %o7+%g1,%g1 */
|
||||
bfd_put_32 (output_bfd, 0x9e100005, entry+20); /* mov %g5,%o7 */
|
||||
/* mov %o7,%g5
|
||||
call .+8
|
||||
nop
|
||||
ldx [%o7+P],%g1
|
||||
jmpl %o7+%g1,%g1
|
||||
mov %g5,%o7 */
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0x8a10000f, entry);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0x40000002, entry + 4);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) nop, entry + 8);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) ldx, entry + 12);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0x83c3c001, entry + 16);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0x9e100005, entry + 20);
|
||||
|
||||
bfd_put_64 (output_bfd, contents - (entry+4), ptr);
|
||||
bfd_put_64 (output_bfd, (bfd_vma) (contents - (entry + 4)), ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -925,9 +949,9 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
|
|||
|
||||
static bfd_vma
|
||||
sparc64_elf_plt_entry_offset (index)
|
||||
int index;
|
||||
bfd_vma index;
|
||||
{
|
||||
int block, ofs;
|
||||
bfd_vma block, ofs;
|
||||
|
||||
if (index < LARGE_PLT_THRESHOLD)
|
||||
return index * PLT_ENTRY_SIZE;
|
||||
|
|
@ -937,22 +961,21 @@ sparc64_elf_plt_entry_offset (index)
|
|||
block = (index - LARGE_PLT_THRESHOLD) / 160;
|
||||
ofs = (index - LARGE_PLT_THRESHOLD) % 160;
|
||||
|
||||
return ((bfd_vma) (LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE
|
||||
+ ofs * 6*4);
|
||||
return (LARGE_PLT_THRESHOLD + block * 160) * PLT_ENTRY_SIZE + ofs * 6 * 4;
|
||||
}
|
||||
|
||||
static bfd_vma
|
||||
sparc64_elf_plt_ptr_offset (index, max)
|
||||
int index, max;
|
||||
bfd_vma index;
|
||||
bfd_vma max;
|
||||
{
|
||||
int block, ofs, last;
|
||||
bfd_vma block, ofs, last;
|
||||
|
||||
BFD_ASSERT(index >= LARGE_PLT_THRESHOLD);
|
||||
|
||||
/* See above for details. */
|
||||
|
||||
block = (((index - LARGE_PLT_THRESHOLD) / 160) * 160)
|
||||
+ LARGE_PLT_THRESHOLD;
|
||||
block = (((index - LARGE_PLT_THRESHOLD) / 160) * 160) + LARGE_PLT_THRESHOLD;
|
||||
ofs = index - block;
|
||||
if (block + 160 > max)
|
||||
last = (max - LARGE_PLT_THRESHOLD) % 160;
|
||||
|
|
@ -1073,10 +1096,11 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
|
|||
symbol. */
|
||||
if (local_got_offsets == NULL)
|
||||
{
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
register unsigned int i;
|
||||
|
||||
size = symtab_hdr->sh_info * sizeof (bfd_vma);
|
||||
size = symtab_hdr->sh_info;
|
||||
size *= sizeof (bfd_vma);
|
||||
local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
|
||||
if (local_got_offsets == NULL)
|
||||
return false;
|
||||
|
|
@ -1148,8 +1172,10 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
|
|||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
break;
|
||||
|
||||
if (ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT32
|
||||
&& ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT64)
|
||||
break;
|
||||
/* Fall through. */
|
||||
case R_SPARC_PC10:
|
||||
case R_SPARC_PC22:
|
||||
case R_SPARC_PC_HH22:
|
||||
|
|
@ -1235,6 +1261,8 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
|
|||
|| ! bfd_set_section_alignment (dynobj, sreloc, 3))
|
||||
return false;
|
||||
}
|
||||
if (sec->flags & SEC_READONLY)
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
|
||||
sreloc->_raw_size += sizeof (Elf64_External_Rela);
|
||||
|
|
@ -1247,7 +1275,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
|
|||
|
||||
default:
|
||||
(*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"),
|
||||
bfd_get_filename(abfd),
|
||||
bfd_archive_filename (abfd),
|
||||
ELF64_R_TYPE_ID (rel->r_info));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1269,7 +1297,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
asection **secp ATTRIBUTE_UNUSED;
|
||||
bfd_vma *valp ATTRIBUTE_UNUSED;
|
||||
{
|
||||
static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
|
||||
static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
|
||||
|
||||
if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER)
|
||||
{
|
||||
|
|
@ -1284,7 +1312,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
default:
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"),
|
||||
bfd_get_filename (abfd));
|
||||
bfd_archive_filename (abfd));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1303,11 +1331,12 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
if (p->name != NULL && strcmp (p->name, *namep))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("Register %%g%d used incompatibly: "
|
||||
"previously declared in %s to %s, in %s redefined to %s"),
|
||||
(int)sym->st_value,
|
||||
bfd_get_filename (p->abfd), *p->name ? p->name : "#scratch",
|
||||
bfd_get_filename (abfd), **namep ? *namep : "#scratch");
|
||||
(_("Register %%g%d used incompatibly: %s in %s"),
|
||||
(int) sym->st_value,
|
||||
**namep ? *namep : "#scratch", bfd_archive_filename (abfd));
|
||||
(*_bfd_error_handler)
|
||||
(_(" previously %s in %s"),
|
||||
*p->name ? p->name : "#scratch", bfd_archive_filename (p->abfd));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1324,11 +1353,14 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
{
|
||||
unsigned char type = h->type;
|
||||
|
||||
if (type > STT_FUNC) type = 0;
|
||||
if (type > STT_FUNC)
|
||||
type = 0;
|
||||
(*_bfd_error_handler)
|
||||
(_("Symbol `%s' has differing types: "
|
||||
"previously %s, REGISTER in %s"),
|
||||
*namep, stt_types [type], bfd_get_filename (abfd));
|
||||
(_("Symbol `%s' has differing types: %s in %s"),
|
||||
*namep, "REGISTER", bfd_archive_filename (abfd));
|
||||
(*_bfd_error_handler)
|
||||
(_(" previously %s in %s"),
|
||||
stt_types[type], bfd_archive_filename (p->abfd));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1370,12 +1402,14 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
|||
{
|
||||
unsigned char type = ELF_ST_TYPE (sym->st_info);
|
||||
|
||||
if (type > STT_FUNC) type = 0;
|
||||
if (type > STT_FUNC)
|
||||
type = 0;
|
||||
(*_bfd_error_handler)
|
||||
(_("Symbol `%s' has differing types: "
|
||||
"REGISTER in %s, %s in %s"),
|
||||
*namep, bfd_get_filename (p->abfd), stt_types [type],
|
||||
bfd_get_filename (abfd));
|
||||
(_("Symbol `%s' has differing types: %s in %s"),
|
||||
*namep, stt_types[type], bfd_archive_filename (abfd));
|
||||
(*_bfd_error_handler)
|
||||
(_(" previously %s in %s"),
|
||||
"REGISTER", bfd_archive_filename (p->abfd));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1653,7 +1687,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
{
|
||||
bfd *dynobj;
|
||||
asection *s;
|
||||
boolean reltext;
|
||||
boolean relplt;
|
||||
|
||||
dynobj = elf_hash_table (info)->dynobj;
|
||||
|
|
@ -1685,7 +1718,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
/* The check_relocs and adjust_dynamic_symbol entry points have
|
||||
determined the sizes of the various dynamic sections. Allocate
|
||||
memory for them. */
|
||||
reltext = false;
|
||||
relplt = false;
|
||||
for (s = dynobj->sections; s != NULL; s = s->next)
|
||||
{
|
||||
|
|
@ -1718,18 +1750,6 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
}
|
||||
else
|
||||
{
|
||||
const char *outname;
|
||||
asection *target;
|
||||
|
||||
/* If this relocation section applies to a read only
|
||||
section, then we probably need a DT_TEXTREL entry. */
|
||||
outname = bfd_get_section_name (output_bfd,
|
||||
s->output_section);
|
||||
target = bfd_get_section_by_name (output_bfd, outname + 5);
|
||||
if (target != NULL
|
||||
&& (target->flags & SEC_READONLY) != 0)
|
||||
reltext = true;
|
||||
|
||||
if (strcmp (name, ".rela.plt") == 0)
|
||||
relplt = true;
|
||||
|
||||
|
|
@ -1766,37 +1786,38 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
must add the entries now so that we get the correct size for
|
||||
the .dynamic section. The DT_DEBUG entry is filled in by the
|
||||
dynamic linker and used by the debugger. */
|
||||
#define add_dynamic_entry(TAG, VAL) \
|
||||
bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
|
||||
|
||||
int reg;
|
||||
struct sparc64_elf_app_reg * app_regs;
|
||||
struct bfd_strtab_hash *dynstr;
|
||||
struct elf_strtab_hash *dynstr;
|
||||
struct elf_link_hash_table *eht = elf_hash_table (info);
|
||||
|
||||
if (! info->shared)
|
||||
if (!info->shared)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0))
|
||||
if (!add_dynamic_entry (DT_DEBUG, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (relplt)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
|
||||
if (!add_dynamic_entry (DT_PLTGOT, 0)
|
||||
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
|
||||
|| !add_dynamic_entry (DT_PLTREL, DT_RELA)
|
||||
|| !add_dynamic_entry (DT_JMPREL, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT,
|
||||
sizeof (Elf64_External_Rela)))
|
||||
if (!add_dynamic_entry (DT_RELA, 0)
|
||||
|| !add_dynamic_entry (DT_RELASZ, 0)
|
||||
|| !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela)))
|
||||
return false;
|
||||
|
||||
if (reltext)
|
||||
if (info->flags & DF_TEXTREL)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
|
||||
if (!add_dynamic_entry (DT_TEXTREL, 0))
|
||||
return false;
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
|
||||
/* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER
|
||||
|
|
@ -1809,7 +1830,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
{
|
||||
struct elf_link_local_dynamic_entry *entry, *e;
|
||||
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_SPARC_REGISTER, 0))
|
||||
if (!add_dynamic_entry (DT_SPARC_REGISTER, 0))
|
||||
return false;
|
||||
|
||||
entry = (struct elf_link_local_dynamic_entry *)
|
||||
|
|
@ -1824,7 +1845,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
entry->isym.st_size = 0;
|
||||
if (*app_regs [reg].name != '\0')
|
||||
entry->isym.st_name
|
||||
= _bfd_stringtab_add (dynstr, app_regs[reg].name, true, false);
|
||||
= _bfd_elf_strtab_add (dynstr, app_regs[reg].name, false);
|
||||
else
|
||||
entry->isym.st_name = 0;
|
||||
entry->isym.st_other = 0;
|
||||
|
|
@ -1846,6 +1867,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
|
|||
eht->dynsymcount++;
|
||||
}
|
||||
}
|
||||
#undef add_dynamic_entry
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1914,6 +1936,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
asection *sec;
|
||||
bfd_vma relocation;
|
||||
bfd_reloc_status_type r;
|
||||
boolean is_plt = false;
|
||||
|
||||
r_type = ELF64_R_TYPE_ID (rel->r_info);
|
||||
if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
|
||||
|
|
@ -1952,9 +1975,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
sym = local_syms + r_symndx;
|
||||
sec = local_sections[r_symndx];
|
||||
relocation = (sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ sym->st_value);
|
||||
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2038,7 +2059,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (info->shared
|
||||
&& ((!info->symbolic && h->dynindx != -1)
|
||||
|| !(h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR)))
|
||||
& ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& ((input_section->flags & SEC_ALLOC) != 0
|
||||
/* DWARF will emit R_SPARC_{32,64} relocations in
|
||||
its sections against symbols defined externally
|
||||
in shared libraries. We can't do anything
|
||||
with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
|
||||
skip_it = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -2059,7 +2088,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else if (h->root.type == bfd_link_hash_undefweak)
|
||||
relocation = 0;
|
||||
else if (info->shared && !info->symbolic
|
||||
else if (info->shared
|
||||
&& (!info->symbolic || info->allow_shlib_undefined)
|
||||
&& !info->no_undefined
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
|
||||
relocation = 0;
|
||||
|
|
@ -2083,9 +2113,10 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
}
|
||||
|
||||
do_dynreloc:
|
||||
/* When generating a shared object, these relocations are copied
|
||||
into the output file to be resolved at run time. */
|
||||
if (info->shared && (input_section->flags & SEC_ALLOC))
|
||||
if (info->shared && r_symndx != 0 && (input_section->flags & SEC_ALLOC))
|
||||
{
|
||||
switch (r_type)
|
||||
{
|
||||
|
|
@ -2160,21 +2191,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
skip = false;
|
||||
|
||||
if (elf_section_data (input_section)->stab_info == NULL)
|
||||
outrel.r_offset = rel->r_offset;
|
||||
else
|
||||
{
|
||||
bfd_vma off;
|
||||
|
||||
off = (_bfd_stab_section_offset
|
||||
(output_bfd, &elf_hash_table (info)->stab_info,
|
||||
input_section,
|
||||
&elf_section_data (input_section)->stab_info,
|
||||
rel->r_offset));
|
||||
if (off == MINUS_ONE)
|
||||
skip = true;
|
||||
outrel.r_offset = off;
|
||||
}
|
||||
outrel.r_offset =
|
||||
_bfd_elf_section_offset (output_bfd, info, input_section,
|
||||
rel->r_offset);
|
||||
if (outrel.r_offset == (bfd_vma) -1)
|
||||
skip = true;
|
||||
|
||||
outrel.r_offset += (input_section->output_section->vma
|
||||
+ input_section->output_offset);
|
||||
|
|
@ -2207,7 +2228,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
memset (&outrel, 0, sizeof outrel);
|
||||
/* h->dynindx may be -1 if the symbol was marked to
|
||||
become local. */
|
||||
else if (h != NULL
|
||||
else if (h != NULL && ! is_plt
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|
|
@ -2231,7 +2252,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
long indx;
|
||||
|
||||
if (h == NULL)
|
||||
if (is_plt)
|
||||
sec = splt;
|
||||
else if (h == NULL)
|
||||
sec = local_sections[r_symndx];
|
||||
else
|
||||
{
|
||||
|
|
@ -2261,7 +2284,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
BFD_FAIL ();
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: probably compiled without -fPIC?"),
|
||||
bfd_get_filename (input_bfd));
|
||||
bfd_archive_filename (input_bfd));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2283,12 +2306,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
++sreloc->reloc_count;
|
||||
|
||||
/* This reloc will be computed at runtime, so there's no
|
||||
need to do anything now, unless this is a RELATIVE
|
||||
reloc in an unallocated section. */
|
||||
if (skip
|
||||
|| (input_section->flags & SEC_ALLOC) != 0
|
||||
|| ELF64_R_TYPE_ID (outrel.r_info) != R_SPARC_RELATIVE)
|
||||
continue;
|
||||
need to do anything now. */
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -2368,7 +2387,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
Note this is different behaviour to the
|
||||
32-bit linker, which both adds the contents
|
||||
and ignores the addend. So clear the location. */
|
||||
bfd_put_64 (output_bfd, 0, sgot->contents + off);
|
||||
bfd_put_64 (output_bfd, (bfd_vma) 0,
|
||||
sgot->contents + off);
|
||||
|
||||
/* We need to generate a R_SPARC_RELATIVE reloc
|
||||
for the dynamic linker. */
|
||||
|
|
@ -2424,6 +2444,12 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
+ sparc64_elf_plt_entry_offset (h->plt.offset));
|
||||
if (r_type == R_SPARC_WPLT30)
|
||||
goto do_wplt30;
|
||||
if (r_type == R_SPARC_PLT32 || r_type == R_SPARC_PLT64)
|
||||
{
|
||||
r_type = r_type == R_SPARC_PLT32 ? R_SPARC_32 : R_SPARC_64;
|
||||
is_plt = true;
|
||||
goto do_dynreloc;
|
||||
}
|
||||
goto do_default;
|
||||
|
||||
case R_SPARC_OLO10:
|
||||
|
|
@ -2434,7 +2460,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
relocation = (relocation & 0x3ff) + ELF64_R_TYPE_DATA (rel->r_info);
|
||||
|
||||
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
|
||||
x = (x & ~0x1fff) | (relocation & 0x1fff);
|
||||
x = (x & ~(bfd_vma) 0x1fff) | (relocation & 0x1fff);
|
||||
bfd_put_32 (input_bfd, x, contents + rel->r_offset);
|
||||
|
||||
r = bfd_check_overflow (howto->complain_on_overflow,
|
||||
|
|
@ -2455,8 +2481,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
relocation -= rel->r_offset;
|
||||
|
||||
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
|
||||
x = (x & ~0x303fff) | ((((relocation >> 2) & 0xc000) << 6)
|
||||
| ((relocation >> 2) & 0x3fff));
|
||||
x &= ~(bfd_vma) 0x303fff;
|
||||
x |= ((((relocation >> 2) & 0xc000) << 6)
|
||||
| ((relocation >> 2) & 0x3fff));
|
||||
bfd_put_32 (input_bfd, x, contents + rel->r_offset);
|
||||
|
||||
r = bfd_check_overflow (howto->complain_on_overflow,
|
||||
|
|
@ -2474,7 +2501,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
relocation = relocation ^ MINUS_ONE;
|
||||
|
||||
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
|
||||
x = (x & ~0x3fffff) | ((relocation >> 10) & 0x3fffff);
|
||||
x = (x & ~(bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff);
|
||||
bfd_put_32 (input_bfd, x, contents + rel->r_offset);
|
||||
|
||||
r = bfd_check_overflow (howto->complain_on_overflow,
|
||||
|
|
@ -2492,7 +2519,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
relocation = (relocation & 0x3ff) | 0x1c00;
|
||||
|
||||
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
|
||||
x = (x & ~0x1fff) | relocation;
|
||||
x = (x & ~(bfd_vma) 0x1fff) | relocation;
|
||||
bfd_put_32 (input_bfd, x, contents + rel->r_offset);
|
||||
|
||||
r = bfd_reloc_ok;
|
||||
|
|
@ -2581,7 +2608,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|| reg == G0 || reg == O7)
|
||||
break;
|
||||
|
||||
bfd_put_32 (input_bfd, INSN_NOP,
|
||||
bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP,
|
||||
contents + rel->r_offset + 4);
|
||||
}
|
||||
break;
|
||||
|
|
@ -2611,6 +2638,16 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
const char *name;
|
||||
|
||||
/* The Solaris native linker silently disregards
|
||||
overflows. We don't, but this breaks stabs debugging
|
||||
info, whose relocations are only 32-bits wide. Ignore
|
||||
overflows in this case. */
|
||||
if (r_type == R_SPARC_32
|
||||
&& (input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& strcmp (bfd_section_name (input_bfd, input_section),
|
||||
".stab") == 0)
|
||||
break;
|
||||
|
||||
if (h != NULL)
|
||||
{
|
||||
if (h->root.type == bfd_link_hash_undefweak
|
||||
|
|
@ -2686,7 +2723,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
}
|
||||
else
|
||||
{
|
||||
int max = splt->_raw_size / PLT_ENTRY_SIZE;
|
||||
bfd_vma max = splt->_raw_size / PLT_ENTRY_SIZE;
|
||||
rela.r_offset = sparc64_elf_plt_ptr_offset (h->plt.offset, max);
|
||||
rela.r_addend = -(sparc64_elf_plt_entry_offset (h->plt.offset) + 4)
|
||||
-(splt->output_section->vma + splt->output_offset);
|
||||
|
|
@ -2732,7 +2769,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
|
||||
rela.r_offset = (sgot->output_section->vma
|
||||
+ sgot->output_offset
|
||||
+ (h->got.offset &~ 1));
|
||||
+ (h->got.offset &~ (bfd_vma) 1));
|
||||
|
||||
/* If this is a -Bsymbolic link, and the symbol is defined
|
||||
locally, we just want to emit a RELATIVE reloc. Likewise if
|
||||
|
|
@ -2874,8 +2911,8 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
|
|||
/* Initialize the contents of the .plt section. */
|
||||
if (splt->_raw_size > 0)
|
||||
{
|
||||
sparc64_elf_build_plt(output_bfd, splt->contents,
|
||||
splt->_raw_size / PLT_ENTRY_SIZE);
|
||||
sparc64_elf_build_plt (output_bfd, splt->contents,
|
||||
(int) (splt->_raw_size / PLT_ENTRY_SIZE));
|
||||
}
|
||||
|
||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize =
|
||||
|
|
@ -2900,27 +2937,26 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
static enum elf_reloc_type_class
|
||||
sparc64_elf_reloc_type_class (rela)
|
||||
const Elf_Internal_Rela *rela;
|
||||
{
|
||||
switch ((int) ELF64_R_TYPE (rela->r_info))
|
||||
{
|
||||
case R_SPARC_RELATIVE:
|
||||
return reloc_class_relative;
|
||||
case R_SPARC_JMP_SLOT:
|
||||
return reloc_class_plt;
|
||||
case R_SPARC_COPY:
|
||||
return reloc_class_copy;
|
||||
default:
|
||||
return reloc_class_normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions for dealing with the e_flags field. */
|
||||
|
||||
/* Copy backend specific data from one object module to another */
|
||||
static boolean
|
||||
sparc64_elf_copy_private_bfd_data (ibfd, obfd)
|
||||
bfd *ibfd, *obfd;
|
||||
{
|
||||
if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|
||||
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
||||
return true;
|
||||
|
||||
BFD_ASSERT (!elf_flags_init (obfd)
|
||||
|| (elf_elfheader (obfd)->e_flags
|
||||
== elf_elfheader (ibfd)->e_flags));
|
||||
|
||||
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
|
||||
elf_flags_init (obfd) = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Merge backend specific data from an object file to the output
|
||||
object file when linking. */
|
||||
|
||||
|
|
@ -2976,7 +3012,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: linking UltraSPARC specific with HAL specific code"),
|
||||
bfd_get_filename (ibfd));
|
||||
bfd_archive_filename (ibfd));
|
||||
}
|
||||
/* Choose the most restrictive memory ordering. */
|
||||
old_mm = (old_flags & EF_SPARCV9_MM);
|
||||
|
|
@ -2995,7 +3031,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
|
|||
error = true;
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
|
||||
bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
|
||||
bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags);
|
||||
}
|
||||
|
||||
elf_elfheader (obfd)->e_flags = old_flags;
|
||||
|
|
@ -3029,8 +3065,8 @@ sparc64_elf_print_symbol_all (abfd, filep, symbol)
|
|||
fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "",
|
||||
((type & BSF_LOCAL)
|
||||
? (type & BSF_GLOBAL) ? '!' : 'l'
|
||||
: (type & BSF_GLOBAL) ? 'g' : ' '),
|
||||
(type & BSF_WEAK) ? 'w' : ' ');
|
||||
: (type & BSF_GLOBAL) ? 'g' : ' '),
|
||||
(type & BSF_WEAK) ? 'w' : ' ');
|
||||
if (symbol->name == NULL || symbol->name [0] == '\0')
|
||||
return "#scratch";
|
||||
else
|
||||
|
|
@ -3142,8 +3178,6 @@ const struct elf_size_info sparc64_elf_size_info =
|
|||
sparc64_elf_print_symbol_all
|
||||
#define elf_backend_output_arch_syms \
|
||||
sparc64_elf_output_arch_syms
|
||||
#define bfd_elf64_bfd_copy_private_bfd_data \
|
||||
sparc64_elf_copy_private_bfd_data
|
||||
#define bfd_elf64_bfd_merge_private_bfd_data \
|
||||
sparc64_elf_merge_private_bfd_data
|
||||
|
||||
|
|
@ -3151,6 +3185,8 @@ const struct elf_size_info sparc64_elf_size_info =
|
|||
sparc64_elf_size_info
|
||||
#define elf_backend_object_p \
|
||||
sparc64_elf_object_p
|
||||
#define elf_backend_reloc_type_class \
|
||||
sparc64_elf_reloc_type_class
|
||||
|
||||
#define elf_backend_want_got_plt 0
|
||||
#define elf_backend_plt_readonly 0
|
||||
|
|
|
|||
|
|
@ -79,7 +79,16 @@ static reloc_howto_type x86_64_elf_howto_table[] =
|
|||
HOWTO(R_X86_64_8, 0, 0, 8, false, 0, complain_overflow_signed,
|
||||
bfd_elf_generic_reloc, "R_X86_64_8", false, 0xff, 0xff, false),
|
||||
HOWTO(R_X86_64_PC8, 0, 0, 8, true, 0, complain_overflow_signed,
|
||||
bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true)
|
||||
bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true),
|
||||
|
||||
/* GNU extension to record C++ vtable hierarchy. */
|
||||
HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, false, 0, complain_overflow_dont,
|
||||
NULL, "R_X86_64_GNU_VTINHERIT", false, 0, 0, false),
|
||||
|
||||
/* GNU extension to record C++ vtable member usage. */
|
||||
HOWTO (R_X86_64_GNU_VTENTRY, 0, 4, 0, false, 0, complain_overflow_dont,
|
||||
_bfd_elf_rel_vtable_reloc_fn, "R_X86_64_GNU_VTENTRY", false, 0, 0,
|
||||
false)
|
||||
};
|
||||
|
||||
/* Map BFD relocs to the x86_64 elf relocs. */
|
||||
|
|
@ -89,7 +98,7 @@ struct elf_reloc_map
|
|||
unsigned char elf_reloc_val;
|
||||
};
|
||||
|
||||
static CONST struct elf_reloc_map x86_64_reloc_map[] =
|
||||
static const struct elf_reloc_map x86_64_reloc_map[] =
|
||||
{
|
||||
{ BFD_RELOC_NONE, R_X86_64_NONE, },
|
||||
{ BFD_RELOC_64, R_X86_64_64, },
|
||||
|
|
@ -107,6 +116,8 @@ static CONST struct elf_reloc_map x86_64_reloc_map[] =
|
|||
{ BFD_RELOC_16_PCREL, R_X86_64_PC16, },
|
||||
{ BFD_RELOC_8, R_X86_64_8, },
|
||||
{ BFD_RELOC_8_PCREL, R_X86_64_PC8, },
|
||||
{ BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, },
|
||||
{ BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, },
|
||||
};
|
||||
|
||||
static reloc_howto_type *elf64_x86_64_reloc_type_lookup
|
||||
|
|
@ -115,6 +126,17 @@ static void elf64_x86_64_info_to_howto
|
|||
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *));
|
||||
static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create
|
||||
PARAMS ((bfd *));
|
||||
static boolean elf64_x86_64_elf_object_p PARAMS ((bfd *abfd));
|
||||
static boolean elf64_x86_64_check_relocs
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *sec,
|
||||
const Elf_Internal_Rela *));
|
||||
static asection *elf64_x86_64_gc_mark_hook
|
||||
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
|
||||
struct elf_link_hash_entry *, Elf_Internal_Sym *));
|
||||
|
||||
static boolean elf64_x86_64_gc_sweep_hook
|
||||
PARAMS ((bfd *, struct bfd_link_info *, asection *,
|
||||
const Elf_Internal_Rela *));
|
||||
|
||||
static struct bfd_hash_entry *elf64_x86_64_link_hash_newfunc
|
||||
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
|
||||
|
|
@ -131,6 +153,8 @@ static boolean elf64_x86_64_finish_dynamic_symbol
|
|||
Elf_Internal_Sym *sym));
|
||||
static boolean elf64_x86_64_finish_dynamic_sections
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
static enum elf_reloc_type_class elf64_x86_64_reloc_type_class
|
||||
PARAMS ((const Elf_Internal_Rela *));
|
||||
|
||||
/* Given a BFD reloc type, return a HOWTO structure. */
|
||||
static reloc_howto_type *
|
||||
|
|
@ -143,8 +167,7 @@ elf64_x86_64_reloc_type_lookup (abfd, code)
|
|||
i++)
|
||||
{
|
||||
if (x86_64_reloc_map[i].bfd_reloc_val == code)
|
||||
return &x86_64_elf_howto_table[(int)
|
||||
x86_64_reloc_map[i].elf_reloc_val];
|
||||
return &x86_64_elf_howto_table[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -157,11 +180,20 @@ elf64_x86_64_info_to_howto (abfd, cache_ptr, dst)
|
|||
arelent *cache_ptr;
|
||||
Elf64_Internal_Rela *dst;
|
||||
{
|
||||
unsigned r_type;
|
||||
unsigned r_type, i;
|
||||
|
||||
r_type = ELF64_R_TYPE (dst->r_info);
|
||||
BFD_ASSERT (r_type < (unsigned int) R_X86_64_max);
|
||||
cache_ptr->howto = &x86_64_elf_howto_table[r_type];
|
||||
if (r_type < (unsigned int) R_X86_64_GNU_VTINHERIT)
|
||||
{
|
||||
BFD_ASSERT (r_type <= (unsigned int) R_X86_64_PC8);
|
||||
i = r_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
BFD_ASSERT (r_type < (unsigned int) R_X86_64_max);
|
||||
i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_PC8 - 1);
|
||||
}
|
||||
cache_ptr->howto = &x86_64_elf_howto_table[i];
|
||||
BFD_ASSERT (r_type == cache_ptr->howto->type);
|
||||
}
|
||||
|
||||
|
|
@ -295,9 +327,9 @@ elf64_x86_64_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct elf64_x86_64_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct elf64_x86_64_link_hash_table);
|
||||
|
||||
ret = ((struct elf64_x86_64_link_hash_table *)
|
||||
bfd_alloc (abfd, sizeof (struct elf64_x86_64_link_hash_table)));
|
||||
ret = ((struct elf64_x86_64_link_hash_table *) bfd_alloc (abfd, amt));
|
||||
if (ret == (struct elf64_x86_64_link_hash_table *) NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -311,7 +343,7 @@ elf64_x86_64_link_hash_table_create (abfd)
|
|||
return &ret->root.root;
|
||||
}
|
||||
|
||||
boolean
|
||||
static boolean
|
||||
elf64_x86_64_elf_object_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
|
|
@ -409,10 +441,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
|
||||
if (h != NULL)
|
||||
{
|
||||
if (h->got.refcount == -1)
|
||||
if (h->got.refcount == 0)
|
||||
{
|
||||
h->got.refcount = 1;
|
||||
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1)
|
||||
{
|
||||
|
|
@ -423,28 +453,25 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
sgot->_raw_size += GOT_ENTRY_SIZE;
|
||||
srelgot->_raw_size += sizeof (Elf64_External_Rela);
|
||||
}
|
||||
else
|
||||
h->got.refcount += 1;
|
||||
h->got.refcount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a global offset table entry for a local symbol. */
|
||||
if (local_got_refcounts == NULL)
|
||||
{
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
|
||||
size = symtab_hdr->sh_info * sizeof (bfd_signed_vma);
|
||||
size = symtab_hdr->sh_info;
|
||||
size *= sizeof (bfd_signed_vma);
|
||||
local_got_refcounts = ((bfd_signed_vma *)
|
||||
bfd_alloc (abfd, size));
|
||||
bfd_zalloc (abfd, size));
|
||||
if (local_got_refcounts == NULL)
|
||||
return false;
|
||||
elf_local_got_refcounts (abfd) = local_got_refcounts;
|
||||
memset (local_got_refcounts, -1, size);
|
||||
}
|
||||
if (local_got_refcounts[r_symndx] == -1)
|
||||
if (local_got_refcounts[r_symndx] == 0)
|
||||
{
|
||||
local_got_refcounts[r_symndx] = 1;
|
||||
|
||||
sgot->_raw_size += GOT_ENTRY_SIZE;
|
||||
if (info->shared)
|
||||
{
|
||||
|
|
@ -454,8 +481,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
srelgot->_raw_size += sizeof (Elf64_External_Rela);
|
||||
}
|
||||
}
|
||||
else
|
||||
local_got_refcounts[r_symndx] += 1;
|
||||
local_got_refcounts[r_symndx] += 1;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -473,10 +499,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
if (h->plt.refcount == -1)
|
||||
h->plt.refcount = 1;
|
||||
else
|
||||
h->plt.refcount += 1;
|
||||
h->plt.refcount += 1;
|
||||
break;
|
||||
|
||||
case R_X86_64_8:
|
||||
|
|
@ -545,6 +568,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
|| ! bfd_set_section_alignment (dynobj, sreloc, 3))
|
||||
return false;
|
||||
}
|
||||
if (sec->flags & SEC_READONLY)
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
|
||||
sreloc->_raw_size += sizeof (Elf64_External_Rela);
|
||||
|
|
@ -572,7 +597,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
if (p == NULL)
|
||||
{
|
||||
p = ((struct elf64_x86_64_pcrel_relocs_copied *)
|
||||
bfd_alloc (dynobj, sizeof *p));
|
||||
bfd_alloc (dynobj, (bfd_size_type) sizeof *p));
|
||||
if (p == NULL)
|
||||
return false;
|
||||
p->next = eh->pcrel_relocs_copied;
|
||||
|
|
@ -585,6 +610,20 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* This relocation describes the C++ object vtable hierarchy.
|
||||
Reconstruct it for later use during GC. */
|
||||
case R_X86_64_GNU_VTINHERIT:
|
||||
if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
|
||||
return false;
|
||||
break;
|
||||
|
||||
/* This relocation describes which C++ vtable entries are actually
|
||||
used. Record for later use during GC. */
|
||||
case R_X86_64_GNU_VTENTRY:
|
||||
if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -604,28 +643,30 @@ elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym)
|
|||
{
|
||||
if (h != NULL)
|
||||
{
|
||||
switch (h->root.type)
|
||||
switch (ELF64_R_TYPE (rel->r_info))
|
||||
{
|
||||
case bfd_link_hash_defined:
|
||||
case bfd_link_hash_defweak:
|
||||
return h->root.u.def.section;
|
||||
|
||||
case bfd_link_hash_common:
|
||||
return h->root.u.c.p->section;
|
||||
case R_X86_64_GNU_VTINHERIT:
|
||||
case R_X86_64_GNU_VTENTRY:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
switch (h->root.type)
|
||||
{
|
||||
case bfd_link_hash_defined:
|
||||
case bfd_link_hash_defweak:
|
||||
return h->root.u.def.section;
|
||||
|
||||
case bfd_link_hash_common:
|
||||
return h->root.u.c.p->section;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(elf_bad_symtab (abfd)
|
||||
&& ELF_ST_BIND (sym->st_info) != STB_LOCAL)
|
||||
&& ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
|
||||
&& sym->st_shndx != SHN_COMMON))
|
||||
{
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
return bfd_section_from_elf_index (abfd, sym->st_shndx);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
@ -807,6 +848,8 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
|
|||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
|
||||
/* If this is a weak symbol, and there is a real definition, the
|
||||
processor independent code will have arranged for us to see the
|
||||
|
|
@ -893,14 +936,13 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
|
|||
|
||||
static boolean
|
||||
elf64_x86_64_size_dynamic_sections (output_bfd, info)
|
||||
bfd *output_bfd;
|
||||
bfd *output_bfd ATTRIBUTE_UNUSED;
|
||||
struct bfd_link_info *info;
|
||||
{
|
||||
bfd *dynobj;
|
||||
asection *s;
|
||||
boolean plt;
|
||||
boolean relocs;
|
||||
boolean reltext;
|
||||
|
||||
dynobj = elf_hash_table (info)->dynobj;
|
||||
BFD_ASSERT (dynobj != NULL);
|
||||
|
|
@ -940,7 +982,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info)
|
|||
/* The check_relocs and adjust_dynamic_symbol entry points have
|
||||
determined the sizes of the various dynamic sections. Allocate
|
||||
memory for them. */
|
||||
plt = relocs = reltext = false;
|
||||
plt = relocs = false;
|
||||
for (s = dynobj->sections; s != NULL; s = s->next)
|
||||
{
|
||||
const char *name;
|
||||
|
|
@ -985,29 +1027,8 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info)
|
|||
}
|
||||
else
|
||||
{
|
||||
asection *target;
|
||||
|
||||
/* Remember whether there are any reloc sections other
|
||||
than .rela.plt. */
|
||||
if (strcmp (name, ".rela.plt") != 0)
|
||||
{
|
||||
const char *outname;
|
||||
|
||||
relocs = true;
|
||||
|
||||
/* If this relocation section applies to a read only
|
||||
section, then we probably need a DT_TEXTREL
|
||||
entry. The entries in the .rela.plt section
|
||||
really apply to the .got section, which we
|
||||
created ourselves and so know is not readonly. */
|
||||
outname = bfd_get_section_name (output_bfd,
|
||||
s->output_section);
|
||||
target = bfd_get_section_by_name (output_bfd, outname + 5);
|
||||
if (target != NULL
|
||||
&& (target->flags & SEC_READONLY) != 0
|
||||
&& (target->flags & SEC_ALLOC) != 0)
|
||||
reltext = true;
|
||||
}
|
||||
relocs = true;
|
||||
|
||||
/* We use the reloc_count field as a counter if we need
|
||||
to copy relocs into the output file. */
|
||||
|
|
@ -1043,37 +1064,39 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info)
|
|||
must add the entries now so that we get the correct size for
|
||||
the .dynamic section. The DT_DEBUG entry is filled in by the
|
||||
dynamic linker and used by the debugger. */
|
||||
#define add_dynamic_entry(TAG, VAL) \
|
||||
bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
|
||||
|
||||
if (! info->shared)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0))
|
||||
if (!add_dynamic_entry (DT_DEBUG, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plt)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
|
||||
if (!add_dynamic_entry (DT_PLTGOT, 0)
|
||||
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
|
||||
|| !add_dynamic_entry (DT_PLTREL, DT_RELA)
|
||||
|| !add_dynamic_entry (DT_JMPREL, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (relocs)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0)
|
||||
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT,
|
||||
sizeof (Elf64_External_Rela)))
|
||||
if (!add_dynamic_entry (DT_RELA, 0)
|
||||
|| !add_dynamic_entry (DT_RELASZ, 0)
|
||||
|| !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela)))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (reltext)
|
||||
if ((info->flags & DF_TEXTREL) != 0)
|
||||
{
|
||||
if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
|
||||
if (!add_dynamic_entry (DT_TEXTREL, 0))
|
||||
return false;
|
||||
info->flags |= DF_TEXTREL;
|
||||
}
|
||||
}
|
||||
#undef add_dynamic_entry
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1160,6 +1183,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
unsigned int indx;
|
||||
|
||||
r_type = ELF64_R_TYPE (rela->r_info);
|
||||
if (r_type == (int) R_X86_64_GNU_VTINHERIT
|
||||
|| r_type == (int) R_X86_64_GNU_VTENTRY)
|
||||
continue;
|
||||
|
||||
if ((indx = (unsigned) r_type) >= R_X86_64_max)
|
||||
{
|
||||
|
|
@ -1197,9 +1223,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
sym = local_syms + r_symndx;
|
||||
sec = local_sections[r_symndx];
|
||||
relocation = (sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ sym->st_value);
|
||||
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rela);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1249,7 +1273,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
|
||||
bfd_get_filename (input_bfd), h->root.root.string,
|
||||
bfd_archive_filename (input_bfd), h->root.root.string,
|
||||
bfd_get_section_name (input_bfd, input_section));
|
||||
relocation = 0;
|
||||
}
|
||||
|
|
@ -1260,7 +1284,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else if (h->root.type == bfd_link_hash_undefweak)
|
||||
relocation = 0;
|
||||
else if (info->shared && !info->symbolic && !info->no_undefined
|
||||
else if (info->shared
|
||||
&& (!info->symbolic || info->allow_shlib_undefined)
|
||||
&& !info->no_undefined
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
|
||||
relocation = 0;
|
||||
else
|
||||
|
|
@ -1408,7 +1434,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
case R_X86_64_64:
|
||||
/* FIXME: The ABI says the linker should make sure the value is
|
||||
the same when it's zeroextended to 64 bit. */
|
||||
if (info->shared && (input_section->flags & SEC_ALLOC) != 0)
|
||||
if (info->shared
|
||||
&& r_symndx != 0
|
||||
&& (input_section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
boolean skip, relocate;
|
||||
|
|
@ -1439,21 +1467,11 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
|
||||
skip = false;
|
||||
|
||||
if (elf_section_data (input_section)->stab_info == NULL)
|
||||
outrel.r_offset = rela->r_offset;
|
||||
else
|
||||
{
|
||||
bfd_vma off;
|
||||
|
||||
off = (_bfd_stab_section_offset
|
||||
(output_bfd, &elf_hash_table (info)->stab_info,
|
||||
input_section,
|
||||
&elf_section_data (input_section)->stab_info,
|
||||
rela->r_offset));
|
||||
if (off == (bfd_vma) -1)
|
||||
skip = true;
|
||||
outrel.r_offset = off;
|
||||
}
|
||||
outrel.r_offset =
|
||||
_bfd_elf_section_offset (output_bfd, info, input_section,
|
||||
rela->r_offset);
|
||||
if (outrel.r_offset == (bfd_vma) -1)
|
||||
skip = true;
|
||||
|
||||
outrel.r_offset += (input_section->output_section->vma
|
||||
+ input_section->output_offset);
|
||||
|
|
@ -1485,7 +1503,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
}
|
||||
else
|
||||
{
|
||||
long indx;
|
||||
long sindx;
|
||||
|
||||
if (h == NULL)
|
||||
sec = local_sections[r_symndx];
|
||||
|
|
@ -1497,7 +1515,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
sec = h->root.u.def.section;
|
||||
}
|
||||
if (sec != NULL && bfd_is_abs_section (sec))
|
||||
indx = 0;
|
||||
sindx = 0;
|
||||
else if (sec == NULL || sec->owner == NULL)
|
||||
{
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
|
|
@ -1508,12 +1526,12 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
asection *osec;
|
||||
|
||||
osec = sec->output_section;
|
||||
indx = elf_section_data (osec)->dynindx;
|
||||
BFD_ASSERT (indx > 0);
|
||||
sindx = elf_section_data (osec)->dynindx;
|
||||
BFD_ASSERT (sindx > 0);
|
||||
}
|
||||
|
||||
relocate = false;
|
||||
outrel.r_info = ELF64_R_INFO (indx, r_type);
|
||||
outrel.r_info = ELF64_R_INFO (sindx, r_type);
|
||||
outrel.r_addend = relocation + rela->r_addend;
|
||||
}
|
||||
|
||||
|
|
@ -1694,7 +1712,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
|
|||
|
||||
rela.r_offset = (sgot->output_section->vma
|
||||
+ sgot->output_offset
|
||||
+ (h->got.offset &~ 1));
|
||||
+ (h->got.offset &~ (bfd_vma) 1));
|
||||
|
||||
/* If this is a static link, or it is a -Bsymbolic link and the
|
||||
symbol is defined locally or was forced to be local because
|
||||
|
|
@ -1893,6 +1911,22 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info)
|
|||
return true;
|
||||
}
|
||||
|
||||
static enum elf_reloc_type_class
|
||||
elf64_x86_64_reloc_type_class (rela)
|
||||
const Elf_Internal_Rela *rela;
|
||||
{
|
||||
switch ((int) ELF64_R_TYPE (rela->r_info))
|
||||
{
|
||||
case R_X86_64_RELATIVE:
|
||||
return reloc_class_relative;
|
||||
case R_X86_64_JUMP_SLOT:
|
||||
return reloc_class_plt;
|
||||
case R_X86_64_COPY:
|
||||
return reloc_class_copy;
|
||||
default:
|
||||
return reloc_class_normal;
|
||||
}
|
||||
}
|
||||
|
||||
#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec
|
||||
#define TARGET_LITTLE_NAME "elf64-x86-64"
|
||||
|
|
@ -1901,6 +1935,7 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info)
|
|||
#define ELF_MAXPAGESIZE 0x100000
|
||||
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_can_refcount 1
|
||||
#define elf_backend_want_got_plt 1
|
||||
#define elf_backend_plt_readonly 1
|
||||
#define elf_backend_want_plt_sym 0
|
||||
|
|
@ -1925,5 +1960,6 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info)
|
|||
#define elf_backend_relocate_section elf64_x86_64_relocate_section
|
||||
#define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections
|
||||
#define elf_backend_object_p elf64_x86_64_elf_object_p
|
||||
#define elf_backend_reloc_type_class elf64_x86_64_reloc_type_class
|
||||
|
||||
#include "elf64-target.h"
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@
|
|||
|
||||
static reloc_howto_type * elf32_arm_reloc_type_lookup
|
||||
PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
|
||||
static boolean elf32_arm_nabi_grok_prstatus
|
||||
PARAMS ((bfd *abfd, Elf_Internal_Note *note));
|
||||
static boolean elf32_arm_nabi_grok_psinfo
|
||||
PARAMS ((bfd *abfd, Elf_Internal_Note *note));
|
||||
|
||||
/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
|
||||
R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
|
||||
|
|
@ -578,6 +582,9 @@ static reloc_howto_type elf32_arm_thm_pc9_howto =
|
|||
0x000000ff, /* dst_mask */
|
||||
true); /* pcrel_offset */
|
||||
|
||||
static void elf32_arm_info_to_howto
|
||||
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
|
||||
|
||||
static void
|
||||
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
|
||||
bfd * abfd ATTRIBUTE_UNUSED;
|
||||
|
|
@ -622,27 +629,27 @@ struct elf32_arm_reloc_map
|
|||
};
|
||||
|
||||
static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
|
||||
{
|
||||
{BFD_RELOC_NONE, R_ARM_NONE},
|
||||
{BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24},
|
||||
{BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25},
|
||||
{BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22},
|
||||
{BFD_RELOC_32, R_ARM_ABS32},
|
||||
{BFD_RELOC_32_PCREL, R_ARM_REL32},
|
||||
{BFD_RELOC_8, R_ARM_ABS8},
|
||||
{BFD_RELOC_16, R_ARM_ABS16},
|
||||
{BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12},
|
||||
{BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5},
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22},
|
||||
{BFD_RELOC_ARM_COPY, R_ARM_COPY},
|
||||
{BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT},
|
||||
{BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT},
|
||||
{BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE},
|
||||
{BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF},
|
||||
{BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
|
||||
{BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
|
||||
{BFD_RELOC_ARM_PLT32, R_ARM_PLT32}
|
||||
};
|
||||
{
|
||||
{BFD_RELOC_NONE, R_ARM_NONE},
|
||||
{BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24},
|
||||
{BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25},
|
||||
{BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22},
|
||||
{BFD_RELOC_32, R_ARM_ABS32},
|
||||
{BFD_RELOC_32_PCREL, R_ARM_REL32},
|
||||
{BFD_RELOC_8, R_ARM_ABS8},
|
||||
{BFD_RELOC_16, R_ARM_ABS16},
|
||||
{BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12},
|
||||
{BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5},
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22},
|
||||
{BFD_RELOC_ARM_COPY, R_ARM_COPY},
|
||||
{BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT},
|
||||
{BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT},
|
||||
{BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE},
|
||||
{BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF},
|
||||
{BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
|
||||
{BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
|
||||
{BFD_RELOC_ARM_PLT32, R_ARM_PLT32}
|
||||
};
|
||||
|
||||
static reloc_howto_type *
|
||||
elf32_arm_reloc_type_lookup (abfd, code)
|
||||
|
|
@ -674,4 +681,72 @@ elf32_arm_reloc_type_lookup (abfd, code)
|
|||
}
|
||||
}
|
||||
|
||||
/* Support for core dump NOTE sections */
|
||||
static boolean
|
||||
elf32_arm_nabi_grok_prstatus (abfd, note)
|
||||
bfd *abfd;
|
||||
Elf_Internal_Note *note;
|
||||
{
|
||||
int offset;
|
||||
size_t raw_size;
|
||||
|
||||
switch (note->descsz)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
|
||||
case 148: /* Linux/ARM 32-bit*/
|
||||
/* pr_cursig */
|
||||
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
|
||||
|
||||
/* pr_pid */
|
||||
elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
|
||||
|
||||
/* pr_reg */
|
||||
offset = 72;
|
||||
raw_size = 72;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make a ".reg/999" section. */
|
||||
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
|
||||
raw_size, note->descpos + offset);
|
||||
}
|
||||
|
||||
static boolean
|
||||
elf32_arm_nabi_grok_psinfo (abfd, note)
|
||||
bfd *abfd;
|
||||
Elf_Internal_Note *note;
|
||||
{
|
||||
switch (note->descsz)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
|
||||
case 124: /* Linux/ARM elf_prpsinfo */
|
||||
elf_tdata (abfd)->core_program
|
||||
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
|
||||
elf_tdata (abfd)->core_command
|
||||
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
|
||||
}
|
||||
|
||||
/* Note that for some reason, a spurious space is tacked
|
||||
onto the end of the args in some (at least one anyway)
|
||||
implementations, so strip it off if it exists. */
|
||||
|
||||
{
|
||||
char *command = elf_tdata (abfd)->core_command;
|
||||
int n = strlen (command);
|
||||
|
||||
if (0 < n && command[n - 1] == ' ')
|
||||
command[n - 1] = '\0';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus
|
||||
#define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo
|
||||
|
||||
#include "elf32-arm.h"
|
||||
|
|
|
|||
|
|
@ -42,305 +42,310 @@
|
|||
#define ARM_ELF_ABI_VERSION 0
|
||||
#define ARM_ELF_OS_ABI_VERSION 0
|
||||
|
||||
static reloc_howto_type * find_howto PARAMS ((unsigned int));
|
||||
static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
|
||||
static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
|
||||
static reloc_howto_type elf32_arm_howto_table[] =
|
||||
{
|
||||
/* No relocation */
|
||||
HOWTO (R_ARM_NONE, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_NONE", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
{
|
||||
/* No relocation. */
|
||||
HOWTO (R_ARM_NONE, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_NONE", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_PC24, /* type */
|
||||
2, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
24, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_PC24", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x00ffffff, /* src_mask */
|
||||
0x00ffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
HOWTO (R_ARM_PC24, /* type */
|
||||
2, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
24, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_PC24", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x00ffffff, /* src_mask */
|
||||
0x00ffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* 32 bit absolute */
|
||||
HOWTO (R_ARM_ABS32, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
32, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0xffffffff, /* src_mask */
|
||||
0xffffffff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* 32 bit absolute. */
|
||||
HOWTO (R_ARM_ABS32, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
32, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0xffffffff, /* src_mask */
|
||||
0xffffffff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
/* standard 32bit pc-relative reloc */
|
||||
HOWTO (R_ARM_REL32, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
32, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_REL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0xffffffff, /* src_mask */
|
||||
0xffffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
/* Standard 32bit pc-relative reloc. */
|
||||
HOWTO (R_ARM_REL32, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
32, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_REL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0xffffffff, /* src_mask */
|
||||
0xffffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* 8 bit absolute */
|
||||
HOWTO (R_ARM_ABS8, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS8", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* 8 bit absolute. */
|
||||
HOWTO (R_ARM_ABS8, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS8", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
/* 16 bit absolute */
|
||||
HOWTO (R_ARM_ABS16, /* type */
|
||||
0, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
16, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS16", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* 16 bit absolute. */
|
||||
HOWTO (R_ARM_ABS16, /* type */
|
||||
0, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
16, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS16", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
/* 12 bit absolute */
|
||||
HOWTO (R_ARM_ABS12, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
12, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS12", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000008ff, /* src_mask */
|
||||
0x000008ff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* 12 bit absolute. */
|
||||
HOWTO (R_ARM_ABS12, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
12, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_ABS12", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000008ff, /* src_mask */
|
||||
0x000008ff, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_THM_ABS5, /* type */
|
||||
6, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
5, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_ABS5", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000007e0, /* src_mask */
|
||||
0x000007e0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
HOWTO (R_ARM_THM_ABS5, /* type */
|
||||
6, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
5, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_ABS5", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000007e0, /* src_mask */
|
||||
0x000007e0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_THM_PC22, /* type */
|
||||
1, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
23, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC22", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x07ff07ff, /* src_mask */
|
||||
0x07ff07ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
HOWTO (R_ARM_THM_PC22, /* type */
|
||||
1, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
23, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC22", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x07ff07ff, /* src_mask */
|
||||
0x07ff07ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_SBREL32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont,/* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_SBREL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
HOWTO (R_ARM_SBREL32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont,/* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_SBREL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_AMP_VCALL9, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_AMP_VCALL9", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
HOWTO (R_ARM_AMP_VCALL9, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_AMP_VCALL9", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* 12 bit pc relative */
|
||||
HOWTO (R_ARM_THM_PC11, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
11, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC11", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000007ff, /* src_mask */
|
||||
0x000007ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
/* 12 bit pc relative. */
|
||||
HOWTO (R_ARM_THM_PC11, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
11, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC11", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000007ff, /* src_mask */
|
||||
0x000007ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* 12 bit pc relative */
|
||||
HOWTO (R_ARM_THM_PC9, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC9", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
/* 12 bit pc relative. */
|
||||
HOWTO (R_ARM_THM_PC9, /* type */
|
||||
1, /* rightshift */
|
||||
1, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
8, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_signed, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_THM_PC9", /* name */
|
||||
false, /* partial_inplace */
|
||||
0x000000ff, /* src_mask */
|
||||
0x000000ff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* GNU extension to record C++ vtable hierarchy */
|
||||
HOWTO (R_ARM_GNU_VTINHERIT, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
NULL, /* special_function */
|
||||
"R_ARM_GNU_VTINHERIT", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* GNU extension to record C++ vtable hierarchy. */
|
||||
HOWTO (R_ARM_GNU_VTINHERIT, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
NULL, /* special_function */
|
||||
"R_ARM_GNU_VTINHERIT", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
/* GNU extension to record C++ vtable member usage */
|
||||
HOWTO (R_ARM_GNU_VTENTRY, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
_bfd_elf_rel_vtable_reloc_fn, /* special_function */
|
||||
"R_ARM_GNU_VTENTRY", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
/* GNU extension to record C++ vtable member usage. */
|
||||
HOWTO (R_ARM_GNU_VTENTRY, /* type */
|
||||
0, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
_bfd_elf_rel_vtable_reloc_fn, /* special_function */
|
||||
"R_ARM_GNU_VTENTRY", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
/* XXX - gap in index numbering here. */
|
||||
/* XXX - gap in index numbering here. */
|
||||
|
||||
HOWTO (R_ARM_PLT32, /* type */
|
||||
2, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
26, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield,/* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_PLT32", /* name */
|
||||
true, /* partial_inplace */
|
||||
0x00ffffff, /* src_mask */
|
||||
0x00ffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
HOWTO (R_ARM_PLT32, /* type */
|
||||
2, /* rightshift */
|
||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
26, /* bitsize */
|
||||
true, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_bitfield,/* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_PLT32", /* name */
|
||||
true, /* partial_inplace */
|
||||
0x00ffffff, /* src_mask */
|
||||
0x00ffffff, /* dst_mask */
|
||||
true), /* pcrel_offset */
|
||||
|
||||
/* XXX - gap in index numbering here. */
|
||||
/* XXX - gap in index numbering here. */
|
||||
|
||||
HOWTO (R_ARM_RREL32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RREL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
HOWTO (R_ARM_RREL32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RREL32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_RABS32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RABS32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
HOWTO (R_ARM_RABS32, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RABS32", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_RPC24, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RPC24", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
HOWTO (R_ARM_RPC24, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RPC24", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false), /* pcrel_offset */
|
||||
|
||||
HOWTO (R_ARM_RBASE, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RBASE", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false) /* pcrel_offset */
|
||||
};
|
||||
HOWTO (R_ARM_RBASE, /* type */
|
||||
0, /* rightshift */
|
||||
0, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
0, /* bitsize */
|
||||
false, /* pc_relative */
|
||||
0, /* bitpos */
|
||||
complain_overflow_dont, /* complain_on_overflow */
|
||||
bfd_elf_generic_reloc, /* special_function */
|
||||
"R_ARM_RBASE", /* name */
|
||||
false, /* partial_inplace */
|
||||
0, /* src_mask */
|
||||
0, /* dst_mask */
|
||||
false) /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Locate a reloc in the howto table. This function must be used
|
||||
when the entry number is is > R_ARM_GNU_VTINHERIT. */
|
||||
|
||||
static reloc_howto_type *
|
||||
find_howto (r_type)
|
||||
unsigned int r_type;
|
||||
|
|
@ -377,23 +382,23 @@ struct elf32_arm_reloc_map
|
|||
};
|
||||
|
||||
static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
|
||||
{
|
||||
{BFD_RELOC_NONE, R_ARM_NONE },
|
||||
{BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 },
|
||||
{BFD_RELOC_32, R_ARM_ABS32 },
|
||||
{BFD_RELOC_32_PCREL, R_ARM_REL32 },
|
||||
{BFD_RELOC_8, R_ARM_ABS8 },
|
||||
{BFD_RELOC_16, R_ARM_ABS16 },
|
||||
{BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 },
|
||||
{BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 },
|
||||
{BFD_RELOC_NONE, R_ARM_SBREL32 },
|
||||
{BFD_RELOC_NONE, R_ARM_AMP_VCALL9 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 },
|
||||
{BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
|
||||
{BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY }
|
||||
};
|
||||
{
|
||||
{BFD_RELOC_NONE, R_ARM_NONE },
|
||||
{BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 },
|
||||
{BFD_RELOC_32, R_ARM_ABS32 },
|
||||
{BFD_RELOC_32_PCREL, R_ARM_REL32 },
|
||||
{BFD_RELOC_8, R_ARM_ABS8 },
|
||||
{BFD_RELOC_16, R_ARM_ABS16 },
|
||||
{BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 },
|
||||
{BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 },
|
||||
{BFD_RELOC_NONE, R_ARM_SBREL32 },
|
||||
{BFD_RELOC_NONE, R_ARM_AMP_VCALL9 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 },
|
||||
{BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 },
|
||||
{BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
|
||||
{BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY }
|
||||
};
|
||||
|
||||
static reloc_howto_type *
|
||||
elf32_arm_reloc_type_lookup (abfd, code)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "libiberty.h"
|
||||
#include "bfdlink.h"
|
||||
#include "libbfd.h"
|
||||
#include "elf-bfd.h"
|
||||
|
|
@ -122,6 +123,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table)
|
||||
#define elf_link_create_dynamic_sections \
|
||||
NAME(bfd_elf,link_create_dynamic_sections)
|
||||
#define elf_bfd_discard_info NAME(bfd_elf,discard_info)
|
||||
#define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p)
|
||||
#define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
|
||||
#define elf_bfd_final_link NAME(bfd_elf,bfd_final_link)
|
||||
#define elf_create_pointer_linker_section NAME(bfd_elf,create_pointer_linker_section)
|
||||
|
|
@ -184,56 +187,73 @@ static char *elf_symbol_flags PARAMS ((flagword));
|
|||
/* Should perhaps use put_offset, put_word, etc. For now, the two versions
|
||||
can be handled by explicitly specifying 32 bits or "the long type". */
|
||||
#if ARCH_SIZE == 64
|
||||
#define put_word bfd_h_put_64
|
||||
#define put_signed_word bfd_h_put_signed_64
|
||||
#define get_word bfd_h_get_64
|
||||
#define get_signed_word bfd_h_get_signed_64
|
||||
#define H_PUT_WORD H_PUT_64
|
||||
#define H_PUT_SIGNED_WORD H_PUT_S64
|
||||
#define H_GET_WORD H_GET_64
|
||||
#define H_GET_SIGNED_WORD H_GET_S64
|
||||
#endif
|
||||
#if ARCH_SIZE == 32
|
||||
#define put_word bfd_h_put_32
|
||||
#define put_signed_word bfd_h_put_signed_32
|
||||
#define get_word bfd_h_get_32
|
||||
#define get_signed_word bfd_h_get_signed_32
|
||||
#define H_PUT_WORD H_PUT_32
|
||||
#define H_PUT_SIGNED_WORD H_PUT_S32
|
||||
#define H_GET_WORD H_GET_32
|
||||
#define H_GET_SIGNED_WORD H_GET_S32
|
||||
#endif
|
||||
|
||||
/* Translate an ELF symbol in external format into an ELF symbol in internal
|
||||
format. */
|
||||
|
||||
void
|
||||
elf_swap_symbol_in (abfd, src, dst)
|
||||
elf_swap_symbol_in (abfd, src, shndx, dst)
|
||||
bfd *abfd;
|
||||
const Elf_External_Sym *src;
|
||||
const Elf_External_Sym_Shndx *shndx;
|
||||
Elf_Internal_Sym *dst;
|
||||
{
|
||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||
|
||||
dst->st_name = bfd_h_get_32 (abfd, (bfd_byte *) src->st_name);
|
||||
dst->st_name = H_GET_32 (abfd, src->st_name);
|
||||
if (signed_vma)
|
||||
dst->st_value = get_signed_word (abfd, (bfd_byte *) src->st_value);
|
||||
dst->st_value = H_GET_SIGNED_WORD (abfd, src->st_value);
|
||||
else
|
||||
dst->st_value = get_word (abfd, (bfd_byte *) src->st_value);
|
||||
dst->st_size = get_word (abfd, (bfd_byte *) src->st_size);
|
||||
dst->st_info = bfd_h_get_8 (abfd, (bfd_byte *) src->st_info);
|
||||
dst->st_other = bfd_h_get_8 (abfd, (bfd_byte *) src->st_other);
|
||||
dst->st_shndx = bfd_h_get_16 (abfd, (bfd_byte *) src->st_shndx);
|
||||
dst->st_value = H_GET_WORD (abfd, src->st_value);
|
||||
dst->st_size = H_GET_WORD (abfd, src->st_size);
|
||||
dst->st_info = H_GET_8 (abfd, src->st_info);
|
||||
dst->st_other = H_GET_8 (abfd, src->st_other);
|
||||
dst->st_shndx = H_GET_16 (abfd, src->st_shndx);
|
||||
if (dst->st_shndx == SHN_XINDEX)
|
||||
{
|
||||
if (shndx == NULL)
|
||||
abort ();
|
||||
dst->st_shndx = H_GET_32 (abfd, shndx->est_shndx);
|
||||
}
|
||||
}
|
||||
|
||||
/* Translate an ELF symbol in internal format into an ELF symbol in external
|
||||
format. */
|
||||
|
||||
void
|
||||
elf_swap_symbol_out (abfd, src, cdst)
|
||||
elf_swap_symbol_out (abfd, src, cdst, shndx)
|
||||
bfd *abfd;
|
||||
const Elf_Internal_Sym *src;
|
||||
PTR cdst;
|
||||
PTR shndx;
|
||||
{
|
||||
unsigned int tmp;
|
||||
Elf_External_Sym *dst = (Elf_External_Sym *) cdst;
|
||||
bfd_h_put_32 (abfd, src->st_name, dst->st_name);
|
||||
put_word (abfd, src->st_value, dst->st_value);
|
||||
put_word (abfd, src->st_size, dst->st_size);
|
||||
bfd_h_put_8 (abfd, src->st_info, dst->st_info);
|
||||
bfd_h_put_8 (abfd, src->st_other, dst->st_other);
|
||||
bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx);
|
||||
H_PUT_32 (abfd, src->st_name, dst->st_name);
|
||||
H_PUT_WORD (abfd, src->st_value, dst->st_value);
|
||||
H_PUT_WORD (abfd, src->st_size, dst->st_size);
|
||||
H_PUT_8 (abfd, src->st_info, dst->st_info);
|
||||
H_PUT_8 (abfd, src->st_other, dst->st_other);
|
||||
tmp = src->st_shndx;
|
||||
if (tmp > SHN_HIRESERVE)
|
||||
{
|
||||
if (shndx == NULL)
|
||||
abort ();
|
||||
H_PUT_32 (abfd, tmp, shndx);
|
||||
tmp = SHN_XINDEX;
|
||||
}
|
||||
H_PUT_16 (abfd, tmp, dst->st_shndx);
|
||||
}
|
||||
|
||||
/* Translate an ELF file header in external format into an ELF file header in
|
||||
|
|
@ -247,22 +267,22 @@ elf_swap_ehdr_in (abfd, src, dst)
|
|||
{
|
||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||
memcpy (dst->e_ident, src->e_ident, EI_NIDENT);
|
||||
dst->e_type = bfd_h_get_16 (abfd, (bfd_byte *) src->e_type);
|
||||
dst->e_machine = bfd_h_get_16 (abfd, (bfd_byte *) src->e_machine);
|
||||
dst->e_version = bfd_h_get_32 (abfd, (bfd_byte *) src->e_version);
|
||||
dst->e_type = H_GET_16 (abfd, src->e_type);
|
||||
dst->e_machine = H_GET_16 (abfd, src->e_machine);
|
||||
dst->e_version = H_GET_32 (abfd, src->e_version);
|
||||
if (signed_vma)
|
||||
dst->e_entry = get_signed_word (abfd, (bfd_byte *) src->e_entry);
|
||||
dst->e_entry = H_GET_SIGNED_WORD (abfd, src->e_entry);
|
||||
else
|
||||
dst->e_entry = get_word (abfd, (bfd_byte *) src->e_entry);
|
||||
dst->e_phoff = get_word (abfd, (bfd_byte *) src->e_phoff);
|
||||
dst->e_shoff = get_word (abfd, (bfd_byte *) src->e_shoff);
|
||||
dst->e_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->e_flags);
|
||||
dst->e_ehsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_ehsize);
|
||||
dst->e_phentsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_phentsize);
|
||||
dst->e_phnum = bfd_h_get_16 (abfd, (bfd_byte *) src->e_phnum);
|
||||
dst->e_shentsize = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shentsize);
|
||||
dst->e_shnum = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shnum);
|
||||
dst->e_shstrndx = bfd_h_get_16 (abfd, (bfd_byte *) src->e_shstrndx);
|
||||
dst->e_entry = H_GET_WORD (abfd, src->e_entry);
|
||||
dst->e_phoff = H_GET_WORD (abfd, src->e_phoff);
|
||||
dst->e_shoff = H_GET_WORD (abfd, src->e_shoff);
|
||||
dst->e_flags = H_GET_32 (abfd, src->e_flags);
|
||||
dst->e_ehsize = H_GET_16 (abfd, src->e_ehsize);
|
||||
dst->e_phentsize = H_GET_16 (abfd, src->e_phentsize);
|
||||
dst->e_phnum = H_GET_16 (abfd, src->e_phnum);
|
||||
dst->e_shentsize = H_GET_16 (abfd, src->e_shentsize);
|
||||
dst->e_shnum = H_GET_16 (abfd, src->e_shnum);
|
||||
dst->e_shstrndx = H_GET_16 (abfd, src->e_shstrndx);
|
||||
}
|
||||
|
||||
/* Translate an ELF file header in internal format into an ELF file header in
|
||||
|
|
@ -274,25 +294,32 @@ elf_swap_ehdr_out (abfd, src, dst)
|
|||
const Elf_Internal_Ehdr *src;
|
||||
Elf_External_Ehdr *dst;
|
||||
{
|
||||
unsigned int tmp;
|
||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||
memcpy (dst->e_ident, src->e_ident, EI_NIDENT);
|
||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||
bfd_h_put_16 (abfd, src->e_type, dst->e_type);
|
||||
bfd_h_put_16 (abfd, src->e_machine, dst->e_machine);
|
||||
bfd_h_put_32 (abfd, src->e_version, dst->e_version);
|
||||
H_PUT_16 (abfd, src->e_type, dst->e_type);
|
||||
H_PUT_16 (abfd, src->e_machine, dst->e_machine);
|
||||
H_PUT_32 (abfd, src->e_version, dst->e_version);
|
||||
if (signed_vma)
|
||||
put_signed_word (abfd, src->e_entry, dst->e_entry);
|
||||
H_PUT_SIGNED_WORD (abfd, src->e_entry, dst->e_entry);
|
||||
else
|
||||
put_word (abfd, src->e_entry, dst->e_entry);
|
||||
put_word (abfd, src->e_phoff, dst->e_phoff);
|
||||
put_word (abfd, src->e_shoff, dst->e_shoff);
|
||||
bfd_h_put_32 (abfd, src->e_flags, dst->e_flags);
|
||||
bfd_h_put_16 (abfd, src->e_ehsize, dst->e_ehsize);
|
||||
bfd_h_put_16 (abfd, src->e_phentsize, dst->e_phentsize);
|
||||
bfd_h_put_16 (abfd, src->e_phnum, dst->e_phnum);
|
||||
bfd_h_put_16 (abfd, src->e_shentsize, dst->e_shentsize);
|
||||
bfd_h_put_16 (abfd, src->e_shnum, dst->e_shnum);
|
||||
bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx);
|
||||
H_PUT_WORD (abfd, src->e_entry, dst->e_entry);
|
||||
H_PUT_WORD (abfd, src->e_phoff, dst->e_phoff);
|
||||
H_PUT_WORD (abfd, src->e_shoff, dst->e_shoff);
|
||||
H_PUT_32 (abfd, src->e_flags, dst->e_flags);
|
||||
H_PUT_16 (abfd, src->e_ehsize, dst->e_ehsize);
|
||||
H_PUT_16 (abfd, src->e_phentsize, dst->e_phentsize);
|
||||
H_PUT_16 (abfd, src->e_phnum, dst->e_phnum);
|
||||
H_PUT_16 (abfd, src->e_shentsize, dst->e_shentsize);
|
||||
tmp = src->e_shnum;
|
||||
if (tmp >= SHN_LORESERVE)
|
||||
tmp = SHN_UNDEF;
|
||||
H_PUT_16 (abfd, tmp, dst->e_shnum);
|
||||
tmp = src->e_shstrndx;
|
||||
if (tmp >= SHN_LORESERVE)
|
||||
tmp = SHN_XINDEX;
|
||||
H_PUT_16 (abfd, tmp, dst->e_shstrndx);
|
||||
}
|
||||
|
||||
/* Translate an ELF section header table entry in external format into an
|
||||
|
|
@ -306,19 +333,19 @@ elf_swap_shdr_in (abfd, src, dst)
|
|||
{
|
||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||
|
||||
dst->sh_name = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_name);
|
||||
dst->sh_type = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_type);
|
||||
dst->sh_flags = get_word (abfd, (bfd_byte *) src->sh_flags);
|
||||
dst->sh_name = H_GET_32 (abfd, src->sh_name);
|
||||
dst->sh_type = H_GET_32 (abfd, src->sh_type);
|
||||
dst->sh_flags = H_GET_WORD (abfd, src->sh_flags);
|
||||
if (signed_vma)
|
||||
dst->sh_addr = get_signed_word (abfd, (bfd_byte *) src->sh_addr);
|
||||
dst->sh_addr = H_GET_SIGNED_WORD (abfd, src->sh_addr);
|
||||
else
|
||||
dst->sh_addr = get_word (abfd, (bfd_byte *) src->sh_addr);
|
||||
dst->sh_offset = get_word (abfd, (bfd_byte *) src->sh_offset);
|
||||
dst->sh_size = get_word (abfd, (bfd_byte *) src->sh_size);
|
||||
dst->sh_link = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_link);
|
||||
dst->sh_info = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_info);
|
||||
dst->sh_addralign = get_word (abfd, (bfd_byte *) src->sh_addralign);
|
||||
dst->sh_entsize = get_word (abfd, (bfd_byte *) src->sh_entsize);
|
||||
dst->sh_addr = H_GET_WORD (abfd, src->sh_addr);
|
||||
dst->sh_offset = H_GET_WORD (abfd, src->sh_offset);
|
||||
dst->sh_size = H_GET_WORD (abfd, src->sh_size);
|
||||
dst->sh_link = H_GET_32 (abfd, src->sh_link);
|
||||
dst->sh_info = H_GET_32 (abfd, src->sh_info);
|
||||
dst->sh_addralign = H_GET_WORD (abfd, src->sh_addralign);
|
||||
dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
|
||||
dst->bfd_section = NULL;
|
||||
dst->contents = NULL;
|
||||
}
|
||||
|
|
@ -333,16 +360,16 @@ elf_swap_shdr_out (abfd, src, dst)
|
|||
Elf_External_Shdr *dst;
|
||||
{
|
||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||
bfd_h_put_32 (abfd, src->sh_name, dst->sh_name);
|
||||
bfd_h_put_32 (abfd, src->sh_type, dst->sh_type);
|
||||
put_word (abfd, src->sh_flags, dst->sh_flags);
|
||||
put_word (abfd, src->sh_addr, dst->sh_addr);
|
||||
put_word (abfd, src->sh_offset, dst->sh_offset);
|
||||
put_word (abfd, src->sh_size, dst->sh_size);
|
||||
bfd_h_put_32 (abfd, src->sh_link, dst->sh_link);
|
||||
bfd_h_put_32 (abfd, src->sh_info, dst->sh_info);
|
||||
put_word (abfd, src->sh_addralign, dst->sh_addralign);
|
||||
put_word (abfd, src->sh_entsize, dst->sh_entsize);
|
||||
H_PUT_32 (abfd, src->sh_name, dst->sh_name);
|
||||
H_PUT_32 (abfd, src->sh_type, dst->sh_type);
|
||||
H_PUT_WORD (abfd, src->sh_flags, dst->sh_flags);
|
||||
H_PUT_WORD (abfd, src->sh_addr, dst->sh_addr);
|
||||
H_PUT_WORD (abfd, src->sh_offset, dst->sh_offset);
|
||||
H_PUT_WORD (abfd, src->sh_size, dst->sh_size);
|
||||
H_PUT_32 (abfd, src->sh_link, dst->sh_link);
|
||||
H_PUT_32 (abfd, src->sh_info, dst->sh_info);
|
||||
H_PUT_WORD (abfd, src->sh_addralign, dst->sh_addralign);
|
||||
H_PUT_WORD (abfd, src->sh_entsize, dst->sh_entsize);
|
||||
}
|
||||
|
||||
/* Translate an ELF program header table entry in external format into an
|
||||
|
|
@ -356,22 +383,22 @@ elf_swap_phdr_in (abfd, src, dst)
|
|||
{
|
||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||
|
||||
dst->p_type = bfd_h_get_32 (abfd, (bfd_byte *) src->p_type);
|
||||
dst->p_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->p_flags);
|
||||
dst->p_offset = get_word (abfd, (bfd_byte *) src->p_offset);
|
||||
dst->p_type = H_GET_32 (abfd, src->p_type);
|
||||
dst->p_flags = H_GET_32 (abfd, src->p_flags);
|
||||
dst->p_offset = H_GET_WORD (abfd, src->p_offset);
|
||||
if (signed_vma)
|
||||
{
|
||||
dst->p_vaddr = get_signed_word (abfd, (bfd_byte *) src->p_vaddr);
|
||||
dst->p_paddr = get_signed_word (abfd, (bfd_byte *) src->p_paddr);
|
||||
dst->p_vaddr = H_GET_SIGNED_WORD (abfd, src->p_vaddr);
|
||||
dst->p_paddr = H_GET_SIGNED_WORD (abfd, src->p_paddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
dst->p_vaddr = get_word (abfd, (bfd_byte *) src->p_vaddr);
|
||||
dst->p_paddr = get_word (abfd, (bfd_byte *) src->p_paddr);
|
||||
dst->p_vaddr = H_GET_WORD (abfd, src->p_vaddr);
|
||||
dst->p_paddr = H_GET_WORD (abfd, src->p_paddr);
|
||||
}
|
||||
dst->p_filesz = get_word (abfd, (bfd_byte *) src->p_filesz);
|
||||
dst->p_memsz = get_word (abfd, (bfd_byte *) src->p_memsz);
|
||||
dst->p_align = get_word (abfd, (bfd_byte *) src->p_align);
|
||||
dst->p_filesz = H_GET_WORD (abfd, src->p_filesz);
|
||||
dst->p_memsz = H_GET_WORD (abfd, src->p_memsz);
|
||||
dst->p_align = H_GET_WORD (abfd, src->p_align);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -381,14 +408,14 @@ elf_swap_phdr_out (abfd, src, dst)
|
|||
Elf_External_Phdr *dst;
|
||||
{
|
||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||
bfd_h_put_32 (abfd, src->p_type, dst->p_type);
|
||||
put_word (abfd, src->p_offset, dst->p_offset);
|
||||
put_word (abfd, src->p_vaddr, dst->p_vaddr);
|
||||
put_word (abfd, src->p_paddr, dst->p_paddr);
|
||||
put_word (abfd, src->p_filesz, dst->p_filesz);
|
||||
put_word (abfd, src->p_memsz, dst->p_memsz);
|
||||
bfd_h_put_32 (abfd, src->p_flags, dst->p_flags);
|
||||
put_word (abfd, src->p_align, dst->p_align);
|
||||
H_PUT_32 (abfd, src->p_type, dst->p_type);
|
||||
H_PUT_WORD (abfd, src->p_offset, dst->p_offset);
|
||||
H_PUT_WORD (abfd, src->p_vaddr, dst->p_vaddr);
|
||||
H_PUT_WORD (abfd, src->p_paddr, dst->p_paddr);
|
||||
H_PUT_WORD (abfd, src->p_filesz, dst->p_filesz);
|
||||
H_PUT_WORD (abfd, src->p_memsz, dst->p_memsz);
|
||||
H_PUT_32 (abfd, src->p_flags, dst->p_flags);
|
||||
H_PUT_WORD (abfd, src->p_align, dst->p_align);
|
||||
}
|
||||
|
||||
/* Translate an ELF reloc from external format to internal format. */
|
||||
|
|
@ -398,8 +425,8 @@ elf_swap_reloc_in (abfd, src, dst)
|
|||
const Elf_External_Rel *src;
|
||||
Elf_Internal_Rel *dst;
|
||||
{
|
||||
dst->r_offset = get_word (abfd, (bfd_byte *) src->r_offset);
|
||||
dst->r_info = get_word (abfd, (bfd_byte *) src->r_info);
|
||||
dst->r_offset = H_GET_WORD (abfd, src->r_offset);
|
||||
dst->r_info = H_GET_WORD (abfd, src->r_info);
|
||||
}
|
||||
|
||||
INLINE void
|
||||
|
|
@ -408,9 +435,9 @@ elf_swap_reloca_in (abfd, src, dst)
|
|||
const Elf_External_Rela *src;
|
||||
Elf_Internal_Rela *dst;
|
||||
{
|
||||
dst->r_offset = get_word (abfd, (bfd_byte *) src->r_offset);
|
||||
dst->r_info = get_word (abfd, (bfd_byte *) src->r_info);
|
||||
dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend);
|
||||
dst->r_offset = H_GET_WORD (abfd, src->r_offset);
|
||||
dst->r_info = H_GET_WORD (abfd, src->r_info);
|
||||
dst->r_addend = H_GET_SIGNED_WORD (abfd, src->r_addend);
|
||||
}
|
||||
|
||||
/* Translate an ELF reloc from internal format to external format. */
|
||||
|
|
@ -420,8 +447,8 @@ elf_swap_reloc_out (abfd, src, dst)
|
|||
const Elf_Internal_Rel *src;
|
||||
Elf_External_Rel *dst;
|
||||
{
|
||||
put_word (abfd, src->r_offset, dst->r_offset);
|
||||
put_word (abfd, src->r_info, dst->r_info);
|
||||
H_PUT_WORD (abfd, src->r_offset, dst->r_offset);
|
||||
H_PUT_WORD (abfd, src->r_info, dst->r_info);
|
||||
}
|
||||
|
||||
INLINE void
|
||||
|
|
@ -430,9 +457,9 @@ elf_swap_reloca_out (abfd, src, dst)
|
|||
const Elf_Internal_Rela *src;
|
||||
Elf_External_Rela *dst;
|
||||
{
|
||||
put_word (abfd, src->r_offset, dst->r_offset);
|
||||
put_word (abfd, src->r_info, dst->r_info);
|
||||
put_signed_word (abfd, src->r_addend, dst->r_addend);
|
||||
H_PUT_WORD (abfd, src->r_offset, dst->r_offset);
|
||||
H_PUT_WORD (abfd, src->r_info, dst->r_info);
|
||||
H_PUT_SIGNED_WORD (abfd, src->r_addend, dst->r_addend);
|
||||
}
|
||||
|
||||
INLINE void
|
||||
|
|
@ -443,8 +470,8 @@ elf_swap_dyn_in (abfd, p, dst)
|
|||
{
|
||||
const Elf_External_Dyn *src = (const Elf_External_Dyn *) p;
|
||||
|
||||
dst->d_tag = get_word (abfd, src->d_tag);
|
||||
dst->d_un.d_val = get_word (abfd, src->d_un.d_val);
|
||||
dst->d_tag = H_GET_WORD (abfd, src->d_tag);
|
||||
dst->d_un.d_val = H_GET_WORD (abfd, src->d_un.d_val);
|
||||
}
|
||||
|
||||
INLINE void
|
||||
|
|
@ -455,8 +482,8 @@ elf_swap_dyn_out (abfd, src, p)
|
|||
{
|
||||
Elf_External_Dyn *dst = (Elf_External_Dyn *) p;
|
||||
|
||||
put_word (abfd, src->d_tag, dst->d_tag);
|
||||
put_word (abfd, src->d_un.d_val, dst->d_un.d_val);
|
||||
H_PUT_WORD (abfd, src->d_tag, dst->d_tag);
|
||||
H_PUT_WORD (abfd, src->d_un.d_val, dst->d_un.d_val);
|
||||
}
|
||||
|
||||
/* ELF .o/exec file reading */
|
||||
|
|
@ -476,6 +503,16 @@ elf_file_p (x_ehdrp)
|
|||
&& (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3));
|
||||
}
|
||||
|
||||
struct bfd_preserve
|
||||
{
|
||||
const struct bfd_arch_info *arch_info;
|
||||
struct elf_obj_tdata *tdata;
|
||||
struct bfd_hash_table section_htab;
|
||||
struct sec *sections;
|
||||
struct sec **section_tail;
|
||||
unsigned int section_count;
|
||||
};
|
||||
|
||||
/* Check to see if the file associated with ABFD matches the target vector
|
||||
that ABFD points to.
|
||||
|
||||
|
|
@ -491,26 +528,22 @@ elf_object_p (abfd)
|
|||
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
|
||||
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
|
||||
Elf_External_Shdr x_shdr; /* Section header table entry, external form */
|
||||
Elf_Internal_Shdr *i_shdrp = NULL; /* Section header table, internal form */
|
||||
Elf_Internal_Shdr i_shdr;
|
||||
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
|
||||
unsigned int shindex;
|
||||
char *shstrtab; /* Internal copy of section header stringtab */
|
||||
struct elf_backend_data *ebd;
|
||||
struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd);
|
||||
struct sec *preserved_sections = abfd->sections;
|
||||
unsigned int preserved_section_count = abfd->section_count;
|
||||
enum bfd_architecture previous_arch = bfd_get_arch (abfd);
|
||||
unsigned long previous_mach = bfd_get_mach (abfd);
|
||||
struct bfd_preserve preserve;
|
||||
struct elf_obj_tdata *new_tdata = NULL;
|
||||
asection *s;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Clear section information, since there might be a recognized bfd that
|
||||
we now check if we can replace, and we don't want to append to it. */
|
||||
abfd->sections = NULL;
|
||||
abfd->section_count = 0;
|
||||
preserve.arch_info = abfd->arch_info;
|
||||
|
||||
/* Read in the ELF header in external format. */
|
||||
|
||||
if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr))
|
||||
if (bfd_bread ((PTR) & x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd)
|
||||
!= sizeof (x_ehdr))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
goto got_wrong_format_error;
|
||||
|
|
@ -548,12 +581,25 @@ elf_object_p (abfd)
|
|||
/* Allocate an instance of the elf_obj_tdata structure and hook it up to
|
||||
the tdata pointer in the bfd. */
|
||||
|
||||
new_tdata = ((struct elf_obj_tdata *)
|
||||
bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)));
|
||||
amt = sizeof (struct elf_obj_tdata);
|
||||
new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt);
|
||||
if (new_tdata == NULL)
|
||||
goto got_no_match;
|
||||
preserve.tdata = elf_tdata (abfd);
|
||||
elf_tdata (abfd) = new_tdata;
|
||||
|
||||
/* Clear section information, since there might be a recognized bfd that
|
||||
we now check if we can replace, and we don't want to append to it. */
|
||||
preserve.sections = abfd->sections;
|
||||
preserve.section_tail = abfd->section_tail;
|
||||
preserve.section_count = abfd->section_count;
|
||||
preserve.section_htab = abfd->section_htab;
|
||||
abfd->sections = NULL;
|
||||
abfd->section_tail = &abfd->sections;
|
||||
abfd->section_count = 0;
|
||||
if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
|
||||
goto got_no_match;
|
||||
|
||||
/* Now that we know the byte order, swap in the rest of the header */
|
||||
i_ehdrp = elf_elfheader (abfd);
|
||||
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
|
||||
|
|
@ -565,14 +611,15 @@ elf_object_p (abfd)
|
|||
if (i_ehdrp->e_type == ET_CORE)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
/* If there is no section header table, we're hosed. */
|
||||
if (i_ehdrp->e_shoff == 0)
|
||||
/* If this is a relocatable file and there is no section header
|
||||
table, then we're hosed. */
|
||||
if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
/* As a simple sanity check, verify that the what BFD thinks is the
|
||||
size of each section header table entry actually matches the size
|
||||
recorded in the file. */
|
||||
if (i_ehdrp->e_shentsize != sizeof (x_shdr))
|
||||
recorded in the file, but only if there are any sections. */
|
||||
if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
ebd = get_elf_backend_data (abfd);
|
||||
|
|
@ -628,34 +675,80 @@ elf_object_p (abfd)
|
|||
/* Remember the entry point specified in the ELF file header. */
|
||||
bfd_set_start_address (abfd, i_ehdrp->e_entry);
|
||||
|
||||
/* Allocate space for a copy of the section header table in
|
||||
internal form, seek to the section header table in the file,
|
||||
read it in, and convert it to internal form. */
|
||||
i_shdrp = ((Elf_Internal_Shdr *)
|
||||
bfd_alloc (abfd, sizeof (*i_shdrp) * i_ehdrp->e_shnum));
|
||||
elf_elfsections (abfd) = ((Elf_Internal_Shdr **)
|
||||
bfd_alloc (abfd,
|
||||
sizeof (i_shdrp) * i_ehdrp->e_shnum));
|
||||
if (!i_shdrp || !elf_elfsections (abfd))
|
||||
/* Seek to the section header table in the file. */
|
||||
if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0)
|
||||
goto got_no_match;
|
||||
if (bfd_seek (abfd, i_ehdrp->e_shoff, SEEK_SET) != 0)
|
||||
goto got_no_match;
|
||||
for (shindex = 0; shindex < i_ehdrp->e_shnum; shindex++)
|
||||
{
|
||||
if (bfd_read ((PTR) & x_shdr, sizeof x_shdr, 1, abfd) != sizeof (x_shdr))
|
||||
goto got_no_match;
|
||||
elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
|
||||
elf_elfsections (abfd)[shindex] = i_shdrp + shindex;
|
||||
|
||||
/* If the section is loaded, but not page aligned, clear
|
||||
D_PAGED. */
|
||||
if ((i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
|
||||
&& i_shdrp[shindex].sh_type != SHT_NOBITS
|
||||
&& (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
|
||||
% ebd->maxpagesize)
|
||||
!= 0))
|
||||
abfd->flags &= ~D_PAGED;
|
||||
/* Read the first section header at index 0, and convert to internal
|
||||
form. */
|
||||
if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd)
|
||||
!= sizeof (x_shdr))
|
||||
goto got_no_match;
|
||||
elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
|
||||
|
||||
/* If the section count is zero, the actual count is in the first
|
||||
section header. */
|
||||
if (i_ehdrp->e_shnum == SHN_UNDEF)
|
||||
i_ehdrp->e_shnum = i_shdr.sh_size;
|
||||
|
||||
/* And similarly for the string table index. */
|
||||
if (i_ehdrp->e_shstrndx == SHN_XINDEX)
|
||||
i_ehdrp->e_shstrndx = i_shdr.sh_link;
|
||||
|
||||
/* Allocate space for a copy of the section header table in
|
||||
internal form. */
|
||||
if (i_ehdrp->e_shnum != 0)
|
||||
{
|
||||
Elf_Internal_Shdr *shdrp;
|
||||
unsigned int num_sec;
|
||||
|
||||
amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum;
|
||||
i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
|
||||
if (!i_shdrp)
|
||||
goto got_no_match;
|
||||
num_sec = i_ehdrp->e_shnum;
|
||||
if (num_sec > SHN_LORESERVE)
|
||||
num_sec += SHN_HIRESERVE + 1 - SHN_LORESERVE;
|
||||
elf_numsections (abfd) = num_sec;
|
||||
amt = sizeof (i_shdrp) * num_sec;
|
||||
elf_elfsections (abfd) = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt);
|
||||
if (!elf_elfsections (abfd))
|
||||
goto got_no_match;
|
||||
|
||||
memcpy (i_shdrp, &i_shdr, sizeof (*i_shdrp));
|
||||
shdrp = i_shdrp;
|
||||
shindex = 0;
|
||||
if (num_sec > SHN_LORESERVE)
|
||||
{
|
||||
for ( ; shindex < SHN_LORESERVE; shindex++)
|
||||
elf_elfsections (abfd)[shindex] = shdrp++;
|
||||
for ( ; shindex < SHN_HIRESERVE + 1; shindex++)
|
||||
elf_elfsections (abfd)[shindex] = i_shdrp;
|
||||
}
|
||||
for ( ; shindex < num_sec; shindex++)
|
||||
elf_elfsections (abfd)[shindex] = shdrp++;
|
||||
|
||||
/* Read in the rest of the section header table and convert it
|
||||
to internal form. */
|
||||
for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
|
||||
{
|
||||
if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd)
|
||||
!= sizeof (x_shdr))
|
||||
goto got_no_match;
|
||||
elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
|
||||
|
||||
/* If the section is loaded, but not page aligned, clear
|
||||
D_PAGED. */
|
||||
if (i_shdrp[shindex].sh_size != 0
|
||||
&& (i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
|
||||
&& i_shdrp[shindex].sh_type != SHT_NOBITS
|
||||
&& (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
|
||||
% ebd->maxpagesize)
|
||||
!= 0))
|
||||
abfd->flags &= ~D_PAGED;
|
||||
}
|
||||
}
|
||||
|
||||
if (i_ehdrp->e_shstrndx)
|
||||
{
|
||||
if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx))
|
||||
|
|
@ -670,20 +763,18 @@ elf_object_p (abfd)
|
|||
Elf_Internal_Phdr *i_phdr;
|
||||
unsigned int i;
|
||||
|
||||
elf_tdata (abfd)->phdr = ((Elf_Internal_Phdr *)
|
||||
bfd_alloc (abfd,
|
||||
(i_ehdrp->e_phnum
|
||||
* sizeof (Elf_Internal_Phdr))));
|
||||
amt = i_ehdrp->e_phnum * sizeof (Elf_Internal_Phdr);
|
||||
elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->phdr == NULL)
|
||||
goto got_no_match;
|
||||
if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_phoff, SEEK_SET) != 0)
|
||||
goto got_no_match;
|
||||
i_phdr = elf_tdata (abfd)->phdr;
|
||||
for (i = 0; i < i_ehdrp->e_phnum; i++, i_phdr++)
|
||||
{
|
||||
Elf_External_Phdr x_phdr;
|
||||
|
||||
if (bfd_read ((PTR) &x_phdr, sizeof x_phdr, 1, abfd)
|
||||
if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof x_phdr, abfd)
|
||||
!= sizeof x_phdr)
|
||||
goto got_no_match;
|
||||
elf_swap_phdr_in (abfd, &x_phdr, i_phdr);
|
||||
|
|
@ -696,18 +787,25 @@ elf_object_p (abfd)
|
|||
bfd_section_from_shdr with it (since this particular strtab is
|
||||
used to find all of the ELF section names.) */
|
||||
|
||||
shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx);
|
||||
if (!shstrtab)
|
||||
goto got_no_match;
|
||||
|
||||
/* Once all of the section headers have been read and converted, we
|
||||
can start processing them. Note that the first section header is
|
||||
a dummy placeholder entry, so we ignore it. */
|
||||
|
||||
for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
|
||||
if (i_ehdrp->e_shstrndx != 0)
|
||||
{
|
||||
if (! bfd_section_from_shdr (abfd, shindex))
|
||||
unsigned int num_sec;
|
||||
|
||||
shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx);
|
||||
if (!shstrtab)
|
||||
goto got_no_match;
|
||||
|
||||
/* Once all of the section headers have been read and converted, we
|
||||
can start processing them. Note that the first section header is
|
||||
a dummy placeholder entry, so we ignore it. */
|
||||
num_sec = elf_numsections (abfd);
|
||||
for (shindex = 1; shindex < num_sec; shindex++)
|
||||
{
|
||||
if (! bfd_section_from_shdr (abfd, shindex))
|
||||
goto got_no_match;
|
||||
if (shindex == SHN_LORESERVE - 1)
|
||||
shindex += SHN_HIRESERVE + 1 - SHN_LORESERVE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Let the backend double check the format and override global
|
||||
|
|
@ -737,6 +835,10 @@ elf_object_p (abfd)
|
|||
}
|
||||
}
|
||||
|
||||
/* It would be nice to be able to free more memory here, eg. old
|
||||
elf_elfsections, old tdata, but that's not possible since these
|
||||
blocks are sitting inside obj_alloc'd memory. */
|
||||
bfd_hash_table_free (&preserve.section_htab);
|
||||
return (abfd->xvec);
|
||||
|
||||
got_wrong_format_error:
|
||||
|
|
@ -749,20 +851,22 @@ elf_object_p (abfd)
|
|||
target-specific elf_backend_object_p function. Note that saving the
|
||||
whole bfd here and restoring it would be even worse; the first thing
|
||||
you notice is that the cached bfd file position gets out of sync. */
|
||||
bfd_default_set_arch_mach (abfd, previous_arch, previous_mach);
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
||||
got_no_match:
|
||||
if (new_tdata != NULL
|
||||
&& new_tdata->elf_sect_ptr != NULL)
|
||||
bfd_release (abfd, new_tdata->elf_sect_ptr);
|
||||
if (i_shdrp != NULL)
|
||||
bfd_release (abfd, i_shdrp);
|
||||
abfd->arch_info = preserve.arch_info;
|
||||
if (new_tdata != NULL)
|
||||
bfd_release (abfd, new_tdata);
|
||||
elf_tdata (abfd) = preserved_tdata;
|
||||
abfd->sections = preserved_sections;
|
||||
abfd->section_count = preserved_section_count;
|
||||
return (NULL);
|
||||
{
|
||||
/* bfd_release frees all memory more recently bfd_alloc'd than
|
||||
its arg, as well as its arg. */
|
||||
bfd_release (abfd, new_tdata);
|
||||
elf_tdata (abfd) = preserve.tdata;
|
||||
abfd->section_htab = preserve.section_htab;
|
||||
abfd->sections = preserve.sections;
|
||||
abfd->section_tail = preserve.section_tail;
|
||||
abfd->section_count = preserve.section_count;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* ELF .o/exec file writing */
|
||||
|
|
@ -935,14 +1039,14 @@ int
|
|||
elf_write_out_phdrs (abfd, phdr, count)
|
||||
bfd *abfd;
|
||||
const Elf_Internal_Phdr *phdr;
|
||||
int count;
|
||||
unsigned int count;
|
||||
{
|
||||
while (count--)
|
||||
{
|
||||
Elf_External_Phdr extphdr;
|
||||
elf_swap_phdr_out (abfd, phdr, &extphdr);
|
||||
if (bfd_write (&extphdr, sizeof (Elf_External_Phdr), 1, abfd)
|
||||
!= sizeof (Elf_External_Phdr))
|
||||
if (bfd_bwrite (&extphdr, (bfd_size_type) sizeof (Elf_External_Phdr),
|
||||
abfd) != sizeof (Elf_External_Phdr))
|
||||
return -1;
|
||||
phdr++;
|
||||
}
|
||||
|
|
@ -960,6 +1064,7 @@ elf_write_shdrs_and_ehdr (abfd)
|
|||
Elf_External_Shdr *x_shdrp; /* Section header table, external form */
|
||||
Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */
|
||||
unsigned int count;
|
||||
bfd_size_type amt;
|
||||
|
||||
i_ehdrp = elf_elfheader (abfd);
|
||||
i_shdrp = elf_elfsections (abfd);
|
||||
|
|
@ -970,27 +1075,37 @@ elf_write_shdrs_and_ehdr (abfd)
|
|||
elf_debug_file (i_ehdrp);
|
||||
#endif
|
||||
elf_swap_ehdr_out (abfd, i_ehdrp, &x_ehdr);
|
||||
amt = sizeof (x_ehdr);
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|
||||
|| (bfd_write ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd)
|
||||
!= sizeof (x_ehdr)))
|
||||
|| bfd_bwrite ((PTR) & x_ehdr, amt, abfd) != amt)
|
||||
return false;
|
||||
|
||||
/* Some fields in the first section header handle overflow of ehdr
|
||||
fields. */
|
||||
if (i_ehdrp->e_shnum >= SHN_LORESERVE)
|
||||
i_shdrp[0]->sh_size = i_ehdrp->e_shnum;
|
||||
if (i_ehdrp->e_shstrndx >= SHN_LORESERVE)
|
||||
i_shdrp[0]->sh_link = i_ehdrp->e_shstrndx;
|
||||
|
||||
/* at this point we've concocted all the ELF sections... */
|
||||
x_shdrp = (Elf_External_Shdr *)
|
||||
bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum));
|
||||
amt = i_ehdrp->e_shnum;
|
||||
amt *= sizeof (*x_shdrp);
|
||||
x_shdrp = (Elf_External_Shdr *) bfd_alloc (abfd, amt);
|
||||
if (!x_shdrp)
|
||||
return false;
|
||||
|
||||
for (count = 0; count < i_ehdrp->e_shnum; count++)
|
||||
for (count = 0; count < i_ehdrp->e_shnum; i_shdrp++, count++)
|
||||
{
|
||||
#if DEBUG & 2
|
||||
elf_debug_section (count, i_shdrp[count]);
|
||||
elf_debug_section (count, *i_shdrp);
|
||||
#endif
|
||||
elf_swap_shdr_out (abfd, i_shdrp[count], x_shdrp + count);
|
||||
elf_swap_shdr_out (abfd, *i_shdrp, x_shdrp + count);
|
||||
|
||||
if (count == SHN_LORESERVE - 1)
|
||||
i_shdrp += SHN_HIRESERVE + 1 - SHN_LORESERVE;
|
||||
}
|
||||
if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0
|
||||
|| (bfd_write ((PTR) x_shdrp, sizeof (*x_shdrp), i_ehdrp->e_shnum, abfd)
|
||||
!= sizeof (*x_shdrp) * i_ehdrp->e_shnum))
|
||||
|| bfd_bwrite ((PTR) x_shdrp, amt, abfd) != amt)
|
||||
return false;
|
||||
|
||||
/* need to dump the string table too... */
|
||||
|
|
@ -1011,7 +1126,9 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
elf_symbol_type *symbase; /* Buffer for generated bfd symbols */
|
||||
Elf_Internal_Sym i_sym;
|
||||
Elf_External_Sym *x_symp = NULL;
|
||||
Elf_External_Sym_Shndx *x_shndx = NULL;
|
||||
Elf_External_Versym *x_versymp = NULL;
|
||||
bfd_size_type amt;
|
||||
|
||||
/* Read each raw ELF symbol, converting from external ELF form to
|
||||
internal ELF form, and then using the information to create a
|
||||
|
|
@ -1025,8 +1142,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
|
||||
if (! dynamic)
|
||||
{
|
||||
Elf_Internal_Shdr *shndx_hdr;
|
||||
|
||||
hdr = &elf_tdata (abfd)->symtab_hdr;
|
||||
shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
|
||||
verhdr = NULL;
|
||||
|
||||
/* If we have a SHT_SYMTAB_SHNDX section for the symbol table,
|
||||
read the raw contents. */
|
||||
if (elf_elfsections (abfd) != NULL
|
||||
&& elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr)
|
||||
{
|
||||
amt = shndx_hdr->sh_size;
|
||||
x_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
|
||||
if (x_shndx == NULL
|
||||
|| bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
|
||||
|| bfd_bread ((PTR) x_shndx, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1045,8 +1178,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
}
|
||||
}
|
||||
|
||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
|
||||
return -1;
|
||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
|
||||
symcount = hdr->sh_size / sizeof (Elf_External_Sym);
|
||||
|
||||
|
|
@ -1056,23 +1189,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
{
|
||||
unsigned long i;
|
||||
|
||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
|
||||
return -1;
|
||||
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0)
|
||||
goto error_return;
|
||||
|
||||
symbase = ((elf_symbol_type *)
|
||||
bfd_zalloc (abfd, symcount * sizeof (elf_symbol_type)));
|
||||
amt = symcount;
|
||||
amt *= sizeof (elf_symbol_type);
|
||||
symbase = (elf_symbol_type *) bfd_zalloc (abfd, amt);
|
||||
if (symbase == (elf_symbol_type *) NULL)
|
||||
return -1;
|
||||
goto error_return;
|
||||
sym = symbase;
|
||||
|
||||
/* Temporarily allocate room for the raw ELF symbols. */
|
||||
x_symp = ((Elf_External_Sym *)
|
||||
bfd_malloc (symcount * sizeof (Elf_External_Sym)));
|
||||
if (x_symp == NULL && symcount != 0)
|
||||
amt = symcount;
|
||||
amt *= sizeof (Elf_External_Sym);
|
||||
x_symp = (Elf_External_Sym *) bfd_malloc (amt);
|
||||
if (x_symp == NULL)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_read ((PTR) x_symp, sizeof (Elf_External_Sym), symcount, abfd)
|
||||
!= symcount * sizeof (Elf_External_Sym))
|
||||
if (bfd_bread ((PTR) x_symp, amt, abfd) != amt)
|
||||
goto error_return;
|
||||
|
||||
/* Read the raw ELF version symbol information. */
|
||||
|
|
@ -1100,7 +1234,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
if (x_versymp == NULL && verhdr->sh_size != 0)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_read ((PTR) x_versymp, 1, verhdr->sh_size, abfd)
|
||||
if (bfd_bread ((PTR) x_versymp, verhdr->sh_size, abfd)
|
||||
!= verhdr->sh_size)
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -1108,7 +1242,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
/* Skip first symbol, which is a null dummy. */
|
||||
for (i = 1; i < symcount; i++)
|
||||
{
|
||||
elf_swap_symbol_in (abfd, x_symp + i, &i_sym);
|
||||
elf_swap_symbol_in (abfd, x_symp + i,
|
||||
x_shndx + (x_shndx != NULL ? i : 0), &i_sym);
|
||||
memcpy (&sym->internal_elf_sym, &i_sym, sizeof (Elf_Internal_Sym));
|
||||
#ifdef ELF_KEEP_EXTSYM
|
||||
memcpy (&sym->native_elf_sym, x_symp + i, sizeof (Elf_External_Sym));
|
||||
|
|
@ -1121,7 +1256,12 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
|
||||
sym->symbol.value = i_sym.st_value;
|
||||
|
||||
if (i_sym.st_shndx > 0 && i_sym.st_shndx < SHN_LORESERVE)
|
||||
if (i_sym.st_shndx == SHN_UNDEF)
|
||||
{
|
||||
sym->symbol.section = bfd_und_section_ptr;
|
||||
}
|
||||
else if (i_sym.st_shndx < SHN_LORESERVE
|
||||
|| i_sym.st_shndx > SHN_HIRESERVE)
|
||||
{
|
||||
sym->symbol.section = section_from_elf_index (abfd,
|
||||
i_sym.st_shndx);
|
||||
|
|
@ -1146,10 +1286,6 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
moment) about the alignment. */
|
||||
sym->symbol.value = i_sym.st_size;
|
||||
}
|
||||
else if (i_sym.st_shndx == SHN_UNDEF)
|
||||
{
|
||||
sym->symbol.section = bfd_und_section_ptr;
|
||||
}
|
||||
else
|
||||
sym->symbol.section = bfd_abs_section_ptr;
|
||||
|
||||
|
|
@ -1236,12 +1372,17 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||
*symptrs = 0; /* Final null pointer */
|
||||
}
|
||||
|
||||
if (x_shndx != NULL)
|
||||
free (x_shndx);
|
||||
if (x_versymp != NULL)
|
||||
free (x_versymp);
|
||||
if (x_symp != NULL)
|
||||
free (x_symp);
|
||||
return symcount;
|
||||
|
||||
error_return:
|
||||
if (x_shndx != NULL)
|
||||
free (x_shndx);
|
||||
if (x_versymp != NULL)
|
||||
free (x_versymp);
|
||||
if (x_symp != NULL)
|
||||
|
|
@ -1270,12 +1411,12 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
|
|||
unsigned int i;
|
||||
int entsize;
|
||||
|
||||
allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
|
||||
allocated = (PTR) bfd_malloc (rel_hdr->sh_size);
|
||||
if (allocated == NULL)
|
||||
goto error_return;
|
||||
|
||||
if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
|
||||
|| (bfd_read (allocated, 1, rel_hdr->sh_size, abfd)
|
||||
|| (bfd_bread (allocated, rel_hdr->sh_size, abfd)
|
||||
!= rel_hdr->sh_size))
|
||||
goto error_return;
|
||||
|
||||
|
|
@ -1361,6 +1502,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
|
|||
bfd_size_type reloc_count;
|
||||
bfd_size_type reloc_count2;
|
||||
arelent *relents;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (asect->relocation != NULL)
|
||||
return true;
|
||||
|
|
@ -1396,9 +1538,8 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
|
|||
reloc_count2 = 0;
|
||||
}
|
||||
|
||||
relents = ((arelent *)
|
||||
bfd_alloc (abfd,
|
||||
(reloc_count + reloc_count2) * sizeof (arelent)));
|
||||
amt = (reloc_count + reloc_count2) * sizeof (arelent);
|
||||
relents = (arelent *) bfd_alloc (abfd, amt);
|
||||
if (relents == NULL)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,14 +81,18 @@ elf_core_file_p (abfd)
|
|||
{
|
||||
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
|
||||
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
|
||||
Elf_Internal_Phdr *i_phdrp = NULL; /* Elf program header, internal form */
|
||||
Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form */
|
||||
unsigned int phindex;
|
||||
struct elf_backend_data *ebd;
|
||||
struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd);
|
||||
struct bfd_preserve preserve;
|
||||
struct elf_obj_tdata *new_tdata = NULL;
|
||||
bfd_size_type amt;
|
||||
|
||||
preserve.arch_info = abfd->arch_info;
|
||||
|
||||
/* Read in the ELF header in external format. */
|
||||
if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr))
|
||||
if (bfd_bread ((PTR) &x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd)
|
||||
!= sizeof (x_ehdr))
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_system_call)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -121,12 +125,25 @@ elf_core_file_p (abfd)
|
|||
}
|
||||
|
||||
/* Give abfd an elf_obj_tdata. */
|
||||
new_tdata =
|
||||
(struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata));
|
||||
amt = sizeof (struct elf_obj_tdata);
|
||||
new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt);
|
||||
if (new_tdata == NULL)
|
||||
return NULL;
|
||||
preserve.tdata = elf_tdata (abfd);
|
||||
elf_tdata (abfd) = new_tdata;
|
||||
|
||||
/* Clear section information, since there might be a recognized bfd that
|
||||
we now check if we can replace, and we don't want to append to it. */
|
||||
preserve.sections = abfd->sections;
|
||||
preserve.section_tail = abfd->section_tail;
|
||||
preserve.section_count = abfd->section_count;
|
||||
preserve.section_htab = abfd->section_htab;
|
||||
abfd->sections = NULL;
|
||||
abfd->section_tail = &abfd->sections;
|
||||
abfd->section_count = 0;
|
||||
if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
|
||||
goto fail;
|
||||
|
||||
/* Swap in the rest of the header, now that we have the byte order. */
|
||||
i_ehdrp = elf_elfheader (abfd);
|
||||
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
|
||||
|
|
@ -181,12 +198,12 @@ elf_core_file_p (abfd)
|
|||
goto wrong;
|
||||
|
||||
/* Move to the start of the program headers. */
|
||||
if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_phoff, SEEK_SET) != 0)
|
||||
goto wrong;
|
||||
|
||||
/* Allocate space for the program headers. */
|
||||
i_phdrp = (Elf_Internal_Phdr *)
|
||||
bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum);
|
||||
amt = sizeof (*i_phdrp) * i_ehdrp->e_phnum;
|
||||
i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
|
||||
if (!i_phdrp)
|
||||
goto fail;
|
||||
|
||||
|
|
@ -196,7 +213,7 @@ elf_core_file_p (abfd)
|
|||
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
||||
{
|
||||
Elf_External_Phdr x_phdr;
|
||||
if (bfd_read ((PTR) &x_phdr, sizeof (x_phdr), 1, abfd)
|
||||
if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof (x_phdr), abfd)
|
||||
!= sizeof (x_phdr))
|
||||
goto fail;
|
||||
|
||||
|
|
@ -206,7 +223,7 @@ elf_core_file_p (abfd)
|
|||
/* Process each program header. */
|
||||
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
||||
{
|
||||
if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
|
||||
if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -229,15 +246,33 @@ elf_core_file_p (abfd)
|
|||
goto wrong;
|
||||
}
|
||||
|
||||
bfd_hash_table_free (&preserve.section_htab);
|
||||
return abfd->xvec;
|
||||
|
||||
wrong:
|
||||
/* There is way too much undoing of half-known state here. The caller,
|
||||
bfd_check_format_matches, really shouldn't iterate on live bfd's to
|
||||
check match/no-match like it does. We have to rely on that a call to
|
||||
bfd_default_set_arch_mach with the previously known mach, undoes what
|
||||
was done by the first bfd_default_set_arch_mach (with mach 0) here.
|
||||
For this to work, only elf-data and the mach may be changed by the
|
||||
target-specific elf_backend_object_p function. Note that saving the
|
||||
whole bfd here and restoring it would be even worse; the first thing
|
||||
you notice is that the cached bfd file position gets out of sync. */
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
||||
fail:
|
||||
if (i_phdrp != NULL)
|
||||
bfd_release (abfd, i_phdrp);
|
||||
abfd->arch_info = preserve.arch_info;
|
||||
if (new_tdata != NULL)
|
||||
bfd_release (abfd, new_tdata);
|
||||
elf_tdata (abfd) = preserved_tdata;
|
||||
{
|
||||
/* bfd_release frees all memory more recently bfd_alloc'd than
|
||||
its arg, as well as its arg. */
|
||||
bfd_release (abfd, new_tdata);
|
||||
elf_tdata (abfd) = preserve.tdata;
|
||||
abfd->section_htab = preserve.section_htab;
|
||||
abfd->sections = preserve.sections;
|
||||
abfd->section_tail = preserve.section_tail;
|
||||
abfd->section_count = preserve.section_count;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,24 +73,27 @@ _bfd_elf_create_got_section (abfd, info)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got
|
||||
(or .got.plt) section. We don't do this in the linker script
|
||||
because we don't want to define the symbol if we are not creating
|
||||
a global offset table. */
|
||||
h = NULL;
|
||||
if (!(_bfd_generic_link_add_one_symbol
|
||||
(info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
|
||||
bed->got_symbol_offset, (const char *) NULL, false,
|
||||
bed->collect, (struct bfd_link_hash_entry **) &h)))
|
||||
return false;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->type = STT_OBJECT;
|
||||
if (bed->want_got_sym)
|
||||
{
|
||||
/* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got
|
||||
(or .got.plt) section. We don't do this in the linker script
|
||||
because we don't want to define the symbol if we are not creating
|
||||
a global offset table. */
|
||||
h = NULL;
|
||||
if (!(_bfd_generic_link_add_one_symbol
|
||||
(info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
|
||||
bed->got_symbol_offset, (const char *) NULL, false,
|
||||
bed->collect, (struct bfd_link_hash_entry **) &h)))
|
||||
return false;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
&& ! _bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return false;
|
||||
if (info->shared
|
||||
&& ! _bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return false;
|
||||
|
||||
elf_hash_table (info)->hgot = h;
|
||||
elf_hash_table (info)->hgot = h;
|
||||
}
|
||||
|
||||
/* The first bit of the global offset table is the header. */
|
||||
s->_raw_size += bed->got_header_size + bed->got_symbol_offset;
|
||||
|
|
@ -134,7 +137,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
|
|||
pltflags = flags;
|
||||
pltflags |= SEC_CODE;
|
||||
if (bed->plt_not_loaded)
|
||||
pltflags &= ~ (SEC_LOAD | SEC_HAS_CONTENTS);
|
||||
pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
|
||||
if (bed->plt_readonly)
|
||||
pltflags |= SEC_READONLY;
|
||||
|
||||
|
|
@ -227,7 +230,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
|
|||
{
|
||||
if (h->dynindx == -1)
|
||||
{
|
||||
struct bfd_strtab_hash *dynstr;
|
||||
struct elf_strtab_hash *dynstr;
|
||||
char *p, *alc;
|
||||
const char *name;
|
||||
boolean copy;
|
||||
|
|
@ -259,7 +262,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
|
|||
if (dynstr == NULL)
|
||||
{
|
||||
/* Create a strtab to hold the dynamic symbol names. */
|
||||
elf_hash_table (info)->dynstr = dynstr = _bfd_elf_stringtab_init ();
|
||||
elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init ();
|
||||
if (dynstr == NULL)
|
||||
return false;
|
||||
}
|
||||
|
|
@ -275,16 +278,16 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
|
|||
}
|
||||
else
|
||||
{
|
||||
alc = bfd_malloc (p - name + 1);
|
||||
alc = bfd_malloc ((bfd_size_type) (p - name + 1));
|
||||
if (alc == NULL)
|
||||
return false;
|
||||
strncpy (alc, name, p - name);
|
||||
strncpy (alc, name, (size_t) (p - name));
|
||||
alc[p - name] = '\0';
|
||||
name = alc;
|
||||
copy = true;
|
||||
}
|
||||
|
||||
indx = _bfd_stringtab_add (dynstr, name, true, copy);
|
||||
indx = _bfd_elf_strtab_add (dynstr, name, copy);
|
||||
|
||||
if (alc != NULL)
|
||||
free (alc);
|
||||
|
|
@ -394,9 +397,9 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
|
|||
if (!lsect)
|
||||
{
|
||||
asection *s;
|
||||
bfd_size_type amt = sizeof (elf_linker_section_t);
|
||||
|
||||
lsect = (elf_linker_section_t *)
|
||||
bfd_alloc (dynobj, sizeof (elf_linker_section_t));
|
||||
lsect = (elf_linker_section_t *) bfd_alloc (dynobj, amt);
|
||||
|
||||
*lsect = *defaults;
|
||||
elf_linker_section (dynobj, which) = lsect;
|
||||
|
|
@ -428,10 +431,10 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
|
|||
s->_raw_size += lsect->hole_size;
|
||||
if (lsect->hole_offset > lsect->max_hole_offset)
|
||||
{
|
||||
(*_bfd_error_handler) (_("%s: Section %s is already to large to put hole of %ld bytes in"),
|
||||
(*_bfd_error_handler) (_("%s: Section %s is too large to add hole of %ld bytes"),
|
||||
bfd_get_filename (abfd),
|
||||
lsect->name,
|
||||
(long)lsect->hole_size);
|
||||
(long) lsect->hole_size);
|
||||
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return (elf_linker_section_t *)0;
|
||||
|
|
@ -503,7 +506,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
|
|||
elf_linker_section_pointers_t *
|
||||
_bfd_elf_find_pointer_linker_section (linker_pointers, addend, which)
|
||||
elf_linker_section_pointers_t *linker_pointers;
|
||||
bfd_signed_vma addend;
|
||||
bfd_vma addend;
|
||||
elf_linker_section_enum_t which;
|
||||
{
|
||||
for ( ; linker_pointers != NULL; linker_pointers = linker_pointers->next)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -66,6 +66,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#ifndef elf_backend_got_symbol_offset
|
||||
#define elf_backend_got_symbol_offset (bfd_vma) 0
|
||||
#endif
|
||||
#ifndef elf_backend_can_refcount
|
||||
#define elf_backend_can_refcount 0
|
||||
#endif
|
||||
#ifndef elf_backend_want_got_plt
|
||||
#define elf_backend_want_got_plt 0
|
||||
#endif
|
||||
|
|
@ -87,7 +90,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
#define bfd_elfNN_bfd_debug_info_start bfd_void
|
||||
#define bfd_elfNN_bfd_debug_info_end bfd_void
|
||||
#define bfd_elfNN_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
|
||||
#define bfd_elfNN_bfd_debug_info_accumulate \
|
||||
(void (*) PARAMS ((bfd*, struct sec *))) bfd_void
|
||||
|
||||
#ifndef bfd_elfNN_bfd_get_relocated_section_contents
|
||||
#define bfd_elfNN_bfd_get_relocated_section_contents \
|
||||
|
|
@ -101,6 +105,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#ifndef elf_backend_can_gc_sections
|
||||
#define elf_backend_can_gc_sections 0
|
||||
#endif
|
||||
#ifndef elf_backend_can_refcount
|
||||
#define elf_backend_can_refcount 0
|
||||
#endif
|
||||
#ifndef elf_backend_want_got_sym
|
||||
#define elf_backend_want_got_sym 1
|
||||
#endif
|
||||
#ifndef elf_backend_gc_mark_hook
|
||||
#define elf_backend_gc_mark_hook NULL
|
||||
#endif
|
||||
|
|
@ -111,6 +121,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections
|
||||
#endif
|
||||
|
||||
#ifndef bfd_elfNN_bfd_merge_sections
|
||||
#define bfd_elfNN_bfd_merge_sections \
|
||||
_bfd_elf_merge_sections
|
||||
#endif
|
||||
|
||||
#ifndef bfd_elfNN_bfd_make_debug_symbol
|
||||
#define bfd_elfNN_bfd_make_debug_symbol \
|
||||
((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
|
||||
|
|
@ -127,7 +142,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#endif
|
||||
#ifndef bfd_elfNN_bfd_copy_private_bfd_data
|
||||
#define bfd_elfNN_bfd_copy_private_bfd_data \
|
||||
((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
|
||||
_bfd_elf_copy_private_bfd_data
|
||||
#endif
|
||||
#ifndef bfd_elfNN_bfd_print_private_bfd_data
|
||||
#define bfd_elfNN_bfd_print_private_bfd_data \
|
||||
|
|
@ -159,7 +174,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
|
||||
#endif
|
||||
#else /* ! defined (elf_backend_relocate_section) */
|
||||
/* If no backend relocate_section routine, use the generic linker. */
|
||||
/* If no backend relocate_section routine, use the generic linker.
|
||||
Note - this will prevent the port from being able to use some of
|
||||
the other features of the ELF linker, because the generic hash structure
|
||||
does not have the fields needed by the ELF linker. In particular it
|
||||
means that linking directly to S-records will not work. */
|
||||
#ifndef bfd_elfNN_bfd_link_hash_table_create
|
||||
#define bfd_elfNN_bfd_link_hash_table_create \
|
||||
_bfd_generic_link_hash_table_create
|
||||
|
|
@ -318,6 +337,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#ifndef elf_backend_hide_symbol
|
||||
#define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
|
||||
#endif
|
||||
#ifndef elf_backend_emit_relocs
|
||||
#define elf_backend_emit_relocs NULL
|
||||
#endif
|
||||
#ifndef elf_backend_count_relocs
|
||||
#define elf_backend_count_relocs NULL
|
||||
#endif
|
||||
#ifndef elf_backend_grok_prstatus
|
||||
#define elf_backend_grok_prstatus NULL
|
||||
#endif
|
||||
#ifndef elf_backend_grok_psinfo
|
||||
#define elf_backend_grok_psinfo NULL
|
||||
#endif
|
||||
#ifndef elf_backend_sprintf_vma
|
||||
#define elf_backend_sprintf_vma _bfd_elf_sprintf_vma
|
||||
#endif
|
||||
#ifndef elf_backend_fprintf_vma
|
||||
#define elf_backend_fprintf_vma _bfd_elf_fprintf_vma
|
||||
#endif
|
||||
#ifndef elf_backend_reloc_type_class
|
||||
#define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
|
||||
#endif
|
||||
#ifndef elf_backend_discard_info
|
||||
#define elf_backend_discard_info NULL
|
||||
#endif
|
||||
#ifndef elf_backend_ignore_discarded_relocs
|
||||
#define elf_backend_ignore_discarded_relocs NULL
|
||||
#endif
|
||||
#ifndef elf_backend_write_section
|
||||
#define elf_backend_write_section NULL
|
||||
#endif
|
||||
|
||||
/* Previously, backends could only use SHT_REL or SHT_RELA relocation
|
||||
sections, but not both. They defined USE_REL to indicate SHT_REL
|
||||
|
|
@ -360,7 +409,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
extern const struct elf_size_info _bfd_elfNN_size_info;
|
||||
|
||||
#ifndef INCLUDED_TARGET_FILE
|
||||
static CONST struct elf_backend_data elfNN_bed =
|
||||
static const struct elf_backend_data elfNN_bed =
|
||||
{
|
||||
ELF_ARCH, /* arch */
|
||||
ELF_MACHINE_CODE, /* elf_machine_code */
|
||||
|
|
@ -399,6 +448,16 @@ static CONST struct elf_backend_data elfNN_bed =
|
|||
elf_backend_output_arch_syms,
|
||||
elf_backend_copy_indirect_symbol,
|
||||
elf_backend_hide_symbol,
|
||||
elf_backend_emit_relocs,
|
||||
elf_backend_count_relocs,
|
||||
elf_backend_grok_prstatus,
|
||||
elf_backend_grok_psinfo,
|
||||
elf_backend_sprintf_vma,
|
||||
elf_backend_fprintf_vma,
|
||||
elf_backend_reloc_type_class,
|
||||
elf_backend_discard_info,
|
||||
elf_backend_ignore_discarded_relocs,
|
||||
elf_backend_write_section,
|
||||
elf_backend_ecoff_debug_swap,
|
||||
ELF_MACHINE_ALT1,
|
||||
ELF_MACHINE_ALT2,
|
||||
|
|
@ -418,6 +477,8 @@ static CONST struct elf_backend_data elfNN_bed =
|
|||
elf_backend_plt_not_loaded,
|
||||
elf_backend_plt_alignment,
|
||||
elf_backend_can_gc_sections,
|
||||
elf_backend_can_refcount,
|
||||
elf_backend_want_got_sym,
|
||||
elf_backend_want_dynbss
|
||||
};
|
||||
#endif
|
||||
|
|
@ -443,12 +504,13 @@ const bfd_target TARGET_BIG_SYM =
|
|||
BFD_ENDIAN_BIG,
|
||||
|
||||
/* object_flags: mask of all file flags */
|
||||
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
|
||||
DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
|
||||
| DYNAMIC | WP_TEXT | D_PAGED),
|
||||
|
||||
/* section_flags: mask of all section flags */
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
|
||||
SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
|
||||
| SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
|
||||
| SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
|
||||
|
||||
/* leading_symbol_char: is the first char of a user symbol
|
||||
predictable, and if so what is it */
|
||||
|
|
@ -538,12 +600,13 @@ const bfd_target TARGET_LITTLE_SYM =
|
|||
BFD_ENDIAN_LITTLE,
|
||||
|
||||
/* object_flags: mask of all file flags */
|
||||
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
|
||||
DYNAMIC | WP_TEXT | D_PAGED),
|
||||
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
|
||||
| DYNAMIC | WP_TEXT | D_PAGED),
|
||||
|
||||
/* section_flags: mask of all section flags */
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
|
||||
SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES),
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
|
||||
| SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
|
||||
| SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
|
||||
|
||||
/* leading_symbol_char: is the first char of a user symbol
|
||||
predictable, and if so what is it */
|
||||
|
|
|
|||
|
|
@ -119,38 +119,40 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
char ***matching;
|
||||
{
|
||||
extern const bfd_target binary_vec;
|
||||
const bfd_target * const *target, *save_targ, *right_targ;
|
||||
const bfd_target * const *target, *save_targ, *right_targ, *ar_right_targ;
|
||||
char **matching_vector = NULL;
|
||||
int match_count;
|
||||
int ar_match_index;
|
||||
|
||||
if (!bfd_read_p (abfd) ||
|
||||
((int)(abfd->format) < (int)bfd_unknown) ||
|
||||
((int)(abfd->format) >= (int)bfd_type_end))
|
||||
if (!bfd_read_p (abfd)
|
||||
|| (unsigned int) abfd->format >= (unsigned int) bfd_type_end)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (abfd->format != bfd_unknown)
|
||||
return (abfd->format == format)? true: false;
|
||||
return abfd->format == format;
|
||||
|
||||
/* Since the target type was defaulted, check them
|
||||
all in the hope that one will be uniquely recognized. */
|
||||
save_targ = abfd->xvec;
|
||||
match_count = 0;
|
||||
ar_match_index = _bfd_target_vector_entries;
|
||||
|
||||
if (matching)
|
||||
{
|
||||
matching_vector =
|
||||
(char **) bfd_malloc (sizeof (char *) *
|
||||
(_bfd_target_vector_entries + 1));
|
||||
bfd_size_type amt;
|
||||
|
||||
*matching = NULL;
|
||||
amt = sizeof (char *) * 2 * _bfd_target_vector_entries;
|
||||
matching_vector = (char **) bfd_malloc (amt);
|
||||
if (!matching_vector)
|
||||
return false;
|
||||
matching_vector[0] = NULL;
|
||||
*matching = matching_vector;
|
||||
}
|
||||
|
||||
right_targ = 0;
|
||||
ar_right_targ = 0;
|
||||
|
||||
/* Presume the answer is yes. */
|
||||
abfd->format = format;
|
||||
|
|
@ -158,7 +160,7 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
/* If the target type was explicitly specified, just check that target. */
|
||||
if (!abfd->target_defaulted)
|
||||
{
|
||||
if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) /* rewind! */
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) /* rewind! */
|
||||
return false;
|
||||
|
||||
right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
|
||||
|
|
@ -202,13 +204,14 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
for (target = bfd_target_vector; *target != NULL; target++)
|
||||
{
|
||||
const bfd_target *temp;
|
||||
bfd_error_type err;
|
||||
|
||||
if (*target == &binary_vec)
|
||||
continue;
|
||||
|
||||
abfd->xvec = *target; /* Change BFD's target temporarily */
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0)
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
||||
return false;
|
||||
|
||||
/* If _bfd_check_format neglects to set bfd_error, assume
|
||||
|
|
@ -223,27 +226,20 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
{ /* This format checks out as ok! */
|
||||
right_targ = temp;
|
||||
|
||||
if (matching)
|
||||
{
|
||||
matching_vector[match_count] = temp->name;
|
||||
matching_vector[match_count + 1] = NULL;
|
||||
}
|
||||
|
||||
match_count++;
|
||||
|
||||
/* If this is the default target, accept it, even if other
|
||||
targets might match. People who want those other targets
|
||||
have to set the GNUTARGET variable. */
|
||||
if (temp == bfd_default_vector[0])
|
||||
{
|
||||
if (matching)
|
||||
{
|
||||
matching_vector[0] = temp->name;
|
||||
matching_vector[1] = NULL;
|
||||
}
|
||||
match_count = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (matching)
|
||||
matching_vector[match_count] = temp->name;
|
||||
|
||||
match_count++;
|
||||
|
||||
#ifdef GNU960
|
||||
/* Big- and little-endian b.out archives look the same, but it
|
||||
doesn't matter: there is no difference in their headers, and
|
||||
|
|
@ -254,19 +250,50 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
else if (bfd_get_error () != bfd_error_wrong_format)
|
||||
else if ((err = bfd_get_error ()) == bfd_error_wrong_object_format
|
||||
|| err == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
/* An archive with objects of the wrong type, or an
|
||||
ambiguous match. We want this target to match if we get
|
||||
no better matches. */
|
||||
if (ar_right_targ != bfd_default_vector[0])
|
||||
ar_right_targ = *target;
|
||||
if (matching)
|
||||
matching_vector[ar_match_index] = (*target)->name;
|
||||
ar_match_index++;
|
||||
}
|
||||
else if (err != bfd_error_wrong_format)
|
||||
{
|
||||
abfd->xvec = save_targ;
|
||||
abfd->format = bfd_unknown;
|
||||
|
||||
if (matching && bfd_get_error ()
|
||||
!= bfd_error_file_ambiguously_recognized)
|
||||
if (matching)
|
||||
free (matching_vector);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match_count == 0)
|
||||
{
|
||||
/* Try partial matches. */
|
||||
right_targ = ar_right_targ;
|
||||
if (right_targ == bfd_default_vector[0])
|
||||
{
|
||||
match_count = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
match_count = ar_match_index - _bfd_target_vector_entries;
|
||||
if (matching && match_count > 1)
|
||||
{
|
||||
memcpy (matching_vector,
|
||||
matching_vector + _bfd_target_vector_entries,
|
||||
sizeof (char *) * match_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match_count == 1)
|
||||
{
|
||||
abfd->xvec = right_targ; /* Change BFD's target permanently. */
|
||||
|
|
@ -288,7 +315,15 @@ bfd_check_format_matches (abfd, format, matching)
|
|||
free (matching_vector);
|
||||
}
|
||||
else
|
||||
bfd_set_error (bfd_error_file_ambiguously_recognized);
|
||||
{
|
||||
bfd_set_error (bfd_error_file_ambiguously_recognized);
|
||||
|
||||
if (matching)
|
||||
{
|
||||
*matching = matching_vector;
|
||||
matching_vector[match_count] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -312,9 +347,8 @@ bfd_set_format (abfd, format)
|
|||
bfd *abfd;
|
||||
bfd_format format;
|
||||
{
|
||||
if (bfd_read_p (abfd) ||
|
||||
((int)abfd->format < (int)bfd_unknown) ||
|
||||
((int)abfd->format >= (int)bfd_type_end))
|
||||
if (bfd_read_p (abfd)
|
||||
|| (unsigned int) abfd->format >= (unsigned int) bfd_type_end)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
|
|
@ -340,7 +374,7 @@ FUNCTION
|
|||
bfd_format_string
|
||||
|
||||
SYNOPSIS
|
||||
CONST char *bfd_format_string(bfd_format format);
|
||||
const char *bfd_format_string(bfd_format format);
|
||||
|
||||
DESCRIPTION
|
||||
Return a pointer to a const string
|
||||
|
|
@ -348,7 +382,7 @@ DESCRIPTION
|
|||
depending upon the value of @var{format}.
|
||||
*/
|
||||
|
||||
CONST char *
|
||||
const char *
|
||||
bfd_format_string (format)
|
||||
bfd_format format;
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Generate parameters for an a.out system.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -87,9 +87,12 @@ main (argc, argv)
|
|||
fprintf (stderr, _(" fix DEFAULT_ARCH in the output file yourself\n"));
|
||||
arch = "unknown";
|
||||
}
|
||||
printf("#define DEFAULT_ARCH bfd_arch_%s\n", arch);
|
||||
printf("#define DEFAULT_ARCH bfd_arch_%s\n\n", arch);
|
||||
|
||||
printf("\n#define MY(OP) CAT(%s_,OP)\n", target);
|
||||
printf("/* Do not \"beautify\" the CONCAT* macro args. Traditional C will not");
|
||||
printf(" remove whitespace added here, and thus will fail to concatenate");
|
||||
printf(" the tokens. */");
|
||||
printf("\n#define MY(OP) CONCAT2 (%s_,OP)\n\n", target);
|
||||
printf("#define TARGETNAME \"a.out-%s\"\n\n", target);
|
||||
|
||||
printf("#include \"bfd.h\"\n");
|
||||
|
|
|
|||
|
|
@ -582,9 +582,9 @@ struct bfd_strtab_hash *
|
|||
_bfd_stringtab_init ()
|
||||
{
|
||||
struct bfd_strtab_hash *table;
|
||||
bfd_size_type amt = sizeof (struct bfd_strtab_hash);
|
||||
|
||||
table = ((struct bfd_strtab_hash *)
|
||||
bfd_malloc (sizeof (struct bfd_strtab_hash)));
|
||||
table = (struct bfd_strtab_hash *) bfd_malloc (amt);
|
||||
if (table == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -711,8 +711,8 @@ _bfd_stringtab_emit (abfd, tab)
|
|||
|
||||
for (entry = tab->first; entry != NULL; entry = entry->next)
|
||||
{
|
||||
register const char *str;
|
||||
register size_t len;
|
||||
const char *str;
|
||||
size_t len;
|
||||
|
||||
str = entry->root.string;
|
||||
len = strlen (str) + 1;
|
||||
|
|
@ -722,12 +722,12 @@ _bfd_stringtab_emit (abfd, tab)
|
|||
bfd_byte buf[2];
|
||||
|
||||
/* The output length includes the null byte. */
|
||||
bfd_put_16 (abfd, len, buf);
|
||||
if (bfd_write ((PTR) buf, 1, 2, abfd) != 2)
|
||||
bfd_put_16 (abfd, (bfd_vma) len, buf);
|
||||
if (bfd_bwrite ((PTR) buf, (bfd_size_type) 2, abfd) != 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bfd_write ((PTR) str, 1, len, abfd) != len)
|
||||
if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* BFD backend for local host's a.out binaries
|
||||
Copyright 1990, 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright 1990, 1991, 1992, 1994, 1995, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support. Probably John Gilmore's fault.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -77,7 +78,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#endif
|
||||
#endif /* HOST_MACHINE_ARCH */
|
||||
|
||||
#define MY(OP) CAT(host_aout_,OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (host_aout_,OP)
|
||||
#define TARGETNAME "a.out"
|
||||
|
||||
#include "aout-target.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for i386 a.out binaries.
|
||||
Copyright 1990, 1991, 1992, 1994, 1996, 1997
|
||||
Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* The only 386 aout system we have here is GO32 from DJ.
|
||||
/* The only 386 aout system we have here is GO32 from DJ.
|
||||
These numbers make BFD work with that. If your aout 386 system
|
||||
doesn't work with these, we'll have to split them into different
|
||||
files. Send me (sac@cygnus.com) the runes to make it work on your
|
||||
|
|
@ -41,7 +41,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define SEGMENT_SIZE 0x400000
|
||||
#define DEFAULT_ARCH bfd_arch_i386
|
||||
|
||||
#define MY(OP) CAT(i386aout_,OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (i386aout_,OP)
|
||||
#define TARGETNAME "a.out-i386"
|
||||
#define NO_WRITE_HEADER_KLUDGE 1
|
||||
|
||||
|
|
@ -51,6 +54,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "aout/aout64.h"
|
||||
#include "libaout.h"
|
||||
|
||||
static boolean i386aout_write_object_contents PARAMS ((bfd *));
|
||||
static boolean MY (set_sizes) PARAMS ((bfd *));
|
||||
|
||||
/* Set the machine type correctly. */
|
||||
|
||||
static boolean
|
||||
|
|
@ -71,9 +77,8 @@ i386aout_write_object_contents (abfd)
|
|||
|
||||
#define MY_write_object_contents i386aout_write_object_contents
|
||||
|
||||
static boolean MY(set_sizes)();
|
||||
#define MY_backend_data &MY(backend_data)
|
||||
static CONST struct aout_backend_data MY(backend_data) = {
|
||||
static const struct aout_backend_data MY(backend_data) = {
|
||||
0, /* zmagic contiguous */
|
||||
1, /* text incl header */
|
||||
0, /* entry is text address */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* BFD back-end for i386 a.out binaries under BSD.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
|
@ -35,7 +36,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define DEFAULT_ARCH bfd_arch_i386
|
||||
#define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN)
|
||||
|
||||
#define MY(OP) CAT(i386bsd_,OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (i386bsd_,OP)
|
||||
#define TARGETNAME "a.out-i386-bsd"
|
||||
|
||||
#include "bfd.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for FreeBSD/386 a.out-ish binaries.
|
||||
Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
Copyright 1990, 1991, 1992, 1996, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
|
@ -26,7 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define DEFAULT_ARCH bfd_arch_i386
|
||||
#define MACHTYPE_OK(mtype) ((mtype) == M_386_NETBSD || (mtype) == M_UNKNOWN)
|
||||
|
||||
#define MY(OP) CAT(i386freebsd_,OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (i386freebsd_,OP)
|
||||
|
||||
/* This needs to start with a.out so GDB knows it is an a.out variant. */
|
||||
#define TARGETNAME "a.out-i386-freebsd"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for linux flavored i386 a.out binaries.
|
||||
Copyright 1992, 1993, 1994, 1995, 1996, 1997
|
||||
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -36,7 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "libaout.h" /* BFD a.out internal data structures */
|
||||
|
||||
#define DEFAULT_ARCH bfd_arch_i386
|
||||
#define MY(OP) CAT(i386linux_,OP)
|
||||
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (i386linux_,OP)
|
||||
#define TARGETNAME "a.out-i386-linux"
|
||||
|
||||
extern const bfd_target MY(vec);
|
||||
|
|
@ -223,9 +227,9 @@ linux_link_hash_table_create (abfd)
|
|||
bfd *abfd;
|
||||
{
|
||||
struct linux_link_hash_table *ret;
|
||||
bfd_size_type amt = sizeof (struct linux_link_hash_table);
|
||||
|
||||
ret = ((struct linux_link_hash_table *)
|
||||
bfd_alloc (abfd, sizeof (struct linux_link_hash_table)));
|
||||
ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt);
|
||||
if (ret == (struct linux_link_hash_table *) NULL)
|
||||
return (struct bfd_link_hash_table *) NULL;
|
||||
if (! NAME(aout,link_hash_table_init) (&ret->root, abfd,
|
||||
|
|
@ -405,7 +409,8 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
|
|||
|
||||
if (! (_bfd_generic_link_add_one_symbol
|
||||
(info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS,
|
||||
BSF_GLOBAL | BSF_CONSTRUCTOR, s, 0, NULL, false, false, NULL)))
|
||||
BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL,
|
||||
false, false, NULL)))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -444,7 +449,7 @@ linux_tally_symbols (h, data)
|
|||
name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1;
|
||||
p = strrchr (name, '_');
|
||||
if (p != NULL)
|
||||
alloc = (char *) bfd_malloc (strlen (name) + 1);
|
||||
alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1);
|
||||
|
||||
if (p == NULL || alloc == NULL)
|
||||
(*_bfd_error_handler) (_("Output file requires shared library `%s'\n"),
|
||||
|
|
@ -476,7 +481,7 @@ linux_tally_symbols (h, data)
|
|||
+ sizeof PLT_REF_PREFIX - 1),
|
||||
false, false, true);
|
||||
/* h2 does not follow indirect symbols. */
|
||||
h2 = linux_link_hash_lookup (linux_hash_table (info),
|
||||
h2 = linux_link_hash_lookup (linux_hash_table (info),
|
||||
(h->root.root.root.string
|
||||
+ sizeof PLT_REF_PREFIX - 1),
|
||||
false, false, false);
|
||||
|
|
@ -587,7 +592,8 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info)
|
|||
".linux-dynamic");
|
||||
if (s != NULL)
|
||||
{
|
||||
s->_raw_size = 8 + linux_hash_table (info)->fixup_count * 8;
|
||||
s->_raw_size = linux_hash_table (info)->fixup_count + 1;
|
||||
s->_raw_size *= 8;
|
||||
s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
|
||||
if (s->contents == NULL)
|
||||
return false;
|
||||
|
|
@ -624,13 +630,14 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
fixups_written = 0;
|
||||
|
||||
#ifdef LINUX_LINK_DEBUG
|
||||
printf ("Fixup table file offset: %x VMA: %x\n",
|
||||
printf ("Fixup table file offset: %x VMA: %x\n",
|
||||
os->filepos + s->output_offset,
|
||||
os->vma + s->output_offset);
|
||||
#endif
|
||||
|
||||
fixup_table = s->contents;
|
||||
bfd_put_32 (output_bfd, linux_hash_table (info)->fixup_count, fixup_table);
|
||||
bfd_put_32 (output_bfd,
|
||||
(bfd_vma) linux_hash_table (info)->fixup_count, fixup_table);
|
||||
fixup_table += 4;
|
||||
|
||||
/* Fill in fixup table. */
|
||||
|
|
@ -660,15 +667,15 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
if (f->jump)
|
||||
{
|
||||
/* Relative address */
|
||||
new_addr = new_addr - (f->value + 5);
|
||||
bfd_put_32 (output_bfd, new_addr, fixup_table);
|
||||
new_addr = new_addr - (f->value + 5);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
|
||||
fixup_table += 4;
|
||||
bfd_put_32 (output_bfd, f->value + 1, fixup_table);
|
||||
fixup_table += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
bfd_put_32 (output_bfd, new_addr, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
|
||||
fixup_table += 4;
|
||||
bfd_put_32 (output_bfd, f->value, fixup_table);
|
||||
fixup_table += 4;
|
||||
|
|
@ -679,9 +686,9 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
if (linux_hash_table (info)->local_builtins != 0)
|
||||
{
|
||||
/* Special marker so we know to switch to the other type of fixup */
|
||||
bfd_put_32 (output_bfd, 0, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
|
||||
fixup_table += 4;
|
||||
bfd_put_32 (output_bfd, 0, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
|
||||
fixup_table += 4;
|
||||
++fixups_written;
|
||||
for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
|
||||
|
|
@ -707,7 +714,7 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
new_addr, f->value);
|
||||
#endif
|
||||
|
||||
bfd_put_32 (output_bfd, new_addr, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
|
||||
fixup_table += 4;
|
||||
bfd_put_32 (output_bfd, f->value, fixup_table);
|
||||
fixup_table += 4;
|
||||
|
|
@ -720,15 +727,15 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
(*_bfd_error_handler) (_("Warning: fixup count mismatch\n"));
|
||||
while (linux_hash_table (info)->fixup_count > fixups_written)
|
||||
{
|
||||
bfd_put_32 (output_bfd, 0, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
|
||||
fixup_table += 4;
|
||||
bfd_put_32 (output_bfd, 0, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
|
||||
fixup_table += 4;
|
||||
++fixups_written;
|
||||
}
|
||||
}
|
||||
|
||||
h = linux_link_hash_lookup (linux_hash_table (info),
|
||||
h = linux_link_hash_lookup (linux_hash_table (info),
|
||||
"__BUILTIN_FIXUPS__",
|
||||
false, false, false);
|
||||
|
||||
|
|
@ -744,16 +751,16 @@ linux_finish_dynamic_link (output_bfd, info)
|
|||
printf ("Builtin fixup table at %x\n", new_addr);
|
||||
#endif
|
||||
|
||||
bfd_put_32 (output_bfd, new_addr, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table);
|
||||
}
|
||||
else
|
||||
bfd_put_32 (output_bfd, 0, fixup_table);
|
||||
bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table);
|
||||
|
||||
if (bfd_seek (output_bfd, os->filepos + s->output_offset, SEEK_SET) != 0)
|
||||
if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset),
|
||||
SEEK_SET) != 0)
|
||||
return false;
|
||||
|
||||
if (bfd_write ((PTR) s->contents, 1, s->_raw_size, output_bfd)
|
||||
!= s->_raw_size)
|
||||
if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* BFD back-end for NetBSD/386 a.out-ish binaries.
|
||||
Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998
|
||||
Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -27,7 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define DEFAULT_ARCH bfd_arch_i386
|
||||
#define DEFAULT_MID M_386_NETBSD
|
||||
|
||||
#define MY(OP) CAT(i386netbsd_,OP)
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#define MY(OP) CONCAT2 (i386netbsd_,OP)
|
||||
|
||||
/* This needs to start with a.out so GDB knows it is an a.out variant. */
|
||||
#define TARGETNAME "a.out-i386-netbsd"
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,6 @@
|
|||
/* BFD back-end for Intel Hex objects.
|
||||
Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
|
||||
Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
|
@ -122,8 +123,7 @@ The MRI compiler uses this, which is a repeat of type 5:
|
|||
#include "sysdep.h"
|
||||
#include "libbfd.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include "safe-ctype.h"
|
||||
|
||||
static void ihex_init PARAMS ((void));
|
||||
static boolean ihex_mkobject PARAMS ((bfd *));
|
||||
|
|
@ -137,9 +137,8 @@ static boolean ihex_get_section_contents
|
|||
static boolean ihex_set_section_contents
|
||||
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
|
||||
static boolean ihex_write_record
|
||||
PARAMS ((bfd *, bfd_size_type, bfd_vma, unsigned int, bfd_byte *));
|
||||
PARAMS ((bfd *, size_t, unsigned int, unsigned int, bfd_byte *));
|
||||
static boolean ihex_write_object_contents PARAMS ((bfd *));
|
||||
static asymbol *ihex_make_empty_symbol PARAMS ((bfd *));
|
||||
static boolean ihex_set_arch_mach
|
||||
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
|
||||
static int ihex_sizeof_headers PARAMS ((bfd *, boolean));
|
||||
|
|
@ -197,9 +196,9 @@ ihex_mkobject (abfd)
|
|||
if (abfd->tdata.ihex_data == NULL)
|
||||
{
|
||||
struct ihex_data_struct *tdata;
|
||||
bfd_size_type amt = sizeof (struct ihex_data_struct);
|
||||
|
||||
tdata = ((struct ihex_data_struct *)
|
||||
bfd_alloc (abfd, sizeof (struct ihex_data_struct)));
|
||||
tdata = (struct ihex_data_struct *) bfd_alloc (abfd, amt);
|
||||
if (tdata == NULL)
|
||||
return false;
|
||||
abfd->tdata.ihex_data = tdata;
|
||||
|
|
@ -220,7 +219,7 @@ ihex_get_byte (abfd, errorptr)
|
|||
{
|
||||
bfd_byte c;
|
||||
|
||||
if (bfd_read (&c, 1, 1, abfd) != 1)
|
||||
if (bfd_bread (&c, (bfd_size_type) 1, abfd) != 1)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_file_truncated)
|
||||
*errorptr = true;
|
||||
|
|
@ -248,7 +247,7 @@ ihex_bad_byte (abfd, lineno, c, error)
|
|||
{
|
||||
char buf[10];
|
||||
|
||||
if (! isprint (c))
|
||||
if (! ISPRINT (c))
|
||||
sprintf (buf, "\\%03o", (unsigned int) c);
|
||||
else
|
||||
{
|
||||
|
|
@ -257,7 +256,7 @@ ihex_bad_byte (abfd, lineno, c, error)
|
|||
}
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: unexpected character `%s' in Intel Hex file\n"),
|
||||
bfd_get_filename (abfd), lineno, buf);
|
||||
bfd_archive_filename (abfd), lineno, buf);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
}
|
||||
}
|
||||
|
|
@ -272,7 +271,7 @@ ihex_scan (abfd)
|
|||
bfd_vma segbase;
|
||||
bfd_vma extbase;
|
||||
asection *sec;
|
||||
int lineno;
|
||||
unsigned int lineno;
|
||||
boolean error;
|
||||
bfd_byte *buf = NULL;
|
||||
size_t bufsize;
|
||||
|
|
@ -320,7 +319,7 @@ ihex_scan (abfd)
|
|||
|
||||
/* Read the header bytes. */
|
||||
|
||||
if (bfd_read (hdr, 1, 8, abfd) != 8)
|
||||
if (bfd_bread (hdr, (bfd_size_type) 8, abfd) != 8)
|
||||
goto error_return;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
|
|
@ -341,13 +340,13 @@ ihex_scan (abfd)
|
|||
chars = len * 2 + 2;
|
||||
if (chars >= bufsize)
|
||||
{
|
||||
buf = (bfd_byte *) bfd_realloc (buf, chars);
|
||||
buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) chars);
|
||||
if (buf == NULL)
|
||||
goto error_return;
|
||||
bufsize = chars;
|
||||
}
|
||||
|
||||
if (bfd_read (buf, 1, chars, abfd) != chars)
|
||||
if (bfd_bread (buf, (bfd_size_type) chars, abfd) != chars)
|
||||
goto error_return;
|
||||
|
||||
for (i = 0; i < chars; i++)
|
||||
|
|
@ -366,8 +365,8 @@ ihex_scan (abfd)
|
|||
if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: bad checksum in Intel Hex file (expected %u, found %u)"),
|
||||
bfd_get_filename (abfd), lineno,
|
||||
(_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
|
||||
bfd_archive_filename (abfd), lineno,
|
||||
(- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
|
|
@ -388,9 +387,11 @@ ihex_scan (abfd)
|
|||
{
|
||||
char secbuf[20];
|
||||
char *secname;
|
||||
bfd_size_type amt;
|
||||
|
||||
sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
|
||||
secname = (char *) bfd_alloc (abfd, strlen (secbuf) + 1);
|
||||
amt = strlen (secbuf) + 1;
|
||||
secname = (char *) bfd_alloc (abfd, amt);
|
||||
if (secname == NULL)
|
||||
goto error_return;
|
||||
strcpy (secname, secbuf);
|
||||
|
|
@ -418,8 +419,8 @@ ihex_scan (abfd)
|
|||
if (len != 2)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: bad extended address record length in Intel Hex file"),
|
||||
bfd_get_filename (abfd), lineno);
|
||||
(_("%s:%u: bad extended address record length in Intel Hex file"),
|
||||
bfd_archive_filename (abfd), lineno);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -435,8 +436,8 @@ ihex_scan (abfd)
|
|||
if (len != 4)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: bad extended start address length in Intel Hex file"),
|
||||
bfd_get_filename (abfd), lineno);
|
||||
(_("%s:%u: bad extended start address length in Intel Hex file"),
|
||||
bfd_archive_filename (abfd), lineno);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -452,8 +453,8 @@ ihex_scan (abfd)
|
|||
if (len != 2)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: bad extended linear address record length in Intel Hex file"),
|
||||
bfd_get_filename (abfd), lineno);
|
||||
(_("%s:%u: bad extended linear address record length in Intel Hex file"),
|
||||
bfd_archive_filename (abfd), lineno);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -469,8 +470,8 @@ ihex_scan (abfd)
|
|||
if (len != 2 && len != 4)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: bad extended linear start address length in Intel Hex file"),
|
||||
bfd_get_filename (abfd), lineno);
|
||||
(_("%s:%u: bad extended linear start address length in Intel Hex file"),
|
||||
bfd_archive_filename (abfd), lineno);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -486,8 +487,8 @@ ihex_scan (abfd)
|
|||
|
||||
default:
|
||||
(*_bfd_error_handler)
|
||||
(_("%s:%d: unrecognized ihex type %u in Intel Hex file\n"),
|
||||
bfd_get_filename (abfd), lineno, type);
|
||||
(_("%s:%u: unrecognized ihex type %u in Intel Hex file\n"),
|
||||
bfd_archive_filename (abfd), lineno, type);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -522,7 +523,7 @@ ihex_object_p (abfd)
|
|||
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
||||
return NULL;
|
||||
if (bfd_read (b, 1, 9, abfd) != 9)
|
||||
if (bfd_bread (b, (bfd_size_type) 9, abfd) != 9)
|
||||
{
|
||||
if (bfd_get_error () == bfd_error_file_truncated)
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
|
@ -595,7 +596,7 @@ ihex_read_section (abfd, section, contents)
|
|||
know the exact format. */
|
||||
BFD_ASSERT (c == ':');
|
||||
|
||||
if (bfd_read (hdr, 1, 8, abfd) != 8)
|
||||
if (bfd_bread (hdr, (bfd_size_type) 8, abfd) != 8)
|
||||
goto error_return;
|
||||
|
||||
len = HEX2 (hdr);
|
||||
|
|
@ -607,20 +608,20 @@ ihex_read_section (abfd, section, contents)
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: internal error in ihex_read_section"),
|
||||
bfd_get_filename (abfd));
|
||||
bfd_archive_filename (abfd));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
if (len * 2 > bufsize)
|
||||
{
|
||||
buf = (bfd_byte *) bfd_realloc (buf, len * 2);
|
||||
buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) len * 2);
|
||||
if (buf == NULL)
|
||||
goto error_return;
|
||||
bufsize = len * 2;
|
||||
}
|
||||
|
||||
if (bfd_read (buf, 1, len * 2, abfd) != len * 2)
|
||||
if (bfd_bread (buf, (bfd_size_type) len * 2, abfd) != len * 2)
|
||||
goto error_return;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
|
|
@ -634,7 +635,7 @@ ihex_read_section (abfd, section, contents)
|
|||
}
|
||||
|
||||
/* Skip the checksum. */
|
||||
if (bfd_read (buf, 1, 2, abfd) != 2)
|
||||
if (bfd_bread (buf, (bfd_size_type) 2, abfd) != 2)
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
|
|
@ -642,7 +643,7 @@ ihex_read_section (abfd, section, contents)
|
|||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: bad section length in ihex_read_section"),
|
||||
bfd_get_filename (abfd));
|
||||
bfd_archive_filename (abfd));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
goto error_return;
|
||||
}
|
||||
|
|
@ -696,14 +697,15 @@ ihex_set_section_contents (abfd, section, location, offset, count)
|
|||
struct ihex_data_list *n;
|
||||
bfd_byte *data;
|
||||
struct ihex_data_struct *tdata;
|
||||
bfd_size_type amt;
|
||||
|
||||
if (count == 0
|
||||
|| (section->flags & SEC_ALLOC) == 0
|
||||
|| (section->flags & SEC_LOAD) == 0)
|
||||
return true;
|
||||
|
||||
n = ((struct ihex_data_list *)
|
||||
bfd_alloc (abfd, sizeof (struct ihex_data_list)));
|
||||
amt = sizeof (struct ihex_data_list);
|
||||
n = (struct ihex_data_list *) bfd_alloc (abfd, amt);
|
||||
if (n == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -748,8 +750,8 @@ ihex_set_section_contents (abfd, section, location, offset, count)
|
|||
static boolean
|
||||
ihex_write_record (abfd, count, addr, type, data)
|
||||
bfd *abfd;
|
||||
bfd_size_type count;
|
||||
bfd_vma addr;
|
||||
size_t count;
|
||||
unsigned int addr;
|
||||
unsigned int type;
|
||||
bfd_byte *data;
|
||||
{
|
||||
|
|
@ -758,6 +760,7 @@ ihex_write_record (abfd, count, addr, type, data)
|
|||
char *p;
|
||||
unsigned int chksum;
|
||||
unsigned int i;
|
||||
size_t total;
|
||||
|
||||
#define TOHEX(buf, v) \
|
||||
((buf)[0] = digs[((v) >> 4) & 0xf], (buf)[1] = digs[(v) & 0xf])
|
||||
|
|
@ -780,7 +783,8 @@ ihex_write_record (abfd, count, addr, type, data)
|
|||
p[2] = '\r';
|
||||
p[3] = '\n';
|
||||
|
||||
if (bfd_write (buf, 1, 9 + count * 2 + 4, abfd) != 9 + count * 2 + 4)
|
||||
total = 9 + count * 2 + 4;
|
||||
if (bfd_bwrite (buf, (bfd_size_type) total, abfd) != total)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -809,10 +813,11 @@ ihex_write_object_contents (abfd)
|
|||
count = l->size;
|
||||
while (count > 0)
|
||||
{
|
||||
bfd_size_type now;
|
||||
size_t now;
|
||||
unsigned int rec_addr;
|
||||
|
||||
now = count;
|
||||
if (now > CHUNK)
|
||||
if (count > CHUNK)
|
||||
now = CHUNK;
|
||||
|
||||
if (where > segbase + extbase + 0xffff)
|
||||
|
|
@ -867,8 +872,8 @@ ihex_write_object_contents (abfd)
|
|||
}
|
||||
}
|
||||
|
||||
if (! ihex_write_record (abfd, now, where - (extbase + segbase),
|
||||
0, p))
|
||||
rec_addr = where - (extbase + segbase);
|
||||
if (! ihex_write_record (abfd, now, rec_addr, 0, p))
|
||||
return false;
|
||||
|
||||
where += now;
|
||||
|
|
@ -910,21 +915,6 @@ ihex_write_object_contents (abfd)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Make an empty symbol. This is required only because
|
||||
bfd_make_section_anyway wants to create a symbol for the section. */
|
||||
|
||||
static asymbol *
|
||||
ihex_make_empty_symbol (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
asymbol *new;
|
||||
|
||||
new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
|
||||
if (new != NULL)
|
||||
new->the_bfd = abfd;
|
||||
return new;
|
||||
}
|
||||
|
||||
/* Set the architecture for the output file. The architecture is
|
||||
irrelevant, so we ignore errors about unknown architectures. */
|
||||
|
||||
|
|
@ -964,6 +954,7 @@ ihex_sizeof_headers (abfd, exec)
|
|||
#define ihex_get_symtab_upper_bound bfd_0l
|
||||
#define ihex_get_symtab \
|
||||
((long (*) PARAMS ((bfd *, asymbol **))) bfd_0l)
|
||||
#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
|
||||
#define ihex_print_symbol _bfd_nosymbols_print_symbol
|
||||
#define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
|
||||
#define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
|
||||
|
|
@ -983,6 +974,7 @@ ihex_sizeof_headers (abfd, exec)
|
|||
bfd_generic_get_relocated_section_contents
|
||||
#define ihex_bfd_relax_section bfd_generic_relax_section
|
||||
#define ihex_bfd_gc_sections bfd_generic_gc_sections
|
||||
#define ihex_bfd_merge_sections bfd_generic_merge_sections
|
||||
#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
|
||||
#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
||||
#define ihex_bfd_final_link _bfd_generic_final_link
|
||||
|
|
@ -1038,6 +1030,6 @@ const bfd_target ihex_vec =
|
|||
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||
|
||||
NULL,
|
||||
|
||||
|
||||
(PTR) 0
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,27 +29,94 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include "bfdlink.h"
|
||||
|
||||
/* Macros for accessing components in an aout header. Saves cluttering
|
||||
the source with (bfd_vma) and (bfd_byte *) casts. */
|
||||
|
||||
#define H_PUT_64(abfd, val, where) \
|
||||
bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_32(abfd, val, where) \
|
||||
bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_16(abfd, val, where) \
|
||||
bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_8 bfd_h_put_8
|
||||
|
||||
#define H_PUT_S64(abfd, val, where) \
|
||||
bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_S32(abfd, val, where) \
|
||||
bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_S16(abfd, val, where) \
|
||||
bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
|
||||
#define H_PUT_S8 bfd_h_put_signed_8
|
||||
|
||||
#define H_GET_64(abfd, where) \
|
||||
bfd_h_get_64 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_32(abfd, where) \
|
||||
bfd_h_get_32 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_16(abfd, where) \
|
||||
bfd_h_get_16 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_8 bfd_h_get_8
|
||||
|
||||
#define H_GET_S64(abfd, where) \
|
||||
bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_S32(abfd, where) \
|
||||
bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_S16(abfd, where) \
|
||||
bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
|
||||
|
||||
#define H_GET_S8 bfd_h_get_signed_8
|
||||
|
||||
/* Parameterize the a.out code based on whether it is being built
|
||||
for a 32-bit architecture or a 64-bit architecture. */
|
||||
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
|
||||
remove whitespace added here, and thus will fail to concatenate
|
||||
the tokens. */
|
||||
#if ARCH_SIZE==64
|
||||
#define GET_WORD bfd_h_get_64
|
||||
#define GET_SWORD bfd_h_get_signed_64
|
||||
#define PUT_WORD bfd_h_put_64
|
||||
#define GET_WORD H_GET_64
|
||||
#define GET_SWORD H_GET_S64
|
||||
#define GET_MAGIC H_GET_32
|
||||
#define PUT_WORD H_PUT_64
|
||||
#define PUT_MAGIC H_PUT_32
|
||||
#ifndef NAME
|
||||
#define NAME(x,y) CAT3(x,_64_,y)
|
||||
#define NAME(x,y) CONCAT3 (x,_64_,y)
|
||||
#endif
|
||||
#define JNAME(x) CAT(x,_64)
|
||||
#define JNAME(x) CONCAT2 (x,_64)
|
||||
#define BYTES_IN_WORD 8
|
||||
#else /* ARCH_SIZE == 32 */
|
||||
#define GET_WORD bfd_h_get_32
|
||||
#define GET_SWORD bfd_h_get_signed_32
|
||||
#define PUT_WORD bfd_h_put_32
|
||||
#else
|
||||
#if ARCH_SIZE==16
|
||||
#define GET_WORD H_GET_16
|
||||
#define GET_SWORD H_GET_S16
|
||||
#define GET_MAGIC H_GET_16
|
||||
#define PUT_WORD H_PUT_16
|
||||
#define PUT_MAGIC H_PUT_16
|
||||
#ifndef NAME
|
||||
#define NAME(x,y) CAT3(x,_32_,y)
|
||||
#define NAME(x,y) CONCAT3 (x,_16_,y)
|
||||
#endif
|
||||
#define JNAME(x) CAT(x,_32)
|
||||
#define JNAME(x) CONCAT2 (x,_16)
|
||||
#define BYTES_IN_WORD 2
|
||||
#else /* ARCH_SIZE == 32 */
|
||||
#define GET_WORD H_GET_32
|
||||
#define GET_SWORD H_GET_S32
|
||||
#define GET_MAGIC H_GET_32
|
||||
#define PUT_WORD H_PUT_32
|
||||
#define PUT_MAGIC H_PUT_32
|
||||
#ifndef NAME
|
||||
#define NAME(x,y) CONCAT3 (x,_32_,y)
|
||||
#endif
|
||||
#define JNAME(x) CONCAT2 (x,_32)
|
||||
#define BYTES_IN_WORD 4
|
||||
#endif /* ARCH_SIZE==32 */
|
||||
#endif /* ARCH_SIZE==64 */
|
||||
|
||||
/* Declare at file level, since used in parameter lists, which have
|
||||
weird scope. */
|
||||
|
|
@ -126,7 +193,8 @@ struct aout_backend_data
|
|||
|
||||
/* Callback for setting the page and segment sizes, if they can't be
|
||||
trivially determined from the architecture. */
|
||||
boolean (*set_sizes) PARAMS ((bfd *));
|
||||
boolean (*set_sizes)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
/* zmagic files only. For go32, the length of the exec header contributes
|
||||
to the size of the text section in the file for alignment purposes but
|
||||
|
|
@ -135,44 +203,43 @@ struct aout_backend_data
|
|||
|
||||
/* Callback from the add symbols phase of the linker code to handle
|
||||
a dynamic object. */
|
||||
boolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *,
|
||||
struct external_nlist **,
|
||||
bfd_size_type *, char **));
|
||||
boolean (*add_dynamic_symbols)
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **,
|
||||
bfd_size_type *, char **));
|
||||
|
||||
/* Callback from the add symbols phase of the linker code to handle
|
||||
adding a single symbol to the global linker hash table. */
|
||||
boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *,
|
||||
const char *, flagword, asection *,
|
||||
bfd_vma, const char *, boolean,
|
||||
boolean,
|
||||
struct bfd_link_hash_entry **));
|
||||
boolean (*add_one_symbol)
|
||||
PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
|
||||
asection *, bfd_vma, const char *, boolean, boolean,
|
||||
struct bfd_link_hash_entry **));
|
||||
|
||||
/* Called to handle linking a dynamic object. */
|
||||
boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *));
|
||||
boolean (*link_dynamic_object)
|
||||
PARAMS ((struct bfd_link_info *, bfd *));
|
||||
|
||||
/* Called for each global symbol being written out by the linker.
|
||||
This should write out the dynamic symbol information. */
|
||||
boolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *,
|
||||
struct aout_link_hash_entry *));
|
||||
boolean (*write_dynamic_symbol)
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *));
|
||||
|
||||
/* If this callback is not NULL, the linker calls it for each reloc.
|
||||
RELOC is a pointer to the unswapped reloc. If *SKIP is set to
|
||||
true, the reloc will be skipped. *RELOCATION may be changed to
|
||||
change the effects of the relocation. */
|
||||
boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info,
|
||||
bfd *input_bfd,
|
||||
asection *input_section,
|
||||
struct aout_link_hash_entry *h,
|
||||
PTR reloc, bfd_byte *contents,
|
||||
boolean *skip,
|
||||
bfd_vma *relocation));
|
||||
boolean (*check_dynamic_reloc)
|
||||
PARAMS ((struct bfd_link_info *info, bfd *input_bfd,
|
||||
asection *input_section, struct aout_link_hash_entry *h,
|
||||
PTR reloc, bfd_byte *contents, boolean *skip,
|
||||
bfd_vma *relocation));
|
||||
|
||||
/* Called at the end of a link to finish up any dynamic linking
|
||||
information. */
|
||||
boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *));
|
||||
boolean (*finish_dynamic_link)
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
};
|
||||
#define aout_backend_info(abfd) \
|
||||
((CONST struct aout_backend_data *)((abfd)->xvec->backend_data))
|
||||
((const struct aout_backend_data *)((abfd)->xvec->backend_data))
|
||||
|
||||
/* This is the layout in memory of a "struct exec" while we process it.
|
||||
All 'lengths' are given as a number of bytes.
|
||||
|
|
@ -199,7 +266,7 @@ struct internal_exec
|
|||
char a_relaxable; /* Enough info for linker relax */
|
||||
};
|
||||
|
||||
/* Magic number is written
|
||||
/* Magic number is written
|
||||
< MSB >
|
||||
3130292827262524232221201918171615141312111009080706050403020100
|
||||
< FLAGS >< MACHINE TYPE >< MAGIC NUMBER >
|
||||
|
|
@ -273,7 +340,7 @@ enum machine_type {
|
|||
|
||||
#ifndef N_SET_DYNAMIC
|
||||
# define N_SET_DYNAMIC(exec, dynamic) \
|
||||
((exec).a_info = (dynamic) ? ((exec).a_info | 0x80000000) : \
|
||||
((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \
|
||||
((exec).a_info & 0x7fffffff))
|
||||
#endif
|
||||
|
||||
|
|
@ -308,7 +375,7 @@ typedef struct aout_symbol {
|
|||
struct aoutdata {
|
||||
struct internal_exec *hdr; /* exec file header */
|
||||
aout_symbol_type *symbols; /* symtab for input bfd */
|
||||
|
||||
|
||||
/* For ease, we do this */
|
||||
asection *textsec;
|
||||
asection *datasec;
|
||||
|
|
@ -423,151 +490,131 @@ struct aout_section_data_struct
|
|||
|
||||
/* Prototype declarations for functions defined in aoutx.h */
|
||||
|
||||
boolean
|
||||
NAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section));
|
||||
extern boolean NAME(aout,squirt_out_relocs)
|
||||
PARAMS ((bfd *, asection *));
|
||||
|
||||
boolean
|
||||
NAME(aout,make_sections) PARAMS ((bfd *));
|
||||
extern boolean NAME(aout,make_sections)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
const bfd_target *
|
||||
NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd,
|
||||
struct internal_exec *execp,
|
||||
const bfd_target *(*callback)(bfd *)));
|
||||
extern const bfd_target * NAME(aout,some_aout_object_p)
|
||||
PARAMS ((bfd *, struct internal_exec *, const bfd_target *(*) (bfd *)));
|
||||
|
||||
boolean
|
||||
NAME(aout,mkobject) PARAMS ((bfd *abfd));
|
||||
extern boolean NAME(aout,mkobject)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
enum machine_type
|
||||
NAME(aout,machine_type) PARAMS ((enum bfd_architecture arch,
|
||||
unsigned long machine,
|
||||
boolean *unknown));
|
||||
extern enum machine_type NAME(aout,machine_type)
|
||||
PARAMS ((enum bfd_architecture, unsigned long, boolean *));
|
||||
|
||||
boolean
|
||||
NAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch,
|
||||
unsigned long machine));
|
||||
extern boolean NAME(aout,set_arch_mach)
|
||||
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
|
||||
|
||||
boolean
|
||||
NAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect));
|
||||
extern boolean NAME(aout,new_section_hook)
|
||||
PARAMS ((bfd *, asection *));
|
||||
|
||||
boolean
|
||||
NAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section,
|
||||
PTR location, file_ptr offset, bfd_size_type count));
|
||||
extern boolean NAME(aout,set_section_contents)
|
||||
PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
|
||||
|
||||
asymbol *
|
||||
NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd));
|
||||
extern asymbol * NAME(aout,make_empty_symbol)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
boolean
|
||||
NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *,
|
||||
struct external_nlist *,
|
||||
bfd_size_type, char *,
|
||||
bfd_size_type,
|
||||
boolean dynamic));
|
||||
extern boolean NAME(aout,translate_symbol_table)
|
||||
PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type,
|
||||
char *, bfd_size_type, boolean));
|
||||
|
||||
boolean
|
||||
NAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd));
|
||||
extern boolean NAME(aout,slurp_symbol_table)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
boolean
|
||||
NAME(aout,write_syms) PARAMS ((bfd *abfd));
|
||||
extern boolean NAME(aout,write_syms)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
void
|
||||
NAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd));
|
||||
extern void NAME(aout,reclaim_symbol_table)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
long
|
||||
NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd));
|
||||
extern long NAME(aout,get_symtab_upper_bound)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
long
|
||||
NAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location));
|
||||
extern long NAME(aout,get_symtab)
|
||||
PARAMS ((bfd *, asymbol **));
|
||||
|
||||
void
|
||||
NAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *,
|
||||
arelent *, asymbol **, bfd_size_type));
|
||||
void
|
||||
NAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
|
||||
arelent *, asymbol **, bfd_size_type));
|
||||
extern void NAME(aout,swap_ext_reloc_in)
|
||||
PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **,
|
||||
bfd_size_type));
|
||||
extern void NAME(aout,swap_std_reloc_in)
|
||||
PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **,
|
||||
bfd_size_type));
|
||||
|
||||
reloc_howto_type *
|
||||
NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd,
|
||||
bfd_reloc_code_real_type code));
|
||||
extern reloc_howto_type * NAME(aout,reloc_type_lookup)
|
||||
PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
|
||||
boolean
|
||||
NAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect,
|
||||
asymbol **symbols));
|
||||
extern boolean NAME(aout,slurp_reloc_table)
|
||||
PARAMS ((bfd *, sec_ptr, asymbol **));
|
||||
|
||||
long
|
||||
NAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section,
|
||||
arelent **relptr, asymbol **symbols));
|
||||
extern long NAME(aout,canonicalize_reloc)
|
||||
PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
|
||||
|
||||
long
|
||||
NAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect));
|
||||
extern long NAME(aout,get_reloc_upper_bound)
|
||||
PARAMS ((bfd *, sec_ptr));
|
||||
|
||||
void
|
||||
NAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore));
|
||||
extern void NAME(aout,reclaim_reloc)
|
||||
PARAMS ((bfd *, sec_ptr));
|
||||
|
||||
alent *
|
||||
NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol));
|
||||
extern alent * NAME(aout,get_lineno)
|
||||
PARAMS ((bfd *, asymbol *));
|
||||
|
||||
void
|
||||
NAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file,
|
||||
asymbol *symbol, bfd_print_symbol_type how));
|
||||
extern void NAME(aout,print_symbol)
|
||||
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
|
||||
|
||||
void
|
||||
NAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd,
|
||||
asymbol *symbol, symbol_info *ret));
|
||||
extern void NAME(aout,get_symbol_info)
|
||||
PARAMS ((bfd *, asymbol *, symbol_info *));
|
||||
|
||||
boolean
|
||||
NAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section,
|
||||
asymbol **symbols, bfd_vma offset, CONST char **filename_ptr,
|
||||
CONST char **functionname_ptr, unsigned int *line_ptr));
|
||||
extern boolean NAME(aout,find_nearest_line)
|
||||
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
|
||||
const char **, unsigned int *));
|
||||
|
||||
long
|
||||
NAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *));
|
||||
extern long NAME(aout,read_minisymbols)
|
||||
PARAMS ((bfd *, boolean, PTR *, unsigned int *));
|
||||
|
||||
asymbol *
|
||||
NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
|
||||
asymbol *));
|
||||
extern asymbol * NAME(aout,minisymbol_to_symbol)
|
||||
PARAMS ((bfd *, boolean, const PTR, asymbol *));
|
||||
|
||||
int
|
||||
NAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec));
|
||||
extern int NAME(aout,sizeof_headers)
|
||||
PARAMS ((bfd *, boolean));
|
||||
|
||||
boolean
|
||||
NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd,
|
||||
bfd_size_type *text_size, file_ptr *text_end));
|
||||
extern boolean NAME(aout,adjust_sizes_and_vmas)
|
||||
PARAMS ((bfd *, bfd_size_type *, file_ptr *));
|
||||
|
||||
void
|
||||
NAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd,
|
||||
struct external_exec *raw_bytes, struct internal_exec *execp));
|
||||
extern void NAME(aout,swap_exec_header_in)
|
||||
PARAMS ((bfd *, struct external_exec *, struct internal_exec *));
|
||||
|
||||
void
|
||||
NAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd,
|
||||
struct internal_exec *execp, struct external_exec *raw_bytes));
|
||||
extern void NAME(aout,swap_exec_header_out)
|
||||
PARAMS ((bfd *, struct internal_exec *, struct external_exec *));
|
||||
|
||||
struct bfd_hash_entry *
|
||||
NAME(aout,link_hash_newfunc)
|
||||
extern struct bfd_hash_entry * NAME(aout,link_hash_newfunc)
|
||||
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
|
||||
|
||||
boolean
|
||||
NAME(aout,link_hash_table_init)
|
||||
PARAMS ((struct aout_link_hash_table *, bfd *,
|
||||
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
||||
struct bfd_hash_table *,
|
||||
const char *)));
|
||||
extern boolean NAME(aout,link_hash_table_init)
|
||||
PARAMS ((struct aout_link_hash_table *, bfd *,
|
||||
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
||||
struct bfd_hash_table *,
|
||||
const char *)));
|
||||
|
||||
struct bfd_link_hash_table *
|
||||
NAME(aout,link_hash_table_create) PARAMS ((bfd *));
|
||||
extern struct bfd_link_hash_table * NAME(aout,link_hash_table_create)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
boolean
|
||||
NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
|
||||
extern boolean NAME(aout,link_add_symbols)
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
boolean
|
||||
NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *,
|
||||
void (*) (bfd *, file_ptr *, file_ptr *,
|
||||
file_ptr *)));
|
||||
extern boolean NAME(aout,final_link)
|
||||
PARAMS ((bfd *, struct bfd_link_info *,
|
||||
void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *)));
|
||||
|
||||
boolean
|
||||
NAME(aout,bfd_free_cached_info) PARAMS ((bfd *));
|
||||
extern boolean NAME(aout,bfd_free_cached_info)
|
||||
PARAMS ((bfd *));
|
||||
|
||||
/* A.out uses the generic versions of these routines... */
|
||||
|
||||
#define aout_16_get_section_contents _bfd_generic_get_section_contents
|
||||
|
||||
#define aout_32_get_section_contents _bfd_generic_get_section_contents
|
||||
|
||||
#define aout_64_get_section_contents _bfd_generic_get_section_contents
|
||||
|
|
@ -596,31 +643,32 @@ NAME(aout,bfd_free_cached_info) PARAMS ((bfd *));
|
|||
obj_reloc_entry_size (abfd)); \
|
||||
NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \
|
||||
\
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false; \
|
||||
if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) \
|
||||
!= EXEC_BYTES_SIZE) \
|
||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
|
||||
|| bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
|
||||
abfd) != EXEC_BYTES_SIZE) \
|
||||
return false; \
|
||||
/* Now write out reloc info, followed by syms and strings */ \
|
||||
\
|
||||
if (bfd_get_outsymbols (abfd) != (asymbol **) NULL \
|
||||
&& bfd_get_symcount (abfd) != 0) \
|
||||
{ \
|
||||
if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET) != 0) \
|
||||
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\
|
||||
return false; \
|
||||
\
|
||||
if (! NAME(aout,write_syms)(abfd)) return false; \
|
||||
if (! NAME(aout,write_syms) (abfd)) \
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET) != 0) \
|
||||
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0) \
|
||||
return false; \
|
||||
if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \
|
||||
return false; \
|
||||
\
|
||||
if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) != 0) \
|
||||
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0) \
|
||||
return false; \
|
||||
if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) \
|
||||
if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd))) \
|
||||
return false; \
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! defined (LIBAOUT_H) */
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@
|
|||
Free Software Foundation, Inc.
|
||||
Written by Cygnus Support.
|
||||
|
||||
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
|
||||
** change libbfd-in.h or the other BFD source files processed to
|
||||
** generate this file.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -29,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
E.g. align to an 8-byte boundary with argument of 8. Take care never
|
||||
to wrap around if the address is within boundary-1 of the end of the
|
||||
address space. */
|
||||
#define BFD_ALIGN(this, boundary) \
|
||||
((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
|
||||
? (((bfd_vma) (this) + ((boundary) - 1)) & (~((boundary)-1))) \
|
||||
#define BFD_ALIGN(this, boundary) \
|
||||
((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
|
||||
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
|
||||
: ~ (bfd_vma) 0)
|
||||
|
||||
/* If you want to read and write large blocks, you might want to do it
|
||||
|
|
@ -87,20 +83,20 @@ struct areltdata {
|
|||
|
||||
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
|
||||
|
||||
extern PTR bfd_malloc PARAMS ((size_t));
|
||||
extern PTR bfd_realloc PARAMS ((PTR, size_t));
|
||||
extern PTR bfd_zmalloc PARAMS ((size_t));
|
||||
extern PTR bfd_malloc PARAMS ((bfd_size_type));
|
||||
extern PTR bfd_realloc PARAMS ((PTR, bfd_size_type));
|
||||
extern PTR bfd_zmalloc PARAMS ((bfd_size_type));
|
||||
|
||||
extern bfd_error_handler_type _bfd_error_handler;
|
||||
|
||||
/* These routines allocate and free things on the BFD's objalloc. */
|
||||
|
||||
extern PTR bfd_alloc PARAMS ((bfd *, size_t));
|
||||
extern PTR bfd_zalloc PARAMS ((bfd *, size_t));
|
||||
extern PTR bfd_alloc PARAMS ((bfd *, bfd_size_type));
|
||||
extern PTR bfd_zalloc PARAMS ((bfd *, bfd_size_type));
|
||||
extern void bfd_release PARAMS ((bfd *, PTR));
|
||||
|
||||
bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd));
|
||||
bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index));
|
||||
bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *, file_ptr));
|
||||
boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *));
|
||||
boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd));
|
||||
const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd));
|
||||
|
|
@ -116,6 +112,7 @@ boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength));
|
|||
bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos));
|
||||
extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex));
|
||||
bfd * _bfd_new_bfd PARAMS ((void));
|
||||
void _bfd_delete_bfd PARAMS ((bfd *));
|
||||
|
||||
boolean bfd_false PARAMS ((bfd *ignore));
|
||||
boolean bfd_true PARAMS ((bfd *ignore));
|
||||
|
|
@ -162,8 +159,7 @@ int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
|
|||
#define _bfd_generic_new_section_hook \
|
||||
((boolean (*) PARAMS ((bfd *, asection *))) bfd_true)
|
||||
extern boolean _bfd_generic_get_section_contents
|
||||
PARAMS ((bfd *, asection *, PTR location, file_ptr offset,
|
||||
bfd_size_type count));
|
||||
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
|
||||
extern boolean _bfd_generic_get_section_contents_in_window
|
||||
PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type));
|
||||
|
||||
|
|
@ -255,8 +251,7 @@ extern boolean _bfd_archive_coff_construct_extended_name_table
|
|||
#define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
|
||||
#define _bfd_nosymbols_get_symtab \
|
||||
((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
|
||||
#define _bfd_nosymbols_make_empty_symbol \
|
||||
((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
|
||||
#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
|
||||
#define _bfd_nosymbols_print_symbol \
|
||||
((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void)
|
||||
#define _bfd_nosymbols_get_symbol_info \
|
||||
|
|
@ -323,6 +318,10 @@ extern boolean _bfd_generic_set_section_contents
|
|||
((boolean (*) \
|
||||
PARAMS ((bfd *, struct bfd_link_info *))) \
|
||||
bfd_false)
|
||||
#define _bfd_nolink_bfd_merge_sections \
|
||||
((boolean (*) \
|
||||
PARAMS ((bfd *, struct bfd_link_info *))) \
|
||||
bfd_false)
|
||||
#define _bfd_nolink_bfd_link_hash_table_create \
|
||||
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
|
||||
#define _bfd_nolink_bfd_link_add_symbols \
|
||||
|
|
@ -369,6 +368,10 @@ extern boolean _bfd_dwarf2_find_nearest_line
|
|||
const char **, unsigned int *, unsigned int,
|
||||
PTR *));
|
||||
|
||||
/* Create a new section entry. */
|
||||
extern struct bfd_hash_entry *bfd_section_hash_newfunc
|
||||
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
|
||||
|
||||
/* A routine to create entries for a bfd_link_hash_table. */
|
||||
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
|
||||
PARAMS ((struct bfd_hash_entry *entry,
|
||||
|
|
@ -436,7 +439,7 @@ extern unsigned int _bfd_count_link_order_relocs
|
|||
/* Final link relocation routine. */
|
||||
extern bfd_reloc_status_type _bfd_final_link_relocate
|
||||
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
|
||||
bfd_vma address, bfd_vma value, bfd_vma addend));
|
||||
bfd_vma, bfd_vma, bfd_vma));
|
||||
|
||||
/* Relocate a particular location by a howto and a value. */
|
||||
extern bfd_reloc_status_type _bfd_relocate_contents
|
||||
|
|
@ -447,6 +450,11 @@ extern bfd_reloc_status_type _bfd_relocate_contents
|
|||
extern boolean _bfd_link_section_stabs
|
||||
PARAMS ((bfd *, PTR *, asection *, asection *, PTR *));
|
||||
|
||||
/* Eliminate stabs for discarded functions and symbols. */
|
||||
extern boolean _bfd_discard_section_stabs
|
||||
PARAMS ((bfd *, asection *, PTR,
|
||||
boolean (*) (bfd_vma, PTR), PTR));
|
||||
|
||||
/* Write out the .stab section when linking stabs in sections. */
|
||||
|
||||
extern boolean _bfd_write_section_stabs
|
||||
|
|
@ -462,6 +470,26 @@ extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *));
|
|||
extern bfd_vma _bfd_stab_section_offset
|
||||
PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma));
|
||||
|
||||
/* Attempt to merge a SEC_MERGE section. */
|
||||
|
||||
extern boolean _bfd_merge_section
|
||||
PARAMS ((bfd *, PTR *, asection *, PTR *));
|
||||
|
||||
/* Attempt to merge SEC_MERGE sections. */
|
||||
|
||||
extern boolean _bfd_merge_sections
|
||||
PARAMS ((bfd *, PTR, void (*)(bfd *, asection *)));
|
||||
|
||||
/* Write out a merged section. */
|
||||
|
||||
extern boolean _bfd_write_merged_section
|
||||
PARAMS ((bfd *, asection *, PTR));
|
||||
|
||||
/* Find an offset within a modified SEC_MERGE section. */
|
||||
|
||||
extern bfd_vma _bfd_merged_section_offset
|
||||
PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma));
|
||||
|
||||
/* Create a string table. */
|
||||
extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void));
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#define getpagesize() 2048
|
||||
#endif
|
||||
|
||||
static int real_read PARAMS ((PTR, size_t, size_t, FILE *));
|
||||
static size_t real_read PARAMS ((PTR, size_t, size_t, FILE *));
|
||||
|
||||
/*
|
||||
SECTION
|
||||
|
|
@ -153,13 +153,20 @@ _bfd_dummy_target (ignore_abfd)
|
|||
|
||||
PTR
|
||||
bfd_malloc (size)
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
{
|
||||
PTR ptr;
|
||||
|
||||
ptr = (PTR) malloc (size);
|
||||
if (ptr == NULL && size != 0)
|
||||
if (size != (size_t) size)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = (PTR) malloc ((size_t) size);
|
||||
if (ptr == NULL && (size_t) size != 0)
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
|
@ -168,16 +175,22 @@ bfd_malloc (size)
|
|||
PTR
|
||||
bfd_realloc (ptr, size)
|
||||
PTR ptr;
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
{
|
||||
PTR ret;
|
||||
|
||||
if (ptr == NULL)
|
||||
ret = malloc (size);
|
||||
else
|
||||
ret = realloc (ptr, size);
|
||||
if (size != (size_t) size)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ret == NULL)
|
||||
if (ptr == NULL)
|
||||
ret = malloc ((size_t) size);
|
||||
else
|
||||
ret = realloc (ptr, (size_t) size);
|
||||
|
||||
if (ret == NULL && (size_t) size != 0)
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
|
||||
return ret;
|
||||
|
|
@ -187,18 +200,24 @@ bfd_realloc (ptr, size)
|
|||
|
||||
PTR
|
||||
bfd_zmalloc (size)
|
||||
size_t size;
|
||||
bfd_size_type size;
|
||||
{
|
||||
PTR ptr;
|
||||
|
||||
ptr = (PTR) malloc (size);
|
||||
if (size != (size_t) size)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (size != 0)
|
||||
ptr = (PTR) malloc ((size_t) size);
|
||||
|
||||
if ((size_t) size != 0)
|
||||
{
|
||||
if (ptr == NULL)
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
else
|
||||
memset (ptr, 0, size);
|
||||
memset (ptr, 0, (size_t) size);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
@ -213,8 +232,8 @@ bfd_zmalloc (size)
|
|||
contents (0 for non-archive elements). For archive entries this is the
|
||||
first octet in the file, NOT the beginning of the archive header. */
|
||||
|
||||
static int
|
||||
real_read (where, a,b, file)
|
||||
static size_t
|
||||
real_read (where, a, b, file)
|
||||
PTR where;
|
||||
size_t a;
|
||||
size_t b;
|
||||
|
|
@ -242,17 +261,15 @@ real_read (where, a,b, file)
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Return value is amount read (FIXME: how are errors and end of file dealt
|
||||
with? We never call bfd_set_error, which is probably a mistake). */
|
||||
/* Return value is amount read. */
|
||||
|
||||
bfd_size_type
|
||||
bfd_read (ptr, size, nitems, abfd)
|
||||
bfd_bread (ptr, size, abfd)
|
||||
PTR ptr;
|
||||
bfd_size_type size;
|
||||
bfd_size_type nitems;
|
||||
bfd *abfd;
|
||||
{
|
||||
int nread;
|
||||
size_t nread;
|
||||
|
||||
if ((abfd->flags & BFD_IN_MEMORY) != 0)
|
||||
{
|
||||
|
|
@ -260,7 +277,7 @@ bfd_read (ptr, size, nitems, abfd)
|
|||
bfd_size_type get;
|
||||
|
||||
bim = (struct bfd_in_memory *) abfd->iostream;
|
||||
get = size * nitems;
|
||||
get = size;
|
||||
if (abfd->where + get > bim->size)
|
||||
{
|
||||
if (bim->size < (bfd_size_type) abfd->where)
|
||||
|
|
@ -269,13 +286,13 @@ bfd_read (ptr, size, nitems, abfd)
|
|||
get = bim->size - abfd->where;
|
||||
bfd_set_error (bfd_error_file_truncated);
|
||||
}
|
||||
memcpy (ptr, bim->buffer + abfd->where, get);
|
||||
memcpy (ptr, bim->buffer + abfd->where, (size_t) get);
|
||||
abfd->where += get;
|
||||
return get;
|
||||
}
|
||||
|
||||
nread = real_read (ptr, 1, (size_t) (size*nitems), bfd_cache_lookup(abfd));
|
||||
if (nread > 0)
|
||||
nread = real_read (ptr, 1, (size_t) size, bfd_cache_lookup (abfd));
|
||||
if (nread != (size_t) -1)
|
||||
abfd->where += nread;
|
||||
|
||||
/* Set bfd_error if we did not read as much data as we expected.
|
||||
|
|
@ -285,7 +302,7 @@ bfd_read (ptr, size, nitems, abfd)
|
|||
|
||||
A BFD backend may wish to override bfd_error_file_truncated to
|
||||
provide something more useful (eg. no_symbols or wrong_format). */
|
||||
if (nread != (int) (size * nitems))
|
||||
if (nread != size)
|
||||
{
|
||||
if (ferror (bfd_cache_lookup (abfd)))
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
|
|
@ -386,7 +403,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
|
|||
{
|
||||
static size_t pagesize;
|
||||
bfd_window_internal *i = windowp->i;
|
||||
size_t size_to_alloc = size;
|
||||
bfd_size_type size_to_alloc = size;
|
||||
|
||||
if (debug_windows)
|
||||
fprintf (stderr, "bfd_get_file_window (%p, %6ld, %6ld, %p<%p,%lx,%p>, %d)",
|
||||
|
|
@ -402,7 +419,9 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
|
|||
|
||||
if (i == 0)
|
||||
{
|
||||
windowp->i = i = (bfd_window_internal *) bfd_zmalloc (sizeof (bfd_window_internal));
|
||||
i = ((bfd_window_internal *)
|
||||
bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal)));
|
||||
windowp->i = i;
|
||||
if (i == 0)
|
||||
return false;
|
||||
i->data = 0;
|
||||
|
|
@ -497,12 +516,11 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
|
|||
{
|
||||
if (size_to_alloc == 0)
|
||||
return true;
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return false;
|
||||
}
|
||||
if (bfd_seek (abfd, offset, SEEK_SET) != 0)
|
||||
return false;
|
||||
i->size = bfd_read (i->data, size, 1, abfd);
|
||||
i->size = bfd_bread (i->data, size, abfd);
|
||||
if (i->size != size)
|
||||
return false;
|
||||
i->mapped = 0;
|
||||
|
|
@ -523,24 +541,25 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
|
|||
#endif /* USE_MMAP */
|
||||
|
||||
bfd_size_type
|
||||
bfd_write (ptr, size, nitems, abfd)
|
||||
CONST PTR ptr;
|
||||
bfd_bwrite (ptr, size, abfd)
|
||||
const PTR ptr;
|
||||
bfd_size_type size;
|
||||
bfd_size_type nitems;
|
||||
bfd *abfd;
|
||||
{
|
||||
long nwrote;
|
||||
size_t nwrote;
|
||||
|
||||
if ((abfd->flags & BFD_IN_MEMORY) != 0)
|
||||
{
|
||||
struct bfd_in_memory *bim = (struct bfd_in_memory *) (abfd->iostream);
|
||||
size *= nitems;
|
||||
size = (size_t) size;
|
||||
if (abfd->where + size > bim->size)
|
||||
{
|
||||
long newsize, oldsize = (bim->size + 127) & ~127;
|
||||
bfd_size_type newsize, oldsize;
|
||||
|
||||
oldsize = (bim->size + 127) & ~(bfd_size_type) 127;
|
||||
bim->size = abfd->where + size;
|
||||
/* Round up to cut down on memory fragmentation */
|
||||
newsize = (bim->size + 127) & ~127;
|
||||
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
|
||||
if (newsize > oldsize)
|
||||
{
|
||||
bim->buffer = bfd_realloc (bim->buffer, newsize);
|
||||
|
|
@ -551,20 +570,18 @@ bfd_write (ptr, size, nitems, abfd)
|
|||
}
|
||||
}
|
||||
}
|
||||
memcpy (bim->buffer + abfd->where, ptr, size);
|
||||
memcpy (bim->buffer + abfd->where, ptr, (size_t) size);
|
||||
abfd->where += size;
|
||||
return size;
|
||||
}
|
||||
|
||||
nwrote = fwrite (ptr, 1, (size_t) (size * nitems),
|
||||
bfd_cache_lookup (abfd));
|
||||
if (nwrote > 0)
|
||||
nwrote = fwrite (ptr, 1, (size_t) size, bfd_cache_lookup (abfd));
|
||||
if (nwrote != (size_t) -1)
|
||||
abfd->where += nwrote;
|
||||
if ((bfd_size_type) nwrote != size * nitems)
|
||||
if (nwrote != size)
|
||||
{
|
||||
#ifdef ENOSPC
|
||||
if (nwrote >= 0)
|
||||
errno = ENOSPC;
|
||||
errno = ENOSPC;
|
||||
#endif
|
||||
bfd_set_error (bfd_error_system_call);
|
||||
}
|
||||
|
|
@ -576,7 +593,7 @@ INTERNAL_FUNCTION
|
|||
bfd_write_bigendian_4byte_int
|
||||
|
||||
SYNOPSIS
|
||||
void bfd_write_bigendian_4byte_int(bfd *abfd, int i);
|
||||
void bfd_write_bigendian_4byte_int (bfd *, unsigned int);
|
||||
|
||||
DESCRIPTION
|
||||
Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big
|
||||
|
|
@ -587,15 +604,15 @@ DESCRIPTION
|
|||
void
|
||||
bfd_write_bigendian_4byte_int (abfd, i)
|
||||
bfd *abfd;
|
||||
int i;
|
||||
unsigned int i;
|
||||
{
|
||||
bfd_byte buffer[4];
|
||||
bfd_putb32(i, buffer);
|
||||
if (bfd_write((PTR)buffer, 4, 1, abfd) != 4)
|
||||
bfd_putb32 ((bfd_vma) i, buffer);
|
||||
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) != 4)
|
||||
abort ();
|
||||
}
|
||||
|
||||
long
|
||||
bfd_vma
|
||||
bfd_tell (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
|
|
@ -604,7 +621,7 @@ bfd_tell (abfd)
|
|||
if ((abfd->flags & BFD_IN_MEMORY) != 0)
|
||||
return abfd->where;
|
||||
|
||||
ptr = ftell (bfd_cache_lookup(abfd));
|
||||
ptr = ftell (bfd_cache_lookup (abfd));
|
||||
|
||||
if (abfd->my_archive)
|
||||
ptr -= abfd->origin;
|
||||
|
|
@ -657,7 +674,7 @@ bfd_seek (abfd, position, direction)
|
|||
{
|
||||
int result;
|
||||
FILE *f;
|
||||
file_ptr file_position;
|
||||
long file_position;
|
||||
/* For the time being, a BFD may not seek to it's end. The problem
|
||||
is that we don't easily have a way to recognize the end of an
|
||||
element in an archive. */
|
||||
|
|
@ -678,22 +695,22 @@ bfd_seek (abfd, position, direction)
|
|||
else
|
||||
abfd->where += position;
|
||||
|
||||
if ((bfd_size_type) abfd->where > bim->size)
|
||||
if (abfd->where > bim->size)
|
||||
{
|
||||
if ((abfd->direction == write_direction) ||
|
||||
(abfd->direction == both_direction))
|
||||
{
|
||||
long newsize, oldsize = (bim->size + 127) & ~127;
|
||||
bfd_size_type newsize, oldsize;
|
||||
oldsize = (bim->size + 127) & ~(bfd_size_type) 127;
|
||||
bim->size = abfd->where;
|
||||
/* Round up to cut down on memory fragmentation */
|
||||
newsize = (bim->size + 127) & ~127;
|
||||
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
|
||||
if (newsize > oldsize)
|
||||
{
|
||||
bim->buffer = bfd_realloc (bim->buffer, newsize);
|
||||
if (bim->buffer == 0)
|
||||
{
|
||||
bim->size = 0;
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -724,7 +741,7 @@ bfd_seek (abfd, position, direction)
|
|||
if (where_am_i_now != abfd->where)
|
||||
abort ();
|
||||
#endif
|
||||
if (direction == SEEK_SET && position == abfd->where)
|
||||
if (direction == SEEK_SET && (bfd_vma) position == abfd->where)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -819,9 +836,9 @@ DESCRIPTION
|
|||
.#define bfd_put_signed_8 \
|
||||
. bfd_put_8
|
||||
.#define bfd_get_8(abfd, ptr) \
|
||||
. (*(unsigned char *) (ptr))
|
||||
. (*(unsigned char *) (ptr) & 0xff)
|
||||
.#define bfd_get_signed_8(abfd, ptr) \
|
||||
. ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
|
||||
. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
|
||||
.
|
||||
.#define bfd_put_16(abfd, val, ptr) \
|
||||
. BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
|
||||
|
|
@ -851,14 +868,14 @@ DESCRIPTION
|
|||
. BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
|
||||
.
|
||||
.#define bfd_get(bits, abfd, ptr) \
|
||||
. ((bits) == 8 ? bfd_get_8 (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) == 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) \
|
||||
|
|
@ -873,7 +890,7 @@ FUNCTION
|
|||
|
||||
DESCRIPTION
|
||||
These macros have the same function as their <<bfd_get_x>>
|
||||
bretheren, except that they are used for removing information
|
||||
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.
|
||||
|
|
@ -881,42 +898,89 @@ DESCRIPTION
|
|||
.{* Byte swapping macros for file header data. *}
|
||||
.
|
||||
.#define bfd_h_put_8(abfd, val, ptr) \
|
||||
. bfd_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)
|
||||
. bfd_put_8 (abfd, val, ptr)
|
||||
.#define bfd_h_get_8(abfd, ptr) \
|
||||
. bfd_get_8 (abfd, ptr)
|
||||
. bfd_get_8 (abfd, ptr)
|
||||
.#define bfd_h_get_signed_8(abfd, ptr) \
|
||||
. bfd_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))
|
||||
. BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
|
||||
.#define bfd_h_put_signed_16 \
|
||||
. bfd_h_put_16
|
||||
. bfd_h_put_16
|
||||
.#define bfd_h_get_16(abfd, ptr) \
|
||||
. BFD_SEND(abfd, bfd_h_getx16,(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))
|
||||
. 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))
|
||||
. BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
|
||||
.#define bfd_h_put_signed_32 \
|
||||
. bfd_h_put_32
|
||||
. bfd_h_put_32
|
||||
.#define bfd_h_get_32(abfd, ptr) \
|
||||
. BFD_SEND(abfd, bfd_h_getx32,(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))
|
||||
. 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))
|
||||
. BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
|
||||
.#define bfd_h_put_signed_64 \
|
||||
. bfd_h_put_64
|
||||
. bfd_h_put_64
|
||||
.#define bfd_h_get_64(abfd, ptr) \
|
||||
. BFD_SEND(abfd, bfd_h_getx64,(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))
|
||||
. BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
|
||||
.
|
||||
*/
|
||||
.{* Refinements on the above, which should eventually go away. Save
|
||||
. cluttering the source with (bfd_vma) and (bfd_byte *) casts. *}
|
||||
.
|
||||
.#define H_PUT_64(abfd, val, where) \
|
||||
. bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_32(abfd, val, where) \
|
||||
. bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_16(abfd, val, where) \
|
||||
. bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_8 bfd_h_put_8
|
||||
.
|
||||
.#define H_PUT_S64(abfd, val, where) \
|
||||
. bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_S32(abfd, val, where) \
|
||||
. bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_S16(abfd, val, where) \
|
||||
. bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_PUT_S8 bfd_h_put_signed_8
|
||||
.
|
||||
.#define H_GET_64(abfd, where) \
|
||||
. bfd_h_get_64 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_32(abfd, where) \
|
||||
. bfd_h_get_32 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_16(abfd, where) \
|
||||
. bfd_h_get_16 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_8 bfd_h_get_8
|
||||
.
|
||||
.#define H_GET_S64(abfd, where) \
|
||||
. bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_S32(abfd, where) \
|
||||
. bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_S16(abfd, where) \
|
||||
. bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
|
||||
.
|
||||
.#define H_GET_S8 bfd_h_get_signed_8
|
||||
.
|
||||
.*/
|
||||
|
||||
/* Sign extension to bfd_signed_vma. */
|
||||
#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
|
||||
|
|
@ -1240,14 +1304,14 @@ _bfd_generic_get_section_contents (abfd, section, location, offset, count)
|
|||
if (count == 0)
|
||||
return true;
|
||||
|
||||
if ((bfd_size_type) (offset + count) > section->_raw_size)
|
||||
if (offset + count > section->_raw_size)
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
|
||||
|| bfd_read (location, (bfd_size_type) 1, count, abfd) != count)
|
||||
|| bfd_bread (location, count, abfd) != count)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -1272,10 +1336,11 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
|
|||
/* @@ FIXME : If the internal window has a refcount of 1 and was
|
||||
allocated with malloc instead of mmap, just reuse it. */
|
||||
bfd_free_window (w);
|
||||
w->i = (bfd_window_internal *) bfd_zmalloc (sizeof (bfd_window_internal));
|
||||
w->i = ((bfd_window_internal *)
|
||||
bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal)));
|
||||
if (w->i == NULL)
|
||||
return false;
|
||||
w->i->data = (PTR) bfd_malloc ((size_t) count);
|
||||
w->i->data = (PTR) bfd_malloc (count);
|
||||
if (w->i->data == NULL)
|
||||
{
|
||||
free (w->i);
|
||||
|
|
@ -1288,7 +1353,7 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
|
|||
w->data = w->i->data;
|
||||
return bfd_get_section_contents (abfd, section, w->data, offset, count);
|
||||
}
|
||||
if ((bfd_size_type) (offset+count) > section->_raw_size
|
||||
if (offset + count > section->_raw_size
|
||||
|| (bfd_get_file_window (abfd, section->filepos + offset, count, w, true)
|
||||
== false))
|
||||
return false;
|
||||
|
|
@ -1313,8 +1378,8 @@ _bfd_generic_set_section_contents (abfd, section, location, offset, count)
|
|||
if (count == 0)
|
||||
return true;
|
||||
|
||||
if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) == -1
|
||||
|| bfd_write (location, (bfd_size_type) 1, count, abfd) != count)
|
||||
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
|
||||
|| bfd_bwrite (location, count, abfd) != count)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -1325,11 +1390,11 @@ INTERNAL_FUNCTION
|
|||
bfd_log2
|
||||
|
||||
SYNOPSIS
|
||||
unsigned int bfd_log2(bfd_vma x);
|
||||
unsigned int bfd_log2 (bfd_vma x);
|
||||
|
||||
DESCRIPTION
|
||||
Return the log base 2 of the value supplied, rounded up. E.g., an
|
||||
@var{x} of 1025 returns 11.
|
||||
@var{x} of 1025 returns 11. A @var{x} of 0 returns 0.
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
|
|
@ -1372,7 +1437,7 @@ _bfd_generic_verify_endian_match (ibfd, obfd)
|
|||
else
|
||||
msg = _("%s: compiled for a little endian system and target is big endian");
|
||||
|
||||
(*_bfd_error_handler) (msg, bfd_get_filename (ibfd));
|
||||
(*_bfd_error_handler) (msg, bfd_archive_filename (ibfd));
|
||||
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return false;
|
||||
|
|
@ -1380,3 +1445,26 @@ _bfd_generic_verify_endian_match (ibfd, obfd)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Give a warning at runtime if someone compiles code which calls
|
||||
old routines. */
|
||||
void
|
||||
warn_deprecated (what, file, line, func)
|
||||
const char *what;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
{
|
||||
/* Poor man's tracking of functions we've already warned about. */
|
||||
static size_t mask = 0;
|
||||
|
||||
if (~(size_t) func & ~mask)
|
||||
{
|
||||
fprintf (stderr, _("Deprecated %s called"), what);
|
||||
if (func)
|
||||
fprintf (stderr, _(" at %s line %d in %s\n"), file, line, func);
|
||||
else
|
||||
fprintf (stderr, "\n");
|
||||
mask |= ~(size_t) func;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue