summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-03-06 00:56:39 +0000
committerDavid Carlton <carlton@bactrian.org>2003-03-06 00:56:39 +0000
commit2393a5d62fa28bde5a09ab6eb72dbe8becf59a21 (patch)
treeeabfd8ab1125d7aa1b982923a58d13af7218f0ff
parent2f0858263d878c3a0d2b8fb6a90a06f9f3b35dde (diff)
downloadbinutils-redhat-2393a5d62fa28bde5a09ab6eb72dbe8becf59a21.tar.gz
2003-03-05 David Carlton <carlton@math.stanford.edu>
* Merge with mainline. Tag is carlton_dictionary-20030305-merge.
-rw-r--r--ChangeLog101
-rw-r--r--Makefile.in3671
-rw-r--r--bfd/ChangeLog406
-rw-r--r--bfd/Makefile.am6
-rw-r--r--bfd/Makefile.in10
-rw-r--r--bfd/archures.c1
-rw-r--r--bfd/bfd-in.h9
-rw-r--r--bfd/bfd-in2.h56
-rw-r--r--bfd/bfd.c60
-rw-r--r--bfd/coff-h8300.c20
-rw-r--r--bfd/coff-ppc.c602
-rw-r--r--bfd/coffcode.h319
-rw-r--r--bfd/config.bfd17
-rw-r--r--bfd/cpu-arm.c6
-rw-r--r--bfd/doc/ChangeLog141
-rw-r--r--bfd/doc/bfd.texinfo389
-rw-r--r--bfd/doc/fdl.texi366
-rw-r--r--bfd/elf.c149
-rw-r--r--bfd/elf32-arm.h62
-rw-r--r--bfd/elf32-cris.c27
-rw-r--r--bfd/elf32-hppa.c237
-rw-r--r--bfd/elf32-i386.c153
-rw-r--r--bfd/elf32-m68k.c36
-rw-r--r--bfd/elf32-mips.c10
-rw-r--r--bfd/elf32-ppc.c3842
-rw-r--r--bfd/elf32-ppc.h23
-rw-r--r--bfd/elf32-s390.c540
-rw-r--r--bfd/elf32-sh.c150
-rw-r--r--bfd/elf32-sparc.c412
-rw-r--r--bfd/elf32-vax.c31
-rw-r--r--bfd/elf64-alpha.c3
-rw-r--r--bfd/elf64-hppa.c26
-rw-r--r--bfd/elf64-mips.c14
-rw-r--r--bfd/elf64-ppc.c1048
-rw-r--r--bfd/elf64-ppc.h2
-rw-r--r--bfd/elf64-s390.c130
-rw-r--r--bfd/elf64-sparc.c43
-rw-r--r--bfd/elf64-x86-64.c175
-rw-r--r--bfd/elfcore.h65
-rw-r--r--bfd/elflink.c24
-rw-r--r--bfd/elflink.h222
-rw-r--r--bfd/elfn32-mips.c14
-rw-r--r--bfd/elfxx-ia64.c579
-rw-r--r--bfd/elfxx-mips.c60
-rw-r--r--bfd/format.c50
-rw-r--r--bfd/libbfd.h1
-rw-r--r--bfd/libcoff.h9
-rw-r--r--bfd/po/da.po22
-rw-r--r--bfd/reloc.c6
-rw-r--r--bfd/syms.c93
-rw-r--r--bfd/targets.c14
-rw-r--r--bfd/version.h2
-rwxr-xr-xconfig.guess100
-rwxr-xr-xconfig.sub28
-rw-r--r--config/ChangeLog4
-rw-r--r--config/mh-dgux2
-rwxr-xr-xconfigure356
-rw-r--r--configure.in254
-rw-r--r--include/ChangeLog12
-rw-r--r--include/elf/ChangeLog21
-rw-r--r--include/elf/arm.h1
-rw-r--r--include/elf/ia64.h64
-rw-r--r--include/elf/ppc.h8
-rw-r--r--include/elf/ppc64.h2
-rw-r--r--include/elf/sh.h3
-rw-r--r--include/gdb/ChangeLog14
-rw-r--r--include/gdb/remote-sim.h26
-rw-r--r--include/libiberty.h8
-rw-r--r--include/opcode/ChangeLog4
-rw-r--r--include/opcode/h8300.h90
-rw-r--r--libiberty/ChangeLog109
-rw-r--r--libiberty/Makefile.in8
-rw-r--r--libiberty/acconfig.h3
-rw-r--r--libiberty/aclocal.m429
-rw-r--r--libiberty/config.in59
-rwxr-xr-xlibiberty/configure328
-rw-r--r--libiberty/configure.in11
-rw-r--r--libiberty/cplus-dem.c42
-rw-r--r--libiberty/functions.texi39
-rw-r--r--libiberty/lrealpath.c128
-rw-r--r--libiberty/make-relative-prefix.c55
-rw-r--r--libiberty/physmem.c305
-rw-r--r--libtool.m414
-rw-r--r--ltcf-cxx.sh29
-rw-r--r--ltcf-gcj.sh6
-rwxr-xr-xltconfig14
-rw-r--r--opcodes/ChangeLog20
-rw-r--r--opcodes/fr30-desc.c69
-rw-r--r--opcodes/hppa-dis.c338
-rw-r--r--opcodes/mips-dis.c6
90 files changed, 10120 insertions, 6943 deletions
diff --git a/ChangeLog b/ChangeLog
index 164e10d2d4..63988106d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,104 @@
+2003-03-05 David Carlton <carlton@math.stanford.edu>
+
+ * Merge with mainline. Tag is carlton_dictionary-20030305-merge.
+
+2003-03-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Include $(build_tooldir)/sys-include in
+ FLAGS_FOR_TARGET.
+ * configure: Regenerated.
+
+2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.tpl: Reindent.
+ * Makefile.in: Regenerate.
+ * configure.in: Reindent. Don't set unused variables.
+ * configure: Regenerate.
+
+ * Makefile.tpl: Always pass down RANLIB.
+ * Makefile.in: Regenerate.
+
+ * Makefile.tpl: Don't set unused enable_shared, enable_threads macros.
+ * Makefile.in: Regenerate.
+ * configure.in: Remove unused logic relating to --enable-shared
+ and --enable-threads. Remove bogus comments. Remove redundant
+ noconfigdirs.
+ * configure: Regenerate.
+
+ * configure.in: Replace ${libstdcxx_version} by its value.
+ Remove reference to mh-dgux.
+ * configure: Regenerate.
+
+2003-02-28 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.tpl: Rearrange.
+ * Makefile.in: Regenerate.
+
+2003-02-25 Nick Clifton <nickc@redhat.com>
+
+ * configure: Remove site-file supprot - it is obsolete.
+
+2003-02-24 Uwe Stieber <uwe@wwws.de>
+
+ * configure.in: Add support for kaOS as cross build target system.
+ * configure: Regenerated.
+
+2003-02-20 Sean McNeil <sean@blue.mcneil.com>
+
+ * Makefile.tpl: Add definition of CPPFLAGS to pass into
+ configure-target-* as some target builds may require additional
+ flags for preprocessor tests.
+ * Makefile.in: Regenerated.
+
+2003-02-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld.
+ * ltconfig: Handle it.
+ * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of
+ auto-detecting it.
+
+2003-02-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-cxx.sh: Replace $linker_flags with $compiler_flags wherever
+ it is used as argument to $CC.
+ * ltcf-gcj.sh: Likewise.
+
+2003-02-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Introduce --enable-maintainer-mode.
+ * configure: Rebuilt.
+ * Makefile.tpl (Makefile.in, configure): Enable dependencies only
+ for maintainer mode.
+ * Makefile.in: Rebuilt.
+
+2003-02-19 Andrew Cagney <ac131313@redhat.com>
+
+ * configure: Regenerate using autoconf 2.13.
+
+2003-02-19 Alan Modra <amodra@bigpond.net.au>
+
+ * config.guess: Import latest version.
+ * config.sub: Import latest version.
+
+2003-02-18 Jason Merrill <jason@redhat.com>
+
+ * Makefile.tpl (check-c++): Allow parallelism.
+
+2003-02-17 Andrew Cagney <ac131313@redhat.com>
+
+ * configure: Regenerate using autoconf 000227.
+
+2003-02-15 Geoffrey Keating <geoffk@apple.com>
+
+ * configure.in (*-*-darwin*): Rename from powerpc*-*-darwin*,
+ don't configure target-libobjc.
+ * configure: Regenerate.
+
+2003-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.tpl (RANLIB): Define.
+ * Makefile.in: Regenerate.
+
2003-02-06 Keith R Seitz <keiths@redhat.com>
* Makefile.def: Remove "snavigator", "grep", and "db" modules.
diff --git a/Makefile.in b/Makefile.in
index 4a5ad2e7ec..41b1b641bd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -20,8 +20,10 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+# -------------------------------
+# Standard Autoconf-set variables
+# -------------------------------
VPATH=@srcdir@
-links=@configlinks@
build_alias=@build_alias@
build_cpu=@build_cpu@
@@ -39,21 +41,13 @@ target_vendor=@target_vendor@
target_os=@target_os@
target_canonical=@target_cpu@-@target_vendor@-@target_os@
-enable_shared = @enable_shared@
-enable_threads = @enable_threads@
-enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
-# The file containing GCC's version number.
-gcc_version_trigger = @gcc_version_trigger@
-gcc_version = @gcc_version@
-
-# The gcc driver likes to know the arguments it was configured with.
-TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
-
-srcdir = @srcdir@
+program_transform_name = @program_transform_name@
prefix = @prefix@
exec_prefix = @exec_prefix@
+srcdir = @srcdir@
+
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
@@ -66,14 +60,6 @@ includedir = @includedir@
oldincludedir = @oldincludedir@
infodir = @infodir@
mandir = @mandir@
-gxx_include_dir = @gxx_include_dir@
-libstdcxx_incdir = @libstdcxx_incdir@
-
-tooldir = @tooldir@
-build_tooldir = @build_tooldir@
-
-program_transform_name = @program_transform_name@
-
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
@@ -83,17 +69,6 @@ man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
-# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
-GDB_NLM_DEPS =
-
-SHELL = @config_shell@
-
-# pwd command to use. Allow user to override default by setting PWDCMD in
-# the environment to account for automounters. The make variable must not
-# be called PWDCMD, otherwise the value set here is passed to make
-# subprocesses and overrides the setting from the user's environment.
-PWD = $${PWDCMD-pwd}
# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
# cygwin host.
@@ -104,51 +79,90 @@ INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
INSTALL_SCRIPT = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
-AS = @AS@
-AR = @AR@
-AR_FLAGS = rc
-CC = @CC@
+# -------------------------------------------------
+# Miscellaneous non-standard autoconf-set variables
+# -------------------------------------------------
-# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
-# here so that they can be overridden by Makefile fragments.
-BUILD_CC = $(CC_FOR_BUILD)
-BUILD_PREFIX = @BUILD_PREFIX@
-BUILD_PREFIX_1 = @BUILD_PREFIX_1@
+links=@configlinks@
+enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
+# The file containing GCC's version number.
+gcc_version_trigger = @gcc_version_trigger@
+gcc_version = @gcc_version@
-CFLAGS = @CFLAGS@
-CXXFLAGS = @CXXFLAGS@
+# The gcc driver likes to know the arguments it was configured with.
+TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
-LDFLAGS =
-LIBCFLAGS = $(CFLAGS)
-CFLAGS_FOR_BUILD = $(CFLAGS)
-# During gcc bootstrap, if we use some random cc for stage1 then
-# CFLAGS will be just -g. We want to ensure that TARGET libraries
-# (which we know are built with gcc) are built with optimizations so
-# prepend -O2 when setting CFLAGS_FOR_TARGET.
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
-LDFLAGS_FOR_TARGET =
-LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
-PICFLAG =
-PICFLAG_FOR_TARGET =
+gxx_include_dir = @gxx_include_dir@
+libstdcxx_incdir = @libstdcxx_incdir@
-CXX = @CXX@
+tooldir = @tooldir@
+build_tooldir = @build_tooldir@
-# Use -O2 to stress test the compiler.
-LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
-LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+# Directory in which the compiler finds executables, libraries, etc.
+libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
+GDB_NLM_DEPS =
-DLLTOOL = @DLLTOOL@
-WINDRES = @WINDRES@
+# This is the name of the environment variable used for the path to
+# the libraries.
+RPATH_ENVVAR = @RPATH_ENVVAR@
-NM = @NM@
+# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
+# was used.
+SET_LIB_PATH = @SET_LIB_PATH@
-LD = @LD@
+# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
+# Some platforms don't like blank entries, so we remove duplicate,
+# leading and trailing colons.
+REALLY_SET_LIB_PATH = \
+ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-# These values are substituted by configure.
-DEFAULT_YACC = @DEFAULT_YACC@
-DEFAULT_LEX = @DEFAULT_LEX@
-DEFAULT_M4 = @DEFAULT_M4@
+# This is the list of directories to be built for the build system.
+BUILD_CONFIGDIRS = libiberty
+# Build programs are put under this directory.
+BUILD_SUBDIR = @build_subdir@
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the build system.
+BUILD_CONFIGARGS = @build_configargs@
+
+# This is the list of directories to built for the host system.
+SUBDIRS = @configdirs@
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the host system.
+HOST_CONFIGARGS = @host_configargs@
+
+# This is set by the configure script to the list of directories which
+# should be built using the target tools.
+TARGET_CONFIGDIRS = @target_configdirs@
+# Target libraries are put under this directory:
+TARGET_SUBDIR = @target_subdir@
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the target.
+TARGET_CONFIGARGS = @target_configargs@
+
+# ----------------------------------------------
+# Programs producing files for the BUILD machine
+# ----------------------------------------------
+
+SHELL = @config_shell@
+
+# pwd command to use. Allow user to override default by setting PWDCMD in
+# the environment to account for automounters. The make variable must not
+# be called PWDCMD, otherwise the value set here is passed to make
+# subprocesses and overrides the setting from the user's environment.
+PWD = $${PWDCMD-pwd}
+
+# compilers to use to create programs which must be run in the build
+# environment.
+CC_FOR_BUILD = @CC_FOR_BUILD@
+CFLAGS_FOR_BUILD = $(CFLAGS)
+
+CXX_FOR_BUILD = $(CXX)
+
+# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
+# here so that they can be overridden by Makefile fragments.
+BUILD_CC = $(CC_FOR_BUILD)
+BUILD_PREFIX = @BUILD_PREFIX@
+BUILD_PREFIX_1 = @BUILD_PREFIX_1@
BISON=@BISON@
USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
@@ -157,6 +171,7 @@ USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
echo bison ; \
fi`
+DEFAULT_YACC = @DEFAULT_YACC@
YACC=@YACC@
USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
echo $$r/bison/bison -y -L $$s/bison/ ; \
@@ -166,11 +181,13 @@ USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
echo ${DEFAULT_YACC} ; \
fi`
+DEFAULT_LEX = @DEFAULT_LEX@
LEX=@LEX@
USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
then echo $$r/flex/flex ; \
else echo ${DEFAULT_LEX} ; fi`
+DEFAULT_M4 = @DEFAULT_M4@
M4 = `if [ -f $$r/m4/m4 ] ; \
then echo $$r/m4/m4 ; \
else echo ${DEFAULT_M4} ; fi`
@@ -197,74 +214,61 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
then echo $$s/dejagnu/runtest ; \
else echo runtest ; fi`
+# ---------------------------------------------
+# Programs producing files for the HOST machine
+# ---------------------------------------------
-# compilers to use to create programs which must be run in the build
-# environment.
-CC_FOR_BUILD = @CC_FOR_BUILD@
-CXX_FOR_BUILD = $(CXX)
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that programs built for the host machine work.
+HOST_LIB_PATH = $$r/bfd:$$r/opcodes
-SUBDIRS = @configdirs@
+AS = @AS@
-# This is set by the configure script to the list of directories which
-# should be built using the target tools.
-TARGET_CONFIGDIRS = @target_configdirs@
+AR = @AR@
+AR_FLAGS = rc
-# Target libraries are put under this directory:
-# Changed by configure to $(target_alias) if cross.
-TARGET_SUBDIR = @target_subdir@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBCFLAGS = $(CFLAGS)
-BUILD_CONFIGDIRS = libiberty
-BUILD_SUBDIR = @build_subdir@
+CXX = @CXX@
+CXXFLAGS = @CXXFLAGS@
+LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-# This is set by the configure script to the arguments to use when configuring
-# directories built for the build system.
-BUILD_CONFIGARGS = @build_configargs@
+DLLTOOL = @DLLTOOL@
-# This is set by the configure script to the arguments to use when configuring
-# directories built for the host system.
-HOST_CONFIGARGS = @host_configargs@
+NM = @NM@
-# This is set by the configure script to the arguments to use when configuring
-# directories built for the target.
-TARGET_CONFIGARGS = @target_configargs@
+LD = @LD@
+LDFLAGS =
-# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
-# was used.
-SET_LIB_PATH = @SET_LIB_PATH@
+RANLIB = @RANLIB@
-# This is the name of the environment variable used for the path to
-# the libraries. This may be changed by configure.in.
-RPATH_ENVVAR = @RPATH_ENVVAR@
+WINDRES = @WINDRES@
-# This is the list of directories that may be needed in RPATH_ENVVAR
-# so that programs built for the host machine work.
-HOST_LIB_PATH = $$r/bfd:$$r/opcodes
+PICFLAG =
+
+# -----------------------------------------------
+# Programs producing files for the TARGET machine
+# -----------------------------------------------
# This is the list of directories that may be needed in RPATH_ENVVAR
# so that prorgams built for the target machine work.
TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
-# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
-# Some platforms don't like blank entries, so we remove duplicate,
-# leading and trailing colons.
-REALLY_SET_LIB_PATH = \
- $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-
-# Should be substed by configure.in
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
-CC_FOR_TARGET = @CC_FOR_TARGET@
-CXX_FOR_TARGET = @CXX_FOR_TARGET@
-RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
-CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
-# 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
-# build libgcc2.a. We define it here so that it can itself be
-# overridden on the command line.
-GCC_FOR_TARGET=@GCC_FOR_TARGET@
-USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
+AR_FOR_TARGET=@AR_FOR_TARGET@
+USUAL_AR_FOR_TARGET = ` \
+ if [ -f $$r/binutils/ar ] ; then \
+ echo $$r/binutils/ar ; \
+ else \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
+ echo $(AR); \
+ else \
+ echo ar | sed '$(program_transform_name)' ; \
+ fi; \
+ fi`
AS_FOR_TARGET=@AS_FOR_TARGET@
USUAL_AS_FOR_TARGET = ` \
@@ -280,19 +284,26 @@ USUAL_AS_FOR_TARGET = ` \
fi; \
fi`
-LD_FOR_TARGET=@LD_FOR_TARGET@
-USUAL_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 \
- echo $(LD); \
- else \
- echo ld | sed '$(program_transform_name)' ; \
- fi; \
- fi`
+CC_FOR_TARGET = @CC_FOR_TARGET@
+# During gcc bootstrap, if we use some random cc for stage1 then
+# CFLAGS will be just -g. We want to ensure that TARGET libraries
+# (which we know are built with gcc) are built with optimizations so
+# prepend -O2 when setting CFLAGS_FOR_TARGET.
+CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
+# 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
+# build libgcc2.a. We define it here so that it can itself be
+# overridden on the command line.
+GCC_FOR_TARGET=@GCC_FOR_TARGET@
+USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
+LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+
+CXX_FOR_TARGET = @CXX_FOR_TARGET@
+RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
+CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
+RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
+LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
USUAL_DLLTOOL_FOR_TARGET = ` \
@@ -306,27 +317,35 @@ USUAL_DLLTOOL_FOR_TARGET = ` \
fi; \
fi`
-WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
-USUAL_WINDRES_FOR_TARGET = ` \
- if [ -f $$r/binutils/windres ] ; then \
- echo $$r/binutils/windres ; \
+GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
+
+LD_FOR_TARGET=@LD_FOR_TARGET@
+USUAL_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 \
- echo $(WINDRES); \
+ echo $(LD); \
else \
- echo windres | sed '$(program_transform_name)' ; \
+ echo ld | sed '$(program_transform_name)' ; \
fi; \
fi`
-AR_FOR_TARGET=@AR_FOR_TARGET@
-USUAL_AR_FOR_TARGET = ` \
- if [ -f $$r/binutils/ar ] ; then \
- echo $$r/binutils/ar ; \
+LDFLAGS_FOR_TARGET =
+
+NM_FOR_TARGET=@NM_FOR_TARGET@
+USUAL_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 \
- echo $(AR); \
+ echo $(NM); \
else \
- echo ar | sed '$(program_transform_name)' ; \
+ echo nm | sed '$(program_transform_name)' ; \
fi; \
fi`
@@ -346,20 +365,24 @@ USUAL_RANLIB_FOR_TARGET = ` \
fi; \
fi`
-NM_FOR_TARGET=@NM_FOR_TARGET@
-USUAL_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 ; \
+WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
+USUAL_WINDRES_FOR_TARGET = ` \
+ if [ -f $$r/binutils/windres ] ; then \
+ echo $$r/binutils/windres ; \
else \
if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- echo $(NM); \
+ echo $(WINDRES); \
else \
- echo nm | sed '$(program_transform_name)' ; \
+ echo windres | sed '$(program_transform_name)' ; \
fi; \
fi`
+PICFLAG_FOR_TARGET =
+
+# ------------------------------------
+# Miscellaneous targets and flag lists
+# ------------------------------------
+
# The first rule in the file had better be this one. Don't put any above it.
# This lives here to allow makefile fragments to contain dependencies.
all: all.normal
@@ -458,7 +481,7 @@ EXTRA_HOST_FLAGS = \
'DLLTOOL=$(DLLTOOL)' \
'LD=$(LD)' \
'NM=$(NM)' \
- "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
+ 'RANLIB=$(RANLIB)' \
'WINDRES=$(WINDRES)'
FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
@@ -512,7 +535,7 @@ EXTRA_GCC_FLAGS = \
'BUILD_PREFIX=$(BUILD_PREFIX)' \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
'NM=$(NM)' \
- "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
+ 'RANLIB=$(RANLIB)' \
'WINDRES=$$(WINDRES_FOR_TARGET)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
@@ -658,7 +681,7 @@ do-clean:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
clean) \
|| exit 1; \
@@ -676,7 +699,7 @@ do-clean:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
clean) \
|| exit 1; \
@@ -705,7 +728,7 @@ do-distclean:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
distclean) \
|| exit 1; \
@@ -723,7 +746,7 @@ do-distclean:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
distclean) \
|| exit 1; \
@@ -752,7 +775,7 @@ do-dvi:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
dvi) \
|| exit 1; \
@@ -770,7 +793,7 @@ do-dvi:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
dvi) \
|| exit 1; \
@@ -799,7 +822,7 @@ do-info:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
info) \
|| exit 1; \
@@ -817,7 +840,7 @@ do-info:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
info) \
|| exit 1; \
@@ -846,7 +869,7 @@ do-install-info:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
install-info) \
|| exit 1; \
@@ -864,7 +887,7 @@ do-install-info:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
install-info) \
|| exit 1; \
@@ -893,7 +916,7 @@ do-installcheck:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
installcheck) \
|| exit 1; \
@@ -911,7 +934,7 @@ do-installcheck:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
installcheck) \
|| exit 1; \
@@ -940,7 +963,7 @@ do-mostlyclean:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
mostlyclean) \
|| exit 1; \
@@ -958,7 +981,7 @@ do-mostlyclean:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
mostlyclean) \
|| exit 1; \
@@ -987,7 +1010,7 @@ do-maintainer-clean:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
maintainer-clean) \
|| exit 1; \
@@ -1005,7 +1028,7 @@ do-maintainer-clean:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
maintainer-clean) \
|| exit 1; \
@@ -1034,7 +1057,7 @@ do-TAGS:
(cd ./$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
TAGS) \
|| exit 1; \
@@ -1052,7 +1075,7 @@ do-TAGS:
(cd $(TARGET_SUBDIR)/$$i && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
- "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
+ "RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
TAGS) \
|| exit 1; \
@@ -1235,70 +1258,70 @@ TAGS: do-TAGS
maybe-configure-build-libiberty:
configure-build-libiberty:
@test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \
- [ -d $(BUILD_SUBDIR)/libiberty ] || \
- mkdir $(BUILD_SUBDIR)/libiberty;\
- 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)/libiberty; \
- cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(BUILD_SUBDIR)" in \
+ [ -d $(BUILD_SUBDIR)/libiberty ] || \
+ mkdir $(BUILD_SUBDIR)/libiberty;\
+ 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)/libiberty; \
+ cd "$(BUILD_SUBDIR)/libiberty" || 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}/libiberty "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libiberty"; \
- libsrcdir="$$s/libiberty"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(BUILD_CONFIGARGS) $${srcdiroption} \
- --with-build-subdir="$(BUILD_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libiberty"; \
+ libsrcdir="$$s/libiberty"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(BUILD_CONFIGARGS) $${srcdiroption} \
+ --with-build-subdir="$(BUILD_SUBDIR)" \
+ || exit 1
.PHONY: all-build-libiberty maybe-all-build-libiberty
maybe-all-build-libiberty:
all-build-libiberty: configure-build-libiberty
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all)
# --------------------------------------
@@ -1349,17 +1372,17 @@ configure-ash:
maybe-all-ash:
all-ash: configure-ash
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ash && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ash && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-ash
check-ash:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ash && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ash && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1367,9 +1390,9 @@ check-ash:
maybe-install-ash:
install-ash: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ash && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ash && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-autoconf maybe-configure-autoconf
@@ -1416,17 +1439,17 @@ configure-autoconf:
maybe-all-autoconf:
all-autoconf: configure-autoconf
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-autoconf
check-autoconf:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1434,9 +1457,9 @@ check-autoconf:
maybe-install-autoconf:
install-autoconf: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-automake maybe-configure-automake
@@ -1483,17 +1506,17 @@ configure-automake:
maybe-all-automake:
all-automake: configure-automake
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd automake && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd automake && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-automake
check-automake:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd automake && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd automake && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1501,9 +1524,9 @@ check-automake:
maybe-install-automake:
install-automake: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd automake && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd automake && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-bash maybe-configure-bash
@@ -1550,17 +1573,17 @@ configure-bash:
maybe-all-bash:
all-bash: configure-bash
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bash && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bash && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-bash
check-bash:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bash && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bash && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1568,9 +1591,9 @@ check-bash:
maybe-install-bash:
install-bash: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bash && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bash && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-bfd maybe-configure-bfd
@@ -1617,17 +1640,17 @@ configure-bfd:
maybe-all-bfd:
all-bfd: configure-bfd
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-bfd
check-bfd:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1635,9 +1658,9 @@ check-bfd:
maybe-install-bfd:
install-bfd: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bfd && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bfd && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-opcodes maybe-configure-opcodes
@@ -1684,17 +1707,17 @@ configure-opcodes:
maybe-all-opcodes:
all-opcodes: configure-opcodes
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-opcodes
check-opcodes:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1702,9 +1725,9 @@ check-opcodes:
maybe-install-opcodes:
install-opcodes: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-binutils maybe-configure-binutils
@@ -1751,17 +1774,17 @@ configure-binutils:
maybe-all-binutils:
all-binutils: configure-binutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-binutils
check-binutils:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1769,9 +1792,9 @@ check-binutils:
maybe-install-binutils:
install-binutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd binutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd binutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-bison maybe-configure-bison
@@ -1818,19 +1841,19 @@ configure-bison:
maybe-all-bison:
all-bison: configure-bison
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bison && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bison && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-bison
# This module is only tested in a native toolchain.
check-bison:
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \
fi
@@ -1839,9 +1862,9 @@ check-bison:
maybe-install-bison:
install-bison: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bison && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bison && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-byacc maybe-configure-byacc
@@ -1888,19 +1911,19 @@ configure-byacc:
maybe-all-byacc:
all-byacc: configure-byacc
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-byacc
# This module is only tested in a native toolchain.
check-byacc:
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \
fi
@@ -1909,9 +1932,9 @@ check-byacc:
maybe-install-byacc:
install-byacc: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd byacc && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd byacc && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-bzip2 maybe-configure-bzip2
@@ -1958,17 +1981,17 @@ configure-bzip2:
maybe-all-bzip2:
all-bzip2: configure-bzip2
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-bzip2
check-bzip2:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -1976,9 +1999,9 @@ check-bzip2:
maybe-install-bzip2:
install-bzip2: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-dejagnu maybe-configure-dejagnu
@@ -2025,17 +2048,17 @@ configure-dejagnu:
maybe-all-dejagnu:
all-dejagnu: configure-dejagnu
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-dejagnu
check-dejagnu:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2043,9 +2066,9 @@ check-dejagnu:
maybe-install-dejagnu:
install-dejagnu: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-diff maybe-configure-diff
@@ -2092,17 +2115,17 @@ configure-diff:
maybe-all-diff:
all-diff: configure-diff
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd diff && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd diff && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-diff
check-diff:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd diff && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd diff && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2110,9 +2133,9 @@ check-diff:
maybe-install-diff:
install-diff: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd diff && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd diff && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-dosutils maybe-configure-dosutils
@@ -2159,9 +2182,9 @@ configure-dosutils:
maybe-all-dosutils:
all-dosutils: configure-dosutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-dosutils
@@ -2173,9 +2196,9 @@ check-dosutils:
maybe-install-dosutils:
install-dosutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-etc maybe-configure-etc
@@ -2222,17 +2245,17 @@ configure-etc:
maybe-all-etc:
all-etc: configure-etc
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd etc && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd etc && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-etc
check-etc:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd etc && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd etc && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2240,9 +2263,9 @@ check-etc:
maybe-install-etc:
install-etc: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd etc && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd etc && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-fastjar maybe-configure-fastjar
@@ -2289,19 +2312,19 @@ configure-fastjar:
maybe-all-fastjar:
all-fastjar: configure-fastjar
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-fastjar
# This module is only tested in a native toolchain.
check-fastjar:
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \
fi
@@ -2310,9 +2333,9 @@ check-fastjar:
maybe-install-fastjar:
install-fastjar: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-fileutils maybe-configure-fileutils
@@ -2359,17 +2382,17 @@ configure-fileutils:
maybe-all-fileutils:
all-fileutils: configure-fileutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-fileutils
check-fileutils:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2377,9 +2400,9 @@ check-fileutils:
maybe-install-fileutils:
install-fileutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-findutils maybe-configure-findutils
@@ -2426,17 +2449,17 @@ configure-findutils:
maybe-all-findutils:
all-findutils: configure-findutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-findutils
check-findutils:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2444,9 +2467,9 @@ check-findutils:
maybe-install-findutils:
install-findutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd findutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd findutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-find maybe-configure-find
@@ -2493,17 +2516,17 @@ configure-find:
maybe-all-find:
all-find: configure-find
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd find && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd find && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-find
check-find:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd find && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd find && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2511,9 +2534,9 @@ check-find:
maybe-install-find:
install-find: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd find && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd find && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-flex maybe-configure-flex
@@ -2560,19 +2583,19 @@ configure-flex:
maybe-all-flex:
all-flex: configure-flex
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd flex && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd flex && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-flex
# This module is only tested in a native toolchain.
check-flex:
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \
fi
@@ -2581,9 +2604,9 @@ check-flex:
maybe-install-flex:
install-flex: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd flex && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd flex && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gas maybe-configure-gas
@@ -2630,17 +2653,17 @@ configure-gas:
maybe-all-gas:
all-gas: configure-gas
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gas && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gas && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gas
check-gas:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gas && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gas && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2648,9 +2671,9 @@ check-gas:
maybe-install-gas:
install-gas: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gas && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gas && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gawk maybe-configure-gawk
@@ -2697,17 +2720,17 @@ configure-gawk:
maybe-all-gawk:
all-gawk: configure-gawk
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gawk
check-gawk:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2715,9 +2738,9 @@ check-gawk:
maybe-install-gawk:
install-gawk: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gawk && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gawk && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gettext maybe-configure-gettext
@@ -2764,17 +2787,17 @@ configure-gettext:
maybe-all-gettext:
all-gettext: configure-gettext
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gettext
check-gettext:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2782,9 +2805,9 @@ check-gettext:
maybe-install-gettext:
install-gettext: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gettext && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gettext && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gnuserv maybe-configure-gnuserv
@@ -2831,17 +2854,17 @@ configure-gnuserv:
maybe-all-gnuserv:
all-gnuserv: configure-gnuserv
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gnuserv
check-gnuserv:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2849,9 +2872,9 @@ check-gnuserv:
maybe-install-gnuserv:
install-gnuserv: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gprof maybe-configure-gprof
@@ -2898,17 +2921,17 @@ configure-gprof:
maybe-all-gprof:
all-gprof: configure-gprof
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gprof
check-gprof:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2916,9 +2939,9 @@ check-gprof:
maybe-install-gprof:
install-gprof: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gprof && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gprof && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-gzip maybe-configure-gzip
@@ -2965,17 +2988,17 @@ configure-gzip:
maybe-all-gzip:
all-gzip: configure-gzip
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-gzip
check-gzip:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -2983,9 +3006,9 @@ check-gzip:
maybe-install-gzip:
install-gzip: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gzip && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gzip && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-hello maybe-configure-hello
@@ -3032,17 +3055,17 @@ configure-hello:
maybe-all-hello:
all-hello: configure-hello
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd hello && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd hello && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-hello
check-hello:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd hello && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd hello && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3050,9 +3073,9 @@ check-hello:
maybe-install-hello:
install-hello: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd hello && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd hello && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-indent maybe-configure-indent
@@ -3099,17 +3122,17 @@ configure-indent:
maybe-all-indent:
all-indent: configure-indent
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd indent && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd indent && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-indent
check-indent:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd indent && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd indent && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3117,9 +3140,9 @@ check-indent:
maybe-install-indent:
install-indent: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd indent && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd indent && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-intl maybe-configure-intl
@@ -3166,17 +3189,17 @@ configure-intl:
maybe-all-intl:
all-intl: configure-intl
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd intl && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd intl && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-intl
check-intl:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd intl && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd intl && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3184,9 +3207,9 @@ check-intl:
maybe-install-intl:
install-intl: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd intl && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd intl && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-tcl maybe-configure-tcl
@@ -3233,17 +3256,17 @@ configure-tcl:
maybe-all-tcl:
all-tcl: configure-tcl
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-tcl
check-tcl:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3251,9 +3274,9 @@ check-tcl:
maybe-install-tcl:
install-tcl: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tcl && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tcl && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-itcl maybe-configure-itcl
@@ -3300,17 +3323,17 @@ configure-itcl:
maybe-all-itcl:
all-itcl: configure-itcl
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-itcl
check-itcl:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3318,9 +3341,9 @@ check-itcl:
maybe-install-itcl:
install-itcl: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd itcl && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd itcl && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-ld maybe-configure-ld
@@ -3367,17 +3390,17 @@ configure-ld:
maybe-all-ld:
all-ld: configure-ld
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ld && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ld && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-ld
check-ld:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ld && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ld && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3385,9 +3408,9 @@ check-ld:
maybe-install-ld:
install-ld: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd ld && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd ld && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-libgui maybe-configure-libgui
@@ -3434,17 +3457,17 @@ configure-libgui:
maybe-all-libgui:
all-libgui: configure-libgui
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-libgui
check-libgui:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3452,9 +3475,9 @@ check-libgui:
maybe-install-libgui:
install-libgui: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libgui && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libgui && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-libiberty maybe-configure-libiberty
@@ -3501,17 +3524,17 @@ configure-libiberty:
maybe-all-libiberty:
all-libiberty: configure-libiberty
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-libiberty
check-libiberty:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3519,9 +3542,9 @@ check-libiberty:
maybe-install-libiberty:
install-libiberty: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-libtool maybe-configure-libtool
@@ -3568,17 +3591,17 @@ configure-libtool:
maybe-all-libtool:
all-libtool: configure-libtool
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-libtool
check-libtool:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3586,9 +3609,9 @@ check-libtool:
maybe-install-libtool:
install-libtool: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libtool && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libtool && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-m4 maybe-configure-m4
@@ -3635,17 +3658,17 @@ configure-m4:
maybe-all-m4:
all-m4: configure-m4
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-m4
check-m4:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3653,9 +3676,9 @@ check-m4:
maybe-install-m4:
install-m4: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd m4 && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd m4 && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-make maybe-configure-make
@@ -3702,17 +3725,17 @@ configure-make:
maybe-all-make:
all-make: configure-make
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd make && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd make && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-make
check-make:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd make && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd make && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3720,9 +3743,9 @@ check-make:
maybe-install-make:
install-make: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd make && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd make && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-mmalloc maybe-configure-mmalloc
@@ -3769,9 +3792,9 @@ configure-mmalloc:
maybe-all-mmalloc:
all-mmalloc: configure-mmalloc
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-mmalloc
@@ -3783,9 +3806,9 @@ check-mmalloc:
maybe-install-mmalloc:
install-mmalloc: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-patch maybe-configure-patch
@@ -3832,17 +3855,17 @@ configure-patch:
maybe-all-patch:
all-patch: configure-patch
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd patch && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd patch && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-patch
check-patch:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd patch && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd patch && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3850,9 +3873,9 @@ check-patch:
maybe-install-patch:
install-patch: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd patch && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd patch && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-perl maybe-configure-perl
@@ -3899,17 +3922,17 @@ configure-perl:
maybe-all-perl:
all-perl: configure-perl
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd perl && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd perl && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-perl
check-perl:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd perl && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd perl && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3917,9 +3940,9 @@ check-perl:
maybe-install-perl:
install-perl: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd perl && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd perl && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-prms maybe-configure-prms
@@ -3966,17 +3989,17 @@ configure-prms:
maybe-all-prms:
all-prms: configure-prms
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd prms && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd prms && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-prms
check-prms:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd prms && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd prms && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -3984,9 +4007,9 @@ check-prms:
maybe-install-prms:
install-prms: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd prms && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd prms && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-rcs maybe-configure-rcs
@@ -4033,17 +4056,17 @@ configure-rcs:
maybe-all-rcs:
all-rcs: configure-rcs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-rcs
check-rcs:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4051,9 +4074,9 @@ check-rcs:
maybe-install-rcs:
install-rcs: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd rcs && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd rcs && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-readline maybe-configure-readline
@@ -4100,17 +4123,17 @@ configure-readline:
maybe-all-readline:
all-readline: configure-readline
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd readline && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd readline && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-readline
check-readline:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd readline && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd readline && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4118,9 +4141,9 @@ check-readline:
maybe-install-readline:
install-readline: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd readline && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd readline && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-release maybe-configure-release
@@ -4167,9 +4190,9 @@ configure-release:
maybe-all-release:
all-release: configure-release
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd release && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd release && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-release
@@ -4226,17 +4249,17 @@ configure-recode:
maybe-all-recode:
all-recode: configure-recode
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd recode && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd recode && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-recode
check-recode:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd recode && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd recode && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4244,9 +4267,9 @@ check-recode:
maybe-install-recode:
install-recode: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd recode && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd recode && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-sed maybe-configure-sed
@@ -4293,17 +4316,17 @@ configure-sed:
maybe-all-sed:
all-sed: configure-sed
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sed && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sed && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-sed
check-sed:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sed && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sed && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4311,9 +4334,9 @@ check-sed:
maybe-install-sed:
install-sed: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sed && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sed && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-send-pr maybe-configure-send-pr
@@ -4360,17 +4383,17 @@ configure-send-pr:
maybe-all-send-pr:
all-send-pr: configure-send-pr
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-send-pr
check-send-pr:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4378,9 +4401,9 @@ check-send-pr:
maybe-install-send-pr:
install-send-pr: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-shellutils maybe-configure-shellutils
@@ -4427,17 +4450,17 @@ configure-shellutils:
maybe-all-shellutils:
all-shellutils: configure-shellutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-shellutils
check-shellutils:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4445,9 +4468,9 @@ check-shellutils:
maybe-install-shellutils:
install-shellutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-sid maybe-configure-sid
@@ -4494,17 +4517,17 @@ configure-sid:
maybe-all-sid:
all-sid: configure-sid
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sid && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sid && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-sid
check-sid:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sid && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sid && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4512,9 +4535,9 @@ check-sid:
maybe-install-sid:
install-sid: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sid && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sid && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-sim maybe-configure-sim
@@ -4561,17 +4584,17 @@ configure-sim:
maybe-all-sim:
all-sim: configure-sim
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sim && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sim && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-sim
check-sim:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sim && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sim && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4579,9 +4602,9 @@ check-sim:
maybe-install-sim:
install-sim: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd sim && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd sim && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-tar maybe-configure-tar
@@ -4628,17 +4651,17 @@ configure-tar:
maybe-all-tar:
all-tar: configure-tar
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tar && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tar && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-tar
check-tar:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tar && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tar && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4646,9 +4669,9 @@ check-tar:
maybe-install-tar:
install-tar: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tar && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tar && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-texinfo maybe-configure-texinfo
@@ -4695,17 +4718,17 @@ configure-texinfo:
maybe-all-texinfo:
all-texinfo: configure-texinfo
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-texinfo
check-texinfo:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4758,17 +4781,17 @@ configure-textutils:
maybe-all-textutils:
all-textutils: configure-textutils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-textutils
check-textutils:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4776,9 +4799,9 @@ check-textutils:
maybe-install-textutils:
install-textutils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd textutils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd textutils && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-time maybe-configure-time
@@ -4825,17 +4848,17 @@ configure-time:
maybe-all-time:
all-time: configure-time
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd time && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd time && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-time
check-time:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd time && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd time && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4843,9 +4866,9 @@ check-time:
maybe-install-time:
install-time: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd time && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd time && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-uudecode maybe-configure-uudecode
@@ -4892,17 +4915,17 @@ configure-uudecode:
maybe-all-uudecode:
all-uudecode: configure-uudecode
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-uudecode
check-uudecode:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4910,9 +4933,9 @@ check-uudecode:
maybe-install-uudecode:
install-uudecode: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-wdiff maybe-configure-wdiff
@@ -4959,17 +4982,17 @@ configure-wdiff:
maybe-all-wdiff:
all-wdiff: configure-wdiff
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-wdiff
check-wdiff:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check)
@@ -4977,9 +5000,9 @@ check-wdiff:
maybe-install-wdiff:
install-wdiff: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-zip maybe-configure-zip
@@ -5026,19 +5049,19 @@ configure-zip:
maybe-all-zip:
all-zip: configure-zip
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd zip && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd zip && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-zip
# This module is only tested in a native toolchain.
check-zip:
@if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \
fi
@@ -5047,9 +5070,9 @@ check-zip:
maybe-install-zip:
install-zip: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd zip && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd zip && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-zlib maybe-configure-zlib
@@ -5096,9 +5119,9 @@ configure-zlib:
maybe-all-zlib:
all-zlib: configure-zlib
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-zlib
@@ -5155,17 +5178,17 @@ configure-gdb:
maybe-all-gdb:
all-gdb: configure-gdb
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
.PHONY: check-gdb
check-gdb:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
@@ -5173,9 +5196,9 @@ check-gdb:
maybe-install-gdb:
install-gdb: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
.PHONY: configure-expect maybe-configure-expect
@@ -5222,17 +5245,17 @@ configure-expect:
maybe-all-expect:
all-expect: configure-expect
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
.PHONY: check-expect
check-expect:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
@@ -5240,9 +5263,9 @@ check-expect:
maybe-install-expect:
install-expect: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
.PHONY: configure-guile maybe-configure-guile
@@ -5289,17 +5312,17 @@ configure-guile:
maybe-all-guile:
all-guile: configure-guile
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
.PHONY: check-guile
check-guile:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
@@ -5307,9 +5330,9 @@ check-guile:
maybe-install-guile:
install-guile: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
.PHONY: configure-tk maybe-configure-tk
@@ -5356,17 +5379,17 @@ configure-tk:
maybe-all-tk:
all-tk: configure-tk
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
.PHONY: check-tk
check-tk:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
@@ -5374,9 +5397,9 @@ check-tk:
maybe-install-tk:
install-tk: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
.PHONY: configure-tix maybe-configure-tix
@@ -5423,17 +5446,17 @@ configure-tix:
maybe-all-tix:
all-tix: configure-tix
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
.PHONY: check-tix
check-tix:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
@@ -5441,9 +5464,9 @@ check-tix:
maybe-install-tix:
install-tix: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
.PHONY: configure-libtermcap maybe-configure-libtermcap
@@ -5490,9 +5513,9 @@ configure-libtermcap:
maybe-all-libtermcap:
all-libtermcap: configure-libtermcap
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-libtermcap
@@ -5504,9 +5527,9 @@ check-libtermcap:
maybe-install-libtermcap:
install-libtermcap: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install)
.PHONY: configure-utils maybe-configure-utils
@@ -5553,9 +5576,9 @@ configure-utils:
maybe-all-utils:
all-utils: configure-utils
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd utils && $(MAKE) $(FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd utils && $(MAKE) $(FLAGS_TO_PASS) all)
.PHONY: check-utils
@@ -5567,9 +5590,9 @@ check-utils:
maybe-install-utils:
install-utils: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd utils && $(MAKE) $(FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd utils && $(MAKE) $(FLAGS_TO_PASS) install)
@@ -5583,98 +5606,99 @@ maybe-configure-target-libstdc++-v3:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \
- mkdir $(TARGET_SUBDIR)/libstdc++-v3; \
+ mkdir $(TARGET_SUBDIR)/libstdc++-v3; \
rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
@test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \
- mkdir $(TARGET_SUBDIR)/libstdc++-v3;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
- CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \
- cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \
+ mkdir $(TARGET_SUBDIR)/libstdc++-v3;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+ CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \
+ cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libstdc++-v3 "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libstdc++-v3 "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
- libsrcdir="$$s/libstdc++-v3"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
+ libsrcdir="$$s/libstdc++-v3"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3
maybe-all-target-libstdc++-v3:
all-target-libstdc++-v3: configure-target-libstdc++-v3
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all)
.PHONY: check-target-libstdc++-v3
check-target-libstdc++-v3:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check)
.PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3
maybe-install-target-libstdc++-v3:
install-target-libstdc++-v3: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-newlib maybe-configure-target-newlib
@@ -5683,97 +5707,98 @@ maybe-configure-target-newlib:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/newlib/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/newlib ] || \
- mkdir $(TARGET_SUBDIR)/newlib; \
+ mkdir $(TARGET_SUBDIR)/newlib; \
rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out
configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out
@test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/newlib ] || \
- mkdir $(TARGET_SUBDIR)/newlib;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/newlib; \
- cd "$(TARGET_SUBDIR)/newlib" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/newlib ] || \
+ mkdir $(TARGET_SUBDIR)/newlib;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/newlib; \
+ cd "$(TARGET_SUBDIR)/newlib" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/newlib "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/newlib "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/newlib"; \
- libsrcdir="$$s/newlib"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/newlib"; \
+ libsrcdir="$$s/newlib"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-newlib maybe-all-target-newlib
maybe-all-target-newlib:
all-target-newlib: configure-target-newlib
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/newlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/newlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-newlib
check-target-newlib:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/newlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/newlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-newlib maybe-install-target-newlib
maybe-install-target-newlib:
install-target-newlib: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/newlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/newlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libf2c maybe-configure-target-libf2c
@@ -5782,97 +5807,98 @@ maybe-configure-target-libf2c:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libf2c/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libf2c ] || \
- mkdir $(TARGET_SUBDIR)/libf2c; \
+ mkdir $(TARGET_SUBDIR)/libf2c; \
rm -f $(TARGET_SUBDIR)/libf2c/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libf2c/multilib.out
configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out
@test ! -f $(TARGET_SUBDIR)/libf2c/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libf2c ] || \
- mkdir $(TARGET_SUBDIR)/libf2c;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libf2c; \
- cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libf2c ] || \
+ mkdir $(TARGET_SUBDIR)/libf2c;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libf2c; \
+ cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libf2c "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libf2c "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libf2c"; \
- libsrcdir="$$s/libf2c"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libf2c"; \
+ libsrcdir="$$s/libf2c"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libf2c maybe-all-target-libf2c
maybe-all-target-libf2c:
all-target-libf2c: configure-target-libf2c
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libf2c && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libf2c && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-libf2c
check-target-libf2c:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libf2c && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libf2c && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-libf2c maybe-install-target-libf2c
maybe-install-target-libf2c:
install-target-libf2c: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libf2c && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libf2c && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libobjc maybe-configure-target-libobjc
@@ -5881,97 +5907,98 @@ maybe-configure-target-libobjc:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libobjc ] || \
- mkdir $(TARGET_SUBDIR)/libobjc; \
+ mkdir $(TARGET_SUBDIR)/libobjc; \
rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out
configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
@test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libobjc ] || \
- mkdir $(TARGET_SUBDIR)/libobjc;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libobjc; \
- cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libobjc ] || \
+ mkdir $(TARGET_SUBDIR)/libobjc;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libobjc; \
+ cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libobjc "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libobjc "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libobjc"; \
- libsrcdir="$$s/libobjc"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libobjc"; \
+ libsrcdir="$$s/libobjc"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libobjc maybe-all-target-libobjc
maybe-all-target-libobjc:
all-target-libobjc: configure-target-libobjc
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libobjc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libobjc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-libobjc
check-target-libobjc:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libobjc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libobjc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-libobjc maybe-install-target-libobjc
maybe-install-target-libobjc:
install-target-libobjc: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libobjc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libobjc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
@@ -5980,79 +6007,80 @@ maybe-configure-target-libtermcap:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libtermcap ] || \
- mkdir $(TARGET_SUBDIR)/libtermcap; \
+ mkdir $(TARGET_SUBDIR)/libtermcap; \
rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out
configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out
@test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libtermcap ] || \
- mkdir $(TARGET_SUBDIR)/libtermcap;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libtermcap; \
- cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libtermcap ] || \
+ mkdir $(TARGET_SUBDIR)/libtermcap;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libtermcap; \
+ cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libtermcap"; \
- libsrcdir="$$s/libtermcap"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libtermcap"; \
+ libsrcdir="$$s/libtermcap"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libtermcap maybe-all-target-libtermcap
maybe-all-target-libtermcap:
all-target-libtermcap: configure-target-libtermcap
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libtermcap && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libtermcap && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
# Dummy target for uncheckable module.
.PHONY: check-target-libtermcap
@@ -6063,10 +6091,10 @@ check-target-libtermcap:
maybe-install-target-libtermcap:
install-target-libtermcap: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libtermcap && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libtermcap && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-winsup maybe-configure-target-winsup
@@ -6075,97 +6103,98 @@ maybe-configure-target-winsup:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/winsup/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/winsup ] || \
- mkdir $(TARGET_SUBDIR)/winsup; \
+ mkdir $(TARGET_SUBDIR)/winsup; \
rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out
configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out
@test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/winsup ] || \
- mkdir $(TARGET_SUBDIR)/winsup;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/winsup; \
- cd "$(TARGET_SUBDIR)/winsup" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/winsup ] || \
+ mkdir $(TARGET_SUBDIR)/winsup;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/winsup; \
+ cd "$(TARGET_SUBDIR)/winsup" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/winsup "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/winsup "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/winsup"; \
- libsrcdir="$$s/winsup"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/winsup"; \
+ libsrcdir="$$s/winsup"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-winsup maybe-all-target-winsup
maybe-all-target-winsup:
all-target-winsup: configure-target-winsup
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/winsup && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/winsup && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-winsup
check-target-winsup:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/winsup && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/winsup && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-winsup maybe-install-target-winsup
maybe-install-target-winsup:
install-target-winsup: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/winsup && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/winsup && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libgloss maybe-configure-target-libgloss
@@ -6174,79 +6203,80 @@ maybe-configure-target-libgloss:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libgloss ] || \
- mkdir $(TARGET_SUBDIR)/libgloss; \
+ mkdir $(TARGET_SUBDIR)/libgloss; \
rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out
configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out
@test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libgloss ] || \
- mkdir $(TARGET_SUBDIR)/libgloss;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libgloss; \
- cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libgloss ] || \
+ mkdir $(TARGET_SUBDIR)/libgloss;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libgloss; \
+ cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libgloss "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libgloss "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libgloss"; \
- libsrcdir="$$s/libgloss"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libgloss"; \
+ libsrcdir="$$s/libgloss"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libgloss maybe-all-target-libgloss
maybe-all-target-libgloss:
all-target-libgloss: configure-target-libgloss
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libgloss && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libgloss && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
# Dummy target for uncheckable module.
.PHONY: check-target-libgloss
@@ -6257,10 +6287,10 @@ check-target-libgloss:
maybe-install-target-libgloss:
install-target-libgloss: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libgloss && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libgloss && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libiberty maybe-configure-target-libiberty
@@ -6269,97 +6299,98 @@ maybe-configure-target-libiberty:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libiberty ] || \
- mkdir $(TARGET_SUBDIR)/libiberty; \
+ mkdir $(TARGET_SUBDIR)/libiberty; \
rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out
configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out
@test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libiberty ] || \
- mkdir $(TARGET_SUBDIR)/libiberty;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libiberty; \
- cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libiberty ] || \
+ mkdir $(TARGET_SUBDIR)/libiberty;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libiberty; \
+ cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libiberty"; \
- libsrcdir="$$s/libiberty"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libiberty"; \
+ libsrcdir="$$s/libiberty"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libiberty maybe-all-target-libiberty
maybe-all-target-libiberty:
all-target-libiberty: configure-target-libiberty
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libiberty && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libiberty && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-libiberty
check-target-libiberty:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libiberty && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libiberty && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-libiberty maybe-install-target-libiberty
maybe-install-target-libiberty:
install-target-libiberty: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libiberty && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libiberty && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-gperf maybe-configure-target-gperf
@@ -6368,97 +6399,98 @@ maybe-configure-target-gperf:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/gperf/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/gperf ] || \
- mkdir $(TARGET_SUBDIR)/gperf; \
+ mkdir $(TARGET_SUBDIR)/gperf; \
rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out
configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out
@test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/gperf ] || \
- mkdir $(TARGET_SUBDIR)/gperf;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/gperf; \
- cd "$(TARGET_SUBDIR)/gperf" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/gperf ] || \
+ mkdir $(TARGET_SUBDIR)/gperf;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/gperf; \
+ cd "$(TARGET_SUBDIR)/gperf" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/gperf "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/gperf "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/gperf"; \
- libsrcdir="$$s/gperf"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/gperf"; \
+ libsrcdir="$$s/gperf"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-gperf maybe-all-target-gperf
maybe-all-target-gperf:
all-target-gperf: configure-target-gperf
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/gperf && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/gperf && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-gperf
check-target-gperf:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/gperf && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/gperf && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-gperf maybe-install-target-gperf
maybe-install-target-gperf:
install-target-gperf: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/gperf && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/gperf && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-examples maybe-configure-target-examples
@@ -6467,79 +6499,80 @@ maybe-configure-target-examples:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/examples/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/examples ] || \
- mkdir $(TARGET_SUBDIR)/examples; \
+ mkdir $(TARGET_SUBDIR)/examples; \
rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out
configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out
@test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/examples ] || \
- mkdir $(TARGET_SUBDIR)/examples;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/examples; \
- cd "$(TARGET_SUBDIR)/examples" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/examples ] || \
+ mkdir $(TARGET_SUBDIR)/examples;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/examples; \
+ cd "$(TARGET_SUBDIR)/examples" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/examples "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/examples "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/examples"; \
- libsrcdir="$$s/examples"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/examples"; \
+ libsrcdir="$$s/examples"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-examples maybe-all-target-examples
maybe-all-target-examples:
all-target-examples: configure-target-examples
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/examples && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/examples && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
# Dummy target for uncheckable module.
.PHONY: check-target-examples
@@ -6558,97 +6591,98 @@ maybe-configure-target-libffi:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libffi/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libffi ] || \
- mkdir $(TARGET_SUBDIR)/libffi; \
+ mkdir $(TARGET_SUBDIR)/libffi; \
rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out
configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out
@test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libffi ] || \
- mkdir $(TARGET_SUBDIR)/libffi;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libffi; \
- cd "$(TARGET_SUBDIR)/libffi" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libffi ] || \
+ mkdir $(TARGET_SUBDIR)/libffi;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libffi; \
+ cd "$(TARGET_SUBDIR)/libffi" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libffi "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libffi "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libffi"; \
- libsrcdir="$$s/libffi"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libffi"; \
+ libsrcdir="$$s/libffi"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libffi maybe-all-target-libffi
maybe-all-target-libffi:
all-target-libffi: configure-target-libffi
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libffi && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libffi && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-libffi
check-target-libffi:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libffi && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libffi && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-libffi maybe-install-target-libffi
maybe-install-target-libffi:
install-target-libffi: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libffi && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libffi && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-libjava maybe-configure-target-libjava
@@ -6657,98 +6691,99 @@ maybe-configure-target-libjava:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libjava/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/libjava ] || \
- mkdir $(TARGET_SUBDIR)/libjava; \
+ mkdir $(TARGET_SUBDIR)/libjava; \
rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out
configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out
@test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libjava ] || \
- mkdir $(TARGET_SUBDIR)/libjava;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
- CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/libjava; \
- cd "$(TARGET_SUBDIR)/libjava" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/libjava ] || \
+ mkdir $(TARGET_SUBDIR)/libjava;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+ CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/libjava; \
+ cd "$(TARGET_SUBDIR)/libjava" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libjava "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libjava "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/libjava"; \
- libsrcdir="$$s/libjava"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/libjava"; \
+ libsrcdir="$$s/libjava"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-libjava maybe-all-target-libjava
maybe-all-target-libjava:
all-target-libjava: configure-target-libjava
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libjava && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libjava && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all)
.PHONY: check-target-libjava
check-target-libjava:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libjava && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libjava && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check)
.PHONY: install-target-libjava maybe-install-target-libjava
maybe-install-target-libjava:
install-target-libjava: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/libjava && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/libjava && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-zlib maybe-configure-target-zlib
@@ -6757,97 +6792,98 @@ maybe-configure-target-zlib:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/zlib/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/zlib ] || \
- mkdir $(TARGET_SUBDIR)/zlib; \
+ mkdir $(TARGET_SUBDIR)/zlib; \
rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out
configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out
@test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/zlib ] || \
- mkdir $(TARGET_SUBDIR)/zlib;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/zlib; \
- cd "$(TARGET_SUBDIR)/zlib" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/zlib ] || \
+ mkdir $(TARGET_SUBDIR)/zlib;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/zlib; \
+ cd "$(TARGET_SUBDIR)/zlib" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/zlib"; \
- libsrcdir="$$s/zlib"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/zlib"; \
+ libsrcdir="$$s/zlib"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-zlib maybe-all-target-zlib
maybe-all-target-zlib:
all-target-zlib: configure-target-zlib
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/zlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/zlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-zlib
check-target-zlib:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/zlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/zlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-zlib maybe-install-target-zlib
maybe-install-target-zlib:
install-target-zlib: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/zlib && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/zlib && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc
@@ -6856,97 +6892,98 @@ maybe-configure-target-boehm-gc:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/boehm-gc ] || \
- mkdir $(TARGET_SUBDIR)/boehm-gc; \
+ mkdir $(TARGET_SUBDIR)/boehm-gc; \
rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out
configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out
@test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/boehm-gc ] || \
- mkdir $(TARGET_SUBDIR)/boehm-gc;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \
- cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/boehm-gc ] || \
+ mkdir $(TARGET_SUBDIR)/boehm-gc;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \
+ cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/boehm-gc "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/boehm-gc "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/boehm-gc"; \
- libsrcdir="$$s/boehm-gc"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/boehm-gc"; \
+ libsrcdir="$$s/boehm-gc"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-boehm-gc maybe-all-target-boehm-gc
maybe-all-target-boehm-gc:
all-target-boehm-gc: configure-target-boehm-gc
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/boehm-gc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/boehm-gc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-boehm-gc
check-target-boehm-gc:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/boehm-gc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/boehm-gc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-boehm-gc maybe-install-target-boehm-gc
maybe-install-target-boehm-gc:
install-target-boehm-gc: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/boehm-gc && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/boehm-gc && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-qthreads maybe-configure-target-qthreads
@@ -6955,97 +6992,98 @@ maybe-configure-target-qthreads:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/qthreads ] || \
- mkdir $(TARGET_SUBDIR)/qthreads; \
+ mkdir $(TARGET_SUBDIR)/qthreads; \
rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out
configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out
@test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/qthreads ] || \
- mkdir $(TARGET_SUBDIR)/qthreads;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/qthreads; \
- cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/qthreads ] || \
+ mkdir $(TARGET_SUBDIR)/qthreads;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/qthreads; \
+ cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/qthreads "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/qthreads "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/qthreads"; \
- libsrcdir="$$s/qthreads"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/qthreads"; \
+ libsrcdir="$$s/qthreads"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-qthreads maybe-all-target-qthreads
maybe-all-target-qthreads:
all-target-qthreads: configure-target-qthreads
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/qthreads && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/qthreads && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-qthreads
check-target-qthreads:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/qthreads && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/qthreads && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-qthreads maybe-install-target-qthreads
maybe-install-target-qthreads:
install-target-qthreads: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/qthreads && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/qthreads && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
.PHONY: configure-target-rda maybe-configure-target-rda
@@ -7054,97 +7092,98 @@ maybe-configure-target-rda:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/rda/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/rda ] || \
- mkdir $(TARGET_SUBDIR)/rda; \
+ mkdir $(TARGET_SUBDIR)/rda; \
rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out
configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out
@test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/rda ] || \
- mkdir $(TARGET_SUBDIR)/rda;\
- r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CXX="$(CXX_FOR_TARGET)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- echo Configuring in $(TARGET_SUBDIR)/rda; \
- cd "$(TARGET_SUBDIR)/rda" || exit 1; \
- case $(srcdir) in \
- /* | [A-Za-z]:[\\/]*) \
- topdir=$(srcdir) ;; \
- *) \
- case "$(TARGET_SUBDIR)" in \
+ [ -d $(TARGET_SUBDIR)/rda ] || \
+ mkdir $(TARGET_SUBDIR)/rda;\
+ r=`${PWD}`; export r; \
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+ echo Configuring in $(TARGET_SUBDIR)/rda; \
+ cd "$(TARGET_SUBDIR)/rda" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(TARGET_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
- esac ;; \
- esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/rda "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(TARGET_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/rda "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
else \
- true; \
+ true; \
fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/rda"; \
- libsrcdir="$$s/rda"; \
+ exit 1; \
fi; \
- rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(TARGET_CONFIGARGS) $${srcdiroption} \
- --with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/rda"; \
+ libsrcdir="$$s/rda"; \
+ fi; \
+ rm -f no-such-file || : ; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
+ --with-target-subdir="$(TARGET_SUBDIR)" \
+ || exit 1
.PHONY: all-target-rda maybe-all-target-rda
maybe-all-target-rda:
all-target-rda: configure-target-rda
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/rda && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/rda && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all)
.PHONY: check-target-rda
check-target-rda:
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/rda && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/rda && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check)
.PHONY: install-target-rda maybe-install-target-rda
maybe-install-target-rda:
install-target-rda: installdirs
@r=`${PWD}`; export r; \
- s=`cd $(srcdir); ${PWD}`; export s; \
- $(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/rda && \
- $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+ s=`cd $(srcdir); ${PWD}`; export s; \
+ $(SET_LIB_PATH) \
+ (cd $(TARGET_SUBDIR)/rda && \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
@@ -7237,14 +7276,17 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
s=`cd $(srcdir); ${PWD}`; export s; \
case "$@" in \
*bootstrap4-lean ) \
- msg="Comparing stage3 and stage4 of the compiler"; \
- compare=compare3-lean ;; \
- *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
- compare=compare3 ;; \
- *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
- compare=compare-lean ;; \
- * ) msg="Comparing stage2 and stage3 of the compiler"; \
- compare=compare ;; \
+ msg="Comparing stage3 and stage4 of the compiler"; \
+ compare=compare3-lean ;; \
+ *bootstrap4 ) \
+ msg="Comparing stage3 and stage4 of the compiler"; \
+ compare=compare3 ;; \
+ *-lean ) \
+ msg="Comparing stage2 and stage3 of the compiler"; \
+ compare=compare-lean ;; \
+ * ) \
+ msg="Comparing stage2 and stage3 of the compiler"; \
+ compare=compare ;; \
esac; \
$(SET_LIB_PATH) \
echo "$$msg"; \
@@ -7292,7 +7334,8 @@ check-gcc-c++:
fi
.PHONY: check-c++
-check-c++: check-target-libstdc++-v3 check-gcc-c++
+check-c++:
+ $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok
.PHONY: install-gcc maybe-install-gcc
maybe-install-gcc:
@@ -7468,7 +7511,7 @@ multilib.out: maybe-all-gcc
# Rebuilding Makefile.in, using autogen.
AUTOGEN = autogen
-$(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
+$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
cd $(srcdir) && $(AUTOGEN) Makefile.def
# Rebuilding Makefile.
@@ -7480,7 +7523,7 @@ config.status: configure $(gcc_version_trigger)
# Rebuilding configure.
AUTOCONF = autoconf
-$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/config/acx.m4
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
cd $(srcdir) && $(AUTOCONF)
#
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 85bffb4ccc..5f949ed7fe 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,388 @@
+2003-03-03 H.J. Lu <hjl@gnu.org>
+
+ * elfxx-ia64.c (USE_BRL): Removed.
+ (oor_ip): Removed.
+
+Mon Mar 3 20:48:23 2003 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
+ relocation (no special function), and make it non-partial_inplace.
+ (sh_elf_relax_section): When creating a bsr, use a consistent value
+ no matter if the symbol is extern or not; set addend to -4.
+ Don't swap load / non-load instructions for SH4.
+ (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
+ rather than if the symbol is external to determine if adjusting the
+ offset makes sense. Adjust the addend too if appropriate.
+ (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
+ relocation.
+
+2003-03-03 Nick Clifton <nickc@redhat.com>
+
+ * po/da.po: Installed latest translation.
+
+2003-03-02 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
+ R_MIPS_PC16 to rightshift 2.
+ (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
+ (bfd_elf32_bfd_reloc_type_lookup): Support
+ BFD_RELOC_MIPSEMB_16_PCREL_S2.
+ * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
+ R_MIPS_PC16 to rightshift 2.
+ (mips_elf64_howto_table_rela): Likewise.
+ (mips_reloc_map): Map to rightshifted BFD reloc.
+ * elfn32-mips.c: The same as in elf64-mips.c.
+ * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
+ (mips_elf_calculate_relocation): Handle rightshifted addends for
+ R_MIPS_PC16.
+ * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
+ MIPS Embedded PIC. Remove superfluous empty COMMENT.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+
+2003-02-28 Richard Henderson <rth@redhat.com>
+
+ * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
+ for ltoff22x relaxation.
+
+2003-03-01 Alan Modra <amodra@bigpond.net.au>
+
+ * bfd-in.h (_bfd): Don't define.
+ * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
+ * syms.c: Likewise.
+ * bfd-in2.h: Regenerate.
+
+2003-02-27 Richard Henderson <rth@redhat.com>
+
+ * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
+ (elfNN_ia64_check_relocs): Set it.
+ (allocate_global_data_got): Check it.
+ (allocate_local_got): Likewise.
+ (allocate_dynrel_entries): Likewise.
+ (elfNN_ia64_relax_ldxmov): New.
+ (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
+ (elfNN_ia64_choose_gp): Split out from ...
+ (elfNN_ia64_final_link): ... here.
+
+2003-02-27 Andrew Cagney <cagney@redhat.com>
+
+ * bfd.c (struct bfd): Rename "struct _bfd".
+ * bfd-in.h: Update copyright.
+ (struct bfd): Rename "struct _bfd".
+ (_bfd): Define for backward compatibility.
+ * bfd-in2.h: Regenerate.
+
+2003-02-25 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
+ and rel_hdr2 when initially counting input relocs rather than after
+ creating output reloc sections.
+ (elf_link_read_relocs_from_section): Don't abort with wrong reloc
+ sizes.
+
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2003-02-24 Kris Warkentin <kewarken@qnx.com>
+
+ * elf.c (elfcore_read_notes): Add check for QNX style core file.
+ (elfcore_grog_nto_note): New function.
+ (elfcore_grog_nto_gregs): New function.
+ (elfcore_grog_nto_status): New function.
+
+2003-02-24 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (_bfd_elf_create_got_section): Check existing .got
+ section flags before concluding that we've already been called.
+ Don't use register keyword.
+ (_bfd_elf_create_dynamic_sections): Don't use register keyword.
+ (_bfd_elf_create_linker_section): Formatting.
+
+2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl>
+
+ * coff-h8300.c: Fix typo: intial -> initial.
+ * coff-ppc.c: Likewise.
+
+2003-02-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c: Formatting.
+ (allocate_dynrelocs): LD and GD relocs against the same sym need
+ separate GOT entries.
+ (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
+ entries per symbol.
+
+2003-02-19 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
+ removal. Localize vars. Remove unnecessary dynobj test.
+ * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
+ of INFO.
+ (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
+ and optimize.
+ (elf_i386_relocate_section): Likewise.
+ (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars.
+ * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
+ * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
+ * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
+ * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove
+ local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32
+ or PCPLT10 relocs. Don't subtract twice on PLT32 relocs.
+ Formatting.
+
+ * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
+ (ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC
+ test.
+ (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
+ (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
+ (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
+ and optimize. Use ELIMINATE_COPY_RELOCS.
+ (ppc64_elf_relocate_section): Likewise.
+
+ * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
+ (ppc_elf_copy_indirect_symbol): Copy pc_count field.
+ (ELIMINATE_COPY_RELOCS): Define.
+ (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
+ (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
+ (MUST_BE_DYN_RELOC): Define.
+ (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
+ and optimize. Trim dyn_relocs.
+ (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
+ not be used. Do generate dyn_relocs for copy reloc avoidance. Keep
+ track of pc_rel dyn relocs.
+ (ppc_elf_relocate_section): Remove "will_become_local". Adjust
+ WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per
+ allocate_dynrelocs. Don't recalculate "sec".
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
+ * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
+ on invalid LD relocs.
+ (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
+ (ppc64_elf_relocate_section): Unify new handling of LD relocs and
+ tlsld_got entry. Use IS_PPC64_TLS_RELOC.
+
+ * elf32-ppc.h: New file.
+ * elf32-ppc.c: Include elf32-ppc.h.
+ (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
+ (struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses.
+ Add "tls_mask" field.
+ (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
+ (struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses.
+ Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
+ sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
+ Make use of htab shortcuts throughout file.
+ (ppc_elf_link_hash_newfunc): Init tls_mask field.
+ (ppc_elf_link_hash_table_create): Init new fields.
+ (ppc_elf_copy_indirect_symbol): Copy tls_mask.
+ (ppc_elf_howto_raw): Add tls relocs.
+ (ppc_elf_reloc_type_lookup): Handle them.
+ (ppc_elf_unhandled_reloc): New function.
+ (ppc_elf_create_got): Stash got section pointer in hash table,
+ return status. Make .rela.got too.
+ (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
+ (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
+ NON_GOT_REF set. Don't allocate space in .plt here..
+ (allocate_dynrelocs): ..do so here instead, properly ref-counting and
+ not allocating plt entries unnecessarily. Allocate got entries here.
+ (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
+ (ppc_elf_size_dynamic_sections): Allocate local got entries. Pass
+ "info" during allocate_dynrelocs hash traversal. Use htab section
+ shortcuts rather than searching for named sections. Get rid of
+ "plt" and "strip" booleans.
+ (update_local_sym_info, bad_shared_reloc): New functions.
+ (ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to
+ ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so
+ in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc.
+ Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
+ R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
+ in shared libs. R_PPC_PLTREL32 is a plt reloc too. Refcount all
+ relocs that might use a plt entry. Set NON_GOT_REF too.
+ Enumerate all do-nothing relocs.
+ (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs. Handle
+ tls relocs and all plt relocs.
+ (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
+ (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
+ (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
+ shortcuts.
+ (ppc_elf_relocate_section): Tidy. Handle TLS relocs. Use
+ bfd_elf_local_sym_name. Simplify unresolved reloc code. Build got
+ entries and got relocs here. Warn on non-zero got reloc addend.
+ Split out branch taken/not taken reloc code into a separate switch
+ and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
+ Split out HA reloc adjustments to separate switch statement. Don't
+ warn on reloc overflow if we've already warned about undefined.
+ Don't rebuild sym name when reporting errors. Report all possible
+ errors from _bfd_final_link_relocate.
+ (bfd_elf32_bfd_final_link): Don't define.
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't
+ rebuild sym name when reporting errors.
+
+2003-02-17 Nick Clifton <nickc@redhat.com>
+
+ * elflink.h (elf_link_output_extsym): Only check
+ allow_shlib_undefined for shared libraries.
+ * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
+ of allow_shlib_undefined.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
+
+2003-02-17 Nick Clifton <nickc@redhat.com>
+
+ * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
+ address field to use in the comparison.
+ (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
+
+2003-02-14 Bob Wilson <bob.wilson@acm.org>
+
+ * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
+ backends when checking if the generic ELF target should be used.
+
+ * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
+ outside of functions, treat values as absolute addresses.
+
+ * bfd.c: Change embedded documentation to use consistent indentation
+ and to split up long lines. Change informal style of description
+ for functions lacking real documentation.
+ * coffcode.h: Break up long lines in embedded documentation.
+ * format.c: Likewise.
+ * targets.c: Likewise.
+ * libcoff.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+
+2003-02-14 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
+ (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
+ (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
+ (allocate_dynrelocs): Don't treat undefined and undefweak specially.
+ (ppc_size_one_stub): Fix warning, and tighten plt entry check.
+ (group_sections): Don't share a stub section if stubs are for a large
+ section. Adjust comment.
+ (ppc64_elf_size_stubs): Roughly double the size left for stubs if
+ !stubs_always_before_branch.
+ (ppc64_elf_relocate_section): Initialize tlsld GOT entry once. Don't
+ treat undefined and undefweak specially when processing dyn relocs.
+
+2003-02-13 Jakub Jelinek <jakub@redhat.com>
+
+ * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
+
+2003-02-13 Nick Clifton <nickc@redhat.com>
+
+ * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
+ in computation of offset to insert into BL instruction.
+
+2003-02-11 Uwe Stieber <uwe@wwws.de>
+
+ * config.bfd: Add support for kaOS as cross build target system.
+
+2003-02-11 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
+ .__tls_get_addr too.
+ (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
+
+2003-02-10 Kaz kojima <kkojima@rr.iij4u.or.jp>
+
+ * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
+ (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
+ (sh_elf_link_hash_newfunc): Remove the initialization of
+ tls_tpoff32 field.
+ (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
+ for which tls_tpoff32 flag is set.
+ (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
+ of the symbol includes the entry matched with the input_section
+ and having tls_tpoff32 flag on. When linking statically, set
+ symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
+ is defined in this executable.
+ (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
+
+2003-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
+ even if there is just non-empty .rela.plt.
+
+2003-02-10 Nick Clifton <nickc@redhat.com>
+
+ * archures.c (bfd_mach_arm_ep9312): Define.
+ * bfd-in2.h: Regenerate.
+ * cpu-arm.c (processors[]): Add ep9312.
+ (bfd_arm_arch): Add ep9312.
+ * elf32-arm.h (elf32_arm_merge_private_data): Update error
+ messages and add test for Maverick floating point support.
+ (elf32_arm_print_private_bfd_data): Handle
+ EF_ARM_MAVERICK_FLOAT flag.
+ (elf32_arm_object_p): New function.
+ (elf_backend_object_p): Define.
+
+2003-02-10 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
+ variables, structure fields or function params to tls_mask or
+ similar to better reflect usage.
+ (struct got_entry): Comment.
+ (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
+ (get_tls_mask): Rename from get_tls_type.
+
+2003-02-09 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (TLS_GD_LD): Don't define..
+ (TLS_GD): ..define this instead and update all uses.
+ (TLS_TPRELGD): Define.
+ (ppc64_elf_link_hash_table_create): Tweak initialization of
+ init_refcount and init_offset.
+ (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
+ Mark second slot of GD or LD toc entries.
+ (get_tls_type): Return an int. Distinguish toc GD and LD entries
+ from other tls types.
+ (ppc64_elf_tls_setup): New function, split out from..
+ (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are
+ defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL
+ on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type
+ return value to properly decide whether toc GD and LD entries can
+ optimize away __tls_get_addr call. Check next reloc after DTPMOD64
+ to determine GD or LD rather than looking at TLS_LD flag. Don't
+ attempt to adjust got entry tls_type here..
+ (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
+ look for possible merges.
+ (ppc64_elf_size_dynamic_sections): Adjust local got entries for
+ optimization.
+ (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
+ (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
+ Make use of return value from get_tls_type to properly detect GD and
+ LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't
+ handle tls_get_addr removal when looking at REL24 relocs, do it when
+ looking at the previous reloc. Check reloc after DTPMOD64 to determine
+ GD or LD.
+ * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
+
+2003-02-08 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-hppa.c (group_sections): Don't share a stub section if
+ stubs are for a large section.
+
+ * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
+ stubs if !stubs_always_before_branch.
+
2003-02-07 Nick Clifton <nickc@redhat.com>
* elf.c (swap_out_syms): Generate an error message if an
@@ -8,7 +393,6 @@
* elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
local_got_entries is NULL.
-
2003-02-06 Andreas Schwab <schwab@suse.de>
* elf-eh-frame.c (get_DW_EH_PE_signed): Define.
@@ -42,7 +426,7 @@
TLS_EXPLICIT): Define.
(struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
(link_hash_newfunc): Init new fields.
- (ppc64_elf_link_hash_table_create): Likewise. Set init_relcount and
+ (ppc64_elf_link_hash_table_create): Likewise. Set init_refcount and
init_offset to NULL.
(ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call
_bfd_elf_link_hash_copy_indirect, rather insert relevant code from
@@ -407,7 +791,7 @@
* elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
TPREL also get a reloc if shared. Remove SREL support.
(elf64_alpha_emit_dynrel): New.
- (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL
+ (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL
and GOTTPREL relocs to local symbols against the tp base.
(elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
@@ -419,15 +803,15 @@
2003-01-20 Svein E. Seldal <Svein.Seldal@solidas.com>
* coffcode.h (coff_set_flags): Added get/set arch hooks.
-
+
2003-01-20 Fabio Alemagna <falemagn@aros.org>
* elf32-sh.c: Treat elfNN_bed like other macros defined in
elfxx-target.h and #undef it before #define'ing it.
* elf32-i386.c: Likewise.
- * elf32-sh64.c: Likewise.
- * elf64-alpha.c: Likewise.
- * elf64-sh64.c: Likewise.
+ * elf32-sh64.c: Likewise.
+ * elf64-alpha.c: Likewise.
+ * elf64-sh64.c: Likewise.
2003-01-20 Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -505,7 +889,7 @@
* Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
(BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
* Makefile.in: Regenerate.
-
+
2003-01-08 Alexandre Oliva <aoliva@redhat.com>
* elfn32-mips.c (prev_reloc_section): New.
@@ -542,7 +926,7 @@
(bfd_archures_list): Add bfd_iq2000_arch.
* configure.in: Handle bfd_elf32_iq2000_vec.
* configure: Regenerate.
- * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
+ * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
and BFD_RELOC_IQ2000_UHI16.
* targets.c (bfd_elf32_iq2000_vec): Declare.
(bfd_target_vector): Add bfd_elf32_iq2000_vec.
@@ -632,7 +1016,7 @@
* archures.c (bfd_arch_get_compatible): Add third parameter
'accept_unknowns'. Only accept unknown format BFDs if
accept_unknowns is true, or if the format is "binary".
- * bfd-in2.h: Regenerate.
+ * bfd-in2.h: Regenerate.
2002-12-21 Nick Clifton <nickc@redhat.com>
@@ -658,7 +1042,7 @@
* bfd-in2.h: Regenerate.
* elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
(xstormy16_reloc_map): Add R_XSTORMY16_12.
-
+
2002-12-19 Kazu Hirata <kazu@cs.umass.edu>
* doc/bfdint.texi: Fix typos.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 6f053197b5..401568fa7d 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -877,8 +877,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h
format.lo: format.c $(INCDIR)/filenames.h
init.lo: init.c $(INCDIR)/filenames.h
libbfd.lo: libbfd.c $(INCDIR)/filenames.h
-opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
- $(INCDIR)/objalloc.h
+opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \
+ $(INCDIR)/libiberty.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)/safe-ctype.h \
@@ -1250,7 +1250,7 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
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-ppc.h elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index e6a600fd8a..a05b3423e7 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -799,7 +799,7 @@ configure.in version.h
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@@ -1410,8 +1410,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h
format.lo: format.c $(INCDIR)/filenames.h
init.lo: init.c $(INCDIR)/filenames.h
libbfd.lo: libbfd.c $(INCDIR)/filenames.h
-opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
- $(INCDIR)/objalloc.h
+opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \
+ $(INCDIR)/libiberty.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)/safe-ctype.h \
@@ -1783,7 +1783,7 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
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-ppc.h elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
diff --git a/bfd/archures.c b/bfd/archures.c
index 08015f96dd..62edda109b 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -234,6 +234,7 @@ DESCRIPTION
.#define bfd_mach_arm_5T 8
.#define bfd_mach_arm_5TE 9
.#define bfd_mach_arm_XScale 10
+.#define bfd_mach_arm_ep9312 11
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_w65, {* WDC 65816 *}
. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 3b1f9abfd6..917b46f76f 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -1,7 +1,8 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -68,7 +69,7 @@ extern "C" {
#endif
/* Forward declaration. */
-typedef struct _bfd bfd;
+typedef struct bfd bfd;
/* Boolean type used in bfd. Too many systems define their own
versions of "boolean" for us to safely typedef a "boolean" of
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1820b23208..9540eeb26a 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -6,9 +6,10 @@
Run "make headers" in your build bfd/ to regenerate. */
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -75,7 +76,7 @@ extern "C" {
#endif
/* Forward declaration. */
-typedef struct _bfd bfd;
+typedef struct bfd bfd;
/* Boolean type used in bfd. Too many systems define their own
versions of "boolean" for us to safely typedef a "boolean" of
@@ -1689,6 +1690,7 @@ enum bfd_architecture
#define bfd_mach_arm_5T 8
#define bfd_mach_arm_5TE 9
#define bfd_mach_arm_XScale 10
+#define bfd_mach_arm_ep9312 11
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
@@ -2329,6 +2331,9 @@ to compensate for the borrow when the low bits are added. */
/* Like BFD_RELOC_LO16, but PC relative. */
BFD_RELOC_PCREL_LO16,
+/* Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC. */
+ BFD_RELOC_MIPSEMB_16_PCREL_S2,
+
/* Relocation against a MIPS literal section. */
BFD_RELOC_MIPS_LITERAL,
@@ -3443,7 +3448,7 @@ typedef struct symbol_cache_entry
instead, except that some symbols point to the global sections
bfd_{abs,com,und}_section. This could be fixed by making
these globals be per-bfd (or per-target-flavor). FIXME. */
- struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
+ struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
/* The text of the symbol. The name is left alone, and not copied; the
application may not alter it. */
@@ -3604,7 +3609,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb
(ibfd, isymbol, obfd, osymbol))
/* Extracted from bfd.c. */
-struct _bfd
+struct bfd
{
/* A unique identifier of the BFD */
unsigned int id;
@@ -3635,7 +3640,7 @@ struct _bfd
/* The caching routines use these to maintain a
least-recently-used list of BFDs. */
- struct _bfd *lru_prev, *lru_next;
+ struct bfd *lru_prev, *lru_next;
/* When a file is closed by the caching routines, BFD retains
state information on the file here... */
@@ -3709,13 +3714,13 @@ struct _bfd
/* Stuff only useful for archives. */
PTR arelt_data;
- struct _bfd *my_archive; /* The containing archive BFD. */
- struct _bfd *next; /* The next BFD in the archive. */
- struct _bfd *archive_head; /* The first BFD in the archive. */
+ struct bfd *my_archive; /* The containing archive BFD. */
+ struct bfd *next; /* The next BFD in the archive. */
+ struct bfd *archive_head; /* The first BFD in the archive. */
bfd_boolean has_armap;
/* A chain of BFD structures involved in a link. */
- struct _bfd *link_next;
+ struct bfd *link_next;
/* A field used by _bfd_generic_link_add_archive_symbols. This will
be used only for archive elements. */
@@ -3871,33 +3876,31 @@ bfd_boolean
bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
#define bfd_set_private_flags(abfd, flags) \
- BFD_SEND (abfd, _bfd_set_private_flags, \
- (abfd, flags))
+ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
#define bfd_sizeof_headers(abfd, reloc) \
- BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
+ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
- BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
+ BFD_SEND (abfd, _bfd_find_nearest_line, \
+ (abfd, sec, syms, off, file, func, line))
- /* Do these three do anything useful at all, for any back end? */
#define bfd_debug_info_start(abfd) \
- BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+ BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
#define bfd_debug_info_end(abfd) \
- BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+ BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
#define bfd_debug_info_accumulate(abfd, section) \
- BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
-
+ BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
#define bfd_stat_arch_elt(abfd, stat) \
- BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+ BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
#define bfd_update_armap_timestamp(abfd) \
- BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+ BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
#define bfd_set_arch_mach(abfd, arch, mach)\
- BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
#define bfd_relax_section(abfd, section, link_info, again) \
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
@@ -4356,14 +4359,17 @@ const char **
bfd_target_list PARAMS ((void));
const bfd_target *
-bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
+bfd_search_for_target PARAMS ((int (* search_func)
+ (const bfd_target *, void *),
+ void *));
/* Extracted from format.c. */
bfd_boolean
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
bfd_boolean
-bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
+bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format,
+ char ***matching));
bfd_boolean
bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 1a332a866b..32250823a1 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1,6 +1,6 @@
/* Generic BFD library interface and support routines.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -34,7 +34,7 @@ SECTION
CODE_FRAGMENT
.
-.struct _bfd
+.struct bfd
.{
. {* A unique identifier of the BFD *}
. unsigned int id;
@@ -65,7 +65,7 @@ CODE_FRAGMENT
.
. {* The caching routines use these to maintain a
. least-recently-used list of BFDs. *}
-. struct _bfd *lru_prev, *lru_next;
+. struct bfd *lru_prev, *lru_next;
.
. {* When a file is closed by the caching routines, BFD retains
. state information on the file here... *}
@@ -139,13 +139,13 @@ CODE_FRAGMENT
.
. {* Stuff only useful for archives. *}
. PTR arelt_data;
-. struct _bfd *my_archive; {* The containing archive BFD. *}
-. struct _bfd *next; {* The next BFD in the archive. *}
-. struct _bfd *archive_head; {* The first BFD in the archive. *}
+. struct bfd *my_archive; {* The containing archive BFD. *}
+. struct bfd *next; {* The next BFD in the archive. *}
+. struct bfd *archive_head; {* The first BFD in the archive. *}
. bfd_boolean has_armap;
.
. {* A chain of BFD structures involved in a link. *}
-. struct _bfd *link_next;
+. struct bfd *link_next;
.
. {* A field used by _bfd_generic_link_add_archive_symbols. This will
. be used only for archive elements. *}
@@ -567,7 +567,7 @@ FUNCTION
bfd_get_reloc_upper_bound
SYNOPSIS
- long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect);
+ long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
DESCRIPTION
Return the number of bytes required to store the
@@ -662,7 +662,7 @@ FUNCTION
bfd_set_file_flags
SYNOPSIS
- bfd_boolean bfd_set_file_flags(bfd *abfd, flagword flags);
+ bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
DESCRIPTION
Set the flag word in the BFD @var{abfd} to the value @var{flags}.
@@ -813,7 +813,7 @@ FUNCTION
bfd_set_start_address
SYNOPSIS
- bfd_boolean bfd_set_start_address(bfd *abfd, bfd_vma vma);
+ bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
DESCRIPTION
Make @var{vma} the entry point of output BFD @var{abfd}.
@@ -836,7 +836,7 @@ FUNCTION
bfd_get_gp_size
SYNOPSIS
- unsigned 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
@@ -863,7 +863,7 @@ FUNCTION
bfd_set_gp_size
SYNOPSIS
- void bfd_set_gp_size(bfd *abfd, unsigned 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
@@ -926,7 +926,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
@@ -1016,7 +1016,7 @@ FUNCTION
bfd_copy_private_bfd_data
SYNOPSIS
- bfd_boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);
+ bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
DESCRIPTION
Copy private BFD information from the BFD @var{ibfd} to the
@@ -1037,7 +1037,7 @@ FUNCTION
bfd_merge_private_bfd_data
SYNOPSIS
- bfd_boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);
+ bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
DESCRIPTION
Merge private BFD information from the BFD @var{ibfd} to the
@@ -1058,7 +1058,7 @@ FUNCTION
bfd_set_private_flags
SYNOPSIS
- bfd_boolean bfd_set_private_flags(bfd *abfd, flagword flags);
+ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
DESCRIPTION
Set private BFD flag information in the BFD @var{abfd}.
@@ -1069,43 +1069,41 @@ DESCRIPTION
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_set_private_flags(abfd, flags) \
-. BFD_SEND (abfd, _bfd_set_private_flags, \
-. (abfd, flags))
+. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
*/
/*
FUNCTION
- stuff
+ Other functions
DESCRIPTION
- Stuff which should be documented:
+ The following functions exist but have not yet been documented.
.#define bfd_sizeof_headers(abfd, reloc) \
-. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
+. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
.
.#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
-. BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
+. BFD_SEND (abfd, _bfd_find_nearest_line, \
+. (abfd, sec, syms, off, file, func, line))
.
-. {* Do these three do anything useful at all, for any back end? *}
.#define bfd_debug_info_start(abfd) \
-. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
.
.#define bfd_debug_info_end(abfd) \
-. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
.
.#define bfd_debug_info_accumulate(abfd, section) \
-. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
-.
+. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
.
.#define bfd_stat_arch_elt(abfd, stat) \
-. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
.
.#define bfd_update_armap_timestamp(abfd) \
-. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
.
.#define bfd_set_arch_mach(abfd, arch, mach)\
-. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
.
.#define bfd_relax_section(abfd, section, link_info, again) \
. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
@@ -1265,7 +1263,7 @@ FUNCTION
bfd_alt_mach_code
SYNOPSIS
- bfd_boolean bfd_alt_mach_code(bfd *abfd, int alternative);
+ bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
DESCRIPTION
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index e21c5b5484..2c99af18fa 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -1,6 +1,6 @@
/* BFD back-end for Hitachi H8/300 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
@@ -210,7 +210,7 @@ h8300_coff_link_hash_table_create (abfd)
ret->vectors_sec = NULL;
ret->funcvec_hash_table = NULL;
- /* OK. Everything's intialized, return the base pointer. */
+ /* OK. Everything's initialized, return the base pointer. */
return &ret->root.root;
}
@@ -396,13 +396,9 @@ reloc_processing (relent, reloc, symbols, abfd, section)
rtype2howto (relent, reloc);
if (((int) reloc->r_symndx) > 0)
- {
- relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
- }
+ relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
else
- {
- relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- }
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
relent->addend = reloc->r_offset;
@@ -428,6 +424,7 @@ h8300_symbol_address_p (abfd, input_section, address)
while (*s)
{
asymbol *p = *s;
+
if (p->section == input_section
&& (input_section->output_section->vma
+ input_section->output_offset
@@ -472,8 +469,8 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
/* Only examine the relocs which might be relaxable. */
switch (reloc->howto->type)
{
- /* This is the 16/24 bit absolute branch which could become an 8 bit
- pc-relative branch. */
+ /* This is the 16/24 bit absolute branch which could become an 8 bit
+ pc-relative branch. */
case R_JMP1:
case R_JMPL1:
/* Get the address of the target of this branch. */
@@ -720,7 +717,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
/* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */
-
bfd_put_8 (abfd, gap, data + dst_address);
dst_address++;
src_address++;
@@ -752,7 +748,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
/* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */
-
bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address);
dst_address += 2;
src_address += 2;
@@ -773,7 +768,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
{
/* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */
-
bfd_put_8 (abfd, value & 0xff, data + dst_address);
dst_address += 1;
src_address += 1;
diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c
index f0c82a6dfa..067f2b6587 100644
--- a/bfd/coff-ppc.c
+++ b/bfd/coff-ppc.c
@@ -1,6 +1,6 @@
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -9,30 +9,29 @@
coff files, in particular, those for the rs/6000, alpha, mips, and
intel backends, and the PE work for the arm.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* Current State:
- objdump works
- relocs generated by gas
- ld will link files, but they do not run.
- dlltool will not produce correct output in some .reloc cases, and will
- not produce the right glue code for dll function calls.
-*/
+ not produce the right glue code for dll function calls. */
#include "bfd.h"
#include "sysdep.h"
@@ -58,15 +57,15 @@ extern bfd_boolean ppc_bfd_coff_final_link
PARAMS ((bfd *, struct bfd_link_info *));
extern void dump_toc PARAMS ((PTR));
-/* The toc is a set of bfd_vma fields. We use the fact that valid */
-/* addresses are even (i.e. the bit representing "1" is off) to allow */
-/* us to encode a little extra information in the field */
-/* - Unallocated addresses are intialized to 1. */
-/* - Allocated addresses are even numbers. */
-/* The first time we actually write a reference to the toc in the bfd, */
-/* we want to record that fact in a fixup file (if it is asked for), so */
-/* we keep track of whether or not an address has been written by marking */
-/* the low order bit with a "1" upon writing */
+/* The toc is a set of bfd_vma fields. We use the fact that valid
+ addresses are even (i.e. the bit representing "1" is off) to allow
+ us to encode a little extra information in the field
+ - Unallocated addresses are initialized to 1.
+ - Allocated addresses are even numbers.
+ The first time we actually write a reference to the toc in the bfd,
+ we want to record that fact in a fixup file (if it is asked for), so
+ we keep track of whether or not an address has been written by marking
+ the low order bit with a "1" upon writing. */
#define SET_UNALLOCATED(x) ((x) = 1)
#define IS_UNALLOCATED(x) ((x) == 1)
@@ -75,10 +74,10 @@ extern void dump_toc PARAMS ((PTR));
#define MARK_AS_WRITTEN(x) ((x) |= 1)
#define MAKE_ADDR_AGAIN(x) ((x) &= ~1)
-/* Turn on this check if you suspect something amiss in the hash tables */
+/* Turn on this check if you suspect something amiss in the hash tables. */
#ifdef DEBUG_HASH
-/* Need a 7 char string for an eye catcher */
+/* Need a 7 char string for an eye catcher. */
#define EYE "krkjunk"
#define HASH_CHECK_DCL char eye_catcher[8];
@@ -101,17 +100,17 @@ extern void dump_toc PARAMS ((PTR));
#endif
/* In order not to add an int to every hash table item for every coff
- linker, we define our own hash table, derived from the coff one */
+ linker, we define our own hash table, derived from the coff one. */
/* PE linker hash table entries. */
struct ppc_coff_link_hash_entry
{
- struct coff_link_hash_entry root; /* First entry, as required */
+ struct coff_link_hash_entry root; /* First entry, as required. */
/* As we wonder around the relocs, we'll keep the assigned toc_offset
- here */
- bfd_vma toc_offset; /* Our addition, as required */
+ here. */
+ bfd_vma toc_offset; /* Our addition, as required. */
int symbol_is_glue;
unsigned long int glue_insn;
@@ -122,7 +121,7 @@ struct ppc_coff_link_hash_entry
struct ppc_coff_link_hash_table
{
- struct coff_link_hash_table root; /* First entry, as required */
+ struct coff_link_hash_table root; /* First entry, as required. */
};
static struct bfd_hash_entry *ppc_coff_link_hash_newfunc
@@ -172,11 +171,11 @@ ppc_coff_link_hash_newfunc (entry, table, string)
if (ret)
{
/* Initialize the local fields. */
- SET_UNALLOCATED(ret->toc_offset);
+ SET_UNALLOCATED (ret->toc_offset);
ret->symbol_is_glue = 0;
ret->glue_insn = 0;
- HASH_CHECK_INIT(ret);
+ HASH_CHECK_INIT (ret);
}
return (struct bfd_hash_entry *) ret;
@@ -216,13 +215,13 @@ ppc_coff_link_hash_table_create (abfd)
return &ret->root.root;
}
-/* Now, tailor coffcode.h to use our hash stuff */
+/* Now, tailor coffcode.h to use our hash stuff. */
#define coff_bfd_link_hash_table_create ppc_coff_link_hash_table_create
-/* The nt loader points the toc register to &toc + 32768, in order to */
-/* use the complete range of a 16-bit displacement. We have to adjust */
-/* for this when we fix up loads displaced off the toc reg. */
+/* The nt loader points the toc register to &toc + 32768, in order to
+ use the complete range of a 16-bit displacement. We have to adjust
+ for this when we fix up loads displaced off the toc reg. */
#define TOC_LOAD_ADJUSTMENT (-32768)
#define TOC_SECTION_NAME ".private.toc"
@@ -234,7 +233,7 @@ ppc_coff_link_hash_table_create (abfd)
from smaller values. Start with zero, widen, *then* decrement. */
#define MINUS_ONE (((bfd_vma)0) - 1)
-/* these should definitely go in a header file somewhere... */
+/* These should definitely go in a header file somewhere... */
/* NOP */
#define IMAGE_REL_PPC_ABSOLUTE 0x0000
@@ -284,31 +283,31 @@ ppc_coff_link_hash_table_create (abfd)
/* va of containing section (limited to 16 bits) */
#define IMAGE_REL_PPC_SECREL16 0x000F
-/* stuff to handle immediate data when the number of bits in the */
-/* data is greater than the number of bits in the immediate field */
-/* We need to do (usually) 32 bit arithmetic on 16 bit chunks */
+/* Stuff to handle immediate data when the number of bits in the
+ data is greater than the number of bits in the immediate field
+ We need to do (usually) 32 bit arithmetic on 16 bit chunks. */
#define IMAGE_REL_PPC_REFHI 0x0010
#define IMAGE_REL_PPC_REFLO 0x0011
#define IMAGE_REL_PPC_PAIR 0x0012
-/* This is essentially the same as tocrel16, with TOCDEFN assumed */
+/* This is essentially the same as tocrel16, with TOCDEFN assumed. */
#define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013
-/* Flag bits in IMAGE_RELOCATION.TYPE */
+/* Flag bits in IMAGE_RELOCATION.TYPE. */
-/* subtract reloc value rather than adding it */
+/* Subtract reloc value rather than adding it. */
#define IMAGE_REL_PPC_NEG 0x0100
-/* fix branch prediction bit to predict branch taken */
+/* Fix branch prediction bit to predict branch taken. */
#define IMAGE_REL_PPC_BRTAKEN 0x0200
-/* fix branch prediction bit to predict branch not taken */
+/* Fix branch prediction bit to predict branch not taken. */
#define IMAGE_REL_PPC_BRNTAKEN 0x0400
-/* toc slot defined in file (or, data in toc) */
+/* TOC slot defined in file (or, data in toc). */
#define IMAGE_REL_PPC_TOCDEFN 0x0800
-/* masks to isolate above values in IMAGE_RELOCATION.Type */
+/* Masks to isolate above values in IMAGE_RELOCATION.Type. */
#define IMAGE_REL_PPC_TYPEMASK 0x00FF
#define IMAGE_REL_PPC_FLAGMASK 0x0F00
@@ -317,7 +316,7 @@ ppc_coff_link_hash_table_create (abfd)
#define EXTRACT_JUNK(x) \
((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK))
-/* static helper functions to make relocation work */
+/* Static helper functions to make relocation work. */
/* (Work In Progress) */
static bfd_reloc_status_type ppc_refhi_reloc PARAMS ((bfd *abfd,
@@ -389,41 +388,36 @@ static bfd_boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto));
/* FIXME: It'll take a while to get through all of these. I only need a few to
get us started, so those I'll make sure work. Those marked FIXME are either
- completely unverified or have a specific unknown marked in the comment */
-
-/*---------------------------------------------------------------------------*/
-/* */
-/* Relocation entries for Windows/NT on PowerPC. */
-/* */
-/* From the document "" we find the following listed as used relocs: */
-/* */
-/* ABSOLUTE : The noop */
-/* ADDR[64|32|16] : fields that hold addresses in data fields or the */
-/* 16 bit displacement field on a load/store. */
-/* ADDR[24|14] : fields that hold addresses in branch and cond */
-/* branches. These represent [26|16] bit addresses. */
-/* The low order 2 bits are preserved. */
-/* REL[24|14] : branches relative to the Instruction Address */
-/* register. These represent [26|16] bit addresses, */
-/* as before. The instruction field will be zero, and */
-/* the address of the SYM will be inserted at link time. */
-/* TOCREL16 : 16 bit displacement field referring to a slot in */
-/* toc. */
-/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */
-/* ADDR32NB : 32 bit address relative to the virtual origin. */
-/* (On the alpha, this is always a linker generated thunk)*/
-/* (i.e. 32bit addr relative to the image base) */
-/* SECREL : The value is relative to the start of the section */
-/* containing the symbol. */
-/* SECTION : access to the header containing the item. Supports the */
-/* codeview debugger. */
-/* */
-/* In particular, note that the document does not indicate that the */
-/* relocations listed in the header file are used. */
-/* */
-/* */
-/* */
-/*---------------------------------------------------------------------------*/
+ completely unverified or have a specific unknown marked in the comment. */
+
+/* Relocation entries for Windows/NT on PowerPC.
+
+ From the document "" we find the following listed as used relocs:
+
+ ABSOLUTE : The noop
+ ADDR[64|32|16] : fields that hold addresses in data fields or the
+ 16 bit displacement field on a load/store.
+ ADDR[24|14] : fields that hold addresses in branch and cond
+ branches. These represent [26|16] bit addresses.
+ The low order 2 bits are preserved.
+ REL[24|14] : branches relative to the Instruction Address
+ register. These represent [26|16] bit addresses,
+ as before. The instruction field will be zero, and
+ the address of the SYM will be inserted at link time.
+ TOCREL16 : 16 bit displacement field referring to a slot in
+ toc.
+ TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14.
+ ADDR32NB : 32 bit address relative to the virtual origin.
+ (On the alpha, this is always a linker generated thunk)
+ (i.e. 32bit addr relative to the image base)
+ SECREL : The value is relative to the start of the section
+ containing the symbol.
+ SECTION : access to the header containing the item. Supports the
+ codeview debugger.
+
+ In particular, note that the document does not indicate that the
+ relocations listed in the header file are used. */
+
static reloc_howto_type ppc_coff_howto_table[] =
{
@@ -767,7 +761,7 @@ static reloc_howto_type ppc_coff_howto_table[] =
};
-/* Some really cheezy macros that can be turned on to test stderr :-) */
+/* Some really cheezy macros that can be turned on to test stderr :-) */
#ifdef DEBUG_RELOC
#define UN_IMPL(x) \
@@ -792,16 +786,14 @@ static reloc_howto_type ppc_coff_howto_table[] =
#define n_name _n._n_name
#define n_zeroes _n._n_n._n_zeroes
-#define n_offset _n._n_n._n_offset
-
-*/
+#define n_offset _n._n_n._n_offset */
-#define DUMP_RELOC2(n,r) \
-{ \
- fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \
- n, r->r_symndx, r->r_vaddr,\
+#define DUMP_RELOC2(n,r) \
+{ \
+ fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \
+ n, r->r_symndx, r->r_vaddr, \
(((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \
- ?" ":" TOCDEFN" ); \
+ ?" ":" TOCDEFN" ); \
}
#else
@@ -810,14 +802,13 @@ static reloc_howto_type ppc_coff_howto_table[] =
#define DUMP_RELOC2(n,r)
#endif
-/* toc construction and management routines */
+/* TOC construction and management routines. */
/* This file is compiled twice, and these variables are defined in one
of the compilations. FIXME: This is confusing and weird. Also,
BFD should not use global variables. */
-extern bfd* bfd_of_toc_owner;
+extern bfd * bfd_of_toc_owner;
extern long int global_toc_size;
-
extern long int import_table_size;
extern long int first_thunk_address;
extern long int thunk_size;
@@ -858,7 +849,7 @@ record_toc (toc_section, our_toc_offset, cat, name)
enum ref_category cat;
const char *name;
{
- /* add this entry to our toc addr-offset-name list */
+ /* Add this entry to our toc addr-offset-name list. */
bfd_size_type amt = sizeof (struct list_ele);
struct list_ele *t = (struct list_ele *) bfd_malloc (amt);
@@ -889,7 +880,7 @@ static bfd_boolean ppc_record_toc_entry
static void ppc_mark_symbol_as_glue
PARAMS ((bfd *, int, struct internal_reloc *));
-/* record a toc offset against a symbol */
+/* Record a toc offset against a symbol. */
static bfd_boolean
ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
bfd *abfd;
@@ -914,16 +905,19 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
if (h == 0)
{
local_syms = obj_coff_local_toc_table(abfd);
+
if (local_syms == 0)
{
unsigned int i;
bfd_size_type amt;
+
/* allocate a table */
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)
{
SET_UNALLOCATED (local_syms[i]);
@@ -935,7 +929,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
local_syms[sym] = global_toc_size;
global_toc_size += 4;
- /* The size must fit in a 16bit displacment */
+ /* The size must fit in a 16bit displacment. */
if (global_toc_size > 65535)
{
(*_bfd_error_handler) (_("TOC overflow"));
@@ -948,14 +942,14 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
{
name = h->root.root.root.string;
- /* check to see if there's a toc slot allocated. If not, do it
- here. It will be used in relocate_section */
+ /* Check to see if there's a toc slot allocated. If not, do it
+ here. It will be used in relocate_section. */
if (IS_UNALLOCATED(h->toc_offset))
{
h->toc_offset = global_toc_size;
global_toc_size += 4;
- /* The size must fit in a 16bit displacment */
+ /* The size must fit in a 16bit displacment. */
if (global_toc_size >= 65535)
{
(*_bfd_error_handler) (_("TOC overflow"));
@@ -968,7 +962,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
return TRUE;
}
-/* record a toc offset against a symbol */
+/* Record a toc offset against a symbol. */
static void
ppc_mark_symbol_as_glue(abfd, sym, rel)
bfd *abfd;
@@ -1013,9 +1007,9 @@ static bfd_boolean in_reloc_p(abfd, howto)
#if 0
-/* this function is in charge of performing all the ppc PE relocations */
-/* Don't yet know if we want to do this this particular way ... (krk) */
-/* FIXME: (it is not yet enabled) */
+/* This function is in charge of performing all the ppc PE relocations
+ Don't yet know if we want to do this this particular way ... (krk). */
+/* FIXME: (it is not yet enabled). */
static bfd_reloc_status_type
pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
@@ -1028,8 +1022,8 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
bfd *output_bfd;
char **error_message;
{
- /* the consth relocation comes in two parts, we have to remember
- the state between calls, in these variables */
+ /* The consth relocation comes in two parts, we have to remember
+ the state between calls, in these variables. */
static bfd_boolean part1_consth_active = FALSE;
static unsigned long part1_consth_value;
@@ -1041,7 +1035,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
if (output_bfd)
{
- /* Partial linking - do nothing */
+ /* Partial linking - do nothing. */
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
@@ -1049,7 +1043,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
if (symbol_in != NULL
&& bfd_is_und_section (symbol_in->section))
{
- /* Keep the state machine happy in case we're called again */
+ /* Keep the state machine happy in case we're called again. */
if (r_type == IMAGE_REL_PPC_REFHI)
{
part1_consth_active = TRUE;
@@ -1151,7 +1145,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
sec = NULL;
val = 0;
- /* FIXME: PAIR unsupported in the following code */
+ /* FIXME: PAIR unsupported in the following code. */
if (h == NULL)
{
if (symndx == -1)
@@ -1189,7 +1183,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
rstat = bfd_reloc_ok;
- /* Each case must do its own relocation, setting rstat appropriately */
+ /* Each case must do its own relocation, setting rstat appropriately. */
switch (r_type)
{
default:
@@ -1217,16 +1211,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
- /*
- * Amazing bit tricks present. As we may have seen earlier, we
- * use the 1 bit to tell us whether or not a toc offset has been
- * allocated. Now that they've all been allocated, we will use
- * the 1 bit to tell us if we've written this particular toc
- * entry out.
- */
+ /* Amazing bit tricks present. As we may have seen earlier, we
+ use the 1 bit to tell us whether or not a toc offset has been
+ allocated. Now that they've all been allocated, we will use
+ the 1 bit to tell us if we've written this particular toc
+ entry out. */
fixit = FALSE;
if (h == 0)
- { /* it is a file local symbol */
+ {
+ /* It is a file local symbol. */
int *local_toc_table;
const char *name;
@@ -1238,15 +1231,14 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
if (IS_WRITTEN(our_toc_offset))
{
- /* if it has been written out, it is marked with the
+ /* If it has been written out, it is marked with the
1 bit. Fix up our offset, but do not write it out
- again.
- */
+ again. */
MAKE_ADDR_AGAIN(our_toc_offset);
}
else
{
- /* write out the toc entry */
+ /* Write out the toc entry. */
record_toc (toc_section, our_toc_offset, priv,
strdup (name));
@@ -1277,13 +1269,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
Import Address Table is mapped immediately following
the toc, some trippy library code trying for speed on
dll linkage, takes advantage of that and considers
- the IAT to be part of the toc, thus saving a load.
- */
+ 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);
- /* The size must still fit in a 16bit displacment */
+ /* The size must still fit in a 16bit displacment. */
if ((bfd_vma) our_toc_offset >= 65535)
{
(*_bfd_error_handler)
@@ -1297,12 +1288,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
record_toc (toc_section, our_toc_offset, pub,
strdup (name));
}
- else if (IS_WRITTEN(our_toc_offset))
+ else if (IS_WRITTEN (our_toc_offset))
{
- /* if it has been written out, it is marked with the
+ /* If it has been written out, it is marked with the
1 bit. Fix up our offset, but do not write it out
- again.
- */
+ again. */
MAKE_ADDR_AGAIN(our_toc_offset);
}
else
@@ -1310,13 +1300,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
record_toc(toc_section, our_toc_offset, pub,
strdup (name));
- /* write out the toc entry */
+ /* Write out the toc entry. */
bfd_put_32 (output_bfd, val,
toc_section->contents + our_toc_offset);
MARK_AS_WRITTEN(h->toc_offset);
- /* The tricky part is that this is the address that */
- /* needs a .reloc entry for it */
+ /* The tricky part is that this is the address that
+ needs a .reloc entry for it. */
fixit = TRUE;
}
}
@@ -1324,22 +1314,21 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
if (fixit && info->base_file)
{
/* So if this is non pcrelative, and is referenced
- to a section or a common symbol, then it needs a reloc */
+ to a section or a common symbol, then it needs a reloc. */
- /* relocation to a symbol in a section which
+ /* Relocation to a symbol in a section which
isn't absolute - we output the address here
- to a file */
-
+ to a file. */
bfd_vma addr = (toc_section->output_section->vma
+ toc_section->output_offset + our_toc_offset);
- if (coff_data(output_bfd)->pe)
+ if (coff_data (output_bfd)->pe)
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
fwrite (&addr, 1,4, (FILE *) info->base_file);
}
- /* FIXME: this test is conservative */
+ /* FIXME: this test is conservative. */
if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN
&& (bfd_vma) our_toc_offset > toc_section->_raw_size)
{
@@ -1351,21 +1340,21 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
return FALSE;
}
- /* Now we know the relocation for this toc reference */
+ /* 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);
}
break;
case IMAGE_REL_PPC_IFGLUE:
{
- /* To solve this, we need to know whether or not the symbol */
- /* appearing on the call instruction is a glue function or not. */
- /* A glue function must announce itself via a IMGLUE reloc, and */
- /* the reloc contains the required toc restore instruction */
-
+ /* To solve this, we need to know whether or not the symbol
+ appearing on the call instruction is a glue function or not.
+ A glue function must announce itself via a IMGLUE reloc, and
+ the reloc contains the required toc restore instruction. */
bfd_vma x;
const char *my_name;
- DUMP_RELOC2(howto->name, rel);
+
+ DUMP_RELOC2 (howto->name, rel);
if (h != 0)
{
@@ -1379,25 +1368,24 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
}
break;
case IMAGE_REL_PPC_SECREL:
- /* Unimplemented: codeview debugging information */
+ /* Unimplemented: codeview debugging information. */
/* For fast access to the header of the section
containing the item. */
break;
case IMAGE_REL_PPC_SECTION:
- /* Unimplemented: codeview debugging information */
+ /* Unimplemented: codeview debugging information. */
/* Is used to indicate that the value should be relative
to the beginning of the section that contains the
- symbol */
+ symbol. */
break;
case IMAGE_REL_PPC_ABSOLUTE:
{
const char *my_name;
+
if (h == 0)
- my_name = (syms+symndx)->_n._n_name;
+ my_name = (syms+symndx)->_n._n_name;
else
- {
- my_name = h->root.root.root.string;
- }
+ my_name = h->root.root.root.string;
fprintf (stderr,
_("Warning: unsupported reloc %s <file %s, section %s>\n"),
@@ -1413,8 +1401,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
case IMAGE_REL_PPC_IMGLUE:
{
/* There is nothing to do now. This reloc was noted in the first
- pass over the relocs, and the glue instruction extracted */
+ pass over the relocs, and the glue instruction extracted. */
const char *my_name;
+
if (h->symbol_is_glue == 1)
break;
my_name = h->root.root.root.string;
@@ -1429,13 +1418,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
case IMAGE_REL_PPC_ADDR32NB:
{
const char *name = 0;
- DUMP_RELOC2(howto->name, rel);
+
+ DUMP_RELOC2 (howto->name, rel);
if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0)
{
- /* set magic values */
+ /* Set magic values. */
int idata5offset;
struct coff_link_hash_entry *myh;
+
myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata5_magic__",
FALSE, FALSE, TRUE);
@@ -1457,7 +1448,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
}
if (h == 0)
- { /* it is a file local symbol */
+ {
+ /* It is a file local symbol. */
sym = syms + symndx;
name = sym->_n._n_name;
}
@@ -1466,11 +1458,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
char *target = 0;
name = h->root.root.root.string;
- if (strcmp(".idata$2", name) == 0)
+ if (strcmp (".idata$2", name) == 0)
target = "__idata2_magic__";
- else if (strcmp(".idata$4", name) == 0)
+ else if (strcmp (".idata$4", name) == 0)
target = "__idata4_magic__";
- else if (strcmp(".idata$5", name) == 0)
+ else if (strcmp (".idata$5", name) == 0)
target = "__idata5_magic__";
if (target != 0)
@@ -1514,10 +1506,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
}
rstat = _bfd_relocate_contents (howto,
- input_bfd,
- val -
- pe_data(output_bfd)->pe_opthdr.ImageBase,
- loc);
+ input_bfd,
+ val -
+ pe_data (output_bfd)->pe_opthdr.ImageBase,
+ loc);
}
break;
@@ -1542,24 +1534,23 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
- if ( info->base_file )
+ if (info->base_file)
{
/* So if this is non pcrelative, and is referenced
- to a section or a common symbol, then it needs a reloc */
- if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto))
+ to a section or a common symbol, then it needs a reloc. */
+ if (sym && pe_data(output_bfd)->in_reloc_p (output_bfd, howto))
{
- /* relocation to a symbol in a section which
+ /* Relocation to a symbol in a section which
isn't absolute - we output the address here
- to a file */
+ to a file. */
bfd_vma addr = rel->r_vaddr
- input_section->vma
+ input_section->output_offset
+ input_section->output_section->vma;
- if (coff_data(output_bfd)->pe)
- {
- addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
- }
+ if (coff_data (output_bfd)->pe)
+ addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
+
fwrite (&addr, 1,4, (FILE *) info->base_file);
}
}
@@ -1595,12 +1586,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, howto->name,
(bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma)))
- {
- return FALSE;
- }
+ return FALSE;
}
}
-
}
return TRUE;
@@ -1686,21 +1674,17 @@ ppc_allocate_toc_section (info)
bfd_size_type amt;
static char test_char = '1';
- if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
+ if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
return TRUE;
if (bfd_of_toc_owner == 0)
- {
- /* No toc owner? Something is very wrong. */
- abort ();
- }
+ /* No toc owner? Something is very wrong. */
+ abort ();
s = bfd_get_section_by_name ( bfd_of_toc_owner , TOC_SECTION_NAME);
if (s == NULL)
- {
- /* No toc section? Something is very wrong. */
- abort ();
- }
+ /* No toc section? Something is very wrong. */
+ abort ();
amt = global_toc_size;
foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt);
@@ -1720,58 +1704,55 @@ ppc_process_before_allocation (abfd, info)
asection *sec;
struct internal_reloc *i, *rel;
- /* here we have a bfd that is to be included on the link. We have a hook
+ /* Here we have a bfd that is to be included on the link. We have a hook
to do reloc rummaging, before section sizes are nailed down. */
+ _bfd_coff_get_external_symbols (abfd);
- _bfd_coff_get_external_symbols(abfd);
-
- /* rummage around all the relocs and map the toc */
+ /* Rummage around all the relocs and map the toc. */
sec = abfd->sections;
if (sec == 0)
- {
- return TRUE;
- }
+ return TRUE;
for (; sec != 0; sec = sec->next)
- {
- if (sec->reloc_count == 0)
- continue;
+ {
+ if (sec->reloc_count == 0)
+ continue;
- /* load the relocs */
- /* FIXME: there may be a storage leak here */
- i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0);
+ /* load the relocs */
+ /* FIXME: there may be a storage leak here */
+ i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0);
- if (i == 0)
- abort ();
+ if (i == 0)
+ abort ();
- for (rel=i;rel<i+sec->reloc_count;++rel)
- {
- unsigned short r_type = EXTRACT_TYPE (rel->r_type);
- unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
- bfd_boolean ok = TRUE;
+ for (rel = i; rel < i + sec->reloc_count; ++rel)
+ {
+ unsigned short r_type = EXTRACT_TYPE (rel->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS (rel->r_type);
+ bfd_boolean ok = TRUE;
- DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+ DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, rel);
- switch(r_type)
- {
- case IMAGE_REL_PPC_TOCREL16:
- /* if TOCDEFN is on, ignore as someone else has allocated the
- toc entry */
- if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN )
- ok = ppc_record_toc_entry(abfd, info, sec,
- rel->r_symndx, default_toc);
- if (!ok)
- return FALSE;
- break;
- case IMAGE_REL_PPC_IMGLUE:
- ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel);
- break;
- default:
- break;
- }
- }
- }
+ switch(r_type)
+ {
+ case IMAGE_REL_PPC_TOCREL16:
+ /* If TOCDEFN is on, ignore as someone else has allocated the
+ toc entry. */
+ if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN)
+ ok = ppc_record_toc_entry(abfd, info, sec,
+ rel->r_symndx, default_toc);
+ if (!ok)
+ return FALSE;
+ break;
+ case IMAGE_REL_PPC_IMGLUE:
+ ppc_mark_symbol_as_glue (abfd, rel->r_symndx, rel);
+ break;
+ default:
+ break;
+ }
+ }
+ }
return TRUE;
}
@@ -1779,13 +1760,8 @@ ppc_process_before_allocation (abfd, info)
#endif
static bfd_reloc_status_type
-ppc_refhi_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_refhi_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1806,13 +1782,8 @@ ppc_refhi_reloc (abfd,
#if 0
static bfd_reloc_status_type
-ppc_reflo_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_reflo_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd;
arelent *reloc_entry;
asymbol *symbol;
@@ -1833,13 +1804,8 @@ ppc_reflo_reloc (abfd,
#endif
static bfd_reloc_status_type
-ppc_pair_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_pair_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1858,13 +1824,8 @@ ppc_pair_reloc (abfd,
}
static bfd_reloc_status_type
-ppc_toc16_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_toc16_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1873,33 +1834,24 @@ ppc_toc16_reloc (abfd,
bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED;
{
- UN_IMPL("TOCREL16");
- DUMP_RELOC("TOCREL16",reloc_entry);
+ UN_IMPL ("TOCREL16");
+ DUMP_RELOC ("TOCREL16",reloc_entry);
if (output_bfd == (bfd *) NULL)
- {
- return bfd_reloc_continue;
- }
+ return bfd_reloc_continue;
return bfd_reloc_ok;
}
#if 0
-/* ADDR32NB : 32 bit address relative to the virtual origin. */
-/* (On the alpha, this is always a linker generated thunk)*/
-/* (i.e. 32bit addr relative to the image base) */
-/* */
-/* */
+/* ADDR32NB : 32 bit address relative to the virtual origin.
+ (On the alpha, this is always a linker generated thunk)
+ (i.e. 32bit addr relative to the image base). */
static bfd_reloc_status_type
-ppc_addr32nb_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_addr32nb_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd;
arelent *reloc_entry;
asymbol *symbol;
@@ -1917,13 +1869,8 @@ ppc_addr32nb_reloc (abfd,
#endif
static bfd_reloc_status_type
-ppc_secrel_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_secrel_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1942,13 +1889,8 @@ ppc_secrel_reloc (abfd,
}
static bfd_reloc_status_type
-ppc_section_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_section_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1967,13 +1909,8 @@ ppc_section_reloc (abfd,
}
static bfd_reloc_status_type
-ppc_imglue_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
+ppc_imglue_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry ATTRIBUTE_UNUSED;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -1996,17 +1933,14 @@ ppc_imglue_reloc (abfd,
/* FIXME: There is a possiblity that when we read in a reloc from a file,
that there are some bits encoded in the upper portion of the
- type field. Not yet implemented.
-*/
-static void ppc_coff_rtype2howto PARAMS ((arelent *relent,
- struct internal_reloc *internal));
+ type field. Not yet implemented. */
+static void ppc_coff_rtype2howto PARAMS ((arelent *, struct internal_reloc *));
static void
ppc_coff_rtype2howto (relent, internal)
arelent *relent;
struct internal_reloc *internal;
{
-
/* We can encode one of three things in the type field, aside from the
type:
1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction
@@ -2015,19 +1949,18 @@ ppc_coff_rtype2howto (relent, internal)
the branch is expected to be taken or not.
3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
For now, we just strip this stuff to find the type, and ignore it other
- than that.
- */
+ than that. */
reloc_howto_type *howto;
unsigned short r_type = EXTRACT_TYPE (internal->r_type);
unsigned short r_flags = EXTRACT_FLAGS(internal->r_type);
unsigned short junk = EXTRACT_JUNK (internal->r_type);
- /* the masking process only slices off the bottom byte for r_type. */
+ /* The masking process only slices off the bottom byte for r_type. */
if ( r_type > MAX_RELOC_INDEX )
abort ();
- /* check for absolute crap */
- if ( junk != 0 )
+ /* Check for absolute crap. */
+ if (junk != 0)
abort ();
switch(r_type)
@@ -2040,15 +1973,15 @@ ppc_coff_rtype2howto (relent, internal)
case IMAGE_REL_PPC_ADDR32NB:
case IMAGE_REL_PPC_SECTION:
case IMAGE_REL_PPC_SECREL:
- DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal);
howto = ppc_coff_howto_table + r_type;
break;
case IMAGE_REL_PPC_IMGLUE:
- DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal);
howto = ppc_coff_howto_table + r_type;
break;
case IMAGE_REL_PPC_TOCREL16:
- DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal);
if (r_flags & IMAGE_REL_PPC_TOCDEFN)
howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16_DEFN;
else
@@ -2064,7 +1997,6 @@ ppc_coff_rtype2howto (relent, internal)
}
relent->howto = howto;
-
}
static reloc_howto_type *
@@ -2086,19 +2018,18 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
the branch is expected to be taken or not.
3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
For now, we just strip this stuff to find the type, and ignore it other
- than that.
- */
+ than that. */
- unsigned short r_type = EXTRACT_TYPE (rel->r_type);
- unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
- unsigned short junk = EXTRACT_JUNK (rel->r_type);
+ unsigned short r_type = EXTRACT_TYPE (rel->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS (rel->r_type);
+ unsigned short junk = EXTRACT_JUNK (rel->r_type);
- /* the masking process only slices off the bottom byte for r_type. */
- if ( r_type > MAX_RELOC_INDEX )
+ /* The masking process only slices off the bottom byte for r_type. */
+ if (r_type > MAX_RELOC_INDEX)
abort ();
- /* check for absolute crap */
- if ( junk != 0 )
+ /* Check for absolute crap. */
+ if (junk != 0)
abort ();
switch(r_type)
@@ -2141,7 +2072,7 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return howto;
}
-/* a cheesy little macro to make the code a little more readable */
+/* A cheesy little macro to make the code a little more readable. */
#define HOW2MAP(bfd_rtype,ppc_rtype) \
case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype]
@@ -2167,7 +2098,6 @@ ppc_coff_reloc_type_lookup (abfd, code)
default:
return NULL;
}
- /*NOTREACHED*/
}
#undef HOW2MAP
@@ -2229,8 +2159,7 @@ ppc_coff_reloc_type_lookup (abfd, code)
2. It's not clear to me that being the last bfd read necessarily means
that you are the last bfd closed.
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.
-*/
+ 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
@@ -2239,21 +2168,19 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
PTR ext1 ATTRIBUTE_UNUSED;
PTR in1;
{
- struct internal_syment *in = (struct internal_syment *)in1;
+ struct internal_syment * in = (struct internal_syment *)in1;
- if (bfd_of_toc_owner != 0) /* we already have a toc, so go home */
+ if (bfd_of_toc_owner != 0) /* We already have a toc, so go home. */
return;
- if (strcmp(in->_n._n_name, ".toc") == 0)
+ if (strcmp (in->_n._n_name, ".toc") == 0)
{
flagword flags;
register asection *s;
- s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME);
+ s = bfd_get_section_by_name (abfd, TOC_SECTION_NAME);
if (s != NULL)
- {
- return;
- }
+ return;
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY ;
@@ -2262,12 +2189,10 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
if (s == NULL
|| !bfd_set_section_flags (abfd, s, flags)
|| !bfd_set_section_alignment (abfd, s, 2))
- {
- /* FIXME: set appropriate bfd error */
- abort ();
- }
+ /* FIXME: set appropriate bfd error. */
+ abort ();
- /* save the bfd for later allocation */
+ /* Save the bfd for later allocation. */
bfd_of_toc_owner = abfd;
}
@@ -2297,7 +2222,7 @@ ppc_get_last()
return bfd_of_toc_owner;
}
-/* this piece of machinery exists only to guarantee that the bfd that holds
+/* This piece of machinery exists only to guarantee that the bfd that holds
the toc section is written last.
This does depend on bfd_make_section attaching a new section to the
@@ -2306,8 +2231,7 @@ ppc_get_last()
This is otherwise intended to be functionally the same as
cofflink.c:_bfd_coff_final_link(). It is specifically different only
where the POWERPC_LE_PE macro modifies the code. It is left in as a
- precise form of comment. krk@cygnus.com
-*/
+ precise form of comment. krk@cygnus.com */
/* Do the final link step. */
@@ -2382,9 +2306,9 @@ ppc_bfd_coff_final_link (abfd, info)
{
o->reloc_count = 0;
o->lineno_count = 0;
+
for (p = o->link_order_head; p != NULL; p = p->next)
{
-
if (p->type == bfd_indirect_link_order)
{
asection *sec;
@@ -2437,8 +2361,10 @@ ppc_bfd_coff_final_link (abfd, 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++)
{
finfo.section_info[i].relocs = NULL;
@@ -2451,6 +2377,7 @@ ppc_bfd_coff_final_link (abfd, info)
line_filepos = rel_filepos;
linesz = bfd_coff_linesz (abfd);
max_output_reloc_count = 0;
+
for (o = abfd->sections; o != NULL; o = o->next)
{
if (o->lineno_count == 0)
@@ -2605,7 +2532,6 @@ ppc_bfd_coff_final_link (abfd, info)
#endif
/* Free up the buffers used by _bfd_coff_link_input_bfd. */
-
coff_debug_merge_hash_table_free (&finfo.debug_merge);
debug_merge_allocated = FALSE;
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 7ce60db76c..ee50a10993 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1,24 +1,24 @@
/* Support for the generic parts of most COFF variants, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
Most of this hacked by Steve Chamberlain,
@@ -225,7 +225,7 @@ SUBSUBSECTION
This routine runs though the provided symbol table and uses
the offsets generated by the previous pass and the pointers
generated when the symbol table was read in to create the
- structured hierachy required by coff. It changes each pointer
+ structured hierarchy required by coff. It changes each pointer
to a symbol into the index into the symbol table of the asymbol.
o <<coff_write_symbols>>
@@ -558,15 +558,15 @@ sec_to_styp_flags (sec_name, sec_flags)
/* For now, the read/write bits are mapped onto SEC_READONLY, even
though the semantics don't quite match. The bits from the input
- are retained in pei_section_data(abfd, section)->pe_flags */
+ are retained in pei_section_data(abfd, section)->pe_flags. */
- styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */
+ styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */
if ((sec_flags & SEC_READONLY) == 0)
- styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */
+ styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */
if (sec_flags & SEC_CODE)
- styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE */
+ styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */
if (sec_flags & SEC_SHARED)
- styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */
+ styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */
return styp_flags;
}
@@ -693,12 +693,12 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
else
sec_flags |= SEC_ALLOC | SEC_LOAD;
-#ifdef STYP_LIT /* A29k readonly text/data section type */
+#ifdef STYP_LIT /* A29k readonly text/data section type. */
if ((styp_flags & STYP_LIT) == STYP_LIT)
sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY);
#endif /* STYP_LIT */
-#ifdef STYP_OTHER_LOAD /* Other loaded sections */
+#ifdef STYP_OTHER_LOAD /* Other loaded sections. */
if (styp_flags & STYP_OTHER_LOAD)
sec_flags = (SEC_LOAD | SEC_ALLOC);
#endif /* STYP_SDATA */
@@ -802,7 +802,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section)
gas-generated, and look for <something> (whatever
follows the $) as the comdat symbol. */
- /* All 3 branches use this */
+ /* All 3 branches use this. */
symname = _bfd_coff_internal_syment_name (abfd, &isym, buf);
if (symname == NULL)
@@ -930,7 +930,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section)
#ifndef TARGET_UNDERSCORE
#define TARGET_UNDERSCORE 0
#endif
- /* Is this the name we're looking for? */
+ /* Is this the name we're looking for ? */
if (strcmp (target_name,
symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0)
{
@@ -1344,7 +1344,8 @@ Special entry points for gdb to swap in coff symbol table parts:
.#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
. ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
.#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
-. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
+. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
+. (abfd, filehdr, aouthdr))
.
.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
. ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
@@ -1369,7 +1370,8 @@ Special entry points for gdb to swap in coff symbol table parts:
. ((coff_backend_info (abfd)->_bfd_coff_print_aux)\
. (abfd, file, base, symbol, aux, indaux))
.
-.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\
+.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
+. reloc, data, src_ptr, dst_ptr)\
. ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
. (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
.
@@ -1397,7 +1399,8 @@ Special entry points for gdb to swap in coff symbol table parts:
.#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
. ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
. (obfd, info, ibfd, sec, rel, adjustedp))
-.#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\
+.#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
+. value, string, cp, coll, hashp)\
. ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
. (info, abfd, name, flags, section, value, string, cp, coll, hashp))
.
@@ -1420,14 +1423,13 @@ coff_bad_format_hook (abfd, filehdr)
if (BADMAG (*internal_f))
return FALSE;
- /* if the optional header is NULL or not the correct size then
+ /* If the optional header is NULL or not the correct size then
quit; the only difference I can see between m88k dgux headers (MC88DMAGIC)
and Intel 960 readwrite headers (I960WRMAGIC) is that the
optional header is of a different size.
But the mips keeps extra stuff in it's opthdr, so dont check
- when doing that
- */
+ when doing that. */
#if defined(M88) || defined(I960)
if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr)
@@ -1453,6 +1455,7 @@ coff_set_custom_section_alignment (abfd, section, alignment_table, table_size)
for (i = 0; i < table_size; ++i)
{
const char *secname = bfd_get_section_name (abfd, section);
+
if (alignment_table[i].comparison_length == (unsigned int) -1
? strcmp (alignment_table[i].name, secname) == 0
: strncmp (alignment_table[i].name, secname,
@@ -1566,13 +1569,13 @@ coff_set_alignment_hook (abfd, section, scnhdr)
unsigned int i;
#ifdef I960
- /* Extract ALIGN from 2**ALIGN stored in section header */
+ /* Extract ALIGN from 2**ALIGN stored in section header. */
for (i = 0; i < 32; i++)
if ((1 << i) >= hdr->s_align)
break;
#endif
#ifdef TIC80COFF
- /* TI tools puts the alignment power in bits 8-11 */
+ /* TI tools puts the alignment power in bits 8-11. */
i = (hdr->s_flags >> 8) & 0xF ;
#endif
#ifdef COFF_DECODE_ALIGNMENT
@@ -1588,7 +1591,7 @@ coff_set_alignment_hook (abfd, section, scnhdr)
#else /* ! COFF_ALIGN_IN_SECTION_HEADER */
#ifdef COFF_WITH_PE
-/* a couple of macros to help setting the alignment power field */
+/* A couple of macros to help setting the alignment power field. */
#define ALIGN_SET(field,x,y) \
if (((field) & IMAGE_SCN_ALIGN_64BYTES) == x )\
{\
@@ -1649,7 +1652,7 @@ coff_set_alignment_hook (abfd, section, scnhdr)
section->lma = hdr->s_vaddr;
- /* check for extended relocs */
+ /* Check for extended relocs. */
if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL)
{
struct external_reloc dst;
@@ -1745,6 +1748,7 @@ coff_mkobject (abfd)
#endif
/* Create the COFF backend specific information. */
+
#ifndef coff_mkobject_hook
static PTR
coff_mkobject_hook (abfd, filehdr, aouthdr)
@@ -2125,7 +2129,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef TICOFF0MAGIC
#ifdef TICOFF_TARGET_ARCH
- /* this TI COFF section should be used by all new TI COFF v0 targets */
+ /* This TI COFF section should be used by all new TI COFF v0 targets. */
case TICOFF0MAGIC:
arch = TICOFF_TARGET_ARCH;
machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags);
@@ -2134,8 +2138,8 @@ coff_set_arch_mach_hook (abfd, filehdr)
#endif
#ifdef TICOFF1MAGIC
- /* this TI COFF section should be used by all new TI COFF v1/2 targets */
- /* TI COFF1 and COFF2 use the target_id field to specify which arch */
+ /* This TI COFF section should be used by all new TI COFF v1/2 targets. */
+ /* TI COFF1 and COFF2 use the target_id field to specify which arch. */
case TICOFF1MAGIC:
case TICOFF2MAGIC:
switch (internal_f->f_target_id)
@@ -2174,7 +2178,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
break;
#endif
- default: /* Unreadable input file type */
+ default: /* Unreadable input file type. */
arch = bfd_arch_obscure;
break;
}
@@ -2215,7 +2219,6 @@ static bfd_boolean coff_pointerize_aux_hook
PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
unsigned int, combined_entry_type *));
-/*ARGSUSED*/
static bfd_boolean
coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
bfd *abfd ATTRIBUTE_UNUSED;
@@ -2255,7 +2258,6 @@ static bfd_boolean coff_pointerize_aux_hook
PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
unsigned int, combined_entry_type *));
-/*ARGSUSED*/
static bfd_boolean
coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
bfd *abfd ATTRIBUTE_UNUSED;
@@ -2360,7 +2362,7 @@ SUBSUBSECTION
static int compare_arelent_ptr PARAMS ((const PTR, const PTR));
-/* AUX's ld wants relocations to be sorted */
+/* AUX's ld wants relocations to be sorted. */
static int
compare_arelent_ptr (x, y)
const PTR x;
@@ -2393,7 +2395,7 @@ coff_write_relocs (abfd, first_undef)
p = s->orelocation;
#else
{
- /* sort relocations before we write them out */
+ /* Sort relocations before we write them out. */
bfd_size_type amt;
amt = s->reloc_count;
@@ -2412,10 +2414,11 @@ coff_write_relocs (abfd, first_undef)
#ifdef COFF_WITH_PE
if (obj_pe (abfd) && s->reloc_count >= 0xffff)
{
- /* encode real count here as first reloc */
+ /* Encode real count here as first reloc. */
struct internal_reloc n;
+
memset ((PTR) & n, 0, sizeof (n));
- /* add one to count *this* reloc (grr) */
+ /* Add one to count *this* reloc (grr). */
n.r_vaddr = s->reloc_count + 1;
coff_swap_reloc_out (abfd, &n, &dst);
if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd),
@@ -2428,6 +2431,7 @@ coff_write_relocs (abfd, first_undef)
{
struct internal_reloc n;
arelent *q = p[i];
+
memset ((PTR) & n, 0, sizeof (n));
/* Now we've renumbered the symbols we know where the
@@ -2445,11 +2449,13 @@ coff_write_relocs (abfd, first_undef)
int j;
const char *sname = q->sym_ptr_ptr[0]->name;
asymbol **outsyms = abfd->outsymbols;
+
for (j = first_undef; outsyms[j]; j++)
{
const char *intable = outsyms[j]->name;
+
if (strcmp (intable, sname) == 0) {
- /* got a hit, so repoint the reloc */
+ /* Got a hit, so repoint the reloc. */
q->sym_ptr_ptr = outsyms + j;
break;
}
@@ -2492,12 +2498,13 @@ coff_write_relocs (abfd, first_undef)
#endif
#ifdef SELECT_RELOC
- /* Work out reloc type from what is required */
+ /* Work out reloc type from what is required. */
SELECT_RELOC (n, q->howto);
#else
n.r_type = q->howto->type;
#endif
coff_swap_reloc_out (abfd, &n, &dst);
+
if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd),
abfd) != bfd_coff_relsz (abfd))
return FALSE;
@@ -2593,12 +2600,12 @@ coff_set_flags (abfd, magicp, flagsp)
#ifdef TICOFF_DEFAULT_MAGIC
case TICOFF_TARGET_ARCH:
- /* if there's no indication of which version we want, use the default */
+ /* If there's no indication of which version we want, use the default. */
if (!abfd->xvec )
*magicp = TICOFF_DEFAULT_MAGIC;
else
{
- /* we may want to output in a different COFF version */
+ /* We may want to output in a different COFF version. */
switch (abfd->xvec->name[4])
{
case '0':
@@ -3091,8 +3098,8 @@ coff_compute_section_file_positions (abfd)
#ifdef ALIGN_SECTIONS_IN_FILE
if ((abfd->flags & EXEC_P) != 0)
{
- /* make sure this section is aligned on the right boundary - by
- padding the previous section up if necessary */
+ /* Make sure this section is aligned on the right boundary - by
+ padding the previous section up if necessary. */
old_sofar = sofar;
#ifdef RS6000COFF_C
@@ -3128,9 +3135,7 @@ coff_compute_section_file_positions (abfd)
}
#endif
if (previous != (asection *) NULL)
- {
- previous->_raw_size += sofar - old_sofar;
- }
+ previous->_raw_size += sofar - old_sofar;
}
#endif
@@ -3152,7 +3157,7 @@ coff_compute_section_file_positions (abfd)
sofar += current->_raw_size;
#ifdef ALIGN_SECTIONS_IN_FILE
- /* make sure that this section is of the right size too */
+ /* Make sure that this section is of the right size too. */
if ((abfd->flags & EXEC_P) == 0)
{
bfd_size_type old_size;
@@ -3241,10 +3246,11 @@ coff_add_missing_symbols (abfd)
{
coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]);
const char *name;
+
if (csym)
{
- /* only do this if there is a coff representation of the input
- symbol */
+ /* Only do this if there is a coff representation of the input
+ symbol. */
if (csym->native && csym->native->u.syment.n_sclass == C_FILE)
{
need_file = 0;
@@ -3278,11 +3284,11 @@ coff_add_missing_symbols (abfd)
if (!sympp2)
return FALSE;
memcpy (sympp2, sympp, i * sizeof (asymbol *));
+
if (need_file)
- {
- /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */
- abort ();
- }
+ /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */
+ abort ();
+
if (need_text)
sympp2[i++] = coff_section_symbol (abfd, _TEXT);
if (need_data)
@@ -3419,7 +3425,7 @@ coff_write_object_contents (abfd)
bfd_set_error (bfd_error_system_call);
/* Make a pass through the symbol table to count line number entries and
- put them into the correct asections */
+ put them into the correct asections. */
lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd);
@@ -3431,13 +3437,13 @@ coff_write_object_contents (abfd)
reloc_base = obj_relocbase (abfd);
- /* Work out the size of the reloc and linno areas */
+ /* Work out the size of the reloc and linno areas. */
for (current = abfd->sections; current != NULL; current =
current->next)
{
#ifdef COFF_WITH_PE
- /* we store the actual reloc count in the first reloc's addr */
+ /* We store the actual reloc count in the first reloc's addr. */
if (obj_pe (abfd) && current->reloc_count >= 0xffff)
reloc_count ++;
#endif
@@ -3449,7 +3455,7 @@ coff_write_object_contents (abfd)
lineno_base = reloc_base + reloc_size;
sym_base = lineno_base + lnno_size;
- /* Indicate in each section->line_filepos its actual file address */
+ /* Indicate in each section->line_filepos its actual file address. */
for (current = abfd->sections; current != NULL; current =
current->next)
{
@@ -3468,7 +3474,7 @@ coff_write_object_contents (abfd)
current->rel_filepos = reloc_base;
reloc_base += current->reloc_count * bfd_coff_relsz (abfd);
#ifdef COFF_WITH_PE
- /* extra reloc to hold real count */
+ /* Extra reloc to hold real count. */
if (obj_pe (abfd) && current->reloc_count >= 0xffff)
reloc_base += bfd_coff_relsz (abfd);
#endif
@@ -3564,19 +3570,14 @@ coff_write_object_contents (abfd)
section.s_paddr = 0;
#endif
- /*
- If this section has no size or is unloadable then the scnptr
- will be 0 too
- */
+ /* If this section has no size or is unloadable then the scnptr
+ will be 0 too. */
if (current->_raw_size == 0 ||
(current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
- {
- section.s_scnptr = 0;
- }
+ section.s_scnptr = 0;
else
- {
- section.s_scnptr = current->filepos;
- }
+ section.s_scnptr = current->filepos;
+
section.s_relptr = current->rel_filepos;
section.s_lnnoptr = current->line_filepos;
section.s_nreloc = current->reloc_count;
@@ -3606,17 +3607,11 @@ coff_write_object_contents (abfd)
section.s_flags = sec_to_styp_flags (current->name, current->flags);
if (!strcmp (current->name, _TEXT))
- {
- text_sec = current;
- }
+ text_sec = current;
else if (!strcmp (current->name, _DATA))
- {
- data_sec = current;
- }
+ data_sec = current;
else if (!strcmp (current->name, _BSS))
- {
- bss_sec = current;
- }
+ bss_sec = current;
#ifdef I960
section.s_align = (current->alignment_power
@@ -3624,7 +3619,7 @@ coff_write_object_contents (abfd)
: 0);
#endif
#ifdef TIC80COFF
- /* TI COFF puts the alignment power in bits 8-11 of the flags */
+ /* TI COFF puts the alignment power in bits 8-11 of the flags. */
section.s_flags |= (current->alignment_power & 0xF) << 8;
#endif
#ifdef COFF_ENCODE_ALIGNMENT
@@ -3781,14 +3776,11 @@ coff_write_object_contents (abfd)
/* Don't include the internal abs section in the section count */
- /*
- We will NOT put a fucking timestamp in the header here. Every time you
+ /* We will NOT put a fucking timestamp in the header here. Every time you
put it back, I will come in and take it out again. I'm sorry. This
field does not belong here. We fill it with a 0 so it compares the
- same but is not a reasonable time. -- gnu@cygnus.com
- */
+ same but is not a reasonable time. -- gnu@cygnus.com */
internal_f.f_timdat = 0;
-
internal_f.f_flags = 0;
if (abfd->flags & EXEC_P)
@@ -3825,18 +3817,16 @@ coff_write_object_contents (abfd)
#endif
#ifdef TI_TARGET_ID
- /* target id is used in TI COFF v1 and later; COFF0 won't use this field,
- but it doesn't hurt to set it internally */
+ /* Target id is used in TI COFF v1 and later; COFF0 won't use this field,
+ but it doesn't hurt to set it internally. */
internal_f.f_target_id = TI_TARGET_ID;
#endif
#ifdef TIC80_TARGET_ID
internal_f.f_target_id = TIC80_TARGET_ID;
#endif
- /*
- FIXME, should do something about the other byte orders and
- architectures.
- */
+ /* FIXME, should do something about the other byte orders and
+ architectures. */
#ifdef RS6000COFF_C
if ((abfd->flags & DYNAMIC) != 0)
@@ -3847,11 +3837,11 @@ coff_write_object_contents (abfd)
memset (&internal_a, 0, sizeof internal_a);
- /* Set up architecture-dependent stuff */
-
+ /* Set up architecture-dependent stuff. */
{
unsigned int magic = 0;
unsigned short flags = 0;
+
coff_set_flags (abfd, &magic, &flags);
internal_f.f_magic = magic;
internal_f.f_flags |= flags;
@@ -3860,14 +3850,13 @@ coff_write_object_contents (abfd)
#ifdef A29K
#ifdef ULTRA3 /* NYU's machine */
/* FIXME: This is a bogus check. I really want to see if there
- * is a .shbss or a .shdata section, if so then set the magic
- * number to indicate a shared data executable.
- */
+ is a .shbss or a .shdata section, if so then set the magic
+ number to indicate a shared data executable. */
if (internal_f.f_nscns >= 7)
- internal_a.magic = SHMAGIC; /* Shared magic */
+ internal_a.magic = SHMAGIC; /* Shared magic. */
else
#endif /* ULTRA3 */
- internal_a.magic = NMAGIC; /* Assume separate i/d */
+ internal_a.magic = NMAGIC; /* Assume separate i/d. */
#define __A_MAGIC_SET__
#endif /* A29K */
#ifdef TICOFF_AOUT_MAGIC
@@ -3982,7 +3971,7 @@ coff_write_object_contents (abfd)
/* FIXME: Does anybody ever set this to another value? */
internal_a.vstamp = 0;
- /* Now should write relocs, strings, syms */
+ /* Now should write relocs, strings, syms. */
obj_sym_filepos (abfd) = sym_base;
if (bfd_get_symcount (abfd) != 0)
@@ -4165,7 +4154,7 @@ coff_write_object_contents (abfd)
if (abfd->flags & EXEC_P)
{
/* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
- include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */
+ include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */
char * buff;
bfd_size_type amount = bfd_coff_aoutsz (abfd);
@@ -4214,7 +4203,7 @@ coff_set_section_contents (abfd, section, location, offset, count)
file_ptr offset;
bfd_size_type count;
{
- if (! abfd->output_has_begun) /* set by bfd.c handler */
+ if (! abfd->output_has_begun) /* Set by bfd.c handler. */
{
if (! coff_compute_section_file_positions (abfd))
return FALSE;
@@ -4241,7 +4230,7 @@ coff_set_section_contents (abfd, section, location, offset, count)
code has been tested on ISC 4.1 by me, and on SCO by Robert Lipe
<robertl@arnet.com> (Thanks!).
- Gvran Uddeborg <gvran@uddeborg.pp.se> */
+ Gvran Uddeborg <gvran@uddeborg.pp.se>. */
if (strcmp (section->name, _LIB) == 0)
{
@@ -4365,6 +4354,7 @@ coff_slurp_line_table (abfd, asect)
while (counter < asect->lineno_count)
{
struct internal_lineno dst;
+
bfd_coff_swap_lineno_in (abfd, src, &dst);
cache_ptr->line_number = dst.l_lnno;
@@ -4430,19 +4420,16 @@ coff_slurp_symbol_table (abfd)
coff_symbol_type *cached_area;
unsigned int *table_ptr;
bfd_size_type amt;
-
unsigned int number_of_symbols = 0;
if (obj_symbols (abfd))
return TRUE;
- /* Read in the symbol table */
+ /* Read in the symbol table. */
if ((native_symbols = coff_get_normalized_symtab (abfd)) == NULL)
- {
- return FALSE;
- } /* on error */
+ return FALSE;
- /* Allocate enough room for all the symbols in cached form */
+ /* Allocate enough room for all the symbols in cached form. */
amt = obj_raw_syment_count (abfd);
amt *= sizeof (coff_symbol_type);
cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt);
@@ -4460,6 +4447,7 @@ coff_slurp_symbol_table (abfd)
coff_symbol_type *dst = cached_area;
unsigned int last_native_index = obj_raw_syment_count (abfd);
unsigned int this_index = 0;
+
while (this_index < last_native_index)
{
combined_entry_type *src = native_symbols + this_index;
@@ -4483,8 +4471,7 @@ coff_slurp_symbol_table (abfd)
dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL;
dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION;
#endif
- /* Fall through to next case */
-
+ /* Fall through to next case. */
#endif
case C_EXT:
@@ -4497,10 +4484,10 @@ coff_slurp_symbol_table (abfd)
case C_HIDEXT:
#endif
#ifdef C_SYSTEM
- case C_SYSTEM: /* System Wide variable */
+ case C_SYSTEM: /* System Wide variable. */
#endif
#ifdef COFF_WITH_PE
- /* In PE, 0x68 (104) denotes a section symbol */
+ /* In PE, 0x68 (104) denotes a section symbol. */
case C_SECTION:
/* In PE, 0x69 (105) denotes a weak external symbol. */
case C_NT_WEAK:
@@ -4574,16 +4561,16 @@ coff_slurp_symbol_table (abfd)
break;
- case C_STAT: /* static */
+ case C_STAT: /* Static. */
#ifdef I960
- case C_LEAFSTAT: /* static leaf procedure */
+ case C_LEAFSTAT: /* Static leaf procedure. */
#endif
#if defined ARM
- case C_THUMBSTAT: /* Thumb static */
- case C_THUMBLABEL: /* Thumb label */
- case C_THUMBSTATFUNC:/* Thumb static function */
+ case C_THUMBSTAT: /* Thumb static. */
+ case C_THUMBLABEL: /* Thumb label. */
+ case C_THUMBSTATFUNC:/* Thumb static function. */
#endif
- case C_LABEL: /* label */
+ case C_LABEL: /* Label. */
if (src->u.syment.n_scnum == N_DEBUG)
dst->symbol.flags = BSF_DEBUGGING;
else
@@ -4606,35 +4593,35 @@ coff_slurp_symbol_table (abfd)
dst->symbol.value = src->u.syment.n_value;
break;
- case C_MOS: /* member of structure */
- case C_EOS: /* end of structure */
-#ifdef NOTDEF /* C_AUTOARG has the same value */
+ case C_MOS: /* Member of structure. */
+ case C_EOS: /* End of structure. */
+#ifdef NOTDEF /* C_AUTOARG has the same value. */
#ifdef C_GLBLREG
- case C_GLBLREG: /* A29k-specific storage class */
+ case C_GLBLREG: /* A29k-specific storage class. */
#endif
#endif
- case C_REGPARM: /* register parameter */
- case C_REG: /* register variable */
- /* C_AUTOARG conflictes with TI COFF C_UEXT */
+ case C_REGPARM: /* Register parameter. */
+ case C_REG: /* register variable. */
+ /* C_AUTOARG conflictes with TI COFF C_UEXT. */
#if !defined (TIC80COFF) && !defined (TICOFF)
#ifdef C_AUTOARG
- case C_AUTOARG: /* 960-specific storage class */
+ case C_AUTOARG: /* 960-specific storage class. */
#endif
#endif
- case C_TPDEF: /* type definition */
+ case C_TPDEF: /* Type definition. */
case C_ARG:
- case C_AUTO: /* automatic variable */
- case C_FIELD: /* bit field */
- case C_ENTAG: /* enumeration tag */
- case C_MOE: /* member of enumeration */
- case C_MOU: /* member of union */
- case C_UNTAG: /* union tag */
+ case C_AUTO: /* Automatic variable. */
+ case C_FIELD: /* Bit field. */
+ case C_ENTAG: /* Enumeration tag. */
+ case C_MOE: /* Member of enumeration. */
+ case C_MOU: /* Member of union. */
+ case C_UNTAG: /* Union tag. */
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
break;
- case C_FILE: /* file name */
- case C_STRTAG: /* structure tag */
+ case C_FILE: /* File name. */
+ case C_STRTAG: /* Structure tag. */
#ifdef RS6000COFF_C
case C_GSYM:
case C_LSYM:
@@ -4654,8 +4641,8 @@ coff_slurp_symbol_table (abfd)
break;
#ifdef RS6000COFF_C
- case C_BINCL: /* beginning of include file */
- case C_EINCL: /* ending of include file */
+ case C_BINCL: /* Beginning of include file. */
+ case C_EINCL: /* Ending of include file. */
/* The value is actually a pointer into the line numbers
of the file. We locate the line number entry, and
set the section to the section which contains it, and
@@ -4696,9 +4683,9 @@ coff_slurp_symbol_table (abfd)
break;
#endif
- case C_BLOCK: /* ".bb" or ".eb" */
- case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */
- case C_EFCN: /* physical end of function */
+ case C_BLOCK: /* ".bb" or ".eb". */
+ case C_FCN: /* ".bf" or ".ef" (or PE ".lf"). */
+ case C_EFCN: /* Physical end of function. */
#if defined COFF_WITH_PE
/* PE sets the symbol to a value relative to the start
of the section. */
@@ -4720,7 +4707,7 @@ coff_slurp_symbol_table (abfd)
#endif
break;
- case C_STATLAB: /* Static load time label */
+ case C_STATLAB: /* Static load time label. */
dst->symbol.value = src->u.syment.n_value;
dst->symbol.flags = BSF_GLOBAL;
break;
@@ -4733,22 +4720,22 @@ coff_slurp_symbol_table (abfd)
&& src->u.syment.n_scnum == 0)
break;
/* Fall through. */
- case C_EXTDEF: /* external definition */
- case C_ULABEL: /* undefined label */
- case C_USTATIC: /* undefined static */
+ case C_EXTDEF: /* External definition. */
+ case C_ULABEL: /* Undefined label. */
+ case C_USTATIC: /* Undefined static. */
#ifndef COFF_WITH_PE
/* C_LINE in regular coff is 0x68. NT has taken over this storage
- class to represent a section symbol */
- case C_LINE: /* line # reformatted as symbol table entry */
+ class to represent a section symbol. */
+ case C_LINE: /* line # reformatted as symbol table entry. */
/* NT uses 0x67 for a weak symbol, not C_ALIAS. */
- case C_ALIAS: /* duplicate tag */
+ case C_ALIAS: /* Duplicate tag. */
#endif
- /* New storage classes for TI COFF */
+ /* New storage classes for TI COFF. */
#if defined(TIC80COFF) || defined(TICOFF)
- case C_UEXT: /* Tentative external definition */
+ case C_UEXT: /* Tentative external definition. */
#endif
- case C_EXTLAB: /* External load time label */
- case C_HIDDEN: /* ext symbol in dmert public lib */
+ case C_EXTLAB: /* External load time label. */
+ case C_HIDDEN: /* Ext symbol in dmert public lib. */
default:
(*_bfd_error_handler)
(_("%s: Unrecognized storage class %d for %s symbol `%s'"),
@@ -4768,17 +4755,18 @@ coff_slurp_symbol_table (abfd)
this_index += (src->u.syment.n_numaux) + 1;
dst++;
number_of_symbols++;
- } /* walk the native symtab */
- } /* bfdize the native symtab */
+ }
+ }
obj_symbols (abfd) = cached_area;
obj_raw_syments (abfd) = native_symbols;
bfd_get_symcount (abfd) = number_of_symbols;
obj_convert (abfd) = table_ptr;
- /* Slurp the line tables for each section too */
+ /* Slurp the line tables for each section too. */
{
asection *p;
+
p = abfd->sections;
while (p)
{
@@ -4786,6 +4774,7 @@ coff_slurp_symbol_table (abfd)
p = p->next;
}
}
+
return TRUE;
} /* coff_slurp_symbol_table() */
@@ -5012,15 +5001,15 @@ coff_slurp_reloc_table (abfd, asect, symbols)
refering to the symbols in the raw data have not been
modified, so we have to have a negative addend to compensate.
- Note that symbols which used to be common must be left alone */
+ Note that symbols which used to be common must be left alone. */
- /* Calculate any reloc addend by looking at the symbol */
+ /* Calculate any reloc addend by looking at the symbol. */
CALC_ADDEND (abfd, ptr, dst, cache_ptr);
cache_ptr->address -= asect->vma;
/* !! cache_ptr->section = (asection *) NULL;*/
- /* Fill in the cache_ptr->howto field from dst.r_type */
+ /* Fill in the cache_ptr->howto field from dst.r_type. */
RTYPE2HOWTO (cache_ptr, &dst);
#endif /* RELOC_PROCESSING */
@@ -5088,16 +5077,16 @@ coff_canonicalize_reloc (abfd, section, relptr, symbols)
if (section->flags & SEC_CONSTRUCTOR)
{
- /* this section has relocs made up by us, they are not in the
- file, so take them out of their chain and place them into
- the data area provided */
+ /* This section has relocs made up by us, they are not in the
+ file, so take them out of their chain and place them into
+ the data area provided. */
arelent_chain *chain = section->constructor_chain;
+
for (count = 0; count < section->reloc_count; count++)
{
*relptr++ = &chain->relent;
chain = chain->next;
}
-
}
else
{
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 96d4765f72..c678496dbd 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -189,6 +189,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_bigarm_vec
targ_selvecs=bfd_elf32_littlearm_vec
;;
+ arm-*-kaos* | strongarm-*-kaos*)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
@@ -370,6 +374,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
+ i[3456]86-*-kaos*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs=bfd_elf32_i386_vec
+ ;;
i[3456]86-*-nto*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
@@ -901,6 +909,11 @@ case "${targ}" in
targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
;;
+ powerpc-*-kaos*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+ ;;
powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*)
targ_defvec=mach_o_be_vec
targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
@@ -1025,7 +1038,7 @@ case "${targ}" in
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
;;
- shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf*)
+ shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
targ_defvec=bfd_elf32_shl_vec
targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec"
#ifdef BFD64
@@ -1033,7 +1046,7 @@ case "${targ}" in
#endif
targ_underscore=yes
;;
- sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself*)
+ sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself* | sh-*-kaos*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
#ifdef BFD64
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index cd4bf14eaa..923c2500af 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -95,7 +95,8 @@ processors[] =
{ bfd_mach_arm_4, "strongarm"},
{ bfd_mach_arm_4, "strongarm110" },
{ bfd_mach_arm_4, "strongarm1100" },
- { bfd_mach_arm_XScale, "xscale" }
+ { bfd_mach_arm_XScale, "xscale" },
+ { bfd_mach_arm_ep9312, "ep9312" }
};
static bfd_boolean
@@ -140,7 +141,8 @@ static const bfd_arch_info_type arch_info_struct[] =
N (bfd_mach_arm_5, "armv5", FALSE, & arch_info_struct[7]),
N (bfd_mach_arm_5T, "armv5t", FALSE, & arch_info_struct[8]),
N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]),
- N (bfd_mach_arm_XScale, "xscale", FALSE, NULL)
+ N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]),
+ N (bfd_mach_arm_ep9312, "ep9312", FALSE, NULL)
};
const bfd_arch_info_type bfd_arm_arch =
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index 2af10b0ce7..b133991110 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,10 @@
+2003-02-12 Bob Wilson <bob.wilson@acm.org>
+
+ * bfd.texinfo: Fix quotes for texinfo. Make section title
+ capitalization more consistent. Use @example instead of @lisp.
+ Replace FDL appendix with include of fdl.texi.
+ * fdl.texi: New file.
+
2002-11-18 Klee Dienes <kdienes@apple.com>
* Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi.
@@ -172,43 +179,43 @@ Wed May 24 12:03:25 2000 Hans-Peter Nilsson <hp@axis.com>
* bfdint.texi (BFD_JUMP_TABLE macros): Fix typo.
-Fri Apr 7 17:54:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+2000-04-07 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in: Rebuild with current autoconf/automake.
-Thu Feb 4 23:21:36 1999 Ian Lance Taylor <ian@cygnus.com>
+1999-02-04 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in: Rebuild with current autoconf/automake.
-Thu Jul 23 09:36:44 1998 Nick Clifton <nickc@cygnus.com>
+1998-07-23 Nick Clifton <nickc@cygnus.com>
* bfdint.texi (BFD ELF processor required): Add paragraph
describing the necessity to create "include/elf/CPU.h".
-Thu May 7 14:45:43 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-05-07 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (chew.o): Add -I options for intl srcdir and
objdir.
* Makefile.in: Rebuild.
-Mon Apr 27 20:19:24 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-04-27 Ian Lance Taylor <ian@cygnus.com>
* bfdint.texi: New file.
* Makefile.am (noinst_TEXINFOS): New variable.
* Makefile.in: Rebuild.
-Mon Apr 13 16:48:56 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-04-13 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in: Rebuild.
-Mon Apr 6 14:06:55 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-04-06 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (STAGESTUFF): Remove variable.
(CLEANFILES): Don't remove $(STAGESTUFF).
(DISTCLEANFILES, MAINTAINERCLEANFILES): New variables.
* Makefile.in: Rebuild.
-Fri Mar 27 16:25:25 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-03-27 Ian Lance Taylor <ian@cygnus.com>
* chew.c (skip_white_and_starts): Remove unused declaration.
(skip_white_and_stars): Add casts to avoid warnings.
@@ -223,12 +230,12 @@ Fri Mar 27 16:25:25 1998 Ian Lance Taylor <ian@cygnus.com>
(print): Change printf format string.
(main): Call usage for an unrecognized option.
-Fri Feb 13 14:37:14 1998 Ian Lance Taylor <ian@cygnus.com>
+1998-02-13 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (AUTOMAKE_OPTIONS): Define.
* Makefile.in: Rebuild.
-Mon Jan 26 15:38:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+1998-01-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* doc.str (bodytext): Don't output @* at the end.
* chew.c (kill_bogus_lines): Make sure that a period at the
@@ -238,45 +245,45 @@ Mon Jan 26 15:38:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.
* Makefile.am (s-reloc, s-syms): Depend on doc.str.
* Makefile.in: Rebuild.
-Wed Oct 1 14:41:28 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-10-01 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or
elfcode.h as input files; they don't contribute anything.
* Makefile.in: Rebuild.
-Fri Aug 15 04:55:15 1997 Doug Evans <dje@canuck.cygnus.com>
+1997-08-15 Doug Evans <dje@canuck.cygnus.com>
* Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC).
* Makefile.in: Rebuild.
-Fri Aug 1 12:59:58 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-08-01 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (CC_FOR_BUILD): Don't set explicitly.
* Makefile.in: Rebuild.
-Thu Jul 31 20:00:12 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-07-31 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am: New file, based on old Makefile.in.
* Makefile.in: Now built with automake.
-Tue Jul 22 14:44:00 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+1997-07-22 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
* Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi
rather than bfd.texi.
(DOCFILES): Change bfd.texi to bfdt.texi.
* bfd.texinfo: Include bfdt.texi, not bfd.texi.
-Mon Jun 16 15:33:15 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-06-16 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (CC, CFLAGS): Substitute from configure script.
From Jeff Makey <jeff@cts.com>.
-Tue Apr 15 12:37:41 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-04-15 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (install-info): Use mkinstalldirs to build
$(infodir).
-Tue Apr 8 12:49:46 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-04-08 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (install-info): Permit info files to be in srcdir.
(stamp-*): Add a stamp-X target for each X.texi target.
@@ -285,61 +292,61 @@ Tue Apr 8 12:49:46 1997 Ian Lance Taylor <ian@cygnus.com>
(distclean): Depend upon mostlyclean. Remove stamp-*. Don't
remove $(DOCFILES).
-Mon Apr 7 15:23:26 1997 Ian Lance Taylor <ian@cygnus.com>
+1997-04-07 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (distclean): Don't remove *.info files.
-Thu Feb 13 20:50:02 1997 Klaus Kaempf (kkaempf@progis.de)
+1997-02-13 Klaus Kaempf (kkaempf@progis.de)
* makefile.vms: New file.
-Tue Jun 18 18:32:28 1996 Ian Lance Taylor <ian@cygnus.com>
+1996-06-18 Ian Lance Taylor <ian@cygnus.com>
* chew.c (kill_bogus_lines): Reset sl when not at the start of a
line. From Uwe Ohse <uwe@tirka.gun.de>.
-Tue Jan 30 14:10:46 1996 Ian Lance Taylor <ian@cygnus.com>
+1996-01-30 Ian Lance Taylor <ian@cygnus.com>
From Ronald F. Guilmette <rfg@monkeys.com>:
* Makefile.in (libbfd.h): Depend upon proto.str.
(libcoff.h, bfd.h): Likewise.
-Fri Nov 3 14:46:48 1995 Fred Fish <fnf@cygnus.com>
+1995-11-03 Fred Fish <fnf@cygnus.com>
* Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c,
renamed from core.c.
-Wed Nov 1 14:28:23 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
+1995-11-01 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
* chew.c: Include <ctype.h>.
-Fri Oct 6 16:23:34 1995 Ken Raeburn <raeburn@cygnus.com>
+1995-10-06 Ken Raeburn <raeburn@cygnus.com>
Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile.in (Makefile): Only remake this Makefile.
-Wed Oct 4 15:51:05 1995 Ken Raeburn <raeburn@cygnus.com>
+1995-10-04 Ken Raeburn <raeburn@cygnus.com>
* chew.c: Include <stdio.h>.
-Tue Sep 12 18:14:50 1995 Ian Lance Taylor <ian@cygnus.com>
+1995-09-12 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (maintainer-clean): New target.
-Thu Aug 31 12:18:43 1995 Ian Lance Taylor <ian@cygnus.com>
+1995-08-31 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (bfd.h): Add additional #endif at end of bfd.h if
__cplusplus is defined.
-Tue Nov 29 16:13:34 1994 Doug Evans <dje@canuck.cygnus.com>
+1994-11-29 Doug Evans <dje@canuck.cygnus.com>
* chew.c (write_buffer): New argument `f', all callers changed.
(stdout, stderr, print, drop, idrop): New forth words.
* proto.str (COMMENT): New command.
* doc.str (COMMENT): Likewise.
-Mon Sep 12 11:44:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+1994-09-12 Ian Lance Taylor (ian@sanguine.cygnus.com)
* Makefile.in (DOCFILES): Remove ctor.texi.
(IPROTOS): Remove ctor.ip.
@@ -349,7 +356,7 @@ Mon Sep 12 11:44:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
$(MKDOC) run on $(srcdir)/../ctor.c.
* bfd.texinfo (Constructors): Remove section.
-Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+1994-09-02 Ken Raeburn (raeburn@cujo.cygnus.com)
* chew.c: Include assert.h. Added prototypes for most functions.
Changed most uses of int to long. Do bounds checking on the
@@ -371,46 +378,46 @@ Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
* doc.str, proto.str: Handle new commands SENUM, ENUM, ENUMX,
ENUMEQ, ENUMEQX, ENUMDOC.
-Wed Jan 12 18:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+1994-01-12 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* bfd.texinfo: Added Linker Functions node.
* Makefile.in (DOCFILES): Added linker.texi.
(SRCDOC): Added linker.c.
(linker.texi): New target.
-Tue Jan 4 10:52:56 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+1994-01-04 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* chew.c: Don't rely on a correct declaration of exit.
(chew_exit): New function which just calls exit.
(main): Use it.
-Mon Jan 3 11:40:40 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+1994-01-03 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* bfd.texinfo: Added Hash Tables node.
* Makefile.in (DOCFILES): Added hash.texi.
(SRCDOC): Added hash.c.
(hash.texi): New target.
-Thu Dec 30 16:57:04 1993 Ken Raeburn (raeburn@cujo.cygnus.com)
+1993-12-30 Ken Raeburn (raeburn@cujo.cygnus.com)
* Makefile.in: Delete all references to seclet.c, since it's just
been deleted. Don't mention hash.c, linker.c, or genlink.h yet,
since they don't contain documentation yet (hint, hint!).
-Fri Nov 5 10:58:53 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+1993-11-05 David J. Mackenzie (djm@thepub.cygnus.com)
* bfd.texinfo: Small cleanups.
-Fri Nov 19 03:46:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+1993-11-19 Ken Raeburn (raeburn@cambridge.cygnus.com)
* Makefile.in (archures.texi): Depends on $(MKDOC).
-Tue Aug 10 14:22:39 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+1993-08-10 Ken Raeburn (raeburn@cambridge.cygnus.com)
* bfd.texinfo (BFD back end): Don't include elfcode.texi, since
it's empty now and that triggers a makeinfo bug.
-Mon Aug 9 16:27:30 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+1993-08-09 Ken Raeburn (raeburn@cambridge.cygnus.com)
* bfd.texinfo (BFD back end): New section on ELF, includes
elf.texi and elfcode.texi.
@@ -418,74 +425,74 @@ Mon Aug 9 16:27:30 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
(SRCDOC): Include elfcode.h, elf.c.
(elf.texi, elfcode.texi): New intermediate targets.
-Thu Jun 24 13:48:13 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+1993-06-24 David J. Mackenzie (djm@thepub.cygnus.com)
* Makefile.in (.c.o, chew.o): Put CFLAGS last.
* bfdsumm.texi: New file, broken out of bfd.texinfo, to share
with ld.texinfo.
-Mon Jun 14 12:07:07 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
+1993-06-14 david d `zoo' zuhn (zoo at rtl.cygnus.com)
* Makefile.in (install-info): remove parentdir cruft,
-Wed Jun 9 16:00:32 1993 Jim Kingdon (kingdon@cygnus.com)
+1993-06-09 Jim Kingdon (kingdon@cygnus.com)
* Makefile.in (mostlyclean): Remove chew.o.
-Tue May 25 14:46:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+1993-05-25 Ken Raeburn (raeburn@cambridge.cygnus.com)
* Makefile.in (libbfd.h): Use elfcode.h, not elf32.c.
-Mon May 24 15:50:07 1993 Ken Raeburn (raeburn@cygnus.com)
+1993-05-24 Ken Raeburn (raeburn@cygnus.com)
* chew.c (compile): Add a couple of missing casts.
-Wed May 12 14:45:14 1993 Ian Lance Taylor (ian@cygnus.com)
+1993-05-12 Ian Lance Taylor (ian@cygnus.com)
* Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC).
(chew.o, $(MKDOC)): Build using CC_FOR_BUILD rather than CC, since
it must run on the build machine.
-Tue Apr 6 22:38:10 1993 John Gilmore (gnu@cygnus.com)
+1993-04-07 John Gilmore (gnu@cygnus.com)
* Makefile.in (chew): Don't compile from .c to executable in a
single step; it puts a temporary .o filename into the executable,
which makes multi-stage comparisons fail. Compile chew.c to
chew.o, and link that, which makes identical executables every time.
-Wed Mar 24 17:26:29 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+1993-03-24 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
* Makefile.in: fix typo (bfd.texinfo not bfd.texino)
-Fri Mar 19 01:13:00 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+1993-03-19 Ken Raeburn (raeburn@kr-pc.cygnus.com)
* bfd.texinfo: Since BFD version number has been bumped, do same
to "version number" on title page, and elsewhere. Should be
fixed to extract real version number.
-Tue Mar 16 12:15:13 1993 Per Bothner (bothner@rtl.cygnus.com)
+1993-03-16 Per Bothner (bothner@rtl.cygnus.com)
* Makefile.in: Add *clean rules.
-Mon Jan 11 18:43:56 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+1993-01-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c.
Added seclet.c.
(bfd.h): Added dependency on bfd.c and seclet.c. Added seclet.c
to build.
-Thu Dec 17 19:35:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+1992-12-17 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
* Makefile.in: added dvi target, define and use $(TEXI2DVI)
-Thu Dec 3 17:42:48 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+1992-12-03 Ken Raeburn (raeburn@cambridge.cygnus.com)
* Makefile.in (TEXIDIR): New variable.
(bfd.dvi): Look for bfd.texinfo in $(srcdir). Generate index.
* bfd.texinfo: Minor doc fixes.
-Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com)
+1992-11-05 John Gilmore (gnu@cygnus.com)
Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS.
@@ -493,70 +500,70 @@ Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com)
(paramstuff): Replace exfunstuff with function to generate PARAMS.
* proto.str: Use paramstuff rather than exfunstuff.
-Mon Aug 17 12:40:32 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+1992-08-17 Steve Chamberlain (sac@thepub.cygnus.com)
* chew.c: various patches provided by Howard Chu.
-Fri Jun 19 18:59:54 1992 John Gilmore (gnu at cygnus.com)
+1992-06-19 John Gilmore (gnu at cygnus.com)
* Makefile.in (libbfd.h): Add elf.c as a source of prototypes.
-Mon May 11 18:55:59 1992 John Gilmore (gnu at cygnus.com)
+1992-05-11 John Gilmore (gnu at cygnus.com)
* chew.c: exit() should be declared by config files, not by
portable source code. Its type could be int or void function.
-Mon May 4 13:45:57 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+1992-05-04 K. Richard Pixley (rich@rtl.cygnus.com)
* Makefile.in: another CFLAGS correction.
-Tue Apr 28 10:21:32 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+1992-04-28 K. Richard Pixley (rich@rtl.cygnus.com)
* Makefile.in: Do the CFLAGS thing.
-Fri Apr 10 22:34:52 1992 Fred Fish (fnf@cygnus.com)
+1992-04-11 Fred Fish (fnf@cygnus.com)
* Makefile.in (MINUS_G): Add macro and default to -g.
-Fri Mar 6 18:53:18 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+1992-03-06 Steve Chamberlain (sac@thepub.cygnus.com)
* chew.c: now has -w switch turn on warnings
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+1992-02-26 K. Richard Pixley (rich@cygnus.com)
* Makefile.in, configure.in: removed traces of namesubdir,
-subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
copyrights to '92, changed some from Cygnus to FSF.
-Tue Dec 10 22:11:05 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in: build chew into the current directory. Complete
the MKDOC macro transition.
-Tue Dec 10 08:26:28 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+1991-12-10 Steve Chamberlain (sac at rtl.cygnus.com)
* chew.c: don't core dump when can't open file
* Makefile.in: get proto.str from the right place when built in
odd directories
-Tue Dec 10 04:07:25 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in: infodir belongs in datadir.
-Sat Dec 7 17:01:23 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+1991-12-07 Steve Chamberlain (sac at rtl.cygnus.com)
* chew.c: Much modified
* proto.str, doc.str: New files for extracting to product
prototypes and documents respectively.
-Fri Dec 6 22:57:12 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in: added standards.text support, host/site/target
inclusion hooks, install using INSTALL_DATA rather than cp,
don't echo on install.
-Thu Dec 5 22:46:17 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in: idestdir and ddestdir go away. Added copyrights
and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo
index f12222e9b3..d6a427f620 100644
--- a/bfd/doc/bfd.texinfo
+++ b/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
\input texinfo.tex
@setfilename bfd.info
-@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000
+@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, 2003
@c Free Software Foundation, Inc.
@c
@tex
@@ -30,14 +30,14 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the BFD library.
-Copyright (C) 1991, 2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
- section entitled "GNU Free Documentation License".
+ section entitled ``GNU Free Documentation License''.
@ignore
Permission is granted to process this file through Tex and print the
@@ -75,14 +75,14 @@ notice identical to this one except for the removal of this paragraph
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 2001 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
- section entitled "GNU Free Documentation License".
+ section entitled ``GNU Free Documentation License''.
@end titlepage
@end iftex
@@ -170,17 +170,17 @@ For example, this sequence does what you would probably expect:
return the number of sections in an object file attached to a BFD
@code{abfd}.
-@lisp
+@example
@c @cartouche
#include "bfd.h"
-unsigned int number_of_sections(abfd)
+unsigned int number_of_sections (abfd)
bfd *abfd;
@{
- return bfd_count_sections(abfd);
+ return bfd_count_sections (abfd);
@}
@c @end cartouche
-@end lisp
+@end example
The abstraction used within BFD is that an object file has:
@@ -205,7 +205,7 @@ IEEE-695.
@include bfdsumm.texi
@node BFD front end, BFD back ends, Overview, Top
-@chapter BFD front end
+@chapter BFD Front End
@include bfdt.texi
@include bfdio.texi
@@ -228,7 +228,7 @@ IEEE-695.
@end menu
@node Memory Usage, Initialization, BFD front end, BFD front end
-@section Memory usage
+@section Memory Usage
BFD keeps all of its internal structures in obstacks. There is one obstack
per open BFD file, into which the current state is stored. When a BFD is
closed, the obstack is deleted, and so everything which has been
@@ -324,370 +324,9 @@ All of BFD lives in one directory.
@include mmo.texi
@node GNU Free Documentation License, Index, BFD back ends, Top
-@chapter GNU Free Documentation License
-@cindex GNU Free Documentation License
-
- GNU Free Documentation License
-
- Version 1.1, March 2000
-
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The "Document", below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as "you".
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section entitled "History", and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section as "Endorsements"
- or to conflict in title with any Invariant Section.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications". You must delete all sections
-entitled "Endorsements."
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
- or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-@end smallexample
-
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-@node Index, , GNU Free Documentation License , Top
+@include fdl.texi
+
+@node Index, , GNU Free Documentation License, Top
@unnumbered Index
@printindex cp
diff --git a/bfd/doc/fdl.texi b/bfd/doc/fdl.texi
new file mode 100644
index 0000000000..176233cb1b
--- /dev/null
+++ b/bfd/doc/fdl.texi
@@ -0,0 +1,366 @@
+@c -*-texinfo-*-
+@appendix GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright (C) 2000, Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+@sp 1
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document ``free'' in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@sp 1
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you.''
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque.''
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+@sp 1
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+@sp 1
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+@sp 1
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.@*
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).@*
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.@*
+D. Preserve all the copyright notices of the Document.@*
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.@*
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.@*
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.@*
+H. Include an unaltered copy of this License.@*
+I. Preserve the section entitled ``History'', and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled ``History'' in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.@*
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the ``History'' section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.@*
+K. In any section entitled ``Acknowledgements'' or ``Dedications'',
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.@*
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.@*
+M. Delete any section entitled ``Endorsements.'' Such a section
+ may not be included in the Modified Version.@*
+N. Do not retitle any existing section as ``Endorsements''
+ or to conflict in title with any Invariant Section.@*
+@sp 1
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+@sp 1
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgements'',
+and any sections entitled ``Dedications.'' You must delete all sections
+entitled ``Endorsements.''
+@sp 1
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+@sp 1
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+@sp 1
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+@sp 1
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+@sp 1
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+@end enumerate
+
+@unnumberedsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+Copyright (C) @var{year} @var{your name}.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1
+or any later version published by the Free Software Foundation;
+with the Invariant Sections being @var{list their titles}, with the
+Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+A copy of the license is included in the section entitled "GNU
+Free Documentation License."
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/bfd/elf.c b/bfd/elf.c
index e4b90cf971..0331f3d316 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -97,6 +97,12 @@ static bfd_boolean elfcore_grok_netbsd_procinfo
PARAMS ((bfd *, Elf_Internal_Note *));
static bfd_boolean elfcore_grok_netbsd_note
PARAMS ((bfd *, Elf_Internal_Note *));
+static bfd_boolean elfcore_grok_nto_gregs
+ PARAMS ((bfd *, Elf_Internal_Note *, pid_t));
+static bfd_boolean elfcore_grok_nto_status
+ PARAMS ((bfd *, Elf_Internal_Note *, pid_t *));
+static bfd_boolean elfcore_grok_nto_note
+ PARAMS ((bfd *, Elf_Internal_Note *));
/* Swap version information in and out. The version information is
currently size independent. If that ever changes, this code will
@@ -3542,7 +3548,7 @@ elf_sort_sections (arg1, arg2)
/* Put !SEC_LOAD sections after SEC_LOAD ones. */
-#define TOEND(x) (((x)->flags & (SEC_LOAD|SEC_THREAD_LOCAL)) == 0)
+#define TOEND(x) (((x)->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0)
if (TOEND (sec1))
{
@@ -4656,13 +4662,20 @@ copy_private_bfd_data (ibfd, obfd)
&& ! section->segment_mark)
/* Returns TRUE iff seg1 starts after the end of seg2. */
-#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \
- (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr))
-
- /* Returns TRUE iff seg1 and seg2 overlap. */
+#define SEGMENT_AFTER_SEGMENT(seg1, seg2, field) \
+ (seg1->field >= SEGMENT_END (seg2, seg2->field))
+
+ /* Returns TRUE iff seg1 and seg2 overlap. Segments overlap iff both
+ their VMA address ranges and their LMA address ranges overlap.
+ It is possible to have overlapping VMA ranges without overlapping LMA
+ ranges. RedBoot images for example can have both .data and .bss mapped
+ to the same VMA range, but with the .data section mapped to a different
+ LMA. */
#define SEGMENT_OVERLAPS(seg1, seg2) \
- (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) \
- || SEGMENT_AFTER_SEGMENT (seg2, seg1)))
+ ( !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_vaddr) \
+ || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \
+ && !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_paddr) \
+ || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr)))
/* Initialise the segment mark field. */
for (section = ibfd->sections; section != NULL; section = section->next)
@@ -4760,13 +4773,14 @@ copy_private_bfd_data (ibfd, obfd)
continue;
/* Compute how many sections might be placed into this segment. */
- section_count = 0;
- for (section = ibfd->sections; section != NULL; section = section->next)
+ for (section = ibfd->sections, section_count = 0;
+ section != NULL;
+ section = section->next)
if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
++section_count;
-
- /* Allocate a segment map big enough to contain all of the
- sections we have selected. */
+
+ /* Allocate a segment map big enough to contain
+ all of the sections we have selected. */
amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
map = (struct elf_segment_map *) bfd_alloc (obfd, amt);
@@ -4838,7 +4852,7 @@ copy_private_bfd_data (ibfd, obfd)
and possibly its LMA changed, and a new segment or segments will
have to be created to contain the other sections.
- 4. The sections have been moved, but not be the same amount.
+ 4. The sections have been moved, but not by the same amount.
In this case we can change the segment's LMA to match the LMA
of the first section and we will have to create a new segment
or segments to contain the other sections.
@@ -5082,10 +5096,8 @@ copy_private_bfd_data (ibfd, obfd)
if (map->p_paddr != 0)
break;
if (map == NULL)
- {
- for (map = map_first; map != NULL; map = map->next)
- map->p_paddr_valid = 0;
- }
+ for (map = map_first; map != NULL; map = map->next)
+ map->p_paddr_valid = 0;
elf_tdata (obfd)->segment_map = map_first;
@@ -6961,6 +6973,104 @@ elfcore_grok_netbsd_note (abfd, note)
/* NOTREACHED */
}
+static bfd_boolean
+elfcore_grok_nto_status (abfd, note, tid)
+ bfd *abfd;
+ Elf_Internal_Note *note;
+ pid_t *tid;
+{
+ void *ddata = note->descdata;
+ char buf[100];
+ char *name;
+ asection *sect;
+
+ /* nto_procfs_status 'pid' field is at offset 0. */
+ elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, (bfd_byte *) ddata);
+
+ /* nto_procfs_status 'tid' field is at offset 4. */
+ elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4);
+
+ /* nto_procfs_status 'what' field is at offset 14. */
+ elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, (bfd_byte *) ddata + 14);
+
+ /* Pass tid back. */
+ *tid = elf_tdata (abfd)->core_lwpid;
+
+ /* Make a ".qnx_core_status/%d" section. */
+ sprintf (buf, ".qnx_core_status/%d", *tid);
+
+ name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1);
+ if (name == NULL)
+ return FALSE;
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return FALSE;
+
+ sect->_raw_size = note->descsz;
+ sect->filepos = note->descpos;
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect));
+}
+
+static bfd_boolean
+elfcore_grok_nto_gregs (abfd, note, tid)
+ bfd *abfd;
+ Elf_Internal_Note *note;
+ pid_t tid;
+{
+ char buf[100];
+ char *name;
+ asection *sect;
+
+ /* Make a ".reg/%d" section. */
+ sprintf (buf, ".reg/%d", tid);
+
+ name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1);
+ if (name == NULL)
+ return FALSE;
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return FALSE;
+
+ sect->_raw_size = note->descsz;
+ sect->filepos = note->descpos;
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ return elfcore_maybe_make_sect (abfd, ".reg", sect);
+}
+
+#define BFD_QNT_CORE_INFO 7
+#define BFD_QNT_CORE_STATUS 8
+#define BFD_QNT_CORE_GREG 9
+#define BFD_QNT_CORE_FPREG 10
+
+static bfd_boolean
+elfcore_grok_nto_note (abfd, note)
+ bfd *abfd;
+ Elf_Internal_Note *note;
+{
+ /* Every GREG section has a STATUS section before it. Store the
+ tid from the previous call to pass down to the next gregs
+ function. */
+ static pid_t tid = 1;
+
+ switch (note->type)
+ {
+ case BFD_QNT_CORE_INFO: return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note);
+ case BFD_QNT_CORE_STATUS: return elfcore_grok_nto_status (abfd, note, &tid);
+ case BFD_QNT_CORE_GREG: return elfcore_grok_nto_gregs (abfd, note, tid);
+ case BFD_QNT_CORE_FPREG: return elfcore_grok_prfpreg (abfd, note);
+ default: return TRUE;
+ }
+}
+
/* Function: elfcore_write_note
Inputs:
@@ -7200,6 +7310,11 @@ elfcore_read_notes (abfd, offset, size)
if (! elfcore_grok_netbsd_note (abfd, &in))
goto error;
}
+ else if (strncmp (in.namedata, "QNX", 3) == 0)
+ {
+ if (! elfcore_grok_nto_note (abfd, &in))
+ goto error;
+ }
else
{
if (! elfcore_grok_note (abfd, &in))
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 48eb873846..509b481557 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1,5 +1,5 @@
/* 32-bit ELF support for ARM
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -86,6 +86,8 @@ static void arm_add_to_rel
#endif
static enum elf_reloc_type_class elf32_arm_reloc_type_class
PARAMS ((const Elf_Internal_Rela *));
+static bfd_boolean elf32_arm_object_p
+ PARAMS ((bfd *));
#ifndef ELFARM_NABI_C_INCLUDED
static void record_arm_to_thumb_glue
@@ -927,13 +929,16 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section,
BFD_ASSERT (my_offset <= globals->thumb_glue_size);
- /* Now go back and fix up the original BL insn to point
- to here. */
- ret_offset = (s->output_offset
- + my_offset
- - (input_section->output_offset
- + offset + addend)
- - 8);
+ /* Now go back and fix up the original BL insn to point to here. */
+ ret_offset =
+ /* Address of where the stub is located. */
+ (s->output_section->vma + s->output_offset + my_offset)
+ /* Address of where the BL is located. */
+ - (input_section->output_section->vma + input_section->output_offset + offset)
+ /* Addend in the relocation. */
+ - addend
+ /* Biassing for PC-relative addressing. */
+ - 8;
tmp = bfd_get_32 (input_bfd, hit_data
- input_section->vma);
@@ -2108,6 +2113,20 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
return TRUE;
}
+/* Set the right machine number. */
+
+static bfd_boolean
+elf32_arm_object_p (abfd)
+ bfd *abfd;
+{
+ /* XXX - we ought to examine a .note section here. */
+
+ if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT)
+ bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312);
+
+ return TRUE;
+}
+
/* Function to keep ARM specific flags in the ELF header. */
static bfd_boolean
elf32_arm_set_private_flags (abfd, flags)
@@ -2310,12 +2329,28 @@ ERROR: %s passes floats in integer registers, whereas %s passes them in float re
{
if (in_flags & EF_ARM_VFP_FLOAT)
_bfd_error_handler (_("\
-ERROR: %s uses VFP instructions, whereas %s uses FPA instructions"),
+ERROR: %s uses VFP instructions, whereas %s does not"),
+ bfd_archive_filename (ibfd),
+ bfd_get_filename (obfd));
+ else
+ _bfd_error_handler (_("\
+ERROR: %s uses FPA instructions, whereas %s does not"),
+ bfd_archive_filename (ibfd),
+ bfd_get_filename (obfd));
+
+ flags_compatible = FALSE;
+ }
+
+ if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT))
+ {
+ if (in_flags & EF_ARM_MAVERICK_FLOAT)
+ _bfd_error_handler (_("\
+ERROR: %s uses Maverick instructions, whereas %s does not"),
bfd_archive_filename (ibfd),
bfd_get_filename (obfd));
else
_bfd_error_handler (_("\
-ERROR: %s uses FPA instructions, whereas %s uses VFP instructions"),
+ERROR: %s uses Maverick instructions, whereas %s does not"),
bfd_archive_filename (ibfd),
bfd_get_filename (obfd));
@@ -2410,6 +2445,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr)
if (flags & EF_ARM_VFP_FLOAT)
fprintf (file, _(" [VFP float format]"));
+ else if (flags & EF_ARM_MAVERICK_FLOAT)
+ fprintf (file, _(" [Maverick float format]"));
else
fprintf (file, _(" [FPA float format]"));
@@ -2430,7 +2467,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr)
flags &= ~(EF_ARM_INTERWORK | EF_ARM_APCS_26 | EF_ARM_APCS_FLOAT
| EF_ARM_PIC | EF_ARM_NEW_ABI | EF_ARM_OLD_ABI
- | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT);
+ | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT
+ | EF_ARM_MAVERICK_FLOAT);
break;
case EF_ARM_EABI_VER1:
@@ -3622,7 +3660,6 @@ elf32_arm_reloc_type_class (rela)
}
}
-
#define ELF_ARCH bfd_arch_arm
#define ELF_MACHINE_CODE EM_ARM
#define ELF_MAXPAGESIZE 0x8000
@@ -3647,6 +3684,7 @@ elf32_arm_reloc_type_class (rela)
#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
#define elf_backend_post_process_headers elf32_arm_post_process_headers
#define elf_backend_reloc_type_class elf32_arm_reloc_type_class
+#define elf_backend_object_p elf32_arm_object_p
#define elf_backend_can_gc_sections 1
#define elf_backend_plt_readonly 1
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 6b6c90681a..40327b650e 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1,24 +1,24 @@
/* CRIS-specific support for 32-bit ELF.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson, based on elf32-fr30.c
PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -940,7 +940,6 @@ cris_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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 2646f3dc4e..b204c57df4 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1,6 +1,6 @@
/* BFD back-end for HP PA-RISC ELF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Original code by
Center for Software Science
@@ -8,21 +8,21 @@
University of Utah
Largely rewritten by Alan Modra <alan@linuxcare.com.au>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -111,7 +111,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
: ldw -24(%sp),%rp ; restore the original rp
: ldsid (%rp),%r1
: mtsp %r1,%sr0
- : be,n 0(%sr0,%rp) ; inter-space return */
+ : be,n 0(%sr0,%rp) ; inter-space return. */
#define PLT_ENTRY_SIZE 8
#define GOT_ENTRY_SIZE 4
@@ -1685,10 +1685,6 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
bfd_signed_vma *local_got_refcounts;
bfd_signed_vma *local_plt_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
- struct elf32_hppa_link_hash_table *htab;
- bfd *dynobj;
elf_section_data (sec)->local_dynrel = NULL;
@@ -1698,112 +1694,81 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
local_plt_refcounts = local_got_refcounts;
if (local_plt_refcounts != NULL)
local_plt_refcounts += symtab_hdr->sh_info;
- htab = hppa_link_hash_table (info);
- dynobj = htab->elf.dynobj;
- if (dynobj == NULL)
- return TRUE;
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
- switch ((unsigned int) ELF32_R_TYPE (rel->r_info))
- {
- case R_PARISC_DLTIND14F:
- case R_PARISC_DLTIND14R:
- case R_PARISC_DLTIND21L:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->got.refcount > 0)
- h->got.refcount -= 1;
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx] -= 1;
- }
- break;
-
- case R_PARISC_PCREL12F:
- case R_PARISC_PCREL17C:
- case R_PARISC_PCREL17F:
- case R_PARISC_PCREL22F:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- break;
-
- case R_PARISC_PLABEL14R:
- case R_PARISC_PLABEL21L:
- case R_PARISC_PLABEL32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf32_hppa_link_hash_entry *eh;
- struct elf32_hppa_dyn_reloc_entry **pp;
- struct elf32_hppa_dyn_reloc_entry *p;
-
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
+ {
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
- eh = (struct elf32_hppa_link_hash_entry *) h;
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf32_hppa_link_hash_entry *eh;
+ struct elf32_hppa_dyn_reloc_entry **pp;
+ struct elf32_hppa_dyn_reloc_entry *p;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
-#if RELATIVE_DYNRELOCS
- if (!IS_ABSOLUTE_RELOC (rtype))
- p->relative_count -= 1;
-#endif
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- else if (local_plt_refcounts != NULL)
- {
- if (local_plt_refcounts[r_symndx] > 0)
- local_plt_refcounts[r_symndx] -= 1;
- }
- break;
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf32_hppa_link_hash_entry *) h;
- case R_PARISC_DIR32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf32_hppa_link_hash_entry *eh;
- struct elf32_hppa_dyn_reloc_entry **pp;
- struct elf32_hppa_dyn_reloc_entry *p;
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ r_type = ELF32_R_TYPE (rel->r_info);
+ switch (r_type)
+ {
+ case R_PARISC_DLTIND14F:
+ case R_PARISC_DLTIND14R:
+ case R_PARISC_DLTIND21L:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx] -= 1;
+ }
+ break;
- eh = (struct elf32_hppa_link_hash_entry *) h;
+ case R_PARISC_PCREL12F:
+ case R_PARISC_PCREL17C:
+ case R_PARISC_PCREL17F:
+ case R_PARISC_PCREL22F:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ break;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
-#if RELATIVE_DYNRELOCS
- if (!IS_ABSOLUTE_RELOC (R_PARISC_DIR32))
- p->relative_count -= 1;
-#endif
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ case R_PARISC_PLABEL14R:
+ case R_PARISC_PLABEL21L:
+ case R_PARISC_PLABEL32:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ else if (local_plt_refcounts != NULL)
+ {
+ if (local_plt_refcounts[r_symndx] > 0)
+ local_plt_refcounts[r_symndx] -= 1;
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
return TRUE;
}
@@ -2686,12 +2651,15 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
asection *curr;
asection *prev;
bfd_size_type total;
+ bfd_boolean big_sec;
curr = tail;
if (tail->_cooked_size)
total = tail->_cooked_size;
else
total = tail->_raw_size;
+ big_sec = total >= stub_group_size;
+
while ((prev = PREV_SEC (curr)) != NULL
&& ((total += curr->output_offset - prev->output_offset)
< stub_group_size))
@@ -2719,8 +2687,11 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
while (tail != curr && (tail = prev) != NULL);
/* But wait, there's more! Input sections up to 240000
- bytes before the stub section can be handled by it too. */
- if (!stubs_always_before_branch)
+ bytes before the stub section can be handled by it too.
+ Don't do this if we have a really large section after the
+ stubs, as adding more stubs increases the chance that
+ branches may not reach into the stub section. */
+ if (!stubs_always_before_branch && !big_sec)
{
total = 0;
while (prev != NULL
@@ -2901,11 +2872,22 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
if (stub_group_size == 1)
{
/* Default values. */
- stub_group_size = 7680000;
- if (htab->has_17bit_branch || htab->multi_subspace)
- stub_group_size = 240000;
- if (htab->has_12bit_branch)
- stub_group_size = 7500;
+ if (stubs_always_before_branch)
+ {
+ stub_group_size = 7680000;
+ if (htab->has_17bit_branch || htab->multi_subspace)
+ stub_group_size = 240000;
+ if (htab->has_12bit_branch)
+ stub_group_size = 7500;
+ }
+ else
+ {
+ stub_group_size = 6971392;
+ if (htab->has_17bit_branch || htab->multi_subspace)
+ stub_group_size = 217856;
+ if (htab->has_12bit_branch)
+ stub_group_size = 6808;
+ }
}
group_sections (htab, stub_group_size, stubs_always_before_branch);
@@ -3688,14 +3670,11 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
&& ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
&& h->elf.type != STT_PARISC_MILLI)
{
- if (info->symbolic && !info->allow_shlib_undefined)
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->elf.root.root.string, input_bfd,
- input_section, rel->r_offset, FALSE)))
- return FALSE;
- warned_undef = TRUE;
- }
+ if (!((*info->callbacks->undefined_symbol)
+ (info, h->elf.root.root.string, input_bfd,
+ input_section, rel->r_offset, FALSE)))
+ return FALSE;
+ warned_undef = TRUE;
}
else
{
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 69292da7f1..a751d98285 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1279,9 +1279,6 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- int r_type;
- struct elf_link_hash_entry *h;
elf_section_data (sec)->local_dynrel = NULL;
@@ -1291,85 +1288,74 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
- switch ((r_type = elf_i386_tls_transition (info,
- ELF32_R_TYPE (rel->r_info),
- ELF32_R_SYM (rel->r_info)
- >= symtab_hdr->sh_info)))
- {
- case R_386_TLS_LDM:
- if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0)
- elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1;
- break;
-
- case R_386_TLS_GD:
- case R_386_TLS_IE_32:
- case R_386_TLS_IE:
- case R_386_TLS_GOTIE:
- case R_386_GOT32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->got.refcount > 0)
- h->got.refcount -= 1;
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx] -= 1;
- }
- if (r_type != R_386_TLS_IE)
- break;
- /* Fall through */
+ {
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
- case R_386_TLS_LE_32:
- case R_386_TLS_LE:
- if (!info->shared)
- break;
- /* Fall through */
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf_i386_link_hash_entry *eh;
+ struct elf_i386_dyn_relocs **pp;
+ struct elf_i386_dyn_relocs *p;
- case R_386_32:
- case R_386_PC32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf_i386_link_hash_entry *eh;
- struct elf_i386_dyn_relocs **pp;
- struct elf_i386_dyn_relocs *p;
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf_i386_link_hash_entry *) h;
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
+ r_type = ELF32_R_TYPE (rel->r_info);
+ r_type = elf_i386_tls_transition (info, r_type, h != NULL);
+ switch (r_type)
+ {
+ case R_386_TLS_LDM:
+ if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0)
+ elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1;
+ break;
- eh = (struct elf_i386_link_hash_entry *) h;
+ case R_386_TLS_GD:
+ case R_386_TLS_IE_32:
+ case R_386_TLS_IE:
+ case R_386_TLS_GOTIE:
+ case R_386_GOT32:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx] -= 1;
+ }
+ break;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (ELF32_R_TYPE (rel->r_info) == R_386_PC32)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ case R_386_32:
+ case R_386_PC32:
+ if (info->shared)
+ break;
+ /* Fall through */
- case R_386_PLT32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- break;
+ case R_386_PLT32:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
return TRUE;
}
@@ -1523,9 +1509,9 @@ elf_i386_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in elf_i386_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
((DYN) \
- && ((INFO)->shared \
+ && ((SHARED) \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -1567,7 +1553,8 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->splt;
@@ -1653,7 +1640,8 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
- else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+ else if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
}
else
@@ -2261,7 +2249,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
@@ -2290,7 +2277,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
@@ -2627,7 +2614,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (rel->r_offset >= 2);
type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
switch (type)
- {
+ {
case 0x8b:
/* movl */
BFD_ASSERT ((val & 0xc7) == 0x05);
@@ -2649,7 +2636,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
default:
BFD_FAIL ();
break;
- }
+ }
}
bfd_put_32 (output_bfd, -tpoff (info, relocation),
contents + rel->r_offset);
@@ -2724,7 +2711,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 81c484ba5c..19a2ce8c75 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -2,21 +2,21 @@
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -90,7 +90,7 @@ static reloc_howto_type howto_table[] = {
HOWTO(R_68K_GLOB_DAT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_GLOB_DAT", FALSE, 0, 0xffffffff,FALSE),
HOWTO(R_68K_JMP_SLOT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_JMP_SLOT", FALSE, 0, 0xffffffff,FALSE),
HOWTO(R_68K_RELATIVE, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_RELATIVE", FALSE, 0, 0xffffffff,FALSE),
- /* GNU extension to record C++ vtable hierarchy */
+ /* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_68K_GNU_VTINHERIT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -104,7 +104,7 @@ static reloc_howto_type howto_table[] = {
0, /* src_mask */
0, /* dst_mask */
FALSE),
- /* GNU extension to record C++ vtable member usage */
+ /* GNU extension to record C++ vtable member usage. */
HOWTO (R_68K_GNU_VTENTRY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -181,7 +181,6 @@ reloc_type_lookup (abfd, code)
#define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
#define ELF_ARCH bfd_arch_m68k
-/* end code generated by elf.el */
/* Functions for the m68k ELF linker. */
@@ -342,7 +341,7 @@ elf_m68k_link_hash_table_create (abfd)
return &ret->root.root;
}
-/* Keep m68k-specific flags in the ELF header */
+/* Keep m68k-specific flags in the ELF header. */
static bfd_boolean
elf32_m68k_set_private_flags (abfd, flags)
bfd *abfd;
@@ -379,7 +378,7 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd)
return TRUE;
}
-/* Display the flags field */
+/* Display the flags field. */
static bfd_boolean
elf32_m68k_print_private_bfd_data (abfd, ptr)
bfd *abfd;
@@ -1008,13 +1007,11 @@ elf_m68k_adjust_dynamic_symbol (info, h)
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
-
s = bfd_get_section_by_name (dynobj, ".got.plt");
BFD_ASSERT (s != NULL);
s->_raw_size += 4;
/* We also need to make an entry in the .rela.plt section. */
-
s = bfd_get_section_by_name (dynobj, ".rela.plt");
BFD_ASSERT (s != NULL);
s->_raw_size += sizeof (Elf32_External_Rela);
@@ -1456,7 +1453,6 @@ elf_m68k_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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 1399f00312..cf705d502f 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -261,9 +261,11 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit PC relative reference. */
+ /* 16 bit PC relative reference. Note that the ABI document has a typo
+ and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+ We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@@ -1401,7 +1403,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
{ BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL },
{ BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
- { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
+ { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
{ BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
{ BFD_RELOC_GPREL32, R_MIPS_GPREL32 },
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
@@ -1458,7 +1460,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
return &elf_mips_gnu_rel_hi16;
case BFD_RELOC_PCREL_LO16:
return &elf_mips_gnu_rel_lo16;
- case BFD_RELOC_16_PCREL_S2:
+ case BFD_RELOC_MIPSEMB_16_PCREL_S2:
return &elf_mips_gnu_rel16_s2;
case BFD_RELOC_64_PCREL:
return &elf_mips_gnu_pcrel64;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index acd9d841b7..9947af855f 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3,21 +3,21 @@
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file is based on a preliminary PowerPC ELF ABI. The
information may not match the final PowerPC ELF ABI. It includes
@@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/ppc.h"
+#include "elf32-ppc.h"
/* RELA relocations are used here. */
@@ -53,6 +54,8 @@ static bfd_boolean ppc_elf_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
static bfd_reloc_status_type ppc_elf_addr16_ha_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type ppc_elf_unhandled_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_boolean ppc_elf_object_p
PARAMS ((bfd *));
static bfd_boolean ppc_elf_set_private_flags
@@ -63,7 +66,7 @@ static int ppc_elf_additional_program_headers
PARAMS ((bfd *));
static bfd_boolean ppc_elf_modify_segment_map
PARAMS ((bfd *));
-static asection *ppc_elf_create_got
+static bfd_boolean ppc_elf_create_got
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean ppc_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
@@ -74,10 +77,14 @@ static bfd_boolean ppc_elf_fake_sections
static elf_linker_section_t *ppc_elf_create_linker_section
PARAMS ((bfd *abfd, struct bfd_link_info *info,
enum elf_linker_section_enum));
+static bfd_boolean update_local_sym_info
+ PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned long, int));
+static void bad_shared_reloc
+ PARAMS ((bfd *, enum elf_ppc_reloc_type));
static bfd_boolean ppc_elf_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
-static asection * ppc_elf_gc_mark_hook
+static asection *ppc_elf_gc_mark_hook
PARAMS ((asection *sec, struct bfd_link_info *info, Elf_Internal_Rela *rel,
struct elf_link_hash_entry *h, Elf_Internal_Sym *sym));
static bfd_boolean ppc_elf_gc_sweep_hook
@@ -110,13 +117,15 @@ static bfd_boolean ppc_elf_grok_prstatus
static bfd_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 */
-#define RA_REGISTER_SHIFT 16 /* value to shift register by to insert RA */
+/* Branch prediction bit for branch taken relocs. */
+#define BRANCH_PREDICT_BIT 0x200000
+/* Mask to set RA in memory instructions. */
+#define RA_REGISTER_MASK 0x001f0000
+/* Value to shift register by to insert RA. */
+#define RA_REGISTER_SHIFT 16
/* The name of the dynamic interpreter. This is put in the .interp
section. */
-
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
/* The size in bytes of an entry in the procedure linkage table. */
@@ -128,6 +137,15 @@ static bfd_boolean ppc_elf_grok_psinfo
/* The number of single-slot PLT entries (the rest use two slots). */
#define PLT_NUM_SINGLE_ENTRIES 8192
+/* Some nop instructions. */
+#define NOP 0x60000000
+#define CROR_151515 0x4def7b82
+#define CROR_313131 0x4ffffb82
+
+/* Offset of tp and dtp pointers from start of TLS block. */
+#define TP_OFFSET 0x7000
+#define DTP_OFFSET 0x8000
+
/* Will references to this symbol always reference the symbol
in this object? */
#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
@@ -161,16 +179,32 @@ struct ppc_elf_dyn_relocs
/* Total number of relocs copied for the input section. */
bfd_size_type count;
+
+ /* Number of pc-relative relocs copied for the input section. */
+ bfd_size_type pc_count;
};
/* PPC ELF linker hash entry. */
struct ppc_elf_link_hash_entry
{
- struct elf_link_hash_entry root;
+ struct elf_link_hash_entry elf;
/* Track dynamic relocs copied for this symbol. */
struct ppc_elf_dyn_relocs *dyn_relocs;
+
+ /* Contexts in which symbol is used in the GOT (or TOC).
+ TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the
+ corresponding relocs are encountered during check_relocs.
+ tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
+ indicate the corresponding GOT entry type is not needed. */
+#define TLS_GD 1 /* GD reloc. */
+#define TLS_LD 2 /* LD reloc. */
+#define TLS_TPREL 4 /* TPREL reloc, => IE. */
+#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */
+#define TLS_TLS 16 /* Any TLS reloc. */
+#define TLS_TPRELGD 32 /* TPREL reloc resulting from GD->IE. */
+ char tls_mask;
};
#define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent))
@@ -179,7 +213,31 @@ struct ppc_elf_link_hash_entry
struct ppc_elf_link_hash_table
{
- struct elf_link_hash_table root;
+ struct elf_link_hash_table elf;
+
+ /* Short-cuts to get to dynamic linker sections. */
+ asection *got;
+ asection *relgot;
+ asection *plt;
+ asection *relplt;
+ asection *dynbss;
+ asection *relbss;
+ asection *dynsbss;
+ asection *relsbss;
+ elf_linker_section_t *sdata;
+ elf_linker_section_t *sdata2;
+
+ /* Short-cut to first output tls section. */
+ asection *tls_sec;
+
+ /* Shortcut to .__tls_get_addr. */
+ struct elf_link_hash_entry *tls_get_addr;
+
+ /* TLS local dynamic got entry handling. */
+ union {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } tlsld_got;
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
@@ -211,7 +269,10 @@ ppc_elf_link_hash_newfunc (entry, table, string)
/* Call the allocation method of the superclass. */
entry = _bfd_elf_link_hash_newfunc (entry, table, string);
if (entry != NULL)
- ppc_elf_hash_entry (entry)->dyn_relocs = NULL;
+ {
+ ppc_elf_hash_entry (entry)->dyn_relocs = NULL;
+ ppc_elf_hash_entry (entry)->tls_mask = 0;
+ }
return entry;
}
@@ -229,16 +290,29 @@ ppc_elf_link_hash_table_create (abfd)
if (ret == NULL)
return NULL;
- if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
+ if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd,
ppc_elf_link_hash_newfunc))
{
free (ret);
return NULL;
}
+ ret->got = NULL;
+ ret->relgot = NULL;
+ ret->plt = NULL;
+ ret->relplt = NULL;
+ ret->dynbss = NULL;
+ ret->relbss = NULL;
+ ret->dynsbss = NULL;
+ ret->relsbss = NULL;
+ ret->sdata = NULL;
+ ret->sdata2 = NULL;
+ ret->tls_sec = NULL;
+ ret->tls_get_addr = NULL;
+ ret->tlsld_got.refcount = 0;
ret->sym_sec.abfd = NULL;
- return &ret->root.root;
+ return &ret->elf.root;
}
/* Copy the extra info we tack onto an elf_link_hash_entry. */
@@ -272,6 +346,7 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind)
for (q = edir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
+ q->pc_count += p->pc_count;
q->count += p->count;
*pp = p->next;
break;
@@ -286,6 +361,8 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind)
eind->dyn_relocs = NULL;
}
+ edir->tls_mask |= eind->tls_mask;
+
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
@@ -878,10 +955,440 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
+ /* Marker reloc for TLS. */
+ HOWTO (R_PPC_TLS,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_TLS", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Computes the load module index of the load module that contains the
+ definition of its TLS sym. */
+ HOWTO (R_PPC_DTPMOD32,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPMOD32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Computes a dtv-relative displacement, the difference between the value
+ of sym+add and the base address of the thread-local storage block that
+ contains the definition of sym, minus 0x8000. */
+ HOWTO (R_PPC_DTPREL32,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPREL32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 16 bit dtprel reloc. */
+ HOWTO (R_PPC_DTPREL16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like DTPREL16, but no overflow. */
+ HOWTO (R_PPC_DTPREL16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPREL16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like DTPREL16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_DTPREL16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPREL16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like DTPREL16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_DTPREL16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_DTPREL16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Computes a tp-relative displacement, the difference between the value of
+ sym+add and the value of the thread pointer (r13). */
+ HOWTO (R_PPC_TPREL32,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_TPREL32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 16 bit tprel reloc. */
+ HOWTO (R_PPC_TPREL16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_TPREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like TPREL16, but no overflow. */
+ HOWTO (R_PPC_TPREL16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_TPREL16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like TPREL16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_TPREL16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_TPREL16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like TPREL16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_TPREL16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_TPREL16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Allocates two contiguous entries in the GOT to hold a tls_index structure,
+ with values (sym+add)@dtpmod and (sym+add)@dtprel, and computes the offset
+ to the first entry. */
+ HOWTO (R_PPC_GOT_TLSGD16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSGD16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSGD16, but no overflow. */
+ HOWTO (R_PPC_GOT_TLSGD16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSGD16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSGD16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_GOT_TLSGD16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSGD16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSGD16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_GOT_TLSGD16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSGD16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Allocates two contiguous entries in the GOT to hold a tls_index structure,
+ with values (sym+add)@dtpmod and zero, and computes the offset to the
+ first entry. */
+ HOWTO (R_PPC_GOT_TLSLD16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSLD16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSLD16, but no overflow. */
+ HOWTO (R_PPC_GOT_TLSLD16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSLD16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSLD16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_GOT_TLSLD16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSLD16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TLSLD16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_GOT_TLSLD16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TLSLD16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Allocates an entry in the GOT with value (sym+add)@dtprel, and computes
+ the offset to the entry. */
+ HOWTO (R_PPC_GOT_DTPREL16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_DTPREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_DTPREL16, but no overflow. */
+ HOWTO (R_PPC_GOT_DTPREL16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_DTPREL16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_DTPREL16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_GOT_DTPREL16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_DTPREL16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_DTPREL16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_GOT_DTPREL16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_DTPREL16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Allocates an entry in the GOT with value (sym+add)@tprel, and computes the
+ offset to the entry. */
+ HOWTO (R_PPC_GOT_TPREL16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TPREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TPREL16, but no overflow. */
+ HOWTO (R_PPC_GOT_TPREL16_LO,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TPREL16_LO", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TPREL16_LO, but next higher group of 16 bits. */
+ HOWTO (R_PPC_GOT_TPREL16_HI,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TPREL16_HI", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like GOT_TPREL16_HI, but adjust for low 16 bits. */
+ HOWTO (R_PPC_GOT_TPREL16_HA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_unhandled_reloc, /* special_function */
+ "R_PPC_GOT_TPREL16_HA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
- /* 32 bit value resulting from the addend minus the symbol */
+ /* 32 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -896,7 +1403,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit value resulting from the addend minus the symbol */
+ /* 16 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -911,7 +1418,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit value resulting from the addend minus the symbol */
+ /* 16 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16_LO, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -926,7 +1433,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* The high order 16 bits of the addend minus the symbol */
+ /* The high order 16 bits of the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16_HI, /* type */
16, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -960,7 +1467,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* 16 bit value resulting from allocating a 4 byte word to hold an
address in the .sdata section, and returning the offset from
- _SDA_BASE_ for that relocation */
+ _SDA_BASE_ for that relocation. */
HOWTO (R_PPC_EMB_SDAI16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -977,7 +1484,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* 16 bit value resulting from allocating a 4 byte word to hold an
address in the .sdata2 section, and returning the offset from
- _SDA2_BASE_ for that relocation */
+ _SDA2_BASE_ for that relocation. */
HOWTO (R_PPC_EMB_SDA2I16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -1049,7 +1556,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* GNU extension to record C++ vtable hierarchy */
+ /* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_PPC_GNU_VTINHERIT, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
@@ -1064,7 +1571,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0, /* dst_mask */
FALSE), /* pcrel_offset */
- /* GNU extension to record C++ vtable member usage */
+ /* GNU extension to record C++ vtable member usage. */
HOWTO (R_PPC_GNU_VTENTRY, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
@@ -1079,7 +1586,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0, /* dst_mask */
FALSE), /* pcrel_offset */
- /* Phony reloc to handle AIX style TOC entries */
+ /* Phony reloc to handle AIX style TOC entries. */
HOWTO (R_PPC_TOC16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -1129,8 +1636,7 @@ ppc_elf_howto_init ()
3/ Conditional forward branches - Ensure that the "inverse prediction
bit" is set (ensure it is predicted taken).
4/ Conditional register branches - Ensure that the "y bit" is set
- (ensure it is predicted taken).
-*/
+ (ensure it is predicted taken). */
/* Sort sections by address. */
@@ -1167,7 +1673,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
/* If needed, initialize this section's cooked size. */
if (isec->_cooked_size == 0)
- isec->_cooked_size = isec->_raw_size;
+ isec->_cooked_size = isec->_raw_size;
/* We're only interested in text sections which overlap the
troublesome area at the end of a page. */
@@ -1179,7 +1685,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
/* Get the section contents. */
/* Get cached copy if it exists. */
if (elf_section_data (isec)->this_hdr.contents != NULL)
- contents = elf_section_data (isec)->this_hdr.contents;
+ contents = elf_section_data (isec)->this_hdr.contents;
else
{
/* Go get them off disk. */
@@ -1197,55 +1703,58 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
comb_count = 0;
if (isec->reloc_count)
{
- unsigned n;
+ unsigned n;
bfd_size_type amt;
- /* Get a copy of the native relocations. */
- internal_relocs = _bfd_elf32_link_read_relocs (
- abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
- if (internal_relocs == NULL)
- goto error_return;
- if (! link_info->keep_memory)
- free_relocs = internal_relocs;
+ /* Get a copy of the native relocations. */
+ internal_relocs
+ = _bfd_elf32_link_read_relocs (abfd, isec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_return;
+ if (! link_info->keep_memory)
+ free_relocs = internal_relocs;
- /* Setup a faster access method for the reloc info we need. */
+ /* Setup a faster access method for the reloc info we need. */
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)
- {
- long r_type;
-
- r_type = ELF32_R_TYPE (internal_relocs[n].r_info);
- if (r_type < 0 || r_type >= (int) R_PPC_max)
- goto error_return;
-
- /* Prologue constants are sometimes present in the ".text"
- sections and they can be identified by their associated relocation.
- We don't want to process those words and some others which
- can also be identified by their relocations. However, not all
- conditional branches will have a relocation so we will
- only ignore words that 1) have a reloc, and 2) the reloc
- is not applicable to a conditional branch.
- The array rela_comb is built here for use in the EOP scan loop. */
- switch (r_type)
- {
- case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */
- case R_PPC_REL14: /* relative cond. br. */
- case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */
- /* We should check the instruction. */
- break;
- default:
- /* The word is not a conditional branch - ignore it. */
- rela_comb[comb_count++] = &internal_relocs[n];
- break;
- }
- }
- if (comb_count > 1)
- qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela);
+ rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt);
+ if (rela_comb == NULL)
+ goto error_return;
+ for (n = 0; n < isec->reloc_count; ++n)
+ {
+ long r_type;
+
+ r_type = ELF32_R_TYPE (internal_relocs[n].r_info);
+ if (r_type < 0 || r_type >= (int) R_PPC_max)
+ goto error_return;
+
+ /* Prologue constants are sometimes present in the ".text"
+ sections and they can be identified by their associated
+ relocation. We don't want to process those words and
+ some others which can also be identified by their
+ relocations. However, not all conditional branches will
+ have a relocation so we will only ignore words that
+ 1) have a reloc, and 2) the reloc is not applicable to a
+ conditional branch. The array rela_comb is built here
+ for use in the EOP scan loop. */
+ switch (r_type)
+ {
+ case R_PPC_ADDR14_BRNTAKEN:
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRNTAKEN:
+ /* We should check the instruction. */
+ break;
+ default:
+ /* The word is not a conditional branch - ignore it. */
+ rela_comb[comb_count++] = &internal_relocs[n];
+ break;
+ }
+ }
+ if (comb_count > 1)
+ qsort (rela_comb, (size_t) comb_count, sizeof (int),
+ ppc_elf_sort_rela);
}
/* Enumerate each EOP region that overlaps this section. */
@@ -1253,99 +1762,104 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
dot = end_page = (isec->vma | (PAGESIZE - 1)) + 1;
dot -= link_info->mpc860c0;
section_modified = FALSE;
- if (dot < isec->vma) /* Increment the start position if this section */
- dot = isec->vma; /* begins in the middle of its first EOP region. */
+ /* Increment the start position if this section begins in the
+ middle of its first EOP region. */
+ if (dot < isec->vma)
+ dot = isec->vma;
for (;
- dot < end_section;
- dot += PAGESIZE, end_page += PAGESIZE)
- {
-
- /* Check each word in this EOP region. */
- for (; dot < end_page; dot += 4)
- {
- bfd_vma isec_offset;
- unsigned long insn;
- bfd_boolean skip, modified;
-
- /* Don't process this word if there is a relocation for it and
- the relocation indicates the word is not a conditional branch. */
- skip = FALSE;
- isec_offset = dot - isec->vma;
- for (; comb_curr<comb_count; ++comb_curr)
- {
- bfd_vma r_offset;
-
- r_offset = rela_comb[comb_curr]->r_offset;
- if (r_offset >= isec_offset)
- {
- if (r_offset == isec_offset) skip = TRUE;
- break;
- }
- }
- if (skip) continue;
-
- /* Check the current word for a problematic conditional branch. */
+ dot < end_section;
+ dot += PAGESIZE, end_page += PAGESIZE)
+ {
+ /* Check each word in this EOP region. */
+ for (; dot < end_page; dot += 4)
+ {
+ bfd_vma isec_offset;
+ unsigned long insn;
+ bfd_boolean skip, modified;
+
+ /* Don't process this word if there is a relocation for it
+ and the relocation indicates the word is not a
+ conditional branch. */
+ skip = FALSE;
+ isec_offset = dot - isec->vma;
+ for (; comb_curr<comb_count; ++comb_curr)
+ {
+ bfd_vma r_offset;
+
+ r_offset = rela_comb[comb_curr]->r_offset;
+ if (r_offset >= isec_offset)
+ {
+ if (r_offset == isec_offset) skip = TRUE;
+ break;
+ }
+ }
+ if (skip) continue;
+
+ /* Check the current word for a problematic conditional
+ branch. */
#define BO0(insn) ((insn) & 0x02000000)
#define BO2(insn) ((insn) & 0x00800000)
#define BO4(insn) ((insn) & 0x00200000)
- insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset);
- modified = FALSE;
- if ((insn & 0xFc000000) == 0x40000000)
- {
- /* Instruction is BCx */
- if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
- {
- bfd_vma target;
- /* This branch is predicted as "normal".
- If this is a forward branch, it is problematic. */
-
- target = insn & 0x0000Fffc; /*extract*/
- target = (target ^ 0x8000) - 0x8000; /*sign extend*/
- if ((insn & 0x00000002) == 0)
- target += dot; /*convert to abs*/
- if (target > dot)
- {
- insn |= 0x00200000; /* set the prediction bit */
- modified = TRUE;
- }
- }
- }
- else if ((insn & 0xFc00Fffe) == 0x4c000420)
- {
- /* Instruction is BCCTRx */
- if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset);
+ modified = FALSE;
+ if ((insn & 0xFc000000) == 0x40000000)
+ {
+ /* Instruction is BCx */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ {
+ bfd_vma target;
+
+ /* This branch is predicted as "normal".
+ If this is a forward branch, it is problematic. */
+ target = insn & 0x0000Fffc;
+ target = (target ^ 0x8000) - 0x8000;
+ if ((insn & 0x00000002) == 0)
+ /* Convert to abs. */
+ target += dot;
+ if (target > dot)
+ {
+ /* Set the prediction bit. */
+ insn |= 0x00200000;
+ modified = TRUE;
+ }
+ }
+ }
+ else if ((insn & 0xFc00Fffe) == 0x4c000420)
+ {
+ /* Instruction is BCCTRx. */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
{
/* This branch is predicted as not-taken.
- If this is a forward branch, it is problematic.
- Since we can't tell statically if it will branch forward,
- always set the prediction bit. */
- insn |= 0x00200000; /* set the prediction bit */
- modified = TRUE;
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch
+ forward, always set the prediction bit. */
+ insn |= 0x00200000;
+ modified = TRUE;
}
- }
- else if ((insn & 0xFc00Fffe) == 0x4c000020)
- {
- /* Instruction is BCLRx */
- if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ }
+ else if ((insn & 0xFc00Fffe) == 0x4c000020)
+ {
+ /* Instruction is BCLRx */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
{
/* This branch is predicted as not-taken.
- If this is a forward branch, it is problematic.
- Since we can't tell statically if it will branch forward,
- always set the prediction bit. */
- insn |= 0x00200000; /* set the prediction bit */
- modified = TRUE;
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch
+ forward, always set the prediction bit. */
+ insn |= 0x00200000;
+ modified = TRUE;
}
- }
+ }
#undef BO0
#undef BO2
#undef BO4
- if (modified)
- {
- bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset);
+ if (modified)
+ {
+ bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset);
section_modified = TRUE;
- }
- }
- }
+ }
+ }
+ }
if (section_modified)
{
elf_section_data (isec)->this_hdr.contents = contents;
@@ -1379,7 +1893,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
return TRUE;
-error_return:
+ error_return:
if (rela_comb != NULL)
free (rela_comb);
if (free_relocs != NULL)
@@ -1394,7 +1908,7 @@ ppc_elf_reloc_type_lookup (abfd, code)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
- enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE;
+ enum elf_ppc_reloc_type r;
if (!ppc_elf_howto_table[R_PPC_ADDR32])
/* Initialize howto table if needed. */
@@ -1405,62 +1919,90 @@ ppc_elf_reloc_type_lookup (abfd, code)
default:
return (reloc_howto_type *) NULL;
- case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break;
- case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break;
- case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC_ADDR24; break;
- case BFD_RELOC_16: ppc_reloc = R_PPC_ADDR16; break;
- case BFD_RELOC_LO16: ppc_reloc = R_PPC_ADDR16_LO; break;
- case BFD_RELOC_HI16: ppc_reloc = R_PPC_ADDR16_HI; break;
- case BFD_RELOC_HI16_S: ppc_reloc = R_PPC_ADDR16_HA; break;
- case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC_ADDR14; break;
- case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC_ADDR14_BRTAKEN; break;
- case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC_ADDR14_BRNTAKEN; break;
- case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC_REL24; break;
- case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC_REL14; break;
- case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC_REL14_BRTAKEN; break;
- case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC_REL14_BRNTAKEN; break;
- case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC_GOT16; break;
- case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC_GOT16_LO; break;
- case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC_GOT16_HI; break;
- case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC_GOT16_HA; break;
- case BFD_RELOC_24_PLT_PCREL: ppc_reloc = R_PPC_PLTREL24; break;
- case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC_COPY; break;
- case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC_GLOB_DAT; break;
- case BFD_RELOC_PPC_LOCAL24PC: ppc_reloc = R_PPC_LOCAL24PC; break;
- case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC_REL32; break;
- case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC_PLT32; break;
- case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC_PLTREL32; break;
- case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC_PLT16_LO; break;
- case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC_PLT16_HI; break;
- case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC_PLT16_HA; break;
- case BFD_RELOC_GPREL16: ppc_reloc = R_PPC_SDAREL16; break;
- case BFD_RELOC_16_BASEREL: ppc_reloc = R_PPC_SECTOFF; break;
- case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC_SECTOFF_LO; break;
- case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC_SECTOFF_HI; break;
- case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC_SECTOFF_HA; break;
- case BFD_RELOC_CTOR: ppc_reloc = R_PPC_ADDR32; break;
- case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC_TOC16; break;
- case BFD_RELOC_PPC_EMB_NADDR32: ppc_reloc = R_PPC_EMB_NADDR32; break;
- case BFD_RELOC_PPC_EMB_NADDR16: ppc_reloc = R_PPC_EMB_NADDR16; break;
- case BFD_RELOC_PPC_EMB_NADDR16_LO: ppc_reloc = R_PPC_EMB_NADDR16_LO; break;
- case BFD_RELOC_PPC_EMB_NADDR16_HI: ppc_reloc = R_PPC_EMB_NADDR16_HI; break;
- case BFD_RELOC_PPC_EMB_NADDR16_HA: ppc_reloc = R_PPC_EMB_NADDR16_HA; break;
- case BFD_RELOC_PPC_EMB_SDAI16: ppc_reloc = R_PPC_EMB_SDAI16; break;
- case BFD_RELOC_PPC_EMB_SDA2I16: ppc_reloc = R_PPC_EMB_SDA2I16; break;
- case BFD_RELOC_PPC_EMB_SDA2REL: ppc_reloc = R_PPC_EMB_SDA2REL; break;
- case BFD_RELOC_PPC_EMB_SDA21: ppc_reloc = R_PPC_EMB_SDA21; break;
- case BFD_RELOC_PPC_EMB_MRKREF: ppc_reloc = R_PPC_EMB_MRKREF; break;
- case BFD_RELOC_PPC_EMB_RELSEC16: ppc_reloc = R_PPC_EMB_RELSEC16; break;
- case BFD_RELOC_PPC_EMB_RELST_LO: ppc_reloc = R_PPC_EMB_RELST_LO; break;
- case BFD_RELOC_PPC_EMB_RELST_HI: ppc_reloc = R_PPC_EMB_RELST_HI; break;
- case BFD_RELOC_PPC_EMB_RELST_HA: ppc_reloc = R_PPC_EMB_RELST_HA; break;
- case BFD_RELOC_PPC_EMB_BIT_FLD: ppc_reloc = R_PPC_EMB_BIT_FLD; break;
- case BFD_RELOC_PPC_EMB_RELSDA: ppc_reloc = R_PPC_EMB_RELSDA; break;
- case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC_GNU_VTINHERIT; break;
- case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC_GNU_VTENTRY; break;
+ case BFD_RELOC_NONE: r = R_PPC_NONE; break;
+ case BFD_RELOC_32: r = R_PPC_ADDR32; break;
+ case BFD_RELOC_PPC_BA26: r = R_PPC_ADDR24; break;
+ case BFD_RELOC_16: r = R_PPC_ADDR16; break;
+ case BFD_RELOC_LO16: r = R_PPC_ADDR16_LO; break;
+ case BFD_RELOC_HI16: r = R_PPC_ADDR16_HI; break;
+ case BFD_RELOC_HI16_S: r = R_PPC_ADDR16_HA; break;
+ case BFD_RELOC_PPC_BA16: r = R_PPC_ADDR14; break;
+ case BFD_RELOC_PPC_BA16_BRTAKEN: r = R_PPC_ADDR14_BRTAKEN; break;
+ case BFD_RELOC_PPC_BA16_BRNTAKEN: r = R_PPC_ADDR14_BRNTAKEN; break;
+ case BFD_RELOC_PPC_B26: r = R_PPC_REL24; break;
+ case BFD_RELOC_PPC_B16: r = R_PPC_REL14; break;
+ case BFD_RELOC_PPC_B16_BRTAKEN: r = R_PPC_REL14_BRTAKEN; break;
+ case BFD_RELOC_PPC_B16_BRNTAKEN: r = R_PPC_REL14_BRNTAKEN; break;
+ case BFD_RELOC_16_GOTOFF: r = R_PPC_GOT16; break;
+ case BFD_RELOC_LO16_GOTOFF: r = R_PPC_GOT16_LO; break;
+ case BFD_RELOC_HI16_GOTOFF: r = R_PPC_GOT16_HI; break;
+ case BFD_RELOC_HI16_S_GOTOFF: r = R_PPC_GOT16_HA; break;
+ case BFD_RELOC_24_PLT_PCREL: r = R_PPC_PLTREL24; break;
+ case BFD_RELOC_PPC_COPY: r = R_PPC_COPY; break;
+ case BFD_RELOC_PPC_GLOB_DAT: r = R_PPC_GLOB_DAT; break;
+ case BFD_RELOC_PPC_LOCAL24PC: r = R_PPC_LOCAL24PC; break;
+ case BFD_RELOC_32_PCREL: r = R_PPC_REL32; break;
+ case BFD_RELOC_32_PLTOFF: r = R_PPC_PLT32; break;
+ case BFD_RELOC_32_PLT_PCREL: r = R_PPC_PLTREL32; break;
+ case BFD_RELOC_LO16_PLTOFF: r = R_PPC_PLT16_LO; break;
+ case BFD_RELOC_HI16_PLTOFF: r = R_PPC_PLT16_HI; break;
+ case BFD_RELOC_HI16_S_PLTOFF: r = R_PPC_PLT16_HA; break;
+ case BFD_RELOC_GPREL16: r = R_PPC_SDAREL16; break;
+ case BFD_RELOC_16_BASEREL: r = R_PPC_SECTOFF; break;
+ case BFD_RELOC_LO16_BASEREL: r = R_PPC_SECTOFF_LO; break;
+ case BFD_RELOC_HI16_BASEREL: r = R_PPC_SECTOFF_HI; break;
+ case BFD_RELOC_HI16_S_BASEREL: r = R_PPC_SECTOFF_HA; break;
+ case BFD_RELOC_CTOR: r = R_PPC_ADDR32; break;
+ case BFD_RELOC_PPC_TOC16: r = R_PPC_TOC16; break;
+ case BFD_RELOC_PPC_TLS: r = R_PPC_TLS; break;
+ case BFD_RELOC_PPC_DTPMOD: r = R_PPC_DTPMOD32; break;
+ case BFD_RELOC_PPC_TPREL16: r = R_PPC_TPREL16; break;
+ case BFD_RELOC_PPC_TPREL16_LO: r = R_PPC_TPREL16_LO; break;
+ case BFD_RELOC_PPC_TPREL16_HI: r = R_PPC_TPREL16_HI; break;
+ case BFD_RELOC_PPC_TPREL16_HA: r = R_PPC_TPREL16_HA; break;
+ case BFD_RELOC_PPC_TPREL: r = R_PPC_TPREL32; break;
+ case BFD_RELOC_PPC_DTPREL16: r = R_PPC_DTPREL16; break;
+ case BFD_RELOC_PPC_DTPREL16_LO: r = R_PPC_DTPREL16_LO; break;
+ case BFD_RELOC_PPC_DTPREL16_HI: r = R_PPC_DTPREL16_HI; break;
+ case BFD_RELOC_PPC_DTPREL16_HA: r = R_PPC_DTPREL16_HA; break;
+ case BFD_RELOC_PPC_DTPREL: r = R_PPC_DTPREL32; break;
+ case BFD_RELOC_PPC_GOT_TLSGD16: r = R_PPC_GOT_TLSGD16; break;
+ case BFD_RELOC_PPC_GOT_TLSGD16_LO: r = R_PPC_GOT_TLSGD16_LO; break;
+ case BFD_RELOC_PPC_GOT_TLSGD16_HI: r = R_PPC_GOT_TLSGD16_HI; break;
+ case BFD_RELOC_PPC_GOT_TLSGD16_HA: r = R_PPC_GOT_TLSGD16_HA; break;
+ case BFD_RELOC_PPC_GOT_TLSLD16: r = R_PPC_GOT_TLSLD16; break;
+ case BFD_RELOC_PPC_GOT_TLSLD16_LO: r = R_PPC_GOT_TLSLD16_LO; break;
+ case BFD_RELOC_PPC_GOT_TLSLD16_HI: r = R_PPC_GOT_TLSLD16_HI; break;
+ case BFD_RELOC_PPC_GOT_TLSLD16_HA: r = R_PPC_GOT_TLSLD16_HA; break;
+ case BFD_RELOC_PPC_GOT_TPREL16: r = R_PPC_GOT_TPREL16; break;
+ case BFD_RELOC_PPC_GOT_TPREL16_LO: r = R_PPC_GOT_TPREL16_LO; break;
+ case BFD_RELOC_PPC_GOT_TPREL16_HI: r = R_PPC_GOT_TPREL16_HI; break;
+ case BFD_RELOC_PPC_GOT_TPREL16_HA: r = R_PPC_GOT_TPREL16_HA; break;
+ case BFD_RELOC_PPC_GOT_DTPREL16: r = R_PPC_GOT_DTPREL16; break;
+ case BFD_RELOC_PPC_GOT_DTPREL16_LO: r = R_PPC_GOT_DTPREL16_LO; break;
+ case BFD_RELOC_PPC_GOT_DTPREL16_HI: r = R_PPC_GOT_DTPREL16_HI; break;
+ case BFD_RELOC_PPC_GOT_DTPREL16_HA: r = R_PPC_GOT_DTPREL16_HA; break;
+ case BFD_RELOC_PPC_EMB_NADDR32: r = R_PPC_EMB_NADDR32; break;
+ case BFD_RELOC_PPC_EMB_NADDR16: r = R_PPC_EMB_NADDR16; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_LO: r = R_PPC_EMB_NADDR16_LO; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_HI: r = R_PPC_EMB_NADDR16_HI; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_HA: r = R_PPC_EMB_NADDR16_HA; break;
+ case BFD_RELOC_PPC_EMB_SDAI16: r = R_PPC_EMB_SDAI16; break;
+ case BFD_RELOC_PPC_EMB_SDA2I16: r = R_PPC_EMB_SDA2I16; break;
+ case BFD_RELOC_PPC_EMB_SDA2REL: r = R_PPC_EMB_SDA2REL; break;
+ case BFD_RELOC_PPC_EMB_SDA21: r = R_PPC_EMB_SDA21; break;
+ case BFD_RELOC_PPC_EMB_MRKREF: r = R_PPC_EMB_MRKREF; break;
+ case BFD_RELOC_PPC_EMB_RELSEC16: r = R_PPC_EMB_RELSEC16; break;
+ case BFD_RELOC_PPC_EMB_RELST_LO: r = R_PPC_EMB_RELST_LO; break;
+ case BFD_RELOC_PPC_EMB_RELST_HI: r = R_PPC_EMB_RELST_HI; break;
+ case BFD_RELOC_PPC_EMB_RELST_HA: r = R_PPC_EMB_RELST_HA; break;
+ case BFD_RELOC_PPC_EMB_BIT_FLD: r = R_PPC_EMB_BIT_FLD; break;
+ case BFD_RELOC_PPC_EMB_RELSDA: r = R_PPC_EMB_RELSDA; break;
+ case BFD_RELOC_VTABLE_INHERIT: r = R_PPC_GNU_VTINHERIT; break;
+ case BFD_RELOC_VTABLE_ENTRY: r = R_PPC_GNU_VTENTRY; break;
}
- return ppc_elf_howto_table[(int) ppc_reloc];
+ return ppc_elf_howto_table[(int) r];
};
/* Set the howto pointer for a PowerPC ELF reloc. */
@@ -1517,6 +2059,34 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section,
return bfd_reloc_continue;
}
+static bfd_reloc_status_type
+ppc_elf_unhandled_reloc (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 this is a relocatable link (output_bfd test tells us), just
+ call the generic function. Any adjustment will be done at final
+ link time. */
+ if (output_bfd != NULL)
+ return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message);
+
+ if (error_message != NULL)
+ {
+ static char buf[60];
+ sprintf (buf, "generic linker can't handle %s",
+ reloc_entry->howto->name);
+ *error_message = buf;
+ }
+ return bfd_reloc_dangerous;
+}
+
/* Fix bad default arch selected for a 32 bit input bfd when the
default is 64 bit. */
@@ -1554,7 +2124,8 @@ ppc_elf_set_private_flags (abfd, flags)
}
/* Merge backend specific data from an object file to the output
- object file when linking */
+ object file when linking. */
+
static bfd_boolean
ppc_elf_merge_private_bfd_data (ibfd, obfd)
bfd *ibfd;
@@ -1564,7 +2135,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
flagword new_flags;
bfd_boolean error;
- /* Check if we have the same endianess */
+ /* Check if we have the same endianess. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
return FALSE;
@@ -1574,19 +2145,22 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
- if (!elf_flags_init (obfd)) /* First call, no flags set */
+ if (!elf_flags_init (obfd))
{
+ /* First call, no flags set. */
elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = new_flags;
}
- else if (new_flags == old_flags) /* Compatible flags are ok */
+ /* Compatible flags are ok. */
+ else if (new_flags == old_flags)
;
- else /* Incompatible flags */
+ /* Incompatible flags. */
+ else
{
- /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib to be linked
- with either. */
+ /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib
+ to be linked with either. */
error = FALSE;
if ((new_flags & EF_PPC_RELOCATABLE) != 0
&& (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0)
@@ -1610,19 +2184,20 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB;
/* The output is -mrelocatable iff it can't be -mrelocatable-lib,
- but each input file is either -mrelocatable or -mrelocatable-lib. */
+ but each input file is either -mrelocatable or -mrelocatable-lib. */
if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB)
&& (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))
&& (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)))
elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE;
- /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */
+ /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if
+ any module uses it. */
elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB);
- new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
- old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+ new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+ old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
- /* Warn about any other mismatches */
+ /* Warn about any other mismatches. */
if (new_flags != old_flags)
{
error = TRUE;
@@ -1695,11 +2270,11 @@ ppc_elf_create_linker_section (abfd, info, which)
bfd *dynobj = elf_hash_table (info)->dynobj;
elf_linker_section_t *lsect;
- /* Record the first bfd section that needs the special section */
+ /* Record the first bfd section that needs the special section. */
if (!dynobj)
dynobj = elf_hash_table (info)->dynobj = abfd;
- /* If this is the first time, create the section */
+ /* If this is the first time, create the section. */
lsect = elf_linker_section (dynobj, which);
if (!lsect)
{
@@ -1794,26 +2369,38 @@ ppc_elf_modify_segment_map (abfd)
/* The powerpc .got has a blrl instruction in it. Mark it executable. */
-static asection *
+static bfd_boolean
ppc_elf_create_got (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- register asection *s;
+ struct ppc_elf_link_hash_table *htab;
+ asection *s;
flagword flags;
if (!_bfd_elf_create_got_section (abfd, info))
- return NULL;
+ return FALSE;
- s = bfd_get_section_by_name (abfd, ".got");
+ htab = ppc_elf_hash_table (info);
+ htab->got = s = bfd_get_section_by_name (abfd, ".got");
if (s == NULL)
abort ();
flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
if (!bfd_set_section_flags (abfd, s, flags))
- return NULL;
- return s;
+ return FALSE;
+
+ htab->relgot = bfd_make_section (abfd, ".rela.got");
+ if (!htab->relgot
+ || ! bfd_set_section_flags (abfd, htab->relgot,
+ (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (abfd, htab->relgot, 2))
+ return FALSE;
+
+ return TRUE;
}
/* We have to create .dynsbss and .rela.sbss here so that they get mapped
@@ -1825,7 +2412,8 @@ ppc_elf_create_dynamic_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- register asection *s;
+ struct ppc_elf_link_hash_table *htab;
+ asection *s;
flagword flags;
if (!ppc_elf_create_got (abfd, info))
@@ -1837,21 +2425,25 @@ ppc_elf_create_dynamic_sections (abfd, info)
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
- s = bfd_make_section (abfd, ".dynsbss");
+ htab = ppc_elf_hash_table (info);
+ htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss");
+ htab->dynsbss = s = bfd_make_section (abfd, ".dynsbss");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
return FALSE;
if (! info->shared)
{
- s = bfd_make_section (abfd, ".rela.sbss");
+ htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss");
+ htab->relsbss = s = bfd_make_section (abfd, ".rela.sbss");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
}
- s = bfd_get_section_by_name (abfd, ".plt");
+ htab->relplt = bfd_get_section_by_name (abfd, ".rela.plt");
+ htab->plt = s = bfd_get_section_by_name (abfd, ".plt");
if (s == NULL)
abort ();
@@ -1859,6 +2451,12 @@ ppc_elf_create_dynamic_sections (abfd, info)
return bfd_set_section_flags (abfd, s, flags);
}
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -1870,17 +2468,18 @@ ppc_elf_adjust_dynamic_symbol (info, h)
struct bfd_link_info *info;
struct elf_link_hash_entry *h;
{
- bfd *dynobj = elf_hash_table (info)->dynobj;
+ struct ppc_elf_link_hash_table *htab;
asection *s;
unsigned int power_of_two;
- bfd_vma plt_offset;
#ifdef DEBUG
- fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", h->root.root.string);
+ fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n",
+ h->root.root.string);
#endif
/* Make sure we know what is going on here. */
- BFD_ASSERT (dynobj != NULL
+ htab = ppc_elf_hash_table (info);
+ BFD_ASSERT (htab->elf.dynobj != NULL
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|| h->weakdef != NULL
|| ((h->elf_link_hash_flags
@@ -1890,85 +2489,28 @@ ppc_elf_adjust_dynamic_symbol (info, h)
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
- /* If this is a function, put it in the procedure linkage table. We
- will fill in the contents of the procedure linkage table later,
- when we know the address of the .got section. */
+ /* Deal with function syms. */
if (h->type == STT_FUNC
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
{
- if (! elf_hash_table (info)->dynamic_sections_created
+ /* Clear procedure linkage table information for any symbol that
+ won't need a .plt entry. */
+ if (! htab->elf.dynamic_sections_created
|| SYMBOL_CALLS_LOCAL (info, h)
- || (info->shared && h->plt.refcount <= 0))
+ || h->plt.refcount <= 0)
{
/* A PLT entry is not required/allowed when:
- 1. We are not using ld.so; because then the PLT entry
- can't be set up, so we can't use one.
+ 1. We are not using ld.so; because then the PLT entry
+ can't be set up, so we can't use one.
- 2. We know for certain that a call to this symbol
- will go to this object.
+ 2. We know for certain that a call to this symbol
+ will go to this object.
- 3. GC has rendered the entry unused.
- Note, however, that in an executable all references to the
- symbol go to the PLT, so we can't turn it off in that case.
- ??? The correct thing to do here is to reference count
- all uses of the symbol, not just those to the GOT or PLT. */
+ 3. GC has rendered the entry unused. */
h->plt.offset = (bfd_vma) -1;
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
- return TRUE;
}
-
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
- BFD_ASSERT (h->dynindx != -1);
-
- s = bfd_get_section_by_name (dynobj, ".plt");
- BFD_ASSERT (s != NULL);
-
- /* If this is the first .plt entry, make room for the special
- first entry. */
- if (s->_raw_size == 0)
- s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
-
- /* The PowerPC PLT is actually composed of two parts, the first part
- is 2 words (for a load and a jump), and then there is a remaining
- word available at the end. */
- plt_offset = (PLT_INITIAL_ENTRY_SIZE
- + (PLT_SLOT_SIZE
- * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE)
- / PLT_ENTRY_SIZE)));
-
- /* If this symbol is not defined in a regular file, and we are
- not generating a shared library, then set the symbol to this
- location in the .plt. This is required to make function
- pointers compare as equal between the normal executable and
- the shared library. */
- if (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- {
- h->root.u.def.section = s;
- h->root.u.def.value = plt_offset;
- }
-
- h->plt.offset = plt_offset;
-
- /* Make room for this entry. After the 8192nd entry, room
- for two entries is allocated. */
- if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
- >= PLT_NUM_SINGLE_ENTRIES)
- s->_raw_size += 2 * PLT_ENTRY_SIZE;
- else
- s->_raw_size += PLT_ENTRY_SIZE;
-
- /* We also need to make an entry in the .rela.plt section. */
- s = bfd_get_section_by_name (dynobj, ".rela.plt");
- BFD_ASSERT (s != NULL);
- s->_raw_size += sizeof (Elf32_External_Rela);
-
return TRUE;
}
else
@@ -1996,6 +2538,30 @@ ppc_elf_adjust_dynamic_symbol (info, h)
if (info->shared)
return TRUE;
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ return TRUE;
+
+ if (ELIMINATE_COPY_RELOCS)
+ {
+ struct ppc_elf_dyn_relocs *p;
+ for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
+ }
+
/* We must allocate the symbol in our .dynbss section, which will
become part of the .bss section of the executable. There will be
an entry for this symbol in the .dynsym section. The dynamic
@@ -2010,10 +2576,10 @@ ppc_elf_adjust_dynamic_symbol (info, h)
allocate it in .sbss. FIXME: It would be better to do this if and
only if there were actually SDAREL relocs for that symbol. */
- if (h->size <= elf_gp_size (dynobj))
- s = bfd_get_section_by_name (dynobj, ".dynsbss");
+ if (h->size <= elf_gp_size (htab->elf.dynobj))
+ s = htab->dynsbss;
else
- s = bfd_get_section_by_name (dynobj, ".dynbss");
+ s = htab->dynbss;
BFD_ASSERT (s != NULL);
/* We must generate a R_PPC_COPY reloc to tell the dynamic linker to
@@ -2024,10 +2590,10 @@ ppc_elf_adjust_dynamic_symbol (info, h)
{
asection *srel;
- if (h->size <= elf_gp_size (dynobj))
- srel = bfd_get_section_by_name (dynobj, ".rela.sbss");
+ if (h->size <= elf_gp_size (htab->elf.dynobj))
+ srel = htab->relsbss;
else
- srel = bfd_get_section_by_name (dynobj, ".rela.bss");
+ srel = htab->relbss;
BFD_ASSERT (srel != NULL);
srel->_raw_size += sizeof (Elf32_External_Rela);
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
@@ -2042,9 +2608,9 @@ ppc_elf_adjust_dynamic_symbol (info, h)
/* Apply the required alignment. */
s->_raw_size = BFD_ALIGN (s->_raw_size,
(bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
{
- if (! bfd_set_section_alignment (dynobj, s, power_of_two))
+ if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
return FALSE;
}
@@ -2058,13 +2624,38 @@ ppc_elf_adjust_dynamic_symbol (info, h)
return TRUE;
}
+/* This is the condition under which finish_dynamic_symbol will be
+ called from elflink.h. If elflink.h doesn't call our
+ finish_dynamic_symbol routine, we'll need to do something about
+ initializing any .plt and .got entries in relocate_section. */
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+ ((DYN) \
+ && ((SHARED) \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
+ && ((H)->dynindx != -1 \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
+
+/* Of those relocs that might be copied as dynamic relocs, this macro
+ selects those that must be copied when linking a shared library,
+ even when the symbol is local. */
+
+#define MUST_BE_DYN_RELOC(RTYPE) \
+ ((RTYPE) != R_PPC_REL24 \
+ && (RTYPE) != R_PPC_REL14 \
+ && (RTYPE) != R_PPC_REL14_BRTAKEN \
+ && (RTYPE) != R_PPC_REL14_BRNTAKEN \
+ && (RTYPE) != R_PPC_REL32)
+
/* Allocate space in associated reloc sections for dynamic relocs. */
static bfd_boolean
-allocate_dynrelocs (h, info)
+allocate_dynrelocs (h, inf)
struct elf_link_hash_entry *h;
- PTR info ATTRIBUTE_UNUSED;
+ PTR inf;
{
+ struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ struct ppc_elf_link_hash_entry *eh;
+ struct ppc_elf_link_hash_table *htab;
struct ppc_elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
@@ -2076,7 +2667,178 @@ allocate_dynrelocs (h, info)
symbol in a hash traversal. So look at it now. */
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ htab = ppc_elf_hash_table (info);
+ if (htab->elf.dynamic_sections_created
+ && h->plt.refcount > 0)
+ {
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
+ {
+ asection *s = htab->plt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->_raw_size == 0)
+ s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
+
+ /* The PowerPC PLT is actually composed of two parts, the
+ first part is 2 words (for a load and a jump), and then
+ there is a remaining word available at the end. */
+ h->plt.offset = (PLT_INITIAL_ENTRY_SIZE
+ + (PLT_SLOT_SIZE
+ * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE)
+ / PLT_ENTRY_SIZE)));
+
+ /* If this symbol is not defined in a regular file, and we
+ are not generating a shared library, then set the symbol
+ to this location in the .plt. This is required to make
+ function pointers compare as equal between the normal
+ executable and the shared library. */
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. After the 8192nd entry, room
+ for two entries is allocated. */
+ s->_raw_size += PLT_ENTRY_SIZE;
+ if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
+ >= PLT_NUM_SINGLE_ENTRIES)
+ s->_raw_size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .rela.plt section. */
+ htab->relplt->_raw_size += sizeof (Elf32_External_Rela);
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ }
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ }
+
+ eh = (struct ppc_elf_link_hash_entry *) h;
+ if (eh->elf.got.refcount > 0)
+ {
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (eh->elf.dynindx == -1
+ && (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ {
+ if (!bfd_elf32_link_record_dynamic_symbol (info, &eh->elf))
+ return FALSE;
+ }
+
+ if (eh->tls_mask == (TLS_TLS | TLS_LD)
+ && !(eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
+ /* If just an LD reloc, we'll just use htab->tlsld_got.offset. */
+ eh->elf.got.offset = (bfd_vma) -1;
+ else
+ {
+ bfd_boolean dyn;
+ eh->elf.got.offset = htab->got->_raw_size;
+ if ((eh->tls_mask & TLS_TLS) != 0)
+ {
+ if ((eh->tls_mask & TLS_LD) != 0)
+ htab->got->_raw_size += 8;
+ if ((eh->tls_mask & TLS_GD) != 0)
+ htab->got->_raw_size += 8;
+ if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ htab->got->_raw_size += 4;
+ if ((eh->tls_mask & TLS_DTPREL) != 0)
+ htab->got->_raw_size += 4;
+ }
+ else
+ htab->got->_raw_size += 4;
+ dyn = htab->elf.dynamic_sections_created;
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
+ {
+ /* All the entries we allocated need relocs. */
+ htab->relgot->_raw_size
+ += ((htab->got->_raw_size - eh->elf.got.offset) / 4
+ * sizeof (Elf32_External_Rela));
+ /* Except LD only needs one. */
+ if ((eh->tls_mask & TLS_LD) != 0)
+ htab->relgot->_raw_size -= sizeof (Elf32_External_Rela);
+ }
+ }
+ }
+ else
+ eh->elf.got.offset = (bfd_vma) -1;
+
+ if (eh->dyn_relocs == NULL)
+ return TRUE;
+
+ /* In the shared -Bsymbolic case, discard space allocated for
+ dynamic pc-relative relocs against symbols which turn out to be
+ defined in regular objects. For the normal shared case, discard
+ space for relocs that have become local due to symbol visibility
+ changes. */
+ if (info->shared)
+ {
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
+ || info->symbolic))
+ {
+ struct ppc_elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
+ }
+ else if (ELIMINATE_COPY_RELOCS)
+ {
+ /* For the non-shared case, discard space for relocs against
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
+
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ {
+ if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
+
+ eh->dyn_relocs = NULL;
+
+ keep: ;
+ }
+
+ /* Finally, allocate space. */
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
@@ -2124,9 +2886,8 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
bfd *output_bfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
{
- bfd *dynobj;
+ struct ppc_elf_link_hash_table *htab;
asection *s;
- bfd_boolean plt;
bfd_boolean relocs;
bfd *ibfd;
@@ -2134,43 +2895,42 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
fprintf (stderr, "ppc_elf_size_dynamic_sections called\n");
#endif
- dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ htab = ppc_elf_hash_table (info);
+ BFD_ASSERT (htab->elf.dynobj != NULL);
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
if (! info->shared)
{
- s = bfd_get_section_by_name (dynobj, ".interp");
+ s = bfd_get_section_by_name (htab->elf.dynobj, ".interp");
BFD_ASSERT (s != NULL);
s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
}
}
- else
+
+ if (htab->tlsld_got.refcount > 0)
{
- /* We may have created entries in the .rela.got, .rela.sdata, and
- .rela.sdata2 sections. However, if we are not creating the
- dynamic sections, we will not actually use these entries. Reset
- the size of .rela.got, et al, which will cause it to get
- stripped from the output file below. */
- static char *rela_sections[] = { ".rela.got", ".rela.sdata",
- ".rela.sdata2", ".rela.sbss",
- (char *) 0 };
- char **p;
-
- for (p = rela_sections; *p != (char *) 0; p++)
- {
- s = bfd_get_section_by_name (dynobj, *p);
- if (s != NULL)
- s->_raw_size = 0;
- }
+ htab->tlsld_got.offset = htab->got->_raw_size;
+ htab->got->_raw_size += 8;
+ if (info->shared)
+ htab->relgot->_raw_size += sizeof (Elf32_External_Rela);
}
+ else
+ htab->tlsld_got.offset = (bfd_vma) -1;
- /* Allocate space for local sym dynamic relocs. */
+ /* Set up .got offsets for local syms, and space for local dynamic
+ relocs. */
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
{
+ bfd_signed_vma *local_got;
+ bfd_signed_vma *end_local_got;
+ char *lgot_masks;
+ bfd_size_type locsymcount;
+ Elf_Internal_Shdr *symtab_hdr;
+ asection *srel;
+
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
continue;
@@ -2179,9 +2939,9 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
struct ppc_elf_dyn_relocs *p;
for (p = ((struct ppc_elf_dyn_relocs *)
- elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
+ elf_section_data (s)->local_dynrel);
+ p != NULL;
+ p = p->next)
{
if (!bfd_is_abs_section (p->sec)
&& bfd_is_abs_section (p->sec->output_section))
@@ -2202,45 +2962,76 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
}
}
}
+
+ local_got = elf_local_got_refcounts (ibfd);
+ if (!local_got)
+ continue;
+
+ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+ locsymcount = symtab_hdr->sh_info;
+ end_local_got = local_got + locsymcount;
+ lgot_masks = (char *) end_local_got;
+ s = htab->got;
+ srel = htab->relgot;
+ for (; local_got < end_local_got; ++local_got, ++lgot_masks)
+ if (*local_got > 0)
+ {
+ if (*lgot_masks == (TLS_TLS | TLS_LD))
+ {
+ /* If just an LD reloc, we'll just use
+ htab->tlsld_got.offset. */
+ if (htab->tlsld_got.offset == (bfd_vma) -1)
+ {
+ htab->tlsld_got.offset = s->_raw_size;
+ s->_raw_size += 8;
+ if (info->shared)
+ srel->_raw_size += sizeof (Elf32_External_Rela);
+ }
+ *local_got = (bfd_vma) -1;
+ }
+ else
+ {
+ *local_got = s->_raw_size;
+ if ((*lgot_masks & TLS_TLS) != 0)
+ {
+ if ((*lgot_masks & TLS_GD) != 0)
+ s->_raw_size += 8;
+ if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ s->_raw_size += 4;
+ if ((*lgot_masks & TLS_DTPREL) != 0)
+ s->_raw_size += 4;
+ }
+ else
+ s->_raw_size += 4;
+ if (info->shared)
+ srel->_raw_size += ((s->_raw_size - *local_got) / 4
+ * sizeof (Elf32_External_Rela));
+ }
+ }
+ else
+ *local_got = (bfd_vma) -1;
}
/* Allocate space for global sym dynamic relocs. */
- elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, NULL);
+ elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info);
- /* The check_relocs and adjust_dynamic_symbol entry points have
- determined the sizes of the various dynamic sections. Allocate
- memory for them. */
- plt = FALSE;
+ /* We've now determined the sizes of the various dynamic sections.
+ Allocate memory for them. */
relocs = FALSE;
- for (s = dynobj->sections; s != NULL; s = s->next)
+ for (s = htab->elf.dynobj->sections; s != NULL; s = s->next)
{
- const char *name;
- bfd_boolean strip;
-
if ((s->flags & SEC_LINKER_CREATED) == 0)
continue;
- /* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
-
- strip = FALSE;
-
- if (strcmp (name, ".plt") == 0)
+ if (s == htab->plt
+ || s == htab->got
+ || (htab->sdata != NULL && s == htab->sdata->section)
+ || (htab->sdata2 != NULL && s == htab->sdata2->section))
{
- if (s->_raw_size == 0)
- {
- /* Strip this section if we don't need it; see the
- comment below. */
- strip = TRUE;
- }
- else
- {
- /* Remember whether there is a PLT. */
- plt = TRUE;
- }
+ /* Strip this section if we don't need it; see the
+ comment below. */
}
- else if (strncmp (name, ".rela", 5) == 0)
+ else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
{
if (s->_raw_size == 0)
{
@@ -2253,7 +3044,6 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
adjust_dynamic_symbol is called, and it is that
function which decides whether anything needs to go
into these sections. */
- strip = TRUE;
}
else
{
@@ -2265,27 +3055,25 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
s->reloc_count = 0;
}
}
- else if (strcmp (name, ".got") != 0
- && strcmp (name, ".sdata") != 0
- && strcmp (name, ".sdata2") != 0)
+ else
{
/* It's not one of our sections, so don't allocate space. */
continue;
}
- if (strip)
+ if (s->_raw_size == 0)
{
_bfd_strip_section_from_output (info, s);
continue;
}
/* Allocate memory for the section contents. */
- s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
- if (s->contents == NULL && s->_raw_size != 0)
+ s->contents = (bfd_byte *) bfd_zalloc (htab->elf.dynobj, s->_raw_size);
+ if (s->contents == NULL)
return FALSE;
}
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->elf.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
values later, in ppc_elf_finish_dynamic_sections, but we
@@ -2301,7 +3089,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
return FALSE;
}
- if (plt)
+ if (htab->plt != NULL && htab->plt->_raw_size != 0)
{
if (!add_dynamic_entry (DT_PLTGOT, 0)
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -2335,6 +3123,45 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
return TRUE;
}
+static bfd_boolean
+update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type)
+ bfd *abfd;
+ Elf_Internal_Shdr *symtab_hdr;
+ unsigned long r_symndx;
+ int tls_type;
+{
+ bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd);
+ char *local_got_tls_masks;
+
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size = symtab_hdr->sh_info;
+
+ size *= sizeof (*local_got_refcounts) + sizeof (*local_got_tls_masks);
+ 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;
+ }
+
+ local_got_refcounts[r_symndx] += 1;
+ local_got_tls_masks = (char *) (local_got_refcounts + symtab_hdr->sh_info);
+ local_got_tls_masks[r_symndx] |= tls_type;
+ return TRUE;
+}
+
+static void
+bad_shared_reloc (abfd, r_type)
+ bfd *abfd;
+ enum elf_ppc_reloc_type r_type;
+{
+ (*_bfd_error_handler)
+ (_("%s: relocation %s cannot be used when making a shared object"),
+ bfd_archive_filename (abfd),
+ ppc_elf_howto_table[(int) r_type]->name);
+ bfd_set_error (bfd_error_bad_value);
+}
+
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
table. */
@@ -2346,17 +3173,12 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
asection *sec;
const Elf_Internal_Rela *relocs;
{
- bfd *dynobj;
+ struct ppc_elf_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+ struct elf_link_hash_entry **sym_hashes;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- bfd_signed_vma *local_got_refcounts;
- elf_linker_section_t *sdata;
- elf_linker_section_t *sdata2;
asection *sreloc;
- asection *sgot = NULL;
- asection *srelgot = NULL;
if (info->relocateable)
return TRUE;
@@ -2370,36 +3192,38 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
/* Create the linker generated sections all the time so that the
special symbols are created. */
- if ((sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA)) == NULL)
+ htab = ppc_elf_hash_table (info);
+ if (htab->sdata == NULL)
{
- sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA);
- if (!sdata)
+ htab->sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA);
+ if (htab->sdata == NULL)
+ htab->sdata = ppc_elf_create_linker_section (abfd, info,
+ LINKER_SECTION_SDATA);
+ if (htab->sdata == NULL)
return FALSE;
}
- if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL)
+ if (htab->sdata2 == NULL)
{
- sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2);
- if (!sdata2)
+ htab->sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2);
+ if (htab->sdata2 == NULL)
+ htab->sdata2 = ppc_elf_create_linker_section (abfd, info,
+ LINKER_SECTION_SDATA2);
+ if (htab->sdata2 == NULL)
return FALSE;
}
- dynobj = elf_hash_table (info)->dynobj;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- local_got_refcounts = elf_local_got_refcounts (abfd);
-
sym_hashes = elf_sym_hashes (abfd);
- sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);
- if (!elf_bad_symtab (abfd))
- sym_hashes_end -= symtab_hdr->sh_info;
-
sreloc = NULL;
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
{
unsigned long r_symndx;
+ enum elf_ppc_reloc_type r_type;
struct elf_link_hash_entry *h;
+ int tls_type = 0;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
@@ -2412,182 +3236,118 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
startup code. */
if (h && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
{
- if (sgot == NULL)
+ if (htab->got == NULL)
{
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- sgot = ppc_elf_create_got (dynobj, info);
- if (sgot == NULL)
+ if (htab->elf.dynobj == NULL)
+ htab->elf.dynobj = abfd;
+ if (!ppc_elf_create_got (htab->elf.dynobj, info))
return FALSE;
}
}
- switch (ELF32_R_TYPE (rel->r_info))
+ r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info);
+ switch (r_type)
{
- /* GOT16 relocations */
+ case R_PPC_GOT_TLSLD16:
+ case R_PPC_GOT_TLSLD16_LO:
+ case R_PPC_GOT_TLSLD16_HI:
+ case R_PPC_GOT_TLSLD16_HA:
+ htab->tlsld_got.refcount += 1;
+ tls_type = TLS_TLS | TLS_LD;
+ goto dogottls;
+
+ case R_PPC_GOT_TLSGD16:
+ case R_PPC_GOT_TLSGD16_LO:
+ case R_PPC_GOT_TLSGD16_HI:
+ case R_PPC_GOT_TLSGD16_HA:
+ tls_type = TLS_TLS | TLS_GD;
+ goto dogottls;
+
+ case R_PPC_GOT_TPREL16:
+ case R_PPC_GOT_TPREL16_LO:
+ case R_PPC_GOT_TPREL16_HI:
+ case R_PPC_GOT_TPREL16_HA:
+ if (info->shared)
+ info->flags |= DF_STATIC_TLS;
+ tls_type = TLS_TLS | TLS_TPREL;
+ goto dogottls;
+
+ case R_PPC_GOT_DTPREL16:
+ case R_PPC_GOT_DTPREL16_LO:
+ case R_PPC_GOT_DTPREL16_HI:
+ case R_PPC_GOT_DTPREL16_HA:
+ tls_type = TLS_TLS | TLS_DTPREL;
+ dogottls:
+ sec->has_tls_reloc = 1;
+ /* Fall thru */
+
+ /* GOT16 relocations */
case R_PPC_GOT16:
case R_PPC_GOT16_LO:
case R_PPC_GOT16_HI:
case R_PPC_GOT16_HA:
/* This symbol requires a global offset table entry. */
-
- if (sgot == NULL)
+ if (htab->got == NULL)
{
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- sgot = ppc_elf_create_got (dynobj, info);
- if (sgot == NULL)
+ if (htab->elf.dynobj == NULL)
+ htab->elf.dynobj = abfd;
+ if (!ppc_elf_create_got (htab->elf.dynobj, info))
return FALSE;
}
-
- if (srelgot == NULL
- && (h != NULL || info->shared))
- {
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- if (srelgot == NULL)
- {
- srelgot = bfd_make_section (dynobj, ".rela.got");
- if (srelgot == NULL
- || ! bfd_set_section_flags (dynobj, srelgot,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
- || ! bfd_set_section_alignment (dynobj, srelgot, 2))
- return FALSE;
- }
- }
-
if (h != NULL)
{
- if (h->got.refcount == 0)
- {
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- if (!bfd_elf32_link_record_dynamic_symbol (info, h))
- return FALSE;
-
- /* Allocate space in the .got. */
- sgot->_raw_size += 4;
- /* Allocate relocation space. */
- srelgot->_raw_size += sizeof (Elf32_External_Rela);
- }
- h->got.refcount++;
+ h->got.refcount += 1;
+ ppc_elf_hash_entry (h)->tls_mask |= tls_type;
}
else
- {
- /* This is a global offset table entry for a local symbol. */
- if (local_got_refcounts == NULL)
- {
- bfd_size_type 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;
- }
- if (local_got_refcounts[r_symndx] == 0)
- {
- sgot->_raw_size += 4;
-
- /* If we are generating a shared object, we need to
- output a R_PPC_RELATIVE reloc so that the
- dynamic linker can adjust this GOT entry. */
- if (info->shared)
- srelgot->_raw_size += sizeof (Elf32_External_Rela);
- }
- local_got_refcounts[r_symndx]++;
- }
+ /* This is a global offset table entry for a local symbol. */
+ if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type))
+ return FALSE;
break;
- /* Indirect .sdata relocation */
+ /* Indirect .sdata relocation. */
case R_PPC_EMB_SDAI16:
if (info->shared)
{
- ((*_bfd_error_handler)
- (_("%s: relocation %s cannot be used when making a shared object"),
- bfd_archive_filename (abfd), "R_PPC_EMB_SDAI16"));
+ bad_shared_reloc (abfd, r_type);
return FALSE;
}
-
- if (srelgot == NULL && (h != NULL || info->shared))
- {
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- if (srelgot == NULL)
- {
- srelgot = bfd_make_section (dynobj, ".rela.got");
- if (srelgot == NULL
- || ! bfd_set_section_flags (dynobj, srelgot,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
- || ! bfd_set_section_alignment (dynobj, srelgot, 2))
- return FALSE;
- }
- }
-
- if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata, h, rel))
+ if (!bfd_elf32_create_pointer_linker_section (abfd, info,
+ htab->sdata, h, rel))
return FALSE;
-
break;
- /* Indirect .sdata2 relocation */
+ /* Indirect .sdata2 relocation. */
case R_PPC_EMB_SDA2I16:
if (info->shared)
{
- ((*_bfd_error_handler)
- (_("%s: relocation %s cannot be used when making a shared object"),
- bfd_archive_filename (abfd), "R_PPC_EMB_SDA2I16"));
+ bad_shared_reloc (abfd, r_type);
return FALSE;
}
-
- if (srelgot == NULL && (h != NULL || info->shared))
- {
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- if (srelgot == NULL)
- {
- srelgot = bfd_make_section (dynobj, ".rela.got");
- if (srelgot == NULL
- || ! bfd_set_section_flags (dynobj, srelgot,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
- || ! bfd_set_section_alignment (dynobj, srelgot, 2))
- return FALSE;
- }
- }
-
- if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata2, h, rel))
+ if (!bfd_elf32_create_pointer_linker_section (abfd, info,
+ htab->sdata2, h, rel))
return FALSE;
-
break;
case R_PPC_SDAREL16:
case R_PPC_EMB_SDA2REL:
case R_PPC_EMB_SDA21:
+ case R_PPC_EMB_RELSDA:
+ case R_PPC_EMB_NADDR32:
+ case R_PPC_EMB_NADDR16:
+ case R_PPC_EMB_NADDR16_LO:
+ case R_PPC_EMB_NADDR16_HI:
+ case R_PPC_EMB_NADDR16_HA:
if (info->shared)
{
- ((*_bfd_error_handler)
- (_("%s: relocation %s cannot be used when making a shared object"),
- bfd_archive_filename (abfd),
- ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name));
+ bad_shared_reloc (abfd, r_type);
return FALSE;
}
break;
case R_PPC_PLT32:
case R_PPC_PLTREL24:
+ case R_PPC_PLTREL32:
case R_PPC_PLT16_LO:
case R_PPC_PLT16_HI:
case R_PPC_PLT16_HA:
@@ -2595,25 +3355,19 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
fprintf (stderr, "Reloc requires a PLT entry\n");
#endif
/* This symbol requires a procedure linkage table entry. We
- actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code without
- linking in any dynamic objects, in which case we don't
- need to generate a procedure linkage table after all. */
+ actually build the entry in finish_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
if (h == NULL)
{
/* It does not make sense to have a procedure linkage
- table entry for a local symbol. */
+ table entry for a local symbol. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
h->plt.refcount++;
break;
@@ -2625,9 +3379,37 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
case R_PPC_SECTOFF_LO:
case R_PPC_SECTOFF_HI:
case R_PPC_SECTOFF_HA:
+ case R_PPC_DTPREL16:
+ case R_PPC_DTPREL16_LO:
+ case R_PPC_DTPREL16_HI:
+ case R_PPC_DTPREL16_HA:
+ case R_PPC_TOC16:
+ break;
+
+ /* This are just markers. */
+ case R_PPC_TLS:
+ case R_PPC_EMB_MRKREF:
+ case R_PPC_NONE:
+ case R_PPC_max:
break;
- /* This refers only to functions defined in the shared library */
+ /* These should only appear in dynamic objects. */
+ case R_PPC_COPY:
+ case R_PPC_GLOB_DAT:
+ case R_PPC_JMP_SLOT:
+ case R_PPC_RELATIVE:
+ break;
+
+ /* These aren't handled yet. We'll report an error later. */
+ case R_PPC_ADDR30:
+ case R_PPC_EMB_RELSEC16:
+ case R_PPC_EMB_RELST_LO:
+ case R_PPC_EMB_RELST_HI:
+ case R_PPC_EMB_RELST_HA:
+ case R_PPC_EMB_BIT_FLD:
+ break;
+
+ /* This refers only to functions defined in the shared library. */
case R_PPC_LOCAL24PC:
break;
@@ -2645,6 +3427,25 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
return FALSE;
break;
+ /* We shouldn't really be seeing these. */
+ case R_PPC_TPREL32:
+ if (info->shared)
+ info->flags |= DF_STATIC_TLS;
+ goto dodyn;
+
+ /* Nor these. */
+ case R_PPC_DTPMOD32:
+ case R_PPC_DTPREL32:
+ goto dodyn;
+
+ case R_PPC_TPREL16:
+ case R_PPC_TPREL16_LO:
+ case R_PPC_TPREL16_HI:
+ case R_PPC_TPREL16_HA:
+ if (info->shared)
+ info->flags |= DF_STATIC_TLS;
+ goto dodyn;
+
/* When creating a shared object, we must copy these
relocs into the output file. We create a reloc
section in dynobj and make room for the reloc. */
@@ -2659,15 +3460,71 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
break;
/* fall through */
- default:
- if (info->shared)
+ case R_PPC_ADDR32:
+ case R_PPC_ADDR24:
+ case R_PPC_ADDR16:
+ case R_PPC_ADDR16_LO:
+ case R_PPC_ADDR16_HI:
+ case R_PPC_ADDR16_HA:
+ case R_PPC_ADDR14:
+ case R_PPC_ADDR14_BRTAKEN:
+ case R_PPC_ADDR14_BRNTAKEN:
+ case R_PPC_UADDR32:
+ case R_PPC_UADDR16:
+ if (h != NULL && !info->shared)
+ {
+ /* We may need a plt entry if the symbol turns out to be
+ a function defined in a dynamic object. */
+ h->plt.refcount++;
+
+ /* We may need a copy reloc too. */
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+ }
+
+ dodyn:
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+ into the shared library. However, if we are linking with
+ -Bsymbolic, we do not need to copy a reloc against a
+ global symbol which is defined in an object we are
+ including in the link (i.e., DEF_REGULAR is set). At
+ this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). In case of a weak definition,
+ DEF_REGULAR may be cleared later by a strong definition in
+ a shared library. We account for that possibility below by
+ storing information in the dyn_relocs field of the hash
+ table entry. A similar situation occurs when creating
+ shared libraries and symbol visibility changes render the
+ symbol local.
+
+ If on the other hand, we are creating an executable, we
+ may need to keep relocations for symbols satisfied by a
+ dynamic library if we manage to avoid copy relocs for the
+ symbol. */
+ if ((info->shared
+ && (MUST_BE_DYN_RELOC (r_type)
+ || (h != NULL
+ && (! info->symbolic
+ || h->root.type == bfd_link_hash_defweak
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)))
{
struct ppc_elf_dyn_relocs *p;
struct ppc_elf_dyn_relocs **head;
#ifdef DEBUG
fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n",
- (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+ (h && h->root.root.string
+ ? h->root.root.string : "<unknown>"));
#endif
if (sreloc == NULL)
{
@@ -2684,19 +3541,21 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
&& strcmp (bfd_get_section_name (abfd, sec),
name + 5) == 0);
- sreloc = bfd_get_section_by_name (dynobj, name);
+ sreloc = bfd_get_section_by_name (htab->elf.dynobj, name);
if (sreloc == NULL)
{
flagword flags;
- sreloc = bfd_make_section (dynobj, name);
+ sreloc = bfd_make_section (htab->elf.dynobj, name);
flags = (SEC_HAS_CONTENTS | SEC_READONLY
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
if ((sec->flags & SEC_ALLOC) != 0)
flags |= SEC_ALLOC | SEC_LOAD;
if (sreloc == NULL
- || ! bfd_set_section_flags (dynobj, sreloc, flags)
- || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+ || ! bfd_set_section_flags (htab->elf.dynobj,
+ sreloc, flags)
+ || ! bfd_set_section_alignment (htab->elf.dynobj,
+ sreloc, 2))
return FALSE;
}
elf_section_data (sec)->sreloc = sreloc;
@@ -2715,9 +3574,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
easily. Oh well. */
asection *s;
- s = (bfd_section_from_r_symndx
- (abfd, &ppc_elf_hash_table (info)->sym_sec,
- sec, r_symndx));
+ s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
+ sec, r_symndx);
if (s == NULL)
return FALSE;
@@ -2729,16 +3587,19 @@ ppc_elf_check_relocs (abfd, info, sec, relocs)
if (p == NULL || p->sec != sec)
{
p = ((struct ppc_elf_dyn_relocs *)
- bfd_alloc (elf_hash_table (info)->dynobj, sizeof *p));
+ bfd_alloc (htab->elf.dynobj, sizeof *p));
if (p == NULL)
return FALSE;
p->next = *head;
*head = p;
p->sec = sec;
p->count = 0;
+ p->pc_count = 0;
}
- p->count++;
+ p->count += 1;
+ if (!MUST_BE_DYN_RELOC (r_type))
+ p->pc_count += 1;
}
break;
@@ -2788,85 +3649,348 @@ ppc_elf_gc_mark_hook (sec, info, rel, h, sym)
return NULL;
}
-/* Update the got entry reference counts for the section being removed. */
+/* Update the got, plt and dynamic reloc reference counts for the
+ section being removed. */
static bfd_boolean
ppc_elf_gc_sweep_hook (abfd, info, sec, relocs)
bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
asection *sec;
const Elf_Internal_Rela *relocs;
{
+ struct ppc_elf_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
elf_section_data (sec)->local_dynrel = NULL;
+ htab = ppc_elf_hash_table (info);
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
local_got_refcounts = elf_local_got_refcounts (abfd);
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
- switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_PPC_GOT16:
- case R_PPC_GOT16_LO:
- case R_PPC_GOT16_HI:
- case R_PPC_GOT16_HA:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->got.refcount > 0)
- h->got.refcount--;
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx]--;
- }
- break;
-
- case R_PPC_PLT32:
- case R_PPC_PLTREL24:
- case R_PPC_PLT16_LO:
- case R_PPC_PLT16_HI:
- case R_PPC_PLT16_HA:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->plt.refcount > 0)
- h->plt.refcount--;
- }
- /* Fall through */
+ {
+ unsigned long r_symndx;
+ enum elf_ppc_reloc_type r_type;
+ struct elf_link_hash_entry *h = NULL;
- default:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct ppc_elf_dyn_relocs **pp, *p;
+ struct ppc_elf_link_hash_entry *eh;
+
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct ppc_elf_link_hash_entry *) h;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
+ r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info);
+ switch (r_type)
+ {
+ case R_PPC_GOT_TLSLD16:
+ case R_PPC_GOT_TLSLD16_LO:
+ case R_PPC_GOT_TLSLD16_HI:
+ case R_PPC_GOT_TLSLD16_HA:
+ htab->tlsld_got.refcount -= 1;
+ /* Fall thru */
+
+ case R_PPC_GOT_TLSGD16:
+ case R_PPC_GOT_TLSGD16_LO:
+ case R_PPC_GOT_TLSGD16_HI:
+ case R_PPC_GOT_TLSGD16_HA:
+ case R_PPC_GOT_TPREL16:
+ case R_PPC_GOT_TPREL16_LO:
+ case R_PPC_GOT_TPREL16_HI:
+ case R_PPC_GOT_TPREL16_HA:
+ case R_PPC_GOT_DTPREL16:
+ case R_PPC_GOT_DTPREL16_LO:
+ case R_PPC_GOT_DTPREL16_HI:
+ case R_PPC_GOT_DTPREL16_HA:
+ case R_PPC_GOT16:
+ case R_PPC_GOT16_LO:
+ case R_PPC_GOT16_HI:
+ case R_PPC_GOT16_HA:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
+
+ case R_PPC_REL24:
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ case R_PPC_REL32:
+ if (h == NULL
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
+ || SYMBOL_REFERENCES_LOCAL (info, h))
+ break;
+ /* Fall thru */
+
+ case R_PPC_ADDR32:
+ case R_PPC_ADDR24:
+ case R_PPC_ADDR16:
+ case R_PPC_ADDR16_LO:
+ case R_PPC_ADDR16_HI:
+ case R_PPC_ADDR16_HA:
+ case R_PPC_ADDR14:
+ case R_PPC_ADDR14_BRTAKEN:
+ case R_PPC_ADDR14_BRNTAKEN:
+ case R_PPC_UADDR32:
+ case R_PPC_UADDR16:
+ case R_PPC_PLT32:
+ case R_PPC_PLTREL24:
+ case R_PPC_PLT16_LO:
+ case R_PPC_PLT16_HI:
+ case R_PPC_PLT16_HA:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ return TRUE;
+}
+
+/* Set htab->tls_sec and htab->tls_get_addr. */
+
+bfd_boolean
+ppc_elf_tls_setup (obfd, info)
+ bfd *obfd;
+ struct bfd_link_info *info;
+{
+ asection *tls;
+ struct ppc_elf_link_hash_table *htab;
+
+ htab = ppc_elf_hash_table (info);
+ htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
+ FALSE, FALSE, TRUE);
+
+ for (tls = obfd->sections; tls != NULL; tls = tls->next)
+ if ((tls->flags & (SEC_THREAD_LOCAL | SEC_LOAD))
+ == (SEC_THREAD_LOCAL | SEC_LOAD))
+ break;
+ htab->tls_sec = tls;
+
+ return tls != NULL;
+}
+
+/* Run through all the TLS relocs looking for optimization
+ opportunities. */
+
+bfd_boolean
+ppc_elf_tls_optimize (obfd, info)
+ bfd *obfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+{
+ bfd *ibfd;
+ asection *sec;
+ struct ppc_elf_link_hash_table *htab;
+
+ if (info->relocateable || info->shared)
+ return TRUE;
+
+ htab = ppc_elf_hash_table (info);
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ {
+ Elf_Internal_Sym *locsyms = NULL;
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+
+ for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+ if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section))
{
- struct ppc_elf_dyn_relocs **pp, *p;
+ Elf_Internal_Rela *relstart, *rel, *relend;
+ int expecting_tls_get_addr;
+
+ /* Read the relocations. */
+ relstart = _bfd_elf32_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
+ if (relstart == NULL)
+ return FALSE;
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ expecting_tls_get_addr = 0;
+ relend = relstart + sec->reloc_count;
+ for (rel = relstart; rel < relend; rel++)
+ {
+ enum elf_ppc_reloc_type r_type;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h = NULL;
+ char *tls_mask;
+ char tls_set, tls_clear;
+ bfd_boolean is_local;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf_link_hash_entry **sym_hashes;
- for (pp = &ppc_elf_hash_entry (h)->dyn_relocs;
- (p = *pp) != NULL;
- pp = &p->next)
- if (p->sec == sec)
- {
- if (--p->count == 0)
- *pp = p->next;
- break;
- }
+ sym_hashes = elf_sym_hashes (ibfd);
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ is_local = FALSE;
+ if (h == NULL
+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
+ is_local = TRUE;
+
+ r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info);
+ switch (r_type)
+ {
+ case R_PPC_GOT_TLSLD16:
+ case R_PPC_GOT_TLSLD16_LO:
+ case R_PPC_GOT_TLSLD16_HI:
+ case R_PPC_GOT_TLSLD16_HA:
+ /* These relocs should never be against a symbol
+ defined in a shared lib. Leave them alone if
+ that turns out to be the case. */
+ expecting_tls_get_addr = 0;
+ htab->tlsld_got.refcount -= 1;
+ if (!is_local)
+ continue;
+
+ /* LD -> LE */
+ tls_set = 0;
+ tls_clear = TLS_LD;
+ expecting_tls_get_addr = 1;
+ break;
+
+ case R_PPC_GOT_TLSGD16:
+ case R_PPC_GOT_TLSGD16_LO:
+ case R_PPC_GOT_TLSGD16_HI:
+ case R_PPC_GOT_TLSGD16_HA:
+ if (is_local)
+ /* GD -> LE */
+ tls_set = 0;
+ else
+ /* GD -> IE */
+ tls_set = TLS_TLS | TLS_TPRELGD;
+ tls_clear = TLS_GD;
+ expecting_tls_get_addr = 1;
+ break;
+
+ case R_PPC_GOT_TPREL16:
+ case R_PPC_GOT_TPREL16_LO:
+ case R_PPC_GOT_TPREL16_HI:
+ case R_PPC_GOT_TPREL16_HA:
+ expecting_tls_get_addr = 0;
+ if (is_local)
+ {
+ /* IE -> LE */
+ tls_set = 0;
+ tls_clear = TLS_TPREL;
+ break;
+ }
+ else
+ continue;
+
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ case R_PPC_REL24:
+ if (expecting_tls_get_addr
+ && h != NULL
+ && h == htab->tls_get_addr)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ expecting_tls_get_addr = 0;
+ continue;
+
+ default:
+ expecting_tls_get_addr = 0;
+ continue;
+ }
+
+ if (h != NULL)
+ {
+ if (tls_set == 0)
+ {
+ /* We managed to get rid of a got entry. */
+ if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ tls_mask = &ppc_elf_hash_entry (h)->tls_mask;
+ }
+ else
+ {
+ Elf_Internal_Sym *sym;
+ bfd_signed_vma *lgot_refs;
+ char *lgot_masks;
+
+ if (locsyms == NULL)
+ {
+ locsyms = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (locsyms == NULL)
+ locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr,
+ symtab_hdr->sh_info,
+ 0, NULL, NULL, NULL);
+ if (locsyms == NULL)
+ {
+ if (elf_section_data (sec)->relocs != relstart)
+ free (relstart);
+ return FALSE;
+ }
+ }
+ sym = locsyms + r_symndx;
+ lgot_refs = elf_local_got_refcounts (ibfd);
+ if (lgot_refs == NULL)
+ abort ();
+ if (tls_set == 0)
+ {
+ /* We managed to get rid of a got entry. */
+ if (lgot_refs[r_symndx] > 0)
+ lgot_refs[r_symndx] -= 1;
+ }
+ lgot_masks = (char *) (lgot_refs + symtab_hdr->sh_info);
+ tls_mask = &lgot_masks[r_symndx];
+ }
+
+ *tls_mask |= tls_set;
+ *tls_mask &= ~tls_clear;
+ }
+
+ if (elf_section_data (sec)->relocs != relstart)
+ free (relstart);
}
- break;
- }
+ if (locsyms != NULL
+ && (symtab_hdr->contents != (unsigned char *) locsyms))
+ {
+ if (!info->keep_memory)
+ free (locsyms);
+ else
+ symtab_hdr->contents = (unsigned char *) locsyms;
+ }
+ }
return TRUE;
}
@@ -2898,9 +4022,9 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
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. */
+ want to attach this common section to DYNOBJ. The linker
+ will move the symbols to the appropriate output section
+ when it defines common symbols. */
amt = sizeof (asection);
sdata->bss_section = (asection *) bfd_zalloc (abfd, amt);
if (sdata->bss_section == NULL)
@@ -2939,20 +4063,18 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
{
- bfd *dynobj;
+ struct ppc_elf_link_hash_table *htab;
#ifdef DEBUG
fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s",
h->root.root.string);
#endif
- dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ htab = ppc_elf_hash_table (info);
+ BFD_ASSERT (htab->elf.dynobj != NULL);
if (h->plt.offset != (bfd_vma) -1)
{
- asection *splt;
- asection *srela;
Elf_Internal_Rela rela;
bfd_byte *loc;
bfd_vma reloc_index;
@@ -2962,20 +4084,17 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
#endif
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
-
- splt = bfd_get_section_by_name (dynobj, ".plt");
- srela = bfd_get_section_by_name (dynobj, ".rela.plt");
- BFD_ASSERT (splt != NULL && srela != NULL);
+ BFD_ASSERT (htab->plt != NULL && htab->relplt != NULL);
/* We don't need to fill in the .plt. The ppc dynamic linker
will fill it in. */
/* Fill in the entry in the .rela.plt section. */
- rela.r_offset = (splt->output_section->vma
- + splt->output_offset
+ rela.r_offset = (htab->plt->output_section->vma
+ + htab->plt->output_offset
+ h->plt.offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT);
rela.r_addend = 0;
@@ -2983,7 +4102,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE;
if (reloc_index > PLT_NUM_SINGLE_ENTRIES)
reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2;
- loc = srela->contents + reloc_index * sizeof (Elf32_External_Rela);
+ loc = (htab->relplt->contents
+ + reloc_index * sizeof (Elf32_External_Rela));
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@@ -3001,49 +4121,6 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
- if (h->got.offset != (bfd_vma) -1)
- {
- asection *sgot;
- asection *srela;
- Elf_Internal_Rela rela;
- bfd_byte *loc;
-
- /* This symbol has an entry in the global offset table. Set it
- up. */
-
- sgot = bfd_get_section_by_name (dynobj, ".got");
- srela = bfd_get_section_by_name (dynobj, ".rela.got");
- BFD_ASSERT (sgot != NULL && srela != NULL);
-
- rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + (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
- the global offset table will already have been initialized in
- the relocate_section function. */
- if (info->shared
- && SYMBOL_REFERENCES_LOCAL (info, h))
- {
- rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
- rela.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
- else
- {
- BFD_ASSERT ((h->got.offset & 1) == 0);
- rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT);
- rela.r_addend = 0;
- }
-
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
- loc = srela->contents;
- loc += srela->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
- }
-
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{
asection *s;
@@ -3058,12 +4135,10 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
BFD_ASSERT (h->dynindx != -1);
- if (h->size <= elf_gp_size (dynobj))
- s = bfd_get_section_by_name (h->root.u.def.section->owner,
- ".rela.sbss");
+ if (h->size <= elf_gp_size (htab->elf.dynobj))
+ s = htab->relsbss;
else
- s = bfd_get_section_by_name (h->root.u.def.section->owner,
- ".rela.bss");
+ s = htab->relbss;
BFD_ASSERT (s != NULL);
rela.r_offset = (h->root.u.def.value
@@ -3096,80 +4171,69 @@ ppc_elf_finish_dynamic_sections (output_bfd, info)
struct bfd_link_info *info;
{
asection *sdyn;
- bfd *dynobj = elf_hash_table (info)->dynobj;
- asection *sgot = bfd_get_section_by_name (dynobj, ".got");
+ struct ppc_elf_link_hash_table *htab;
#ifdef DEBUG
fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n");
#endif
- sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+ htab = ppc_elf_hash_table (info);
+ sdyn = bfd_get_section_by_name (htab->elf.dynobj, ".dynamic");
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->elf.dynamic_sections_created)
{
- asection *splt;
Elf32_External_Dyn *dyncon, *dynconend;
- splt = bfd_get_section_by_name (dynobj, ".plt");
- BFD_ASSERT (splt != NULL && sdyn != NULL);
+ BFD_ASSERT (htab->plt != NULL && sdyn != NULL);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
for (; dyncon < dynconend; dyncon++)
{
Elf_Internal_Dyn dyn;
- const char *name;
- bfd_boolean size;
+ asection *s;
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+ bfd_elf32_swap_dyn_in (htab->elf.dynobj, dyncon, &dyn);
switch (dyn.d_tag)
{
- case DT_PLTGOT: name = ".plt"; size = FALSE; break;
- case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
- case DT_JMPREL: name = ".rela.plt"; size = FALSE; break;
- default: name = NULL; size = FALSE; break;
- }
+ case DT_PLTGOT:
+ s = htab->plt;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
- if (name != NULL)
- {
- asection *s;
+ case DT_PLTRELSZ:
+ dyn.d_un.d_val = htab->relplt->_raw_size;
+ break;
- s = bfd_get_section_by_name (output_bfd, name);
- if (s == NULL)
- dyn.d_un.d_val = 0;
- else
- {
- if (! size)
- dyn.d_un.d_ptr = s->vma;
- else
- {
- if (s->_cooked_size != 0)
- dyn.d_un.d_val = s->_cooked_size;
- else
- dyn.d_un.d_val = s->_raw_size;
- }
- }
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ case DT_JMPREL:
+ s = htab->relplt;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
+
+ default:
+ continue;
}
+
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
}
}
/* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
easily find the address of the _GLOBAL_OFFSET_TABLE_. */
- if (sgot)
+ if (htab->got)
{
- unsigned char *contents = sgot->contents;
+ unsigned char *contents = htab->got->contents;
bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents);
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, contents + 4);
else
bfd_put_32 (output_bfd,
sdyn->output_section->vma + sdyn->output_offset,
- contents+4);
+ contents + 4);
- elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 4;
}
return TRUE;
@@ -3216,25 +4280,16 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Sym *local_syms;
asection **local_sections;
{
- Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
- bfd *dynobj = elf_hash_table (info)->dynobj;
- elf_linker_section_t *sdata = NULL;
- elf_linker_section_t *sdata2 = NULL;
- Elf_Internal_Rela *rel = relocs;
- Elf_Internal_Rela *relend = relocs + input_section->reloc_count;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ struct ppc_elf_link_hash_table *htab;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *relend;
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
asection *sreloc = NULL;
- asection *splt;
- asection *sgot;
bfd_vma *local_got_offsets;
bfd_boolean ret = TRUE;
- long insn;
-
- if (dynobj)
- {
- sdata = elf_linker_section (dynobj, LINKER_SECTION_SDATA);
- sdata2 = elf_linker_section (dynobj, LINKER_SECTION_SDATA2);
- }
#ifdef DEBUG
fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n",
@@ -3251,56 +4306,43 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Initialize howto table if needed. */
ppc_elf_howto_init ();
+ htab = ppc_elf_hash_table (info);
local_got_offsets = elf_local_got_offsets (input_bfd);
-
- splt = sgot = NULL;
- if (dynobj != NULL)
- {
- splt = bfd_get_section_by_name (dynobj, ".plt");
- sgot = bfd_get_section_by_name (dynobj, ".got");
- }
-
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
- enum elf_ppc_reloc_type r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info);
- bfd_vma offset = rel->r_offset;
- bfd_vma addend = rel->r_addend;
- bfd_reloc_status_type r = bfd_reloc_other;
- Elf_Internal_Sym *sym = (Elf_Internal_Sym *) 0;
- asection *sec = (asection *) 0;
- struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) 0;
- const char *sym_name = (const char *) 0;
+ enum elf_ppc_reloc_type r_type;
+ bfd_vma addend;
+ bfd_reloc_status_type r;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ const char *sym_name;
reloc_howto_type *howto;
unsigned long r_symndx;
bfd_vma relocation;
- int will_become_local;
-
- /* Unknown relocation handling */
- if ((unsigned) r_type >= (unsigned) R_PPC_max
- || !ppc_elf_howto_table[(int) r_type])
- {
- (*_bfd_error_handler) (_("%s: unknown relocation type %d"),
- bfd_archive_filename (input_bfd),
- (int) r_type);
-
- bfd_set_error (bfd_error_bad_value);
- ret = FALSE;
- continue;
- }
-
- howto = ppc_elf_howto_table[(int) r_type];
+ bfd_vma branch_bit, insn, from;
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
+ unsigned int tls_type, tls_mask, tls_gd;
+
+ r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info);
+ sym = (Elf_Internal_Sym *) 0;
+ sec = (asection *) 0;
+ h = (struct elf_link_hash_entry *) 0;
+ unresolved_reloc = FALSE;
+ warned = FALSE;
r_symndx = ELF32_R_SYM (rel->r_info);
-
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
- sym_name = "<local symbol>";
+ sym_name = bfd_elf_local_sym_name (input_bfd, sym);
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;
}
else
{
@@ -3310,127 +4352,551 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
h = (struct elf_link_hash_entry *) h->root.u.i.link;
sym_name = h->root.root.string;
- /* Can this relocation be resolved immediately? */
- will_become_local = SYMBOL_REFERENCES_LOCAL (info, h);
-
+ relocation = 0;
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
sec = h->root.u.def.section;
- if (((r_type == R_PPC_PLT32
- || r_type == R_PPC_PLTREL24)
- && splt != NULL
- && h->plt.offset != (bfd_vma) -1)
- || (r_type == R_PPC_LOCAL24PC
- && sec->output_section == NULL)
- || ((r_type == R_PPC_GOT16
- || r_type == R_PPC_GOT16_LO
- || r_type == R_PPC_GOT16_HI
- || r_type == R_PPC_GOT16_HA)
- && elf_hash_table (info)->dynamic_sections_created
- && (! info->shared || ! will_become_local))
- || (info->shared
- && ! will_become_local
- && ((input_section->flags & SEC_ALLOC) != 0
- /* Testing SEC_DEBUGGING here may be wrong.
- It's here to avoid a crash when
- generating a shared library with DWARF
- debugging information. */
- || ((input_section->flags & SEC_DEBUGGING) != 0
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
- && (r_type == R_PPC_ADDR32
- || r_type == R_PPC_ADDR24
- || r_type == R_PPC_ADDR16
- || r_type == R_PPC_ADDR16_LO
- || r_type == R_PPC_ADDR16_HI
- || r_type == R_PPC_ADDR16_HA
- || r_type == R_PPC_ADDR14
- || r_type == R_PPC_ADDR14_BRTAKEN
- || r_type == R_PPC_ADDR14_BRNTAKEN
- || r_type == R_PPC_COPY
- || r_type == R_PPC_GLOB_DAT
- || r_type == R_PPC_JMP_SLOT
- || r_type == R_PPC_UADDR32
- || r_type == R_PPC_UADDR16
- || r_type == R_PPC_SDAREL16
- || r_type == R_PPC_EMB_NADDR32
- || r_type == R_PPC_EMB_NADDR16
- || r_type == R_PPC_EMB_NADDR16_LO
- || r_type == R_PPC_EMB_NADDR16_HI
- || r_type == R_PPC_EMB_NADDR16_HA
- || r_type == R_PPC_EMB_SDAI16
- || r_type == R_PPC_EMB_SDA2I16
- || r_type == R_PPC_EMB_SDA2REL
- || r_type == R_PPC_EMB_SDA21
- || r_type == R_PPC_EMB_MRKREF
- || r_type == R_PPC_EMB_BIT_FLD
- || r_type == R_PPC_EMB_RELSDA
- || ((r_type == R_PPC_REL24
- || r_type == R_PPC_REL32
- || r_type == R_PPC_REL14
- || r_type == R_PPC_REL14_BRTAKEN
- || r_type == R_PPC_REL14_BRNTAKEN
- || r_type == R_PPC_RELATIVE)
- && strcmp (h->root.root.string,
- "_GLOBAL_OFFSET_TABLE_") != 0))))
- {
- /* In these cases, we don't need the relocation
- value. We check specially because in some
- obscure cases sec->output_section will be NULL. */
- relocation = 0;
- }
- else if (sec->output_section == NULL)
- {
- (*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd), h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
- relocation = 0;
- }
+ /* Set a flag that will be cleared later if we find a
+ relocation value for this symbol. output_section
+ is typically NULL for symbols satisfied by a shared
+ library. */
+ if (sec->output_section == NULL)
+ unresolved_reloc = TRUE;
else
relocation = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
}
else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
+ ;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
+ ;
else
{
- if (! (*info->callbacks->undefined_symbol) (info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset,
- (!info->shared
- || info->no_undefined
- || ELF_ST_VISIBILITY (h->other))))
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd, input_section,
+ rel->r_offset, (!info->shared
+ || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return FALSE;
- relocation = 0;
+ warned = TRUE;
+ }
+ }
+
+ /* TLS optimizations. Replace instruction sequences and relocs
+ based on information we collected in tls_optimize. We edit
+ RELOCS so that --emit-relocs will output something sensible
+ for the final instruction stream. */
+ tls_mask = 0;
+ tls_gd = 0;
+ if (IS_PPC_TLS_RELOC (r_type))
+ {
+ if (h != NULL)
+ tls_mask = ((struct ppc_elf_link_hash_entry *) h)->tls_mask;
+ else if (local_got_offsets != NULL)
+ {
+ char *lgot_masks;
+ lgot_masks = (char *) (local_got_offsets + symtab_hdr->sh_info);
+ tls_mask = lgot_masks[r_symndx];
}
}
- switch ((int) r_type)
+ /* Ensure reloc mapping code below stays sane. */
+ if ((R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TLSGD16 & 3)
+ || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TLSGD16_LO & 3)
+ || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TLSGD16_HI & 3)
+ || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TLSGD16_HA & 3)
+ || (R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TPREL16 & 3)
+ || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TPREL16_LO & 3)
+ || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TPREL16_HI & 3)
+ || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TPREL16_HA & 3))
+ abort ();
+ switch (r_type)
{
default:
- (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"),
- bfd_archive_filename (input_bfd),
- (int) r_type, sym_name);
+ break;
+
+ case R_PPC_GOT_TPREL16:
+ case R_PPC_GOT_TPREL16_LO:
+ if (tls_mask != 0
+ && (tls_mask & TLS_TPREL) == 0)
+ {
+ bfd_vma insn;
+ insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2);
+ insn &= 31 << 21;
+ insn |= 0x3c020000; /* addis 0,2,0 */
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2);
+ r_type = R_PPC_TPREL16_HA;
+ rel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ }
+ break;
+
+ case R_PPC_TLS:
+ if (tls_mask != 0
+ && (tls_mask & TLS_TPREL) == 0)
+ {
+ bfd_vma insn, rtra;
+ insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
+ if ((insn & ((31 << 26) | (31 << 11)))
+ == ((31 << 26) | (2 << 11)))
+ rtra = insn & ((1 << 26) - (1 << 16));
+ else if ((insn & ((31 << 26) | (31 << 16)))
+ == ((31 << 26) | (2 << 16)))
+ rtra = (insn & (31 << 21)) | ((insn & (31 << 11)) << 5);
+ else
+ abort ();
+ if ((insn & ((1 << 11) - (1 << 1))) == 266 << 1)
+ /* add -> addi. */
+ insn = 14 << 26;
+ else if ((insn & (31 << 1)) == 23 << 1
+ && ((insn & (31 << 6)) < 14 << 6
+ || ((insn & (31 << 6)) >= 16 << 6
+ && (insn & (31 << 6)) < 24 << 6)))
+ /* load and store indexed -> dform. */
+ insn = (32 | ((insn >> 6) & 31)) << 26;
+ else if ((insn & (31 << 1)) == 21 << 1
+ && (insn & (0x1a << 6)) == 0)
+ /* ldx, ldux, stdx, stdux -> ld, ldu, std, stdu. */
+ insn = (((58 | ((insn >> 6) & 4)) << 26)
+ | ((insn >> 6) & 1));
+ else if ((insn & (31 << 1)) == 21 << 1
+ && (insn & ((1 << 11) - (1 << 1))) == 341 << 1)
+ /* lwax -> lwa. */
+ insn = (58 << 26) | 2;
+ else
+ abort ();
+ insn |= rtra;
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
+ r_type = R_PPC_TPREL16_LO;
+ rel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ /* Was PPC_TLS which sits on insn boundary, now
+ PPC_TPREL16_LO which is at insn+2. */
+ rel->r_offset += 2;
+ }
+ break;
+
+ case R_PPC_GOT_TLSGD16_HI:
+ case R_PPC_GOT_TLSGD16_HA:
+ tls_gd = TLS_TPRELGD;
+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
+ goto tls_gdld_hi;
+ break;
+
+ case R_PPC_GOT_TLSLD16_HI:
+ case R_PPC_GOT_TLSLD16_HA:
+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
+ {
+ tls_gdld_hi:
+ if ((tls_mask & tls_gd) != 0)
+ r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
+ + R_PPC_GOT_TPREL16);
+ else
+ {
+ bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
+ rel->r_offset -= 2;
+ r_type = R_PPC_NONE;
+ }
+ rel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ }
+ break;
+
+ case R_PPC_GOT_TLSGD16:
+ case R_PPC_GOT_TLSGD16_LO:
+ tls_gd = TLS_TPRELGD;
+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
+ goto tls_get_addr_check;
+ break;
+
+ case R_PPC_GOT_TLSLD16:
+ case R_PPC_GOT_TLSLD16_LO:
+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
+ {
+ tls_get_addr_check:
+ if (rel + 1 < relend)
+ {
+ enum elf_ppc_reloc_type r_type2;
+ unsigned long r_symndx2;
+ struct elf_link_hash_entry *h2;
+ bfd_vma insn1, insn2, insn3;
+ bfd_vma offset;
+
+ /* The next instruction should be a call to
+ __tls_get_addr. Peek at the reloc to be sure. */
+ r_type2
+ = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel[1].r_info);
+ r_symndx2 = ELF32_R_SYM (rel[1].r_info);
+ if (r_symndx2 < symtab_hdr->sh_info
+ || (r_type2 != R_PPC_REL14
+ && r_type2 != R_PPC_REL14_BRTAKEN
+ && r_type2 != R_PPC_REL14_BRNTAKEN
+ && r_type2 != R_PPC_REL24
+ && r_type2 != R_PPC_PLTREL24))
+ break;
+
+ h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info];
+ while (h2->root.type == bfd_link_hash_indirect
+ || h2->root.type == bfd_link_hash_warning)
+ h2 = (struct elf_link_hash_entry *) h2->root.u.i.link;
+ if (h2 == NULL || h2 != htab->tls_get_addr)
+ break;
+
+ /* OK, it checks out. Replace the call. */
+ offset = rel[1].r_offset;
+ insn1 = bfd_get_32 (output_bfd,
+ contents + rel->r_offset - 2);
+ insn3 = bfd_get_32 (output_bfd,
+ contents + offset + 4);
+ if ((tls_mask & tls_gd) != 0)
+ {
+ /* IE */
+ insn1 &= (1 << 26) - 1;
+ insn1 |= 32 << 26; /* lwz */
+ insn2 = 0x7c631214; /* add 3,3,2 */
+ rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE);
+ r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
+ + R_PPC_GOT_TPREL16);
+ rel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ }
+ else
+ {
+ /* LE */
+ insn1 = 0x3c620000; /* addis 3,2,0 */
+ insn2 = 0x38630000; /* addi 3,3,0 */
+ if (tls_gd == 0)
+ {
+ /* Was an LD reloc. */
+ r_symndx = 0;
+ rel->r_addend = htab->tls_sec->vma + DTP_OFFSET;
+ rel[1].r_addend = htab->tls_sec->vma + DTP_OFFSET;
+ }
+ r_type = R_PPC_TPREL16_HA;
+ rel->r_info = ELF32_R_INFO (r_symndx, r_type);
+ rel[1].r_info = ELF32_R_INFO (r_symndx,
+ R_PPC_TPREL16_LO);
+ rel[1].r_offset += 2;
+ }
+ if (insn3 == NOP
+ || insn3 == CROR_151515 || insn3 == CROR_313131)
+ {
+ insn3 = insn2;
+ insn2 = NOP;
+ rel[1].r_offset += 4;
+ }
+ bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
+ bfd_put_32 (output_bfd, insn2, contents + offset);
+ bfd_put_32 (output_bfd, insn3, contents + offset + 4);
+ if (tls_gd == 0)
+ {
+ /* We changed the symbol on an LD reloc. Start over
+ in order to get h, sym, sec etc. right. */
+ rel--;
+ continue;
+ }
+ }
+ }
+ break;
+ }
+
+ /* Handle other relocations that tweak non-addend part of insn. */
+ branch_bit = 0;
+ switch (r_type)
+ {
+ default:
+ break;
+
+ /* Branch taken prediction relocations. */
+ case R_PPC_ADDR14_BRTAKEN:
+ case R_PPC_REL14_BRTAKEN:
+ branch_bit = BRANCH_PREDICT_BIT;
+ /* Fall thru */
+
+ /* Branch not taken predicition relocations. */
+ case R_PPC_ADDR14_BRNTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
+ insn &= ~BRANCH_PREDICT_BIT;
+ insn |= branch_bit;
+
+ from = (rel->r_offset
+ + input_section->output_offset
+ + input_section->output_section->vma);
+
+ /* Invert 'y' bit if not the default. */
+ if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0)
+ insn ^= BRANCH_PREDICT_BIT;
+
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
+ break;
+ }
+
+ addend = rel->r_addend;
+ tls_type = 0;
+ howto = NULL;
+ if ((unsigned) r_type < (unsigned) R_PPC_max)
+ howto = ppc_elf_howto_table[(int) r_type];
+ switch (r_type)
+ {
+ default:
+ (*_bfd_error_handler)
+ (_("%s: unknown relocation type %d for symbol %s"),
+ 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:
+ case R_PPC_NONE:
+ case R_PPC_TLS:
+ case R_PPC_EMB_MRKREF:
+ case R_PPC_GNU_VTINHERIT:
+ case R_PPC_GNU_VTENTRY:
continue;
+ /* GOT16 relocations. Like an ADDR16 using the symbol's
+ address in the GOT as relocation value instead of the
+ symbol's value itself. Also, create a GOT entry for the
+ symbol and put the symbol value there. */
+ case R_PPC_GOT_TLSGD16:
+ case R_PPC_GOT_TLSGD16_LO:
+ case R_PPC_GOT_TLSGD16_HI:
+ case R_PPC_GOT_TLSGD16_HA:
+ tls_type = TLS_TLS | TLS_GD;
+ goto dogot;
+
+ case R_PPC_GOT_TLSLD16:
+ case R_PPC_GOT_TLSLD16_LO:
+ case R_PPC_GOT_TLSLD16_HI:
+ case R_PPC_GOT_TLSLD16_HA:
+ tls_type = TLS_TLS | TLS_LD;
+ goto dogot;
+
+ case R_PPC_GOT_TPREL16:
+ case R_PPC_GOT_TPREL16_LO:
+ case R_PPC_GOT_TPREL16_HI:
+ case R_PPC_GOT_TPREL16_HA:
+ tls_type = TLS_TLS | TLS_TPREL;
+ goto dogot;
+
+ case R_PPC_GOT_DTPREL16:
+ case R_PPC_GOT_DTPREL16_LO:
+ case R_PPC_GOT_DTPREL16_HI:
+ case R_PPC_GOT_DTPREL16_HA:
+ tls_type = TLS_TLS | TLS_DTPREL;
+ goto dogot;
+
+ case R_PPC_GOT16:
+ case R_PPC_GOT16_LO:
+ case R_PPC_GOT16_HI:
+ case R_PPC_GOT16_HA:
+ dogot:
+ {
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ bfd_vma off;
+ bfd_vma *offp;
+ unsigned long indx;
+
+ if (htab->got == NULL)
+ abort ();
+
+ indx = 0;
+ if (tls_type == (TLS_TLS | TLS_LD)
+ && (h == NULL
+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
+ offp = &htab->tlsld_got.offset;
+ else if (h != NULL)
+ {
+ bfd_boolean dyn;
+ dyn = htab->elf.dynamic_sections_created;
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && SYMBOL_REFERENCES_LOCAL (info, h)))
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. */
+ ;
+ else
+ {
+ indx = h->dynindx;
+ unresolved_reloc = FALSE;
+ }
+ offp = &h->got.offset;
+ }
+ else
+ {
+ if (local_got_offsets == NULL)
+ abort ();
+ offp = &local_got_offsets[r_symndx];
+ }
+
+ /* The offset must always be a multiple of 4. We use the
+ least significant bit to record whether we have already
+ processed this entry. */
+ off = *offp;
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ unsigned int tls_m = (tls_mask
+ & (TLS_LD | TLS_GD | TLS_DTPREL
+ | TLS_TPREL | TLS_TPRELGD));
+
+ if (offp == &htab->tlsld_got.offset)
+ tls_m = TLS_LD;
+ else if (h == NULL
+ || !(h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC))
+ tls_m &= ~TLS_LD;
+
+ /* We might have multiple got entries for this sym.
+ Initialize them all. */
+ do
+ {
+ int tls_ty = 0;
+
+ if ((tls_m & TLS_LD) != 0)
+ {
+ tls_ty = TLS_TLS | TLS_LD;
+ tls_m &= ~TLS_LD;
+ }
+ else if ((tls_m & TLS_GD) != 0)
+ {
+ tls_ty = TLS_TLS | TLS_GD;
+ tls_m &= ~TLS_GD;
+ }
+ else if ((tls_m & TLS_DTPREL) != 0)
+ {
+ tls_ty = TLS_TLS | TLS_DTPREL;
+ tls_m &= ~TLS_DTPREL;
+ }
+ else if ((tls_m & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ {
+ tls_ty = TLS_TLS | TLS_TPREL;
+ tls_m = 0;
+ }
+
+ /* Generate relocs for the dynamic linker. */
+ if (info->shared || indx != 0)
+ {
+ outrel.r_offset = (htab->got->output_section->vma
+ + htab->got->output_offset
+ + off);
+ if (tls_ty & (TLS_LD | TLS_GD))
+ {
+ outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPMOD32);
+ outrel.r_addend = 0;
+ if (tls_ty == (TLS_TLS | TLS_GD))
+ {
+ loc = htab->relgot->contents;
+ loc += (htab->relgot->reloc_count++
+ * sizeof (Elf32_External_Rela));
+ bfd_elf32_swap_reloca_out (output_bfd,
+ &outrel, loc);
+ outrel.r_info
+ = ELF32_R_INFO (indx, R_PPC_DTPREL32);
+ outrel.r_offset += 4;
+ }
+ }
+ else if (tls_ty == (TLS_TLS | TLS_DTPREL))
+ outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPREL32);
+ else if (tls_ty == (TLS_TLS | TLS_TPREL))
+ outrel.r_info = ELF32_R_INFO (indx, R_PPC_TPREL32);
+ else if (indx == 0)
+ outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE);
+ else
+ outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT);
+ outrel.r_addend = 0;
+ if (indx == 0)
+ outrel.r_addend += relocation;
+ loc = htab->relgot->contents;
+ loc += (htab->relgot->reloc_count++
+ * sizeof (Elf32_External_Rela));
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ }
+
+ /* Init the .got section contents if we're not
+ emitting a reloc. */
+ else
+ {
+ bfd_vma value = relocation;
+
+ if ((tls_ty & (TLS_GD | TLS_TPREL | TLS_DTPREL
+ | TLS_TPRELGD)) != 0)
+ {
+ value -= htab->tls_sec->vma + DTP_OFFSET;
+ if ((tls_ty & TLS_TPREL) != 0)
+ value += DTP_OFFSET - TP_OFFSET;
+ }
+
+ if (tls_ty == (TLS_TLS | TLS_GD))
+ {
+ bfd_put_32 (output_bfd, value,
+ htab->got->contents + off + 4);
+ value = 1;
+ }
+ else if (tls_ty == (TLS_TLS | TLS_LD))
+ value = 1;
+ bfd_put_32 (output_bfd, value,
+ htab->got->contents + off);
+ }
+
+ off += 4;
+ if (tls_ty & (TLS_LD | TLS_GD))
+ off += 4;
+ }
+ while (tls_m != 0);
+
+ off = *offp;
+ *offp = off | 1;
+ }
+
+ if (off >= (bfd_vma) -2)
+ abort ();
+
+ if ((tls_type & TLS_TLS) != 0)
+ {
+ if (tls_type != (TLS_TLS | TLS_LD))
+ {
+ if ((tls_mask & TLS_LD) != 0
+ && !(h == NULL
+ || !(h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC)))
+ off += 8;
+ if (tls_type != (TLS_TLS | TLS_GD))
+ {
+ if ((tls_mask & TLS_GD) != 0)
+ off += 8;
+ if (tls_type != (TLS_TLS | TLS_DTPREL))
+ {
+ if ((tls_mask & TLS_DTPREL) != 0)
+ off += 4;
+ }
+ }
+ }
+ }
+
+ relocation = htab->got->output_offset + off - 4;
+
+ /* Addends on got relocations don't make much sense.
+ x+off@got is actually x@got+off, and since the got is
+ generated by a hash table traversal, the value in the
+ got at entry m+n bears little relation to the entry m. */
+ if (addend != 0)
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): non-zero addend on got reloc against `%s'"),
+ bfd_archive_filename (input_bfd),
+ bfd_get_section_name (input_bfd, input_section),
+ (long) rel->r_offset,
+ sym_name);
+ }
+ break;
+
/* Relocations that need no special processing. */
- case (int) R_PPC_LOCAL24PC:
+ case R_PPC_LOCAL24PC:
/* It makes no sense to point a local relocation
at a symbol not in this object. */
if (h != NULL
@@ -3449,45 +4915,95 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
break;
- /* Relocations that may need to be propagated if this is a shared
- object. */
- case (int) R_PPC_REL24:
- case (int) R_PPC_REL32:
- case (int) R_PPC_REL14:
+ case R_PPC_DTPREL16:
+ case R_PPC_DTPREL16_LO:
+ case R_PPC_DTPREL16_HI:
+ case R_PPC_DTPREL16_HA:
+ addend -= htab->tls_sec->vma + DTP_OFFSET;
+ break;
+
+ /* Relocations that may need to be propagated if this is a shared
+ object. */
+ case R_PPC_TPREL16:
+ case R_PPC_TPREL16_LO:
+ case R_PPC_TPREL16_HI:
+ case R_PPC_TPREL16_HA:
+ addend -= htab->tls_sec->vma + TP_OFFSET;
+ /* The TPREL16 relocs shouldn't really be used in shared
+ libs as they will result in DT_TEXTREL being set, but
+ support them anyway. */
+ goto dodyn;
+
+ case R_PPC_TPREL32:
+ addend -= htab->tls_sec->vma + TP_OFFSET;
+ goto dodyn;
+
+ case R_PPC_DTPREL32:
+ addend -= htab->tls_sec->vma + DTP_OFFSET;
+ goto dodyn;
+
+ case R_PPC_REL24:
+ case R_PPC_REL32:
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
/* If these relocations are not to a named symbol, they can be
handled right here, no need to bother the dynamic linker. */
if (h == NULL
|| strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
|| SYMBOL_REFERENCES_LOCAL (info, h))
break;
- /* fall through */
-
- /* Relocations that always need to be propagated if this is a shared
- object. */
- case (int) R_PPC_ADDR32:
- case (int) R_PPC_ADDR24:
- case (int) R_PPC_ADDR16:
- case (int) R_PPC_ADDR16_LO:
- case (int) R_PPC_ADDR16_HI:
- case (int) R_PPC_ADDR16_HA:
- case (int) R_PPC_ADDR14:
- case (int) R_PPC_UADDR32:
- case (int) R_PPC_UADDR16:
- if (info->shared && r_symndx != 0)
+ /* fall through */
+
+ /* Relocations that always need to be propagated if this is a shared
+ object. */
+ case R_PPC_ADDR32:
+ case R_PPC_ADDR24:
+ case R_PPC_ADDR16:
+ case R_PPC_ADDR16_LO:
+ case R_PPC_ADDR16_HI:
+ case R_PPC_ADDR16_HA:
+ case R_PPC_ADDR14:
+ case R_PPC_ADDR14_BRTAKEN:
+ case R_PPC_ADDR14_BRNTAKEN:
+ case R_PPC_UADDR32:
+ case R_PPC_UADDR16:
+ case R_PPC_DTPMOD32:
+ /* r_symndx will be zero only for relocs against symbols
+ from removed linkonce sections, or sections discarded by
+ a linker script. */
+ dodyn:
+ if (r_symndx == 0)
+ break;
+ /* Fall thru. */
+
+ if ((info->shared
+ && (MUST_BE_DYN_RELOC (r_type)
+ || (h != NULL
+ && h->dynindx != -1
+ && (!info->symbolic
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
+ && (input_section->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && h->dynindx != -1
+ && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
{
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
int skip;
#ifdef DEBUG
fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n",
- (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+ (h && h->root.root.string
+ ? h->root.root.string : "<unknown>"));
#endif
/* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
-
+ are copied into the output file to be resolved at run
+ time. */
if (sreloc == NULL)
{
const char *name;
@@ -3504,7 +5020,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
input_section),
name + 5) == 0);
- sreloc = bfd_get_section_by_name (dynobj, name);
+ sreloc = bfd_get_section_by_name (htab->elf.dynobj, name);
BFD_ASSERT (sreloc != NULL);
}
@@ -3522,9 +5038,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (skip)
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if this symbol was marked to
- become local. */
- else if (! will_become_local)
+ become local. */
+ else if (h != NULL
+ && !SYMBOL_REFERENCES_LOCAL (info, h))
{
+ unresolved_reloc = FALSE;
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
outrel.r_addend = rel->r_addend;
}
@@ -3538,16 +5056,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
long indx;
- if (h == NULL)
- sec = local_sections[r_symndx];
- else
- {
- BFD_ASSERT (h->root.type == bfd_link_hash_defined
- || (h->root.type
- == bfd_link_hash_defweak));
- sec = h->root.u.def.section;
- }
-
if (bfd_is_abs_section (sec))
indx = 0;
else if (sec == NULL || sec->owner == NULL)
@@ -3571,8 +5079,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (indx <= 0)
{
printf ("indx=%d section=%s flags=%08x name=%s\n",
- indx, osec->name, osec->flags,
- h->root.root.string);
+ indx, osec->name, osec->flags,
+ h->root.root.string);
}
#endif
}
@@ -3599,186 +5107,66 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
}
-
- /* Arithmetic adjust relocations that aren't going into a
- shared object. */
- if (r_type == R_PPC_ADDR16_HA
- /* It's just possible that this symbol is a weak symbol
- that's not actually defined anywhere. In that case,
- 'sec' would be NULL, and we should leave the symbol
- alone (it will be set to zero elsewhere in the link). */
- && sec != NULL)
- {
- addend += ((relocation + addend) & 0x8000) << 1;
- }
- break;
-
- /* branch taken prediction relocations */
- case (int) R_PPC_ADDR14_BRTAKEN:
- case (int) R_PPC_REL14_BRTAKEN:
- insn = bfd_get_32 (output_bfd, contents + offset);
- if ((relocation - offset) & 0x8000)
- insn &= ~BRANCH_PREDICT_BIT;
- else
- insn |= BRANCH_PREDICT_BIT;
- bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
- break;
-
- /* branch not taken predicition relocations */
- case (int) R_PPC_ADDR14_BRNTAKEN:
- case (int) R_PPC_REL14_BRNTAKEN:
- insn = bfd_get_32 (output_bfd, contents + offset);
- if ((relocation - offset) & 0x8000)
- insn |= BRANCH_PREDICT_BIT;
- else
- insn &= ~BRANCH_PREDICT_BIT;
- bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
- break;
-
- /* GOT16 relocations */
- case (int) R_PPC_GOT16:
- case (int) R_PPC_GOT16_LO:
- case (int) R_PPC_GOT16_HI:
- case (int) R_PPC_GOT16_HA:
- /* Relocation is to the entry for this symbol in the global
- offset table. */
- BFD_ASSERT (sgot != NULL);
-
- if (h != NULL)
- {
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- if (! elf_hash_table (info)->dynamic_sections_created
- || (info->shared
- && SYMBOL_REFERENCES_LOCAL (info, h)))
- {
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally. We must initialize this entry in the
- global offset table. Since the offset must
- always be a multiple of 4, we use the least
- significant bit to record whether we have
- initialized it already.
-
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- bfd_put_32 (output_bfd, relocation,
- sgot->contents + off);
- h->got.offset |= 1;
- }
- }
-
- relocation = sgot->output_offset + off - 4;
- }
- else
- {
- bfd_vma off;
-
- BFD_ASSERT (local_got_offsets != NULL
- && local_got_offsets[r_symndx] != (bfd_vma) -1);
-
- off = local_got_offsets[r_symndx];
-
- /* The offset must always be a multiple of 4. We use
- the least significant bit to record whether we have
- already processed this entry. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
-
- if (info->shared)
- {
- asection *srelgot;
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
-
- /* We need to generate a R_PPC_RELATIVE reloc
- for the dynamic linker. */
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- BFD_ASSERT (srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + off);
- outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
- outrel.r_addend = relocation;
- loc = srelgot->contents;
- loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
- relocation = 0;
- }
-
- bfd_put_32 (output_bfd, relocation, sgot->contents + off);
- local_got_offsets[r_symndx] |= 1;
- }
-
- relocation = sgot->output_offset + off - 4;
- }
- if (r_type == R_PPC_GOT16_HA)
- addend += ((relocation + addend) & 0x8000) << 1;
break;
- /* Indirect .sdata relocation */
- case (int) R_PPC_EMB_SDAI16:
- BFD_ASSERT (sdata != NULL);
- relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
- sdata, h, relocation, rel,
- R_PPC_RELATIVE);
+ /* Indirect .sdata relocation. */
+ case R_PPC_EMB_SDAI16:
+ BFD_ASSERT (htab->sdata != NULL);
+ relocation
+ = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd,
+ info, htab->sdata, h,
+ relocation, rel,
+ R_PPC_RELATIVE);
break;
- /* Indirect .sdata2 relocation */
- case (int) R_PPC_EMB_SDA2I16:
- BFD_ASSERT (sdata2 != NULL);
- relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
- sdata2, h, relocation, rel,
- R_PPC_RELATIVE);
+ /* Indirect .sdata2 relocation. */
+ case R_PPC_EMB_SDA2I16:
+ BFD_ASSERT (htab->sdata2 != NULL);
+ relocation
+ = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd,
+ info, htab->sdata2, h,
+ relocation, rel,
+ R_PPC_RELATIVE);
break;
- /* Handle the TOC16 reloc. We want to use the offset within the .got
- section, not the actual VMA. This is appropriate when generating
- an embedded ELF object, for which the .got section acts like the
- AIX .toc section. */
- case (int) R_PPC_TOC16: /* phony GOT16 relocations */
+ /* Handle the TOC16 reloc. We want to use the offset within the .got
+ section, not the actual VMA. This is appropriate when generating
+ an embedded ELF object, for which the .got section acts like the
+ AIX .toc section. */
+ case R_PPC_TOC16: /* phony GOT16 relocations */
BFD_ASSERT (sec != (asection *) 0);
BFD_ASSERT (bfd_is_und_section (sec)
|| strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
|| strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0)
- addend -= sec->output_section->vma + sec->output_offset + 0x8000;
+ addend -= sec->output_section->vma + sec->output_offset + 0x8000;
break;
- case (int) R_PPC_PLTREL24:
+ case R_PPC_PLTREL24:
/* Relocation is to the entry for this symbol in the
- procedure linkage table. */
+ procedure linkage table. */
BFD_ASSERT (h != NULL);
if (h->plt.offset == (bfd_vma) -1
- || splt == NULL)
+ || htab->plt == NULL)
{
/* We didn't make a PLT entry for this symbol. This
- happens when statically linking PIC code, or when
- using -Bsymbolic. */
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
break;
}
- relocation = (splt->output_section->vma
- + splt->output_offset
+ unresolved_reloc = FALSE;
+ relocation = (htab->plt->output_section->vma
+ + htab->plt->output_offset
+ h->plt.offset);
break;
- /* relocate against _SDA_BASE_ */
- case (int) R_PPC_SDAREL16:
+ /* Relocate against _SDA_BASE_. */
+ case R_PPC_SDAREL16:
{
const char *name;
+ const struct elf_link_hash_entry *sh;
BFD_ASSERT (sec != (asection *) 0);
name = bfd_get_section_name (abfd, sec->output_section);
@@ -3790,19 +5178,21 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
- ppc_elf_howto_table[(int) r_type]->name,
+ howto->name,
name);
}
- addend -= (sdata->sym_hash->root.u.def.value
- + sdata->sym_hash->root.u.def.section->output_section->vma
- + sdata->sym_hash->root.u.def.section->output_offset);
+ sh = htab->sdata->sym_hash;
+ addend -= (sh->root.u.def.value
+ + sh->root.u.def.section->output_section->vma
+ + sh->root.u.def.section->output_offset);
}
break;
- /* relocate against _SDA2_BASE_ */
- case (int) R_PPC_EMB_SDA2REL:
+ /* Relocate against _SDA2_BASE_. */
+ case R_PPC_EMB_SDA2REL:
{
const char *name;
+ const struct elf_link_hash_entry *sh;
BFD_ASSERT (sec != (asection *) 0);
name = bfd_get_section_name (abfd, sec->output_section);
@@ -3812,24 +5202,26 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
- ppc_elf_howto_table[(int) r_type]->name,
+ howto->name,
name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
continue;
}
- addend -= (sdata2->sym_hash->root.u.def.value
- + sdata2->sym_hash->root.u.def.section->output_section->vma
- + sdata2->sym_hash->root.u.def.section->output_offset);
+ sh = htab->sdata2->sym_hash;
+ addend -= (sh->root.u.def.value
+ + sh->root.u.def.section->output_section->vma
+ + sh->root.u.def.section->output_offset);
}
break;
- /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */
- case (int) R_PPC_EMB_SDA21:
- case (int) R_PPC_EMB_RELSDA:
+ /* Relocate against either _SDA_BASE_, _SDA2_BASE_, or 0. */
+ case R_PPC_EMB_SDA21:
+ case R_PPC_EMB_RELSDA:
{
const char *name;
+ const struct elf_link_hash_entry *sh;
int reg;
BFD_ASSERT (sec != (asection *) 0);
@@ -3840,18 +5232,20 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& (name[5] == 0 || name[5] == '.'))))
{
reg = 13;
- addend -= (sdata->sym_hash->root.u.def.value
- + sdata->sym_hash->root.u.def.section->output_section->vma
- + sdata->sym_hash->root.u.def.section->output_offset);
+ sh = htab->sdata->sym_hash;
+ addend -= (sh->root.u.def.value
+ + sh->root.u.def.section->output_section->vma
+ + sh->root.u.def.section->output_offset);
}
else if (strncmp (name, ".sdata2", 7) == 0
|| strncmp (name, ".sbss2", 6) == 0)
{
reg = 2;
- addend -= (sdata2->sym_hash->root.u.def.value
- + sdata2->sym_hash->root.u.def.section->output_section->vma
- + sdata2->sym_hash->root.u.def.section->output_offset);
+ sh = htab->sdata2->sym_hash;
+ addend -= (sh->root.u.def.value
+ + sh->root.u.def.section->output_section->vma
+ + sh->root.u.def.section->output_offset);
}
else if (strcmp (name, ".PPC.EMB.sdata0") == 0
@@ -3865,7 +5259,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
bfd_archive_filename (input_bfd),
sym_name,
- ppc_elf_howto_table[(int) r_type]->name,
+ howto->name,
name);
bfd_set_error (bfd_error_bad_value);
@@ -3875,72 +5269,83 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_type == R_PPC_EMB_SDA21)
{ /* fill in register field */
- insn = bfd_get_32 (output_bfd, contents + offset);
+ insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
- bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
}
}
break;
- /* Relocate against the beginning of the section */
- case (int) R_PPC_SECTOFF:
- case (int) R_PPC_SECTOFF_LO:
- case (int) R_PPC_SECTOFF_HI:
- BFD_ASSERT (sec != (asection *) 0);
- addend -= sec->output_section->vma;
- break;
-
- case (int) R_PPC_SECTOFF_HA:
+ /* Relocate against the beginning of the section. */
+ case R_PPC_SECTOFF:
+ case R_PPC_SECTOFF_LO:
+ case R_PPC_SECTOFF_HI:
+ case R_PPC_SECTOFF_HA:
BFD_ASSERT (sec != (asection *) 0);
addend -= sec->output_section->vma;
- addend += ((relocation + addend) & 0x8000) << 1;
break;
- /* Negative relocations */
- case (int) R_PPC_EMB_NADDR32:
- case (int) R_PPC_EMB_NADDR16:
- case (int) R_PPC_EMB_NADDR16_LO:
- case (int) R_PPC_EMB_NADDR16_HI:
+ /* Negative relocations. */
+ case R_PPC_EMB_NADDR32:
+ case R_PPC_EMB_NADDR16:
+ case R_PPC_EMB_NADDR16_LO:
+ case R_PPC_EMB_NADDR16_HI:
+ case R_PPC_EMB_NADDR16_HA:
addend -= 2 * relocation;
break;
- case (int) R_PPC_EMB_NADDR16_HA:
- addend -= 2 * relocation;
- addend += ((relocation + addend) & 0x8000) << 1;
- break;
-
- /* NOP relocation that prevents garbage collecting linkers from omitting a
- reference. */
- case (int) R_PPC_EMB_MRKREF:
- continue;
-
- case (int) R_PPC_COPY:
- case (int) R_PPC_GLOB_DAT:
- case (int) R_PPC_JMP_SLOT:
- case (int) R_PPC_RELATIVE:
- case (int) R_PPC_PLT32:
- case (int) R_PPC_PLTREL32:
- case (int) R_PPC_PLT16_LO:
- case (int) R_PPC_PLT16_HI:
- case (int) R_PPC_PLT16_HA:
- case (int) R_PPC_EMB_RELSEC16:
- case (int) R_PPC_EMB_RELST_LO:
- case (int) R_PPC_EMB_RELST_HI:
- 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_archive_filename (input_bfd),
- ppc_elf_howto_table[(int) r_type]->name,
- sym_name);
+ case R_PPC_COPY:
+ case R_PPC_GLOB_DAT:
+ case R_PPC_JMP_SLOT:
+ case R_PPC_RELATIVE:
+ case R_PPC_PLT32:
+ case R_PPC_PLTREL32:
+ case R_PPC_PLT16_LO:
+ case R_PPC_PLT16_HI:
+ case R_PPC_PLT16_HA:
+ case R_PPC_ADDR30:
+ case R_PPC_EMB_RELSEC16:
+ case R_PPC_EMB_RELST_LO:
+ case R_PPC_EMB_RELST_HI:
+ case R_PPC_EMB_RELST_HA:
+ case R_PPC_EMB_BIT_FLD:
+ (*_bfd_error_handler)
+ (_("%s: Relocation %s is not yet supported for symbol %s."),
+ bfd_archive_filename (input_bfd),
+ howto->name,
+ sym_name);
bfd_set_error (bfd_error_invalid_operation);
ret = FALSE;
continue;
+ }
- case (int) R_PPC_GNU_VTINHERIT:
- case (int) R_PPC_GNU_VTENTRY:
- /* These are no-ops in the end. */
- continue;
+ /* Do any further special processing. */
+ switch (r_type)
+ {
+ default:
+ break;
+
+ case R_PPC_ADDR16_HA:
+ case R_PPC_GOT16_HA:
+ case R_PPC_PLT16_HA:
+ case R_PPC_SECTOFF_HA:
+ case R_PPC_TPREL16_HA:
+ case R_PPC_DTPREL16_HA:
+ case R_PPC_GOT_TLSGD16_HA:
+ case R_PPC_GOT_TLSLD16_HA:
+ case R_PPC_GOT_TPREL16_HA:
+ case R_PPC_GOT_DTPREL16_HA:
+ case R_PPC_EMB_NADDR16_HA:
+ case R_PPC_EMB_RELST_HA:
+ /* It's just possible that this symbol is a weak symbol
+ that's not actually defined anywhere. In that case,
+ 'sec' would be NULL, and we should leave the symbol
+ alone (it will be set to zero elsewhere in the link). */
+ if (sec != NULL)
+ /* Add 0x10000 if sign bit in 0:15 is set. */
+ addend += ((relocation + addend) & 0x8000) << 1;
+ break;
}
#ifdef DEBUG
@@ -3949,27 +5354,41 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(int) r_type,
sym_name,
r_symndx,
- (long) offset,
+ (long) rel->r_offset,
(long) addend);
#endif
+ if (unresolved_reloc
+ && !((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+ {
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
+ bfd_archive_filename (input_bfd),
+ bfd_get_section_name (input_bfd, input_section),
+ (long) rel->r_offset,
+ sym_name);
+ ret = FALSE;
+ }
+
r = _bfd_final_link_relocate (howto,
input_bfd,
input_section,
contents,
- offset,
+ rel->r_offset,
relocation,
addend);
- if (r == bfd_reloc_ok)
- ;
- else if (r == bfd_reloc_overflow)
+ if (r != bfd_reloc_ok)
{
- const char *name;
-
- if (h != NULL)
+ if (sym_name == NULL)
+ sym_name = "(null)";
+ if (r == bfd_reloc_overflow)
{
- if (h->root.type == bfd_link_hash_undefweak
+ if (warned)
+ continue;
+ if (h != NULL
+ && h->root.type == bfd_link_hash_undefweak
&& howto->pc_relative)
{
/* Assume this is a call protected by other code that
@@ -3981,30 +5400,25 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
continue;
}
- name = h->root.root.string;
+ if (! (*info->callbacks->reloc_overflow) (info,
+ sym_name,
+ howto->name,
+ rel->r_addend,
+ input_bfd,
+ input_section,
+ rel->r_offset))
+ return FALSE;
}
else
{
- name = bfd_elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
- if (name == NULL)
- continue;
- if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): reloc against `%s': error %d"),
+ bfd_archive_filename (input_bfd),
+ bfd_get_section_name (input_bfd, input_section),
+ (long) rel->r_offset, sym_name, (int) r);
+ ret = FALSE;
}
-
- if (! (*info->callbacks->reloc_overflow) (info,
- name,
- howto->name,
- (bfd_vma) 0,
- input_bfd,
- input_section,
- offset))
- return FALSE;
}
- else
- ret = FALSE;
}
#ifdef DEBUG
@@ -4033,7 +5447,8 @@ ppc_elf_reloc_type_class (rela)
}
}
-/* Support for core dump NOTE sections */
+/* Support for core dump NOTE sections. */
+
static bfd_boolean
ppc_elf_grok_prstatus (abfd, note)
bfd *abfd;
@@ -4044,21 +5459,21 @@ ppc_elf_grok_prstatus (abfd, note)
switch (note->descsz)
{
- default:
- return FALSE;
+ default:
+ return FALSE;
- case 268: /* Linux/PPC */
- /* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ 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_pid */
+ elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
- /* pr_reg */
- offset = 72;
- raw_size = 192;
+ /* pr_reg */
+ offset = 72;
+ raw_size = 192;
- break;
+ break;
}
/* Make a ".reg/999" section. */
@@ -4073,14 +5488,14 @@ ppc_elf_grok_psinfo (abfd, note)
{
switch (note->descsz)
{
- default:
- return FALSE;
+ 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);
+ 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
@@ -4101,28 +5516,27 @@ ppc_elf_grok_psinfo (abfd, note)
/* Very simple linked list structure for recording apuinfo values. */
typedef struct apuinfo_list
{
- struct apuinfo_list * next;
- unsigned long value;
+ struct apuinfo_list *next;
+ unsigned long value;
}
apuinfo_list;
static apuinfo_list * head;
-static void apuinfo_list_init PARAMS ((void));
-static void apuinfo_list_add PARAMS ((unsigned long));
-static unsigned apuinfo_list_length PARAMS ((void));
+static void apuinfo_list_init PARAMS ((void));
+static void apuinfo_list_add PARAMS ((unsigned long));
+static unsigned apuinfo_list_length PARAMS ((void));
static unsigned long apuinfo_list_element PARAMS ((unsigned long));
-static void apuinfo_list_finish PARAMS ((void));
+static void apuinfo_list_finish PARAMS ((void));
-extern void ppc_elf_begin_write_processing
+extern void ppc_elf_begin_write_processing
PARAMS ((bfd *, struct bfd_link_info *));
-extern void ppc_elf_final_write_processing
+extern void ppc_elf_final_write_processing
PARAMS ((bfd *, bfd_boolean));
-extern bfd_boolean ppc_elf_write_section
+extern bfd_boolean ppc_elf_write_section
PARAMS ((bfd *, asection *, bfd_byte *));
-
static void
apuinfo_list_init PARAMS ((void))
{
@@ -4133,7 +5547,7 @@ static void
apuinfo_list_add (value)
unsigned long value;
{
- apuinfo_list * entry = head;
+ apuinfo_list *entry = head;
while (entry != NULL)
{
@@ -4154,7 +5568,7 @@ apuinfo_list_add (value)
static unsigned
apuinfo_list_length PARAMS ((void))
{
- apuinfo_list * entry;
+ apuinfo_list *entry;
unsigned long count;
for (entry = head, count = 0;
@@ -4182,11 +5596,11 @@ apuinfo_list_element (number)
static void
apuinfo_list_finish PARAMS ((void))
{
- apuinfo_list * entry;
+ apuinfo_list *entry;
for (entry = head; entry;)
{
- apuinfo_list * next = entry->next;
+ apuinfo_list *next = entry->next;
free (entry);
entry = next;
}
@@ -4194,8 +5608,8 @@ apuinfo_list_finish PARAMS ((void))
head = NULL;
}
-#define APUINFO_SECTION_NAME ".PPC.EMB.apuinfo"
-#define APUINFO_LABEL "APUinfo"
+#define APUINFO_SECTION_NAME ".PPC.EMB.apuinfo"
+#define APUINFO_LABEL "APUinfo"
/* Scan the input BFDs and create a linked list of
the APUinfo values that will need to be emitted. */
@@ -4205,16 +5619,16 @@ ppc_elf_begin_write_processing (abfd, link_info)
bfd *abfd;
struct bfd_link_info *link_info;
{
- bfd * ibfd;
- asection * asec;
- char * buffer;
- unsigned num_input_sections;
+ bfd *ibfd;
+ asection *asec;
+ char *buffer;
+ unsigned num_input_sections;
bfd_size_type output_section_size;
- unsigned i;
- unsigned num_entries;
+ unsigned i;
+ unsigned num_entries;
unsigned long offset;
unsigned long length;
- const char * error_message = NULL;
+ const char *error_message = NULL;
if (link_info == NULL)
return;
@@ -4254,9 +5668,8 @@ ppc_elf_begin_write_processing (abfd, link_info)
/* Read in the input sections contents. */
for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next)
{
- unsigned long datum;
- char * ptr;
-
+ unsigned long datum;
+ char *ptr;
asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME);
if (asec == NULL)
@@ -4319,7 +5732,7 @@ ppc_elf_begin_write_processing (abfd, link_info)
asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
- if (! bfd_set_section_size (abfd, asec, output_section_size))
+ if (! bfd_set_section_size (abfd, asec, output_section_size))
ibfd = abfd,
error_message = _("warning: unable to set size of %s section in %s");
@@ -4327,8 +5740,8 @@ ppc_elf_begin_write_processing (abfd, link_info)
free (buffer);
if (error_message)
- _bfd_error_handler (error_message, APUINFO_SECTION_NAME,
- bfd_archive_filename (ibfd));
+ (*_bfd_error_handler) (error_message, APUINFO_SECTION_NAME,
+ bfd_archive_filename (ibfd));
}
@@ -4337,11 +5750,12 @@ ppc_elf_begin_write_processing (abfd, link_info)
bfd_boolean
ppc_elf_write_section (abfd, asec, contents)
- bfd * abfd ATTRIBUTE_UNUSED;
- asection * asec;
- bfd_byte * contents ATTRIBUTE_UNUSED;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *asec;
+ bfd_byte *contents ATTRIBUTE_UNUSED;
{
- return apuinfo_list_length () && strcmp (asec->name, APUINFO_SECTION_NAME) == 0;
+ return (apuinfo_list_length ()
+ && strcmp (asec->name, APUINFO_SECTION_NAME) == 0);
}
@@ -4349,13 +5763,13 @@ ppc_elf_write_section (abfd, asec, contents)
void
ppc_elf_final_write_processing (abfd, linker)
- bfd * abfd;
+ bfd *abfd;
bfd_boolean linker ATTRIBUTE_UNUSED;
{
- bfd_byte * buffer;
- asection * asec;
- unsigned i;
- unsigned num_entries;
+ bfd_byte *buffer;
+ asection *asec;
+ unsigned i;
+ unsigned num_entries;
bfd_size_type length;
asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
@@ -4372,7 +5786,8 @@ ppc_elf_final_write_processing (abfd, linker)
buffer = bfd_malloc (length);
if (buffer == NULL)
{
- _bfd_error_handler (_("failed to allocate space for new APUinfo section."));
+ (*_bfd_error_handler)
+ (_("failed to allocate space for new APUinfo section."));
return;
}
@@ -4391,10 +5806,10 @@ ppc_elf_final_write_processing (abfd, linker)
}
if (length != asec->_raw_size)
- _bfd_error_handler (_("failed to compute new APUinfo section."));
+ (*_bfd_error_handler) (_("failed to compute new APUinfo section."));
if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length))
- _bfd_error_handler (_("failed to install new APUinfo section."));
+ (*_bfd_error_handler) (_("failed to install new APUinfo section."));
free (buffer);
@@ -4427,11 +5842,10 @@ ppc_elf_final_write_processing (abfd, linker)
#define elf_backend_rela_normal 1
#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_relax_section ppc_elf_relax_section
#define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup
#define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags
-#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link
-#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create
#define elf_backend_object_p ppc_elf_object_p
#define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook
@@ -4452,8 +5866,8 @@ ppc_elf_final_write_processing (abfd, linker)
#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
-#define elf_backend_begin_write_processing ppc_elf_begin_write_processing
-#define elf_backend_final_write_processing ppc_elf_final_write_processing
-#define elf_backend_write_section ppc_elf_write_section
+#define elf_backend_begin_write_processing ppc_elf_begin_write_processing
+#define elf_backend_final_write_processing ppc_elf_final_write_processing
+#define elf_backend_write_section ppc_elf_write_section
#include "elf32-target.h"
diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h
new file mode 100644
index 0000000000..ead9c944d6
--- /dev/null
+++ b/bfd/elf32-ppc.h
@@ -0,0 +1,23 @@
+/* PowerPC-specific support for 64-bit ELF.
+ Copyright 2003 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. */
+
+bfd_boolean ppc_elf_tls_setup
+ PARAMS ((bfd *, struct bfd_link_info *));
+bfd_boolean ppc_elf_tls_optimize
+ PARAMS ((bfd *, struct bfd_link_info *));
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index e8d94afd1c..857b7a068b 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1,5 +1,5 @@
/* IBM S/390-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
@@ -351,7 +351,7 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst)
/* A relocation function which doesn't do anything. */
static bfd_reloc_status_type
s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
+ output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -935,7 +935,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
&& local_got_refcounts == NULL)
{
bfd_size_type size;
-
+
size = symtab_hdr->sh_info;
size *= (sizeof (bfd_signed_vma) + sizeof(char));
local_got_refcounts = ((bfd_signed_vma *)
@@ -969,20 +969,20 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* Got is created, nothing to be done. */
break;
- case R_390_PLT16DBL:
- case R_390_PLT32DBL:
+ case R_390_PLT16DBL:
+ case R_390_PLT32DBL:
case R_390_PLT32:
case R_390_PLTOFF16:
case R_390_PLTOFF32:
/* This symbol requires a procedure linkage table entry. We
- actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code which is
- never referenced by a dynamic object, in which case we
- don't need to generate a procedure linkage table entry
- after all. */
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
/* If this is a local symbol, we resolve it directly without
- creating a procedure linkage table entry. */
+ creating a procedure linkage table entry. */
if (h != NULL)
{
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
@@ -1022,10 +1022,10 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
case R_390_TLS_IEENT:
if (info->shared)
info->flags |= DF_STATIC_TLS;
- /* Fall through */
+ /* Fall through. */
case R_390_GOT12:
- case R_390_GOT16:
+ case R_390_GOT16:
case R_390_GOT32:
case R_390_GOTENT:
case R_390_TLS_GD32:
@@ -1087,19 +1087,19 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (r_type != R_390_TLS_IE32)
break;
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_LE32:
if (!info->shared)
break;
info->flags |= DF_STATIC_TLS;
- /* Fall through */
+ /* Fall through. */
- case R_390_8:
- case R_390_16:
+ case R_390_8:
+ case R_390_16:
case R_390_32:
- case R_390_PC16:
- case R_390_PC16DBL:
+ case R_390_PC16:
+ case R_390_PC16DBL:
case R_390_PC32DBL:
case R_390_PC32:
if (h != NULL && !info->shared)
@@ -1216,8 +1216,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* Track dynamic relocs needed for local syms too.
We really need local syms available to do this
easily. Oh well. */
-
asection *s;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
@@ -1231,6 +1231,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (p == NULL || p->sec != sec)
{
bfd_size_type amt = sizeof *p;
+
p = ((struct elf_s390_dyn_relocs *)
bfd_alloc (htab->elf.dynobj, amt));
if (p == NULL)
@@ -1253,17 +1254,17 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
- case R_390_GNU_VTINHERIT:
- if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
+ case R_390_GNU_VTINHERIT:
+ if (!_bfd_elf32_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_390_GNU_VTENTRY:
- if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_390_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
default:
break;
@@ -1326,9 +1327,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- int r_type;
- struct elf_link_hash_entry *h;
elf_section_data (sec)->local_dynrel = NULL;
@@ -1339,16 +1337,31 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
{
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
+
r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf_s390_link_hash_entry *eh;
+ struct elf_s390_dyn_relocs **pp;
+ struct elf_s390_dyn_relocs *p;
- if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
- else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf_s390_link_hash_entry *) h;
- r_type = elf_s390_tls_transition (info,
- ELF32_R_TYPE (rel->r_info),
- r_symndx >= symtab_hdr->sh_info);
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
+ r_type = ELF32_R_TYPE (rel->r_info);
+ r_type = elf_s390_tls_transition (info, r_type, h != NULL);
switch (r_type)
{
case R_390_TLS_LDM32:
@@ -1379,14 +1392,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
if (local_got_refcounts[r_symndx] > 0)
local_got_refcounts[r_symndx] -= 1;
}
- if (r_type != R_390_TLS_IE32)
- break;
- /* Fall through */
-
- case R_390_TLS_LE32:
- if (!info->shared)
- break;
- /* Fall through */
+ break;
case R_390_8:
case R_390_12:
@@ -1396,33 +1402,10 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
case R_390_PC16DBL:
case R_390_PC32DBL:
case R_390_PC32:
- if (h != NULL)
- {
- struct elf_s390_link_hash_entry *eh;
- struct elf_s390_dyn_relocs **pp;
- struct elf_s390_dyn_relocs *p;
-
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
-
- eh = (struct elf_s390_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (ELF32_R_TYPE (rel->r_info) == R_390_PC16
- || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL
- || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL
- || ELF32_R_TYPE (rel->r_info) == R_390_PC32)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
-
+ if (info->shared)
+ break;
+ /* Fall through. */
+
case R_390_PLT16DBL:
case R_390_PLT32DBL:
case R_390_PLT32:
@@ -1516,8 +1499,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
&& h->root.type != bfd_link_hash_undefined))
{
/* This case can occur if we saw a PLT32 reloc in an input
- file, but the symbol was never referred to by a dynamic
- object, or if all references were garbage collected. In
+ file, but the symbol was never referred to by a dynamic
+ object, or if all references were garbage collected. In
such a case, we don't actually need to build a procedure
linkage table, and we can just do a PC32 reloc instead. */
h->plt.offset = (bfd_vma) -1;
@@ -1847,6 +1830,7 @@ allocate_dynrelocs (h, inf)
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
+
sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
}
@@ -2014,7 +1998,7 @@ elf_s390_size_dynamic_sections (output_bfd, info)
}
else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
{
- if (s->_raw_size != 0 && s != htab->srelplt)
+ if (s->_raw_size != 0)
relocs = TRUE;
/* We use the reloc_count field as a counter if we need
@@ -2079,10 +2063,10 @@ elf_s390_size_dynamic_sections (output_bfd, info)
}
if (relocs)
- {
- if (!add_dynamic_entry (DT_RELA, 0)
- || !add_dynamic_entry (DT_RELASZ, 0)
- || !add_dynamic_entry (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 any dynamic relocs apply to a read-only section,
@@ -2202,8 +2186,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == (int) R_390_GNU_VTINHERIT
- || r_type == (int) R_390_GNU_VTENTRY)
- continue;
+ || r_type == (int) R_390_GNU_VTENTRY)
+ continue;
if (r_type >= (int) R_390_max)
{
bfd_set_error (bfd_error_bad_value);
@@ -2252,7 +2236,6 @@ elf_s390_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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
@@ -2260,7 +2243,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
+ input_section, rel->r_offset,
(!info->shared || info->no_undefined
|| ELF_ST_VISIBILITY (h->other)))))
return FALSE;
@@ -2291,7 +2274,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) /
PLT_ENTRY_SIZE;
-
+
/* Offset in GOT is PLT index plus GOT headers(3) times 4,
addr & GOT addr. */
relocation = (plt_index + 3) * GOT_ENTRY_SIZE;
@@ -2303,164 +2286,162 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
}
/* Fall through. */
- case R_390_GOT12:
- case R_390_GOT16:
- case R_390_GOT32:
+ case R_390_GOT12:
+ case R_390_GOT16:
+ case R_390_GOT32:
case R_390_GOTENT:
- /* Relocation is to the entry for this symbol in the global
- offset table. */
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
if (htab->sgot == NULL)
abort ();
- if (h != NULL)
- {
+ if (h != NULL)
+ {
bfd_boolean dyn;
- off = h->got.offset;
+ off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
- || (info->shared
- && (info->symbolic
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ || (info->shared
+ && (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
- {
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table. Since the
- offset must always be a multiple of 2, we use the
- least significant bit to record whether we have
- initialized it already.
-
- When doing a dynamic link, we create a .rel.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 2, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rel.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
bfd_put_32 (output_bfd, relocation,
htab->sgot->contents + off);
- h->got.offset |= 1;
- }
- }
+ h->got.offset |= 1;
+ }
+ }
else
unresolved_reloc = FALSE;
- }
- else
- {
+ }
+ else
+ {
if (local_got_offsets == NULL)
abort ();
- off = local_got_offsets[r_symndx];
+ off = local_got_offsets[r_symndx];
- /* The offset must always be a multiple of 4. We use
- the least significant bit to record whether we have
- already generated the necessary reloc. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- bfd_put_32 (output_bfd, relocation,
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already generated the necessary reloc. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation,
htab->sgot->contents + off);
- if (info->shared)
- {
- asection *srelgot;
- Elf_Internal_Rela outrel;
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
bfd_byte *loc;
- srelgot = htab->srelgot;
+ srelgot = htab->srelgot;
if (srelgot == NULL)
abort ();
- outrel.r_offset = (htab->sgot->output_section->vma
- + htab->sgot->output_offset
- + off);
- outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
+ outrel.r_offset = (htab->sgot->output_section->vma
+ + htab->sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
outrel.r_addend = relocation;
loc = srelgot->contents;
loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
- }
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ }
- local_got_offsets[r_symndx] |= 1;
- }
- }
+ local_got_offsets[r_symndx] |= 1;
+ }
+ }
if (off >= (bfd_vma) -2)
abort ();
relocation = htab->sgot->output_offset + off;
- /*
- * For @GOTENT the relocation is against the offset between
- * the instruction and the symbols entry in the GOT and not
- * between the start of the GOT and the symbols entry. We
- * add the vma of the GOT to get the correct value.
- */
+ /* For @GOTENT the relocation is against the offset between
+ the instruction and the symbols entry in the GOT and not
+ between the start of the GOT and the symbols entry. We
+ add the vma of the GOT to get the correct value. */
if ( r_type == R_390_GOTENT
|| r_type == R_390_GOTPLTENT)
relocation += htab->sgot->output_section->vma;
- break;
+ break;
case R_390_GOTOFF16:
- case R_390_GOTOFF32:
- /* Relocation is relative to the start of the global offset
- table. */
-
- /* Note that sgot->output_offset is not involved in this
- calculation. We always want the start of .got. If we
- defined _GLOBAL_OFFSET_TABLE in a different way, as is
- permitted by the ABI, we might have to change this
- calculation. */
- relocation -= htab->sgot->output_section->vma;
- break;
-
- case R_390_GOTPC:
+ case R_390_GOTOFF32:
+ /* Relocation is relative to the start of the global offset
+ table. */
+
+ /* Note that sgot->output_offset is not involved in this
+ calculation. We always want the start of .got. If we
+ defined _GLOBAL_OFFSET_TABLE in a different way, as is
+ permitted by the ABI, we might have to change this
+ calculation. */
+ relocation -= htab->sgot->output_section->vma;
+ break;
+
+ case R_390_GOTPC:
case R_390_GOTPCDBL:
- /* Use global offset table as symbol value. */
- relocation = htab->sgot->output_section->vma;
+ /* Use global offset table as symbol value. */
+ relocation = htab->sgot->output_section->vma;
unresolved_reloc = FALSE;
- break;
+ break;
- case R_390_PLT16DBL:
- case R_390_PLT32DBL:
- case R_390_PLT32:
- /* Relocation is to the entry for this symbol in the
- procedure linkage table. */
+ case R_390_PLT16DBL:
+ case R_390_PLT32DBL:
+ case R_390_PLT32:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
- /* Resolve a PLT32 reloc against a local symbol directly,
- without using the procedure linkage table. */
- if (h == NULL)
- break;
+ /* Resolve a PLT32 reloc against a local symbol directly,
+ without using the procedure linkage table. */
+ if (h == NULL)
+ break;
- if (h->plt.offset == (bfd_vma) -1
+ if (h->plt.offset == (bfd_vma) -1
|| htab->splt == NULL)
- {
- /* We didn't make a PLT entry for this symbol. This
- happens when statically linking PIC code, or when
- using -Bsymbolic. */
- break;
- }
-
- relocation = (htab->splt->output_section->vma
- + htab->splt->output_offset
- + h->plt.offset);
+ {
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ break;
+ }
+
+ relocation = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset);
unresolved_reloc = FALSE;
- break;
+ break;
case R_390_PLTOFF16:
case R_390_PLTOFF32:
- /* Relocation is to the entry for this symbol in the
- procedure linkage table relative to the start of the GOT. */
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table relative to the start of the GOT. */
/* For local symbols or if we didn't make a PLT entry for
this symbol resolve the symbol directly. */
- if ( h == NULL
+ if ( h == NULL
|| h->plt.offset == (bfd_vma) -1
|| htab->splt == NULL)
{
@@ -2468,28 +2449,28 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
- relocation = (htab->splt->output_section->vma
- + htab->splt->output_offset
- + h->plt.offset
+ relocation = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset
- htab->sgot->output_section->vma);
unresolved_reloc = FALSE;
- break;
-
- case R_390_8:
- case R_390_16:
- case R_390_32:
- case R_390_PC16:
- case R_390_PC16DBL:
- case R_390_PC32DBL:
- case R_390_PC32:
+ break;
+
+ case R_390_8:
+ case R_390_16:
+ case R_390_32:
+ case R_390_PC16:
+ case R_390_PC16DBL:
+ case R_390_PC32DBL:
+ case R_390_PC32:
/* r_symndx will be zero only for relocs against symbols
from removed linkonce sections, or sections discarded by
a linker script. */
- if (r_symndx == 0
- || (input_section->flags & SEC_ALLOC) == 0)
+ if (r_symndx == 0
+ || (input_section->flags & SEC_ALLOC) == 0)
break;
- if ((info->shared
+ if ((info->shared
&& ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32DBL
@@ -2509,9 +2490,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|| h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined)))
- {
- Elf_Internal_Rela outrel;
- bfd_boolean skip, relocate;
+ {
+ Elf_Internal_Rela outrel;
+ bfd_boolean skip, relocate;
asection *sreloc;
bfd_byte *loc;
@@ -2519,8 +2500,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
are copied into the output file to be resolved at run
time. */
- skip = FALSE;
- relocate = FALSE;
+ skip = FALSE;
+ relocate = FALSE;
outrel.r_offset =
_bfd_elf_section_offset (output_bfd, info, input_section,
@@ -2529,12 +2510,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
skip = TRUE;
else if (outrel.r_offset == (bfd_vma) -2)
skip = TRUE, relocate = TRUE;
- outrel.r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
- if (skip)
+ if (skip)
memset (&outrel, 0, sizeof outrel);
- else if (h != NULL
+ else if (h != NULL
&& h->dynindx != -1
&& (r_type == R_390_PC16
|| r_type == R_390_PC16DBL
@@ -2544,17 +2525,17 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|| !info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))
- {
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ {
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
outrel.r_addend = rel->r_addend;
- }
- else
- {
+ }
+ else
+ {
/* This symbol is local, or marked to become local. */
relocate = TRUE;
outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
outrel.r_addend = relocation + rel->r_addend;
- }
+ }
sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
@@ -2564,13 +2545,13 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
- /* If this reloc is against an external symbol, we do
- not want to fiddle with the addend. Otherwise, we
- need to include the symbol value so that it becomes
- an addend for the dynamic reloc. */
- if (! relocate)
- continue;
- }
+ /* If this reloc is against an external symbol, we do
+ not want to fiddle with the addend. Otherwise, we
+ need to include the symbol value so that it becomes
+ an addend for the dynamic reloc. */
+ if (! relocate)
+ continue;
+ }
break;
/* Relocations for tls literal pool entries. */
@@ -2592,7 +2573,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
}
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_GD32:
case R_390_TLS_GOTIE32:
@@ -2636,7 +2617,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
@@ -2667,7 +2648,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
{
if (indx == 0)
{
- BFD_ASSERT (! unresolved_reloc);
+ BFD_ASSERT (! unresolved_reloc);
bfd_put_32 (output_bfd,
relocation - dtpoff_base (info),
htab->sgot->contents + off + GOT_ENTRY_SIZE);
@@ -2771,7 +2752,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
htab->tls_ldm_got.offset |= 1;
}
relocation = htab->sgot->output_offset + off;
- unresolved_reloc = FALSE;
+ unresolved_reloc = FALSE;
break;
case R_390_TLS_LE32:
@@ -2981,8 +2962,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma relative_offset;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
-
+ it up. */
if (h->dynindx == -1
|| htab->splt == NULL
|| htab->sgotplt == NULL
@@ -2990,26 +2970,26 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
abort ();
/* Calc. index no.
- Current offset - size first entry / entry size. */
+ Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE;
/* Offset in GOT is PLT index plus GOT headers(3) times 4,
- addr & GOT addr. */
+ addr & GOT addr. */
got_offset = (plt_index + 3) * GOT_ENTRY_SIZE;
/* S390 uses halfwords for relative branch calc! */
relative_offset = - ((PLT_FIRST_ENTRY_SIZE +
- (PLT_ENTRY_SIZE * plt_index) + 18) / 2);
+ (PLT_ENTRY_SIZE * plt_index) + 18) / 2);
/* If offset is > 32768, branch to a previous branch
- 390 can only handle +-64 K jumps. */
+ 390 can only handle +-64 K jumps. */
if ( -32768 > (int) relative_offset )
- relative_offset =
- -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2);
+ relative_offset
+ = -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2);
/* Fill in the entry in the procedure linkage table. */
if (!info->shared)
{
- bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0,
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0,
htab->splt->contents + h->plt.offset);
bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD1,
htab->splt->contents + h->plt.offset + 4);
@@ -3080,10 +3060,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
}
/* Insert offset into reloc. table here. */
bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela),
- htab->splt->contents + h->plt.offset + 28);
+ htab->splt->contents + h->plt.offset + 28);
/* Fill in the entry in the global offset table.
- Points to instruction after GOT offset. */
+ Points to instruction after GOT offset. */
bfd_put_32 (output_bfd,
(htab->splt->output_section->vma
+ htab->splt->output_offset
@@ -3120,7 +3100,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();
@@ -3143,16 +3123,16 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
BFD_ASSERT((h->got.offset & 1) != 0);
rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
rela.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
else
{
BFD_ASSERT((h->got.offset & 1) == 0);
bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_390_GLOB_DAT);
- rela.r_addend = 0;
- }
+ rela.r_addend = 0;
+ }
loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
@@ -3270,39 +3250,39 @@ elf_s390_finish_dynamic_sections (output_bfd, info)
/* Fill in the special first entry in the procedure linkage table. */
if (htab->splt && htab->splt->_raw_size > 0)
{
- memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE);
- if (info->shared)
+ memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE);
+ if (info->shared)
{
bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD0,
- htab->splt->contents );
+ htab->splt->contents );
bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD1,
- htab->splt->contents +4 );
+ htab->splt->contents +4 );
bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD2,
- htab->splt->contents +8 );
+ htab->splt->contents +8 );
bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD3,
- htab->splt->contents +12 );
+ htab->splt->contents +12 );
bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD4,
- htab->splt->contents +16 );
- }
- else
- {
- bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0,
- htab->splt->contents );
- bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1,
- htab->splt->contents +4 );
- bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2,
- htab->splt->contents +8 );
- bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3,
- htab->splt->contents +12 );
- bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4,
- htab->splt->contents +16 );
- bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5,
- htab->splt->contents +20 );
- bfd_put_32 (output_bfd,
- htab->sgotplt->output_section->vma
+ htab->splt->contents +16 );
+ }
+ else
+ {
+ bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0,
+ htab->splt->contents );
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1,
+ htab->splt->contents +4 );
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2,
+ htab->splt->contents +8 );
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3,
+ htab->splt->contents +12 );
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4,
+ htab->splt->contents +16 );
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5,
+ htab->splt->contents +20 );
+ bfd_put_32 (output_bfd,
+ htab->sgotplt->output_section->vma
+ htab->sgotplt->output_offset,
- htab->splt->contents + 24);
- }
+ htab->splt->contents + 24);
+ }
elf_section_data (htab->splt->output_section)
->this_hdr.sh_entsize = 4;
}
@@ -3377,27 +3357,27 @@ elf_s390_grok_prstatus (abfd, note)
#define elf_backend_plt_header_size PLT_ENTRY_SIZE
#define elf_backend_rela_normal 1
-#define elf_info_to_howto elf_s390_info_to_howto
+#define elf_info_to_howto elf_s390_info_to_howto
#define bfd_elf32_bfd_is_local_label_name elf_s390_is_local_label_name
#define bfd_elf32_bfd_link_hash_table_create elf_s390_link_hash_table_create
#define bfd_elf32_bfd_reloc_type_lookup elf_s390_reloc_type_lookup
#define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol
-#define elf_backend_check_relocs elf_s390_check_relocs
+#define elf_backend_check_relocs elf_s390_check_relocs
#define elf_backend_copy_indirect_symbol elf_s390_copy_indirect_symbol
#define elf_backend_create_dynamic_sections elf_s390_create_dynamic_sections
#define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections
#define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol
-#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook
-#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook
+#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook
+#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook
#define elf_backend_reloc_type_class elf_s390_reloc_type_class
-#define elf_backend_relocate_section elf_s390_relocate_section
+#define elf_backend_relocate_section elf_s390_relocate_section
#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections
#define elf_backend_reloc_type_class elf_s390_reloc_type_class
#define elf_backend_grok_prstatus elf_s390_grok_prstatus
#define bfd_elf32_mkobject elf_s390_mkobject
-#define elf_backend_object_p elf_s390_object_p
+#define elf_backend_object_p elf_s390_object_p
#include "elf32-target.h"
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index f0e01772ec..c9167bc4e8 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -179,6 +179,8 @@ static reloc_howto_type sh_elf_howto_table[] =
TRUE), /* pcrel_offset */
/* 12 bit PC relative branch divided by 2. */
+ /* This cannot be partial_inplace because relaxation can't know the
+ eventual value of a symbol. */
HOWTO (R_SH_IND12W, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -186,10 +188,10 @@ static reloc_howto_type sh_elf_howto_table[] =
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- sh_elf_reloc, /* special_function */
+ NULL, /* special_function */
"R_SH_IND12W", /* name */
- TRUE, /* partial_inplace */
- 0xfff, /* src_mask */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
0xfff, /* dst_mask */
TRUE), /* pcrel_offset */
@@ -2232,6 +2234,12 @@ sh_elf_relax_section (abfd, sec, link_info, again)
/* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and
replace the jsr with a bsr. */
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W);
+ /* We used to test (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
+ here, but that only checks if the symbol is an external symbol,
+ not if the symbol is in a different section. Besides, we need
+ a consistent meaning for the relocation, so we just assume here that
+ the value of the symbol is not available. */
+#if 0
if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
{
/* If this needs to be changed because of future relaxing,
@@ -2242,12 +2250,14 @@ sh_elf_relax_section (abfd, sec, link_info, again)
contents + irel->r_offset);
}
else
+#endif
{
/* We can't fully resolve this yet, because the external
symbol value may be changed by future relaxing. We let
the final link phase handle it. */
bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
}
+ irel->r_addend = -4;
/* See if there is another R_SH_USES reloc referring to the same
register load. */
@@ -2316,7 +2326,8 @@ sh_elf_relax_section (abfd, sec, link_info, again)
/* Look for load and store instructions that we can align on four
byte boundaries. */
- if (have_code)
+ if ((elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK) != EF_SH4
+ && have_code)
{
bfd_boolean swapped;
@@ -2542,14 +2553,28 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
break;
case R_SH_IND12W:
- if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info)
- start = stop = addr;
+ off = insn & 0xfff;
+ if (! off)
+ {
+ /* This has been made by previous relaxation. Since the
+ relocation will be against an external symbol, the
+ final relocation will just do the right thing. */
+ start = stop = addr;
+ }
else
{
- off = insn & 0xfff;
if (off & 0x800)
off -= 0x1000;
stop = (bfd_vma) ((bfd_signed_vma) start + 4 + off * 2);
+
+ /* The addend will be against the section symbol, thus
+ for adjusting the addend, the relevant start is the
+ start of the section.
+ N.B. If we want to abandom in-place changes here and
+ test directly using symbol + addend, we have to take into
+ account that the addend has already been adjusted by -4. */
+ if (stop > addr && stop < toaddr)
+ irel->r_addend -= count;
}
break;
@@ -3500,6 +3525,9 @@ struct elf_sh_dyn_relocs
/* Number of pc-relative relocs copied for the input section. */
bfd_size_type pc_count;
+
+ /* If TRUE, R_SH_TLS_TPOFF32 relocation is generated. */
+ bfd_boolean tls_tpoff32;
};
/* sh ELF linker hash entry. */
@@ -3524,9 +3552,6 @@ struct elf_sh_link_hash_entry
enum {
GOT_UNKNOWN = 0, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE
} tls_type;
-
- /* If TRUE, R_SH_TLS_TPOFF32 relocation is generated. */
- bfd_boolean tls_tpoff32;
};
#define sh_elf_hash_entry(ent) ((struct elf_sh_link_hash_entry *)(ent))
@@ -3630,7 +3655,6 @@ sh_elf_link_hash_newfunc (entry, table, string)
ret->datalabel_got.refcount = ret->root.got.refcount;
#endif
ret->tls_type = GOT_UNKNOWN;
- ret->tls_tpoff32 = FALSE;
}
return (struct bfd_hash_entry *) ret;
@@ -4053,7 +4077,7 @@ allocate_dynrelocs (h, inf)
&& eh->gotplt_refcount > 0)
{
/* The symbol has been forced local, or we have some direct got refs,
- so treat all the gotplt refs as got refs. */
+ so treat all the gotplt refs as got refs. */
h->got.refcount += eh->gotplt_refcount;
if (h->plt.refcount >= eh->gotplt_refcount)
h->plt.refcount -= eh->gotplt_refcount;
@@ -4207,8 +4231,9 @@ allocate_dynrelocs (h, inf)
}
else
{
- if (sh_elf_hash_entry (h)->tls_tpoff32)
- goto keep;
+ for (p = eh->dyn_relocs; p; p = p->next)
+ if (p->tls_tpoff32)
+ goto keep;
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -4785,7 +4810,6 @@ sh_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->allow_shlib_undefined)
&& ! info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
@@ -4812,7 +4836,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case R_SH_IND12W:
- relocation -= 4;
goto final_link_relocate;
case R_SH_DIR8WPN:
@@ -5256,10 +5279,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
tls_type = sh_elf_hash_entry (h)->tls_type;
if (! info->shared
&& (h->dynindx == -1
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
- && (tls_type == GOT_TLS_IE
- || sh_elf_hash_entry (h)->tls_tpoff32))
- r_type = R_SH_TLS_LE_32;
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ struct elf_sh_dyn_relocs *p;
+
+ /* If TPOFF32 relocation can be created, convert it. */
+ for (p = sh_elf_hash_entry (h)->dyn_relocs; p; p = p->next)
+ if (p->sec == input_section && p->tls_tpoff32)
+ {
+ r_type = R_SH_TLS_LE_32;
+ break;
+ }
+ }
}
if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE)
@@ -5368,7 +5399,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (sreloc != NULL);
}
- indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ if (h == NULL
+ || h->dynindx == -1
+ || (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ indx = 0;
+ else
+ indx = h->dynindx;
outrel.r_offset = (input_section->output_section->vma
+ input_section->output_offset
+ rel->r_offset);
@@ -5400,7 +5437,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
@@ -5415,7 +5452,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + off);
- indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ if (h == NULL
+ || h->dynindx == -1
+ || (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ indx = 0;
+ else
+ indx = h->dynindx;
dr_type = (r_type == R_SH_TLS_GD_32 ? R_SH_TLS_DTPMOD32 :
R_SH_TLS_TPOFF32);
if (dr_type == R_SH_TLS_TPOFF32 && indx == 0)
@@ -5900,9 +5943,6 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
- struct elf_sh_link_hash_entry *eh;
elf_section_data (sec)->local_dynrel = NULL;
@@ -5913,15 +5953,20 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
{
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
#ifdef INCLUDE_SHMEDIA
int seen_stt_datalabel = 0;
#endif
r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
- else
+ if (r_symndx >= symtab_hdr->sh_info)
{
+ struct elf_sh_link_hash_entry *eh;
+ struct elf_sh_dyn_relocs **pp;
+ struct elf_sh_dyn_relocs *p;
+
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
#ifdef INCLUDE_SHMEDIA
while (h->root.type == bfd_link_hash_indirect
@@ -5931,12 +5976,18 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
}
#endif
+ eh = (struct elf_sh_link_hash_entry *) h;
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
}
- eh = (struct elf_sh_link_hash_entry *) h;
- switch (sh_elf_optimized_tls_reloc (info, ELF32_R_TYPE (rel->r_info),
- ELF32_R_SYM (rel->r_info)
- >= symtab_hdr->sh_info))
+ r_type = ELF32_R_TYPE (rel->r_info);
+ switch (sh_elf_optimized_tls_reloc (info, r_type, h != NULL))
{
case R_SH_TLS_LD_32:
if (sh_elf_hash_table (info)->tls_ldm_got.refcount > 0)
@@ -5969,6 +6020,8 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
#ifdef INCLUDE_SHMEDIA
if (seen_stt_datalabel)
{
+ struct elf_sh_link_hash_entry *eh;
+ eh = (struct elf_sh_link_hash_entry *) h;
if (eh->datalabel_got.refcount > 0)
eh->datalabel_got.refcount -= 1;
}
@@ -5994,27 +6047,9 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
case R_SH_DIR32:
case R_SH_REL32:
- if (h != NULL)
- {
- struct elf_sh_dyn_relocs **pp;
- struct elf_sh_dyn_relocs *p;
-
-
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ if (info->shared)
+ break;
+ /* Fall thru */
case R_SH_PLT32:
#ifdef INCLUDE_SHMEDIA
@@ -6041,6 +6076,8 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
#endif
if (h != NULL)
{
+ struct elf_sh_link_hash_entry *eh;
+ eh = (struct elf_sh_link_hash_entry *) h;
if (eh->gotplt_refcount > 0)
{
eh->gotplt_refcount -= 1;
@@ -6596,6 +6633,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
p->sec = sec;
p->count = 0;
p->pc_count = 0;
+ p->tls_tpoff32 = FALSE;
}
p->count += 1;
@@ -6693,11 +6731,11 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
p->sec = sec;
p->count = 0;
p->pc_count = 0;
+ p->tls_tpoff32 = FALSE;
}
p->count += 1;
- if (h)
- sh_elf_hash_entry (h)->tls_tpoff32 = TRUE;
+ p->tls_tpoff32 = TRUE;
}
break;
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 1c22100e1b..e2c6544815 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -2,21 +2,21 @@
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -63,8 +63,8 @@ static struct bfd_hash_entry *link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static struct bfd_link_hash_table *elf32_sparc_link_hash_table_create
PARAMS ((bfd *));
-static bfd_boolean create_got_section PARAMS ((bfd *,
- struct bfd_link_info *));
+static bfd_boolean create_got_section
+ PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf32_sparc_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static void elf32_sparc_copy_indirect_symbol
@@ -291,11 +291,14 @@ elf32_sparc_reloc_type_lookup (abfd, code)
return &elf32_sparc_rev32_howto;
default:
- for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++)
- {
- if (sparc_reloc_map[i].bfd_reloc_val == code)
- return &_bfd_sparc_elf_howto_table[(int) sparc_reloc_map[i].elf_reloc_val];
- }
+ for (i = 0;
+ i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map);
+ i++)
+ {
+ if (sparc_reloc_map[i].bfd_reloc_val == code)
+ return (_bfd_sparc_elf_howto_table
+ + (int) sparc_reloc_map[i].elf_reloc_val);
+ }
}
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -633,9 +636,9 @@ link_hash_newfunc (entry, table, string)
if (entry == NULL)
{
entry = bfd_hash_allocate (table,
- sizeof (struct elf32_sparc_link_hash_entry));
+ sizeof (struct elf32_sparc_link_hash_entry));
if (entry == NULL)
- return entry;
+ return entry;
}
/* Call the allocation method of the superclass. */
@@ -758,32 +761,32 @@ elf32_sparc_copy_indirect_symbol (bed, dir, ind)
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
- {
- struct elf32_sparc_dyn_relocs **pp;
- struct elf32_sparc_dyn_relocs *p;
-
- if (ind->root.type == bfd_link_hash_indirect)
- abort ();
-
- /* Add reloc counts against the weak sym to the strong sym
- list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
- {
- struct elf32_sparc_dyn_relocs *q;
-
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
- if (q->sec == p->sec)
- {
- q->pc_count += p->pc_count;
- q->count += p->count;
- *pp = p->next;
- break;
- }
- if (q == NULL)
- pp = &p->next;
- }
- *pp = edir->dyn_relocs;
- }
+ {
+ struct elf32_sparc_dyn_relocs **pp;
+ struct elf32_sparc_dyn_relocs *p;
+
+ if (ind->root.type == bfd_link_hash_indirect)
+ abort ();
+
+ /* Add reloc counts against the weak sym to the strong sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ {
+ struct elf32_sparc_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
edir->dyn_relocs = eind->dyn_relocs;
eind->dyn_relocs = NULL;
@@ -820,15 +823,15 @@ elf32_sparc_tls_transition (info, abfd, r_type, is_local)
return R_SPARC_TLS_IE_HI22;
case R_SPARC_TLS_GD_LO10:
if (is_local)
- return R_SPARC_TLS_LE_LOX10;
+ return R_SPARC_TLS_LE_LOX10;
return R_SPARC_TLS_IE_LO10;
case R_SPARC_TLS_IE_HI22:
if (is_local)
- return R_SPARC_TLS_LE_HIX22;
+ return R_SPARC_TLS_LE_HIX22;
return r_type;
case R_SPARC_TLS_IE_LO10:
if (is_local)
- return R_SPARC_TLS_LE_LOX10;
+ return R_SPARC_TLS_LE_LOX10;
return r_type;
case R_SPARC_TLS_LDM_HI22:
return R_SPARC_TLS_LE_HIX22;
@@ -880,12 +883,12 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
- {
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
- r_symndx);
- return FALSE;
- }
+ {
+ (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
+ bfd_archive_filename (abfd),
+ r_symndx);
+ return FALSE;
+ }
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
@@ -1049,17 +1052,17 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
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,
- because this might be a case of linking PIC code without
- linking in any dynamic objects, in which case we don't
- need to generate a procedure linkage table after all. */
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
if (h == NULL)
{
/* The Solaris native assembler will generate a WPLT30
- reloc for a local symbol if you assemble a call from
- one section to another when using -K pic. We treat
- it as WDISP30. */
+ 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_PLT32)
goto r_sparc_plt32;
break;
@@ -1149,8 +1152,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
struct elf32_sparc_dyn_relocs **head;
/* When creating a shared object, we must copy these
- relocs into the output file. We create a reloc
- section in dynobj and make room for the reloc. */
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
if (sreloc == NULL)
{
const char *name;
@@ -1231,15 +1234,15 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
break;
- case R_SPARC_GNU_VTINHERIT:
- if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
+ case R_SPARC_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
- case R_SPARC_GNU_VTENTRY:
- if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_SPARC_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
default:
break;
@@ -1263,21 +1266,21 @@ elf32_sparc_gc_mark_hook (sec, info, rel, h, sym)
{
case R_SPARC_GNU_VTINHERIT:
case R_SPARC_GNU_VTENTRY:
- break;
+ break;
default:
- switch (h->root.type)
- {
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- return h->root.u.def.section;
+ 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;
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
default:
break;
- }
+ }
}
}
else
@@ -1294,14 +1297,12 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs)
asection *sec;
const Elf_Internal_Rela *relocs;
{
-
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- int r_type;
- struct elf_link_hash_entry *h;
+
+ elf_section_data (sec)->local_dynrel = NULL;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
@@ -1309,116 +1310,98 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
- switch ((r_type = elf32_sparc_tls_transition (info, abfd,
- ELF32_R_TYPE (rel->r_info),
- ELF32_R_SYM (rel->r_info)
- >= symtab_hdr->sh_info)))
- {
- case R_SPARC_TLS_LDM_HI22:
- case R_SPARC_TLS_LDM_LO10:
- if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0)
- elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1;
- break;
-
- case R_SPARC_TLS_LE_HIX22:
- case R_SPARC_TLS_LE_LOX10:
- if (info->shared)
- goto r_sparc_plt32;
- break;
+ {
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
- case R_SPARC_PC10:
- case R_SPARC_PC22:
- if ((r_symndx = ELF32_R_SYM (rel->r_info)) >= symtab_hdr->sh_info
- && strcmp (sym_hashes[r_symndx
- - symtab_hdr->sh_info]->root.root.string,
- "_GLOBAL_OFFSET_TABLE_") == 0)
- break;
- /* Fall through. */
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf32_sparc_link_hash_entry *eh;
+ struct elf32_sparc_dyn_relocs **pp;
+ struct elf32_sparc_dyn_relocs *p;
- case R_SPARC_DISP8:
- case R_SPARC_DISP16:
- case R_SPARC_DISP32:
- case R_SPARC_WDISP30:
- case R_SPARC_WDISP22:
- case R_SPARC_WDISP19:
- case R_SPARC_WDISP16:
- case R_SPARC_8:
- case R_SPARC_16:
- case R_SPARC_32:
- case R_SPARC_HI22:
- case R_SPARC_22:
- case R_SPARC_13:
- case R_SPARC_LO10:
- case R_SPARC_UA16:
- case R_SPARC_UA32:
- r_sparc_plt32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf32_sparc_link_hash_entry *eh;
- struct elf32_sparc_dyn_relocs **pp;
- struct elf32_sparc_dyn_relocs *p;
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf32_sparc_link_hash_entry *) h;
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ r_type = ELF32_R_TYPE (rel->r_info);
+ r_type = elf32_sparc_tls_transition (info, abfd, r_type, h != NULL);
+ switch (r_type)
+ {
+ case R_SPARC_TLS_LDM_HI22:
+ case R_SPARC_TLS_LDM_LO10:
+ if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0)
+ elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1;
+ break;
- if (! info->shared)
- --h->plt.refcount;
+ case R_SPARC_TLS_GD_HI22:
+ case R_SPARC_TLS_GD_LO10:
+ case R_SPARC_TLS_IE_HI22:
+ case R_SPARC_TLS_IE_LO10:
+ case R_SPARC_GOT10:
+ case R_SPARC_GOT13:
+ case R_SPARC_GOT22:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
- eh = (struct elf32_sparc_link_hash_entry *) h;
+ case R_SPARC_PC10:
+ case R_SPARC_PC22:
+ if (h != NULL
+ && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ break;
+ /* Fall through. */
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (_bfd_sparc_elf_howto_table[r_type].pc_relative)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ case R_SPARC_DISP8:
+ case R_SPARC_DISP16:
+ case R_SPARC_DISP32:
+ case R_SPARC_WDISP30:
+ case R_SPARC_WDISP22:
+ case R_SPARC_WDISP19:
+ case R_SPARC_WDISP16:
+ case R_SPARC_8:
+ case R_SPARC_16:
+ case R_SPARC_32:
+ case R_SPARC_HI22:
+ case R_SPARC_22:
+ case R_SPARC_13:
+ case R_SPARC_LO10:
+ case R_SPARC_UA16:
+ case R_SPARC_UA32:
+ case R_SPARC_PLT32:
+ if (info->shared)
+ break;
+ /* Fall through. */
- case R_SPARC_TLS_GD_HI22:
- case R_SPARC_TLS_GD_LO10:
- case R_SPARC_TLS_IE_HI22:
- case R_SPARC_TLS_IE_LO10:
- case R_SPARC_GOT10:
- case R_SPARC_GOT13:
- case R_SPARC_GOT22:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->got.refcount > 0)
- h->got.refcount--;
- }
- else
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx]--;
- }
- break;
-
- case R_SPARC_PLT32:
- case R_SPARC_HIPLT22:
- case R_SPARC_LOPLT10:
- case R_SPARC_PCPLT32:
- case R_SPARC_PCPLT10:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->plt.refcount > 0)
- h->plt.refcount--;
- }
- if (r_type == R_SPARC_PLT32)
- goto r_sparc_plt32;
- break;
+ case R_SPARC_WPLT30:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
return TRUE;
}
@@ -1632,7 +1615,7 @@ allocate_dynrelocs (h, inf)
/* The first four entries in .plt are reserved. */
if (s->_raw_size == 0)
s->_raw_size = 4 * PLT_ENTRY_SIZE;
-
+
/* The procedure linkage table has a maximum size. */
if (s->_raw_size >= 0x400000)
{
@@ -2176,8 +2159,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_SPARC_GNU_VTINHERIT
- || r_type == R_SPARC_GNU_VTENTRY)
- continue;
+ || r_type == R_SPARC_GNU_VTENTRY)
+ continue;
if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
{
@@ -2224,7 +2207,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
@@ -2245,7 +2227,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_GOT13:
case R_SPARC_GOT22:
/* Relocation is to the entry for this symbol in the global
- offset table. */
+ offset table. */
if (htab->sgot == NULL)
abort ();
@@ -2265,13 +2247,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table. Since the
- offset must always be a multiple of 4, we use the
- least significant bit to record whether we have
- initialized it already.
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
When doing a dynamic link, we create a .rela.got
relocation entry to initialize the value. This
@@ -2343,7 +2325,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_WPLT30:
r_sparc_wplt30:
/* Relocation is to the entry for this symbol in the
- procedure linkage table. */
+ procedure linkage table. */
/* The Solaris native assembler will generate a WPLT30 reloc
for a local symbol if you assemble a call from one
@@ -2355,8 +2337,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
if (h->plt.offset == (bfd_vma) -1)
{
/* We didn't make a PLT entry for this symbol. This
- happens when statically linking PIC code, or when
- using -Bsymbolic. */
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
break;
}
@@ -2428,8 +2410,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_boolean skip, relocate = FALSE;
/* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
+ are copied into the output file to be resolved at run
+ time. */
BFD_ASSERT (sreloc != NULL);
@@ -2481,7 +2463,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
if (skip)
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if the symbol was marked to
- become local. */
+ become local. */
else if (h != NULL && ! is_plt
&& ((! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
@@ -2550,7 +2532,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now. */
+ need to do anything now. */
if (! relocate)
continue;
}
@@ -2615,7 +2597,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
- if (h != NULL)
+ if (h != NULL)
{
off = h->got.offset;
h->got.offset |= 1;
@@ -2626,14 +2608,14 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
off = local_got_offsets[r_symndx];
local_got_offsets[r_symndx] |= 1;
}
-
+
r_sparc_tlsldm:
if (htab->sgot == NULL)
abort ();
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
Elf32_External_Rela *loc;
@@ -3099,7 +3081,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
{
bfd *dynobj;
struct elf32_sparc_link_hash_table *htab;
-
+
htab = elf32_sparc_hash_table (info);
dynobj = htab->elf.dynobj;
@@ -3111,7 +3093,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
@@ -3165,7 +3147,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
sgot = htab->sgot;
srela = htab->srelgot;
@@ -3245,7 +3227,7 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info)
bfd *dynobj;
asection *sdyn;
struct elf32_sparc_link_hash_table *htab;
-
+
htab = elf32_sparc_hash_table (info);
dynobj = htab->elf.dynobj;
@@ -3513,7 +3495,7 @@ elf32_sparc_reloc_type_class (rela)
#define elf_backend_object_p elf32_sparc_object_p
#define elf_backend_final_write_processing \
elf32_sparc_final_write_processing
-#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook
+#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
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index a9e8b0b37e..1aca042c61 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -1,23 +1,23 @@
/* VAX series support for 32-bit ELF
- Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Matt Thomas <matt@3am-software.com>.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -1539,7 +1539,6 @@ elf_vax_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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
@@ -1699,7 +1698,6 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
if (sreloc == NULL)
{
const char *name;
@@ -1908,7 +1906,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the procedure linkage table. Set
it up. */
-
BFD_ASSERT (h->dynindx != -1);
splt = bfd_get_section_by_name (dynobj, ".plt");
@@ -1975,7 +1972,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the global offset table. Set it
up. */
-
sgot = bfd_get_section_by_name (dynobj, ".got");
srela = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (sgot != NULL && srela != NULL);
@@ -2014,7 +2010,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */
-
BFD_ASSERT (h->dynindx != -1
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak));
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index aa592fae17..9f564ca35d 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -4503,7 +4503,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
;
@@ -5176,7 +5175,7 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info)
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
}
- /* Initialize the PLT0 entry */
+ /* Initialize the PLT0 entry. */
if (splt->_raw_size > 0)
{
bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents);
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 98f46dc8fc..4d3b8d40a7 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -1,21 +1,21 @@
/* Support for HPPA 64-bit ELF
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "alloca-conf.h"
#include "bfd.h"
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index d29f2862ea..807ddf5f22 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -300,9 +300,11 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit PC relative reference. */
+ /* 16 bit PC relative reference. Note that the ABI document has a typo
+ and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+ We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@@ -795,9 +797,11 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit PC relative reference. */
+ /* 16 bit PC relative reference. Note that the ABI document has a typo
+ and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+ We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@@ -1894,7 +1898,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
/* There is no BFD reloc for R_MIPS_REL32. */
{ BFD_RELOC_64, R_MIPS_64 },
{ BFD_RELOC_CTOR, R_MIPS_64 },
- { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
+ { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
{ BFD_RELOC_HI16_S, R_MIPS_HI16 },
{ BFD_RELOC_LO16, R_MIPS_LO16 },
{ BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index b86bb858ca..23d95d512e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3,21 +3,21 @@
Written by Linus Nordberg, Swox AB <info@swox.com>,
based on elf32-ppc.c by Ian Lance Taylor.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file is based on the 64-bit PowerPC ELF ABI. It is also based
on the file elf32-ppc.c. */
@@ -2503,14 +2503,18 @@ struct got_entry
{
struct got_entry *next;
+ /* The symbol addend that we'll be placing in the GOT. */
bfd_vma addend;
+ /* Reference count until size_dynamic_sections, GOT offset thereafter. */
union
{
bfd_signed_vma refcount;
bfd_vma offset;
} got;
+ /* Zero for non-tls entries, or TLS_TLS and one of TLS_GD, TLS_LD,
+ TLS_TPREL or TLS_DTPREL for tls entries. */
char tls_type;
};
@@ -2529,13 +2533,20 @@ struct plt_entry
};
/* Of those relocs that might be copied as dynamic relocs, this macro
- selects those that must be copied when linking a shared library. */
+ selects those that must be copied when linking a shared library,
+ even when the symbol is local. */
#define MUST_BE_DYN_RELOC(RTYPE) \
((RTYPE) != R_PPC64_REL32 \
&& (RTYPE) != R_PPC64_REL64 \
&& (RTYPE) != R_PPC64_REL30)
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* Section name for stubs is the associated section name plus this
string. */
#define STUB_SUFFIX ".stub"
@@ -2633,14 +2644,21 @@ struct ppc_link_hash_entry
unsigned int is_entry:1;
/* Contexts in which symbol is used in the GOT (or TOC).
- Linker optimization will result in various transformations. */
-#define TLS_TLS 1 /* Any TLS reloc. */
-#define TLS_GD_LD 2 /* GD or LD reloc requiring 2 got slots. */
-#define TLS_LD 4 /* LD reloc. */
-#define TLS_TPREL 8 /* TPREL reloc, => IE. */
-#define TLS_DTPREL 16 /* DTPREL reloc, => LD. */
-#define TLS_EXPLICIT 32 /* Marks TOC section relocs. */
- char tls_type;
+ TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the
+ corresponding relocs are encountered during check_relocs.
+ tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
+ indicate the corresponding GOT entry type is not needed.
+ tls_optimize may also set TLS_TPRELGD when a GD reloc turns into
+ a TPREL one. We use a separate flag rather than setting TPREL
+ just for convenience in distinguishing the two cases. */
+#define TLS_GD 1 /* GD reloc. */
+#define TLS_LD 2 /* LD reloc. */
+#define TLS_TPREL 4 /* TPREL reloc, => IE. */
+#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */
+#define TLS_TLS 16 /* Any TLS reloc. */
+#define TLS_EXPLICIT 32 /* Marks TOC section TLS relocs. */
+#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */
+ char tls_mask;
};
/* ppc64 ELF linker hash table. */
@@ -2767,7 +2785,7 @@ static void ppc64_elf_hide_symbol
static bfd_boolean get_sym_h
PARAMS ((struct elf_link_hash_entry **, Elf_Internal_Sym **, asection **,
char **, Elf_Internal_Sym **, unsigned long, bfd *));
-static bfd_boolean get_tls_type
+static int get_tls_mask
PARAMS ((char **, Elf_Internal_Sym **, const Elf_Internal_Rela *, bfd *));
static bfd_boolean allocate_dynrelocs
PARAMS ((struct elf_link_hash_entry *, PTR));
@@ -2909,7 +2927,7 @@ link_hash_newfunc (entry, table, string)
eh->is_func = 0;
eh->is_func_descriptor = 0;
eh->is_entry = 0;
- eh->tls_type = 0;
+ eh->tls_mask = 0;
}
return entry;
@@ -2957,13 +2975,20 @@ ppc64_elf_link_hash_table_create (abfd)
htab->sbrlt = NULL;
htab->srelbrlt = NULL;
htab->tls_sec = NULL;
+ htab->tls_get_addr = NULL;
htab->tlsld_got.refcount = 0;
htab->stub_error = 0;
htab->has_14bit_branch = 0;
htab->have_undefweak = 0;
htab->stub_iteration = 0;
htab->sym_sec.abfd = NULL;
+ /* Initializing two fields of the union is just cosmetic. We really
+ only care about glist, but when compiled on a 32-bit host the
+ bfd_vma fields are larger. Setting the bfd_vma to zero makes
+ debugger inspection of these fields look nicer. */
+ htab->elf.init_refcount.refcount = 0;
htab->elf.init_refcount.glist = NULL;
+ htab->elf.init_offset.offset = 0;
htab->elf.init_offset.glist = NULL;
return &htab->elf.root;
@@ -3289,6 +3314,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind)
edir->is_func |= eind->is_func;
edir->is_func_descriptor |= eind->is_func_descriptor;
edir->is_entry |= eind->is_entry;
+ edir->tls_mask |= eind->tls_mask;
/* Copy down any references that we may have already seen to the
symbol which just became indirect. */
@@ -3404,13 +3430,13 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type)
int tls_type;
{
struct got_entry **local_got_ents = elf_local_got_ents (abfd);
- char *local_got_tls_types;
+ char *local_got_tls_masks;
if (local_got_ents == NULL)
{
bfd_size_type size = symtab_hdr->sh_info;
- size *= sizeof (*local_got_ents) + sizeof (char);
+ size *= sizeof (*local_got_ents) + sizeof (*local_got_tls_masks);
local_got_ents = (struct got_entry **) bfd_zalloc (abfd, size);
if (local_got_ents == NULL)
return FALSE;
@@ -3439,8 +3465,8 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type)
ent->got.refcount += 1;
}
- local_got_tls_types = (char *) (local_got_ents + symtab_hdr->sh_info);
- local_got_tls_types[r_symndx] |= tls_type;
+ local_got_tls_masks = (char *) (local_got_ents + symtab_hdr->sh_info);
+ local_got_tls_masks[r_symndx] |= tls_type;
return TRUE;
}
@@ -3556,14 +3582,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
case R_PPC64_GOT_TLSLD16_HI:
case R_PPC64_GOT_TLSLD16_HA:
htab->tlsld_got.refcount += 1;
- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
+ tls_type = TLS_TLS | TLS_LD;
goto dogottls;
case R_PPC64_GOT_TLSGD16:
case R_PPC64_GOT_TLSGD16_LO:
case R_PPC64_GOT_TLSGD16_HI:
case R_PPC64_GOT_TLSGD16_HA:
- tls_type = TLS_TLS | TLS_GD_LD;
+ tls_type = TLS_TLS | TLS_GD;
goto dogottls;
case R_PPC64_GOT_TPREL16_DS:
@@ -3618,7 +3644,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
eh->elf.got.glist = ent;
}
ent->got.refcount += 1;
- eh->tls_type |= tls_type;
+ eh->tls_mask |= tls_type;
}
else
/* This is a global offset table entry for a local symbol. */
@@ -3709,7 +3735,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
return FALSE;
if (h == htab->tls_get_addr)
sec->has_tls_reloc = 1;
- else if (strcmp (h->root.root.string, ".__tls_get_addr") == 0)
+ else if ((strncmp (h->root.root.string, ".__tls_get_addr", 15)
+ == 0)
+ && (h->root.root.string[15] == 0
+ || h->root.root.string[15] == '@'))
{
htab->tls_get_addr = h;
sec->has_tls_reloc = 1;
@@ -3727,9 +3756,9 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
if (rel + 1 < rel_end
&& rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)
&& rel[1].r_offset == rel->r_offset + 8)
- tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD;
+ tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD;
else
- tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD | TLS_LD;
+ tls_type = TLS_EXPLICIT | TLS_TLS | TLS_LD;
goto dotlstoc;
case R_PPC64_DTPREL64:
@@ -3747,7 +3776,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
{
struct ppc_link_hash_entry *eh;
eh = (struct ppc_link_hash_entry *) h;
- eh->tls_type |= tls_type;
+ eh->tls_mask |= tls_type;
}
else
if (!update_local_sym_info (abfd, symtab_hdr, r_symndx,
@@ -3756,7 +3785,8 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
if (ppc64_elf_section_data (sec)->t_symndx == NULL)
{
- bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8;
+ /* One extra to simplify get_tls_mask. */
+ bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1;
ppc64_elf_section_data (sec)->t_symndx
= (unsigned *) bfd_zalloc (abfd, amt);
if (ppc64_elf_section_data (sec)->t_symndx == NULL)
@@ -3764,6 +3794,13 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
}
BFD_ASSERT (rel->r_offset % 8 == 0);
ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8] = r_symndx;
+
+ /* Mark the second slot of a GD or LD entry.
+ -1 to indicate GD and -2 to indicate LD. */
+ if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_GD))
+ ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -1;
+ else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD))
+ ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2;
goto dodyn;
case R_PPC64_TPREL16:
@@ -3844,6 +3881,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
if (NO_OPD_RELOCS && opd_sym_map != NULL)
break;
+ /* Don't propagate relocs that the dynamic linker won't relocate. */
+ if ((sec->flags & SEC_ALLOC) == 0)
+ break;
+
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
against a local symbol, then we need to copy the reloc
@@ -3856,7 +3897,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
later (it is never cleared). In case of a weak definition,
DEF_REGULAR may be cleared later by a strong definition in
a shared library. We account for that possibility below by
- storing information in the relocs_copied field of the hash
+ storing information in the dyn_relocs field of the hash
table entry. A similar situation occurs when creating
shared libraries and symbol visibility changes render the
symbol local.
@@ -3867,15 +3908,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
symbol. */
dodyn:
if ((info->shared
- && (sec->flags & SEC_ALLOC) != 0
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
&& (! info->symbolic
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
- && (sec->flags & SEC_ALLOC) != 0
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
@@ -4078,11 +4118,29 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs)
{
unsigned long r_symndx;
enum elf_ppc64_reloc_type r_type;
- struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry *h = NULL;
char tls_type = 0;
r_symndx = ELF64_R_SYM (rel->r_info);
r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct ppc_link_hash_entry *eh;
+ struct ppc_dyn_relocs **pp;
+ struct ppc_dyn_relocs *p;
+
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct ppc_link_hash_entry *) h;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
switch (r_type)
{
case R_PPC64_GOT_TLSLD16:
@@ -4090,14 +4148,14 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs)
case R_PPC64_GOT_TLSLD16_HI:
case R_PPC64_GOT_TLSLD16_HA:
htab->tlsld_got.refcount -= 1;
- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
+ tls_type = TLS_TLS | TLS_LD;
goto dogot;
case R_PPC64_GOT_TLSGD16:
case R_PPC64_GOT_TLSGD16_LO:
case R_PPC64_GOT_TLSGD16_HI:
case R_PPC64_GOT_TLSGD16_HA:
- tls_type = TLS_TLS | TLS_GD_LD;
+ tls_type = TLS_TLS | TLS_GD;
goto dogot;
case R_PPC64_GOT_TPREL16_DS:
@@ -4124,11 +4182,8 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs)
{
struct got_entry *ent;
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- ent = h->got.glist;
- }
+ if (h != NULL)
+ ent = h->got.glist;
else
ent = local_got_ents[r_symndx];
@@ -4152,11 +4207,10 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs)
case R_PPC64_REL14_BRNTAKEN:
case R_PPC64_REL14_BRTAKEN:
case R_PPC64_REL24:
- if (r_symndx >= symtab_hdr->sh_info)
+ if (h != NULL)
{
struct plt_entry *ent;
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
for (ent = h->plt.plist; ent != NULL; ent = ent->next)
if (ent->addend == rel->r_addend)
break;
@@ -4167,73 +4221,6 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs)
}
break;
- case R_PPC64_REL30:
- case R_PPC64_REL32:
- case R_PPC64_REL64:
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct ppc_link_hash_entry *eh;
- struct ppc_dyn_relocs **pp;
- struct ppc_dyn_relocs *p;
-
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- eh = (struct ppc_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
-
- case R_PPC64_DTPMOD64:
- case R_PPC64_DTPREL64:
- case R_PPC64_TPREL64:
- case R_PPC64_ADDR14:
- case R_PPC64_ADDR14_BRNTAKEN:
- case R_PPC64_ADDR14_BRTAKEN:
- case R_PPC64_ADDR16:
- case R_PPC64_ADDR16_DS:
- case R_PPC64_ADDR16_HA:
- case R_PPC64_ADDR16_HI:
- case R_PPC64_ADDR16_HIGHER:
- case R_PPC64_ADDR16_HIGHERA:
- case R_PPC64_ADDR16_HIGHEST:
- case R_PPC64_ADDR16_HIGHESTA:
- case R_PPC64_ADDR16_LO:
- case R_PPC64_ADDR16_LO_DS:
- case R_PPC64_ADDR24:
- case R_PPC64_ADDR32:
- case R_PPC64_ADDR64:
- case R_PPC64_UADDR16:
- case R_PPC64_UADDR32:
- case R_PPC64_UADDR64:
- case R_PPC64_TOC:
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct ppc_link_hash_entry *eh;
- struct ppc_dyn_relocs **pp;
- struct ppc_dyn_relocs *p;
-
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- eh = (struct ppc_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
-
default:
break;
}
@@ -4492,8 +4479,6 @@ ppc64_elf_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct ppc_link_hash_table *htab;
- struct ppc_link_hash_entry * eh;
- struct ppc_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -4551,20 +4536,26 @@ ppc64_elf_adjust_dynamic_symbol (info, h)
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
return TRUE;
- eh = (struct ppc_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ if (ELIMINATE_COPY_RELOCS)
{
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ struct ppc_link_hash_entry * eh;
+ struct ppc_dyn_relocs *p;
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
+ eh = (struct ppc_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -4672,11 +4663,11 @@ ppc64_elf_hide_symbol (info, h, force_local)
}
static bfd_boolean
-get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd)
+get_sym_h (hp, symp, symsecp, tls_maskp, locsymsp, r_symndx, ibfd)
struct elf_link_hash_entry **hp;
Elf_Internal_Sym **symp;
asection **symsecp;
- char **tlstypep;
+ char **tls_maskp;
Elf_Internal_Sym **locsymsp;
unsigned long r_symndx;
bfd *ibfd;
@@ -4708,12 +4699,12 @@ get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd)
*symsecp = symsec;
}
- if (tlstypep != NULL)
+ if (tls_maskp != NULL)
{
struct ppc_link_hash_entry *eh;
eh = (struct ppc_link_hash_entry *) h;
- *tlstypep = &eh->tls_type;
+ *tls_maskp = &eh->tls_mask;
}
}
else
@@ -4750,45 +4741,50 @@ get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd)
*symsecp = symsec;
}
- if (tlstypep != NULL)
+ if (tls_maskp != NULL)
{
struct got_entry **lgot_ents;
- char *tlstype;
+ char *tls_mask;
- tlstype = NULL;
+ tls_mask = NULL;
lgot_ents = elf_local_got_ents (ibfd);
if (lgot_ents != NULL)
{
- char *lgot_types = (char *) (lgot_ents + symtab_hdr->sh_info);
- tlstype = &lgot_types[r_symndx];
+ char *lgot_masks = (char *) (lgot_ents + symtab_hdr->sh_info);
+ tls_mask = &lgot_masks[r_symndx];
}
- *tlstypep = tlstype;
+ *tls_maskp = tls_mask;
}
}
return TRUE;
}
-static bfd_boolean
-get_tls_type (tls_type, locsymsp, rel, ibfd)
- char **tls_type;
+/* Returns TLS_MASKP for the given REL symbol. Function return is 0 on
+ error, 2 on a toc GD type suitable for optimization, 3 on a toc LD
+ type suitable for optimization, and 1 otherwise. */
+
+static int
+get_tls_mask (tls_maskp, locsymsp, rel, ibfd)
+ char **tls_maskp;
Elf_Internal_Sym **locsymsp;
const Elf_Internal_Rela *rel;
bfd *ibfd;
{
unsigned long r_symndx;
+ unsigned int next_r;
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
asection *sec;
bfd_vma off;
r_symndx = ELF64_R_SYM (rel->r_info);
- if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd))
- return FALSE;
+ if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd))
+ return 0;
- if ((*tls_type != NULL && **tls_type != 0)
+ if ((*tls_maskp != NULL && **tls_maskp != 0)
|| sec == NULL
|| ppc64_elf_section_data (sec)->t_symndx == NULL)
- return TRUE;
+ return 1;
/* Look inside a TOC section too. */
if (h != NULL)
@@ -4801,7 +4797,21 @@ get_tls_type (tls_type, locsymsp, rel, ibfd)
off += rel->r_addend;
BFD_ASSERT (off % 8 == 0);
r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8];
- return get_sym_h (&h, &sym, NULL, tls_type, locsymsp, r_symndx, ibfd);
+ next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1];
+ if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd))
+ return 0;
+ if (h == NULL
+ || h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ if (next_r == (unsigned) -1)
+ return 2;
+ if (next_r == (unsigned) -2
+ && (h == NULL
+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
+ return 3;
+ }
+ return 1;
}
bfd_boolean
@@ -5110,39 +5120,58 @@ ppc64_elf_edit_opd (obfd, info)
return TRUE;
}
-/* Run through all the TLS relocs looking for optimization
- opportunities. The linker has been hacked (see ppc64elf.em) to do
- a preliminary section layout so that we know the TLS segment
- offsets. We can't optimize earlier because some optimizations need
- to know the tp offset, and we need to optimize before allocating
- dynamic relocations. */
+/* Set htab->tls_sec. */
bfd_boolean
-ppc64_elf_tls_optimize (obfd, info)
+ppc64_elf_tls_setup (obfd, info)
bfd *obfd;
struct bfd_link_info *info;
{
asection *tls;
- bfd *ibfd;
- asection *sec;
struct ppc_link_hash_table *htab;
- if (info->relocateable)
- return TRUE;
-
for (tls = obfd->sections; tls != NULL; tls = tls->next)
if ((tls->flags & (SEC_THREAD_LOCAL | SEC_LOAD))
== (SEC_THREAD_LOCAL | SEC_LOAD))
break;
- if (tls == NULL)
- return TRUE;
htab = ppc_hash_table (info);
htab->tls_sec = tls;
- if (info->shared)
+ if (htab->tls_get_addr != NULL)
+ {
+ struct elf_link_hash_entry *h = htab->tls_get_addr;
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ htab->tls_get_addr = h;
+ }
+
+ return tls != NULL;
+}
+
+/* Run through all the TLS relocs looking for optimization
+ opportunities. The linker has been hacked (see ppc64elf.em) to do
+ a preliminary section layout so that we know the TLS segment
+ offsets. We can't optimize earlier because some optimizations need
+ to know the tp offset, and we need to optimize before allocating
+ dynamic relocations. */
+
+bfd_boolean
+ppc64_elf_tls_optimize (obfd, info)
+ bfd *obfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+{
+ bfd *ibfd;
+ asection *sec;
+ struct ppc_link_hash_table *htab;
+
+ if (info->relocateable || info->shared)
return TRUE;
+ htab = ppc_hash_table (info);
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
{
Elf_Internal_Sym *locsyms = NULL;
@@ -5169,13 +5198,13 @@ ppc64_elf_tls_optimize (obfd, info)
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
asection *sym_sec;
- char *tls_type;
- char tls_set, tls_clear, got_tls_type = 0;
+ char *tls_mask;
+ char tls_set, tls_clear, tls_type = 0;
bfd_vma value;
- bfd_boolean ok_tprel;
+ bfd_boolean ok_tprel, is_local;
r_symndx = ELF64_R_SYM (rel->r_info);
- if (!get_sym_h (&h, &sym, &sym_sec, &tls_type, &locsyms,
+ if (!get_sym_h (&h, &sym, &sym_sec, &tls_mask, &locsyms,
r_symndx, ibfd))
{
err_free_rel:
@@ -5197,9 +5226,13 @@ ppc64_elf_tls_optimize (obfd, info)
}
else
value = sym->st_value;
+
ok_tprel = FALSE;
- if (sym_sec != NULL && sym_sec->output_section != NULL)
+ is_local = FALSE;
+ if (h == NULL
+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
{
+ is_local = TRUE;
value += sym_sec->output_offset;
value += sym_sec->output_section->vma;
value -= htab->tls_sec->vma;
@@ -5215,16 +5248,17 @@ ppc64_elf_tls_optimize (obfd, info)
case R_PPC64_GOT_TLSLD16_LO:
case R_PPC64_GOT_TLSLD16_HI:
case R_PPC64_GOT_TLSLD16_HA:
+ /* These relocs should never be against a symbol
+ defined in a shared lib. Leave them alone if
+ that turns out to be the case. */
htab->tlsld_got.refcount -= 1;
- if (ok_tprel)
- /* LD -> LE */
- tls_set = 0;
- else
- /* We still need a GOT entry as the offset is
- too big. ie. LD -> IE. */
- tls_set = TLS_TLS | TLS_TPREL;
- tls_clear = TLS_GD_LD;
- got_tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
+ if (!is_local)
+ continue;
+
+ /* LD -> LE */
+ tls_set = 0;
+ tls_clear = TLS_LD;
+ tls_type = TLS_TLS | TLS_LD;
expecting_tls_get_addr = 1;
break;
@@ -5232,21 +5266,14 @@ ppc64_elf_tls_optimize (obfd, info)
case R_PPC64_GOT_TLSGD16_LO:
case R_PPC64_GOT_TLSGD16_HI:
case R_PPC64_GOT_TLSGD16_HA:
- if (ok_tprel
- && (h == NULL
- || ((h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags
- & ELF_LINK_FORCED_LOCAL) != 0
- || !info->shared
- || info->symbolic))))
+ if (ok_tprel)
/* GD -> LE */
tls_set = 0;
else
/* GD -> IE */
- tls_set = TLS_TLS | TLS_TPREL;
- tls_clear = TLS_GD_LD;
- got_tls_type = TLS_TLS | TLS_GD_LD;
+ tls_set = TLS_TLS | TLS_TPRELGD;
+ tls_clear = TLS_GD;
+ tls_type = TLS_TLS | TLS_GD;
expecting_tls_get_addr = 1;
break;
@@ -5260,7 +5287,7 @@ ppc64_elf_tls_optimize (obfd, info)
/* IE -> LE */
tls_set = 0;
tls_clear = TLS_TPREL;
- got_tls_type = TLS_TLS | TLS_TPREL;
+ tls_type = TLS_TLS | TLS_TPREL;
break;
}
else
@@ -5282,12 +5309,14 @@ ppc64_elf_tls_optimize (obfd, info)
{
/* Check for toc tls entries. */
char *toc_tls;
+ int retval;
- if (!get_tls_type (&toc_tls, &locsyms,
- rel - 1, ibfd))
+ retval = get_tls_mask (&toc_tls, &locsyms,
+ rel - 1, ibfd);
+ if (retval == 0)
goto err_free_rel;
if (toc_tls != NULL)
- expecting_tls_get_addr = *toc_tls != 0;
+ expecting_tls_get_addr = retval > 1;
}
if (expecting_tls_get_addr)
@@ -5319,32 +5348,27 @@ ppc64_elf_tls_optimize (obfd, info)
case R_PPC64_DTPMOD64:
expecting_tls_get_addr = 0;
- if ((*tls_type & TLS_LD) == 0)
+ if (rel + 1 < relend
+ && (rel[1].r_info
+ == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
+ && rel[1].r_offset == rel->r_offset + 8)
{
- if ((h == NULL
- || ((h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags
- & ELF_LINK_FORCED_LOCAL) != 0
- || !info->shared
- || info->symbolic)))
- && ok_tprel)
+ if (ok_tprel)
/* GD -> LE */
- tls_set = TLS_EXPLICIT;
+ tls_set = TLS_EXPLICIT | TLS_GD;
else
/* GD -> IE */
- tls_set = TLS_EXPLICIT | TLS_TPREL;
- tls_clear = TLS_GD_LD;
+ tls_set = TLS_EXPLICIT | TLS_GD | TLS_TPRELGD;
+ tls_clear = TLS_GD;
}
else
{
- if (ok_tprel)
- /* LD -> LE */
- tls_set = TLS_EXPLICIT;
- else
- /* LD -> IE */
- tls_set = TLS_EXPLICIT | TLS_TPREL;
- tls_clear = TLS_GD_LD;
+ if (!is_local)
+ continue;
+
+ /* LD -> LE */
+ tls_set = TLS_EXPLICIT;
+ tls_clear = TLS_LD;
}
break;
@@ -5365,7 +5389,7 @@ ppc64_elf_tls_optimize (obfd, info)
for (; ent != NULL; ent = ent->next)
if (ent->addend == rel->r_addend
- && ent->tls_type == got_tls_type)
+ && ent->tls_type == tls_type)
break;
if (ent == NULL)
abort ();
@@ -5376,8 +5400,6 @@ ppc64_elf_tls_optimize (obfd, info)
if (ent->got.refcount > 0)
ent->got.refcount -= 1;
}
- else
- ent->tls_type = tls_set;
}
else if (h != NULL)
{
@@ -5395,22 +5417,17 @@ ppc64_elf_tls_optimize (obfd, info)
/* If we got rid of a DTPMOD/DTPREL reloc
pair then we'll lose one or two dyn
relocs. */
- if (tls_clear == TLS_GD_LD
- && rel + 1 < relend
- && (rel[1].r_info
- == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
- && rel[1].r_offset == rel->r_offset + 8)
- p->count -= 1;
- if (tls_set == TLS_EXPLICIT)
+ if (tls_set == (TLS_EXPLICIT | TLS_GD))
p->count -= 1;
+ p->count -= 1;
if (p->count == 0)
*pp = p->next;
break;
}
}
- *tls_type |= tls_set;
- *tls_type &= ~tls_clear;
+ *tls_mask |= tls_set;
+ *tls_mask &= ~tls_clear;
}
if (elf_section_data (sec)->relocs != relstart)
@@ -5434,9 +5451,9 @@ ppc64_elf_tls_optimize (obfd, info)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in ppc64_elf_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
((DYN) \
- && ((INFO)->shared \
+ && ((SHARED) \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -5467,7 +5484,7 @@ allocate_dynrelocs (h, inf)
if (htab->elf.dynamic_sections_created
&& h->dynindx != -1
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
{
struct plt_entry *pent;
bfd_boolean doneone = FALSE;
@@ -5515,11 +5532,39 @@ allocate_dynrelocs (h, inf)
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
}
+ eh = (struct ppc_link_hash_entry *) h;
+ /* Run through the TLS GD got entries first if we're changing them
+ to TPREL. */
+ if ((eh->tls_mask & TLS_TPRELGD) != 0)
+ for (gent = h->got.glist; gent != NULL; gent = gent->next)
+ if (gent->got.refcount > 0
+ && (gent->tls_type & TLS_GD) != 0)
+ {
+ /* This was a GD entry that has been converted to TPREL. If
+ there happens to be a TPREL entry we can use that one. */
+ struct got_entry *ent;
+ for (ent = h->got.glist; ent != NULL; ent = ent->next)
+ if (ent->got.refcount > 0
+ && (ent->tls_type & TLS_TPREL) != 0
+ && ent->addend == gent->addend)
+ {
+ gent->got.refcount = 0;
+ break;
+ }
+
+ /* If not, then we'll be using our own TPREL entry. */
+ if (gent->got.refcount != 0)
+ gent->tls_type = TLS_TLS | TLS_TPREL;
+ }
+
for (gent = h->got.glist; gent != NULL; gent = gent->next)
if (gent->got.refcount > 0)
{
+ bfd_boolean dyn;
+
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic,
+ nor will all TLS symbols. */
if (h->dynindx == -1
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
@@ -5527,27 +5572,28 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if ((gent->tls_type & TLS_LD) != 0)
- gent->got.offset = htab->tlsld_got.offset;
- else
+ if ((gent->tls_type & TLS_LD) != 0
+ && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
{
- bfd_boolean dyn;
-
- s = htab->sgot;
- gent->got.offset = s->_raw_size;
- s->_raw_size += (gent->tls_type & TLS_GD_LD) != 0 ? 16 : 8;
- dyn = htab->elf.dynamic_sections_created;
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
- htab->srelgot->_raw_size
- += ((gent->tls_type & TLS_GD_LD) != 0
- ? 2 * sizeof (Elf64_External_Rela)
- : sizeof (Elf64_External_Rela));
+ gent->got.offset = htab->tlsld_got.offset;
+ continue;
}
+
+ s = htab->sgot;
+ gent->got.offset = s->_raw_size;
+ s->_raw_size
+ += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8;
+ dyn = htab->elf.dynamic_sections_created;
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
+ htab->srelgot->_raw_size
+ += (gent->tls_type & eh->tls_mask & TLS_GD
+ ? 2 * sizeof (Elf64_External_Rela)
+ : sizeof (Elf64_External_Rela));
}
else
gent->got.offset = (bfd_vma) -1;
- eh = (struct ppc_link_hash_entry *) h;
if (eh->dyn_relocs == NULL)
return TRUE;
@@ -5576,18 +5622,15 @@ allocate_dynrelocs (h, inf)
}
}
}
- else
+ else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
dynamic. */
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
- && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- || (htab->elf.dynamic_sections_created
- && (h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined))))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -5697,6 +5740,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
{
struct got_entry **lgot_ents;
struct got_entry **end_lgot_ents;
+ char *lgot_masks;
bfd_size_type locsymcount;
Elf_Internal_Shdr *symtab_hdr;
asection *srel;
@@ -5738,16 +5782,17 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
end_lgot_ents = lgot_ents + locsymcount;
+ lgot_masks = (char *) end_lgot_ents;
s = htab->sgot;
srel = htab->srelgot;
- for (; lgot_ents < end_lgot_ents; ++lgot_ents)
+ for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_masks)
{
struct got_entry *ent;
for (ent = *lgot_ents; ent != NULL; ent = ent->next)
if (ent->got.refcount > 0)
{
- if ((ent->tls_type & TLS_LD) != 0)
+ if ((ent->tls_type & *lgot_masks & TLS_LD) != 0)
{
if (htab->tlsld_got.offset == (bfd_vma) -1)
{
@@ -5761,7 +5806,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
else
{
ent->got.offset = s->_raw_size;
- if ((ent->tls_type & TLS_GD_LD) != 0)
+ if ((ent->tls_type & *lgot_masks & TLS_GD) != 0)
{
s->_raw_size += 16;
if (info->shared)
@@ -6190,13 +6235,14 @@ ppc_size_one_stub (gen_entry, in_arg)
if (stub_entry->stub_type == ppc_stub_plt_call)
{
struct plt_entry *ent;
+ off = (bfd_vma) -1;
for (ent = stub_entry->h->elf.plt.plist; ent != NULL; ent = ent->next)
if (ent->addend == stub_entry->addend)
{
off = ent->plt.offset & ~(bfd_vma) 1;
break;
}
- if (ent == NULL)
+ if (off >= (bfd_vma) -2)
abort ();
off += (htab->splt->output_offset
+ htab->splt->output_section->vma
@@ -6376,12 +6422,15 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
asection *curr;
asection *prev;
bfd_size_type total;
+ bfd_boolean big_sec;
curr = tail;
if (tail->_cooked_size)
total = tail->_cooked_size;
else
total = tail->_raw_size;
+ big_sec = total >= stub_group_size;
+
while ((prev = PREV_SEC (curr)) != NULL
&& ((total += curr->output_offset - prev->output_offset)
< stub_group_size))
@@ -6396,7 +6445,7 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
section size. That's a little tricky, and this way will
only break if stubs added make the total size more than
2^25, ie. for the default stub_group_size, if stubs total
- more than 2834432 bytes, or over 100000 plt call stubs. */
+ more than 2097152 bytes, or nearly 75000 plt call stubs. */
do
{
prev = PREV_SEC (tail);
@@ -6406,8 +6455,11 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
while (tail != curr && (tail = prev) != NULL);
/* But wait, there's more! Input sections up to stub_group_size
- bytes before the stub section can be handled by it too. */
- if (!stubs_always_before_branch)
+ bytes before the stub section can be handled by it too.
+ Don't do this if we have a really large section after the
+ stubs, as adding more stubs increases the chance that
+ branches may not reach into the stub section. */
+ if (!stubs_always_before_branch && !big_sec)
{
total = 0;
while (prev != NULL
@@ -6459,9 +6511,18 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size,
if (stub_group_size == 1)
{
/* Default values. */
- stub_group_size = 30720000;
- if (htab->has_14bit_branch)
- stub_group_size = 30000;
+ if (stubs_always_before_branch)
+ {
+ stub_group_size = 0x1e00000;
+ if (htab->has_14bit_branch)
+ stub_group_size = 0x7800;
+ }
+ else
+ {
+ stub_group_size = 0x1c00000;
+ if (htab->has_14bit_branch)
+ stub_group_size = 0x7000;
+ }
}
group_sections (htab, stub_group_size, stubs_always_before_branch);
@@ -6603,13 +6664,12 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size,
&& irela != internal_relocs)
{
/* Get tls info. */
- char *tls_type;
+ char *tls_mask;
- if (!get_tls_type (&tls_type, &local_syms,
+ if (!get_tls_mask (&tls_mask, &local_syms,
irela - 1, input_bfd))
goto error_ret_free_internal;
- if (tls_type != NULL
- && (*tls_type & (TLS_TLS | TLS_GD_LD)) == TLS_TLS)
+ if (*tls_mask != 0)
continue;
}
@@ -6902,7 +6962,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela *relend;
Elf_Internal_Rela outrel;
bfd_byte *loc;
- unsigned int tls_get_addr_type;
struct got_entry **local_got_ents;
bfd_vma TOCstart;
bfd_boolean ret = TRUE;
@@ -6918,27 +6977,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
ppc_howto_init ();
htab = ppc_hash_table (info);
- if (info->shared && (htab->tlsld_got.offset & 1) == 0)
- {
- outrel.r_offset = (htab->sgot->output_section->vma
- + htab->sgot->output_offset
- + htab->tlsld_got.offset);
- outrel.r_info = ELF64_R_INFO (0, R_PPC64_DTPMOD64);
- outrel.r_addend = 0;
-
- loc = htab->srelgot->contents;
- loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
- bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
- htab->tlsld_got.offset |= 1;
- }
-
local_got_ents = elf_local_got_ents (input_bfd);
TOCstart = elf_gp (output_bfd);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL;
- tls_get_addr_type = 0;
rel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
@@ -6952,7 +6996,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_link_hash_entry *fdh;
const char *sym_name;
unsigned long r_symndx;
- char tls_type;
+ char tls_mask, tls_gd, tls_type;
bfd_vma relocation;
bfd_boolean unresolved_reloc;
bfd_boolean warned;
@@ -6963,7 +7007,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
r_symndx = ELF64_R_SYM (rel->r_info);
- r = bfd_reloc_other;
sym = (Elf_Internal_Sym *) 0;
sec = (asection *) 0;
h = (struct elf_link_hash_entry *) 0;
@@ -7019,7 +7062,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
@@ -7035,17 +7077,21 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
- /* TLS optimizations. */
- tls_type = 0;
- if (IS_TLS_RELOC (r_type))
+ /* TLS optimizations. Replace instruction sequences and relocs
+ based on information we collected in tls_optimize. We edit
+ RELOCS so that --emit-relocs will output something sensible
+ for the final instruction stream. */
+ tls_mask = 0;
+ tls_gd = 0;
+ if (IS_PPC64_TLS_RELOC (r_type))
{
if (h != NULL)
- tls_type = ((struct ppc_link_hash_entry *) h)->tls_type;
+ tls_mask = ((struct ppc_link_hash_entry *) h)->tls_mask;
else if (local_got_ents != NULL)
{
- char *lgot_types;
- lgot_types = (char *) (local_got_ents + symtab_hdr->sh_info);
- tls_type = lgot_types[r_symndx];
+ char *lgot_masks;
+ lgot_masks = (char *) (local_got_ents + symtab_hdr->sh_info);
+ tls_mask = lgot_masks[r_symndx];
}
}
@@ -7064,39 +7110,52 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
switch (r_type)
{
default:
- tls_get_addr_type = 0;
break;
case R_PPC64_TOC16:
case R_PPC64_TOC16_LO:
case R_PPC64_TOC16_DS:
case R_PPC64_TOC16_LO_DS:
- tls_get_addr_type = 0;
{
/* Check for toc tls entries. */
char *toc_tls;
+ int retval;
- if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd))
+ retval = get_tls_mask (&toc_tls, &local_syms, rel, input_bfd);
+ if (retval == 0)
return FALSE;
if (toc_tls)
{
- tls_type = *toc_tls;
+ tls_mask = *toc_tls;
if (r_type == R_PPC64_TOC16_DS
|| r_type == R_PPC64_TOC16_LO_DS)
goto toctprel;
else
- tls_get_addr_type = tls_type;
+ {
+ /* If we found a GD reloc pair, then we might be
+ doing a GD->IE transition. */
+ if (retval == 2)
+ {
+ tls_gd = TLS_TPRELGD;
+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
+ goto tls_get_addr_check;
+ }
+ else if (retval == 3)
+ {
+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
+ goto tls_get_addr_check;
+ }
+ }
}
}
break;
case R_PPC64_GOT_TPREL16_DS:
case R_PPC64_GOT_TPREL16_LO_DS:
- tls_get_addr_type = 0;
toctprel:
- if (tls_type != 0
- && (tls_type & TLS_TPREL) == 0)
+ if (tls_mask != 0
+ && (tls_mask & TLS_TPREL) == 0)
{
bfd_vma insn;
insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2);
@@ -7109,20 +7168,19 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case R_PPC64_TLS:
- tls_get_addr_type = 0;
- if (tls_type == 0)
+ if (tls_mask == 0)
{
/* Check for toc tls entries. */
char *toc_tls;
- if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd))
+ if (!get_tls_mask (&toc_tls, &local_syms, rel, input_bfd))
return FALSE;
if (toc_tls)
- tls_type = *toc_tls;
+ tls_mask = *toc_tls;
}
- if (tls_type != 0
- && (tls_type & TLS_TPREL) == 0)
+ if (tls_mask != 0
+ && (tls_mask & TLS_TPREL) == 0)
{
bfd_vma insn, rtra;
insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
@@ -7164,130 +7222,162 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
break;
- case R_PPC64_GOT_TLSGD16:
- case R_PPC64_GOT_TLSGD16_LO:
case R_PPC64_GOT_TLSGD16_HI:
case R_PPC64_GOT_TLSGD16_HA:
- case R_PPC64_GOT_TLSLD16:
- case R_PPC64_GOT_TLSLD16_LO:
+ tls_gd = TLS_TPRELGD;
+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
+ goto tls_gdld_hi;
+ break;
+
case R_PPC64_GOT_TLSLD16_HI:
case R_PPC64_GOT_TLSLD16_HA:
- tls_get_addr_type = 0;
- if (tls_type != 0 && (tls_type & TLS_GD_LD) == 0)
+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
{
- if (r_type == R_PPC64_GOT_TLSGD16_HI
- || r_type == R_PPC64_GOT_TLSGD16_HA
- || r_type == R_PPC64_GOT_TLSLD16_HI
- || r_type == R_PPC64_GOT_TLSLD16_HA)
+ tls_gdld_hi:
+ if ((tls_mask & tls_gd) != 0)
+ r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
+ + R_PPC64_GOT_TPREL16_DS);
+ else
{
- if ((tls_type & TLS_LD) != 0)
- {
- bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
- r_type = R_PPC64_NONE;
- rel->r_offset -= 2;
- }
- else
- r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
- + R_PPC64_GOT_TPREL16_DS);
- rel->r_info = ELF64_R_INFO (r_symndx, r_type);
- break;
+ bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
+ rel->r_offset -= 2;
+ r_type = R_PPC64_NONE;
}
-
- /* This reloc and its instruction will be replaced so there's
- not much point in doing anything more here. We know the
- next reloc will be a REL24 to __tls_get_addr, and will
- be handled below. */
- tls_get_addr_type = tls_type;
- continue;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
}
break;
- case R_PPC64_REL14:
- case R_PPC64_REL14_BRTAKEN:
- case R_PPC64_REL14_BRNTAKEN:
- case R_PPC64_REL24:
- if (h != NULL
- && h == htab->tls_get_addr
- && tls_get_addr_type != 0
- && (tls_get_addr_type & TLS_GD_LD) == 0)
- {
- /* Replace the call. */
- bfd_vma insn1, insn2, insn3;
- bfd_vma offset = rel->r_offset;
+ case R_PPC64_GOT_TLSGD16:
+ case R_PPC64_GOT_TLSGD16_LO:
+ tls_gd = TLS_TPRELGD;
+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
+ goto tls_get_addr_check;
+ break;
- insn1 = bfd_get_32 (output_bfd, contents + rel[-1].r_offset - 2);
- insn3 = bfd_get_32 (output_bfd, contents + offset + 4);
- if (tls_get_addr_type & TLS_TPREL)
- {
- /* IE */
- insn1 &= (1 << 26) - (1 << 2);
- insn1 |= 58 << 26; /* ld */
- insn2 = 0x7c636a14; /* add 3,3,13 */
- /* Fix the relocs for --emit-relocs. */
- r_type = ELF64_R_TYPE (rel[-1].r_info);
- if (tls_get_addr_type & TLS_EXPLICIT)
- r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16;
- else
- r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
- + R_PPC64_GOT_TPREL16_DS);
- rel[-1].r_info
- = ELF64_R_INFO (ELF64_R_SYM (rel[-1].r_info), r_type);
- rel->r_info = 0;
- }
- else
+ case R_PPC64_GOT_TLSLD16:
+ case R_PPC64_GOT_TLSLD16_LO:
+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
+ {
+ tls_get_addr_check:
+ if (rel + 1 < relend)
{
- /* LE */
- insn1 = 0x3c6d0000; /* addis 3,13,0 */
- insn2 = 0x38630000; /* addi 3,3,0 */
- if (tls_get_addr_type & TLS_LD)
+ enum elf_ppc64_reloc_type r_type2;
+ unsigned long r_symndx2;
+ struct elf_link_hash_entry *h2;
+ bfd_vma insn1, insn2, insn3;
+ bfd_vma offset;
+
+ /* The next instruction should be a call to
+ __tls_get_addr. Peek at the reloc to be sure. */
+ r_type2
+ = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel[1].r_info);
+ r_symndx2 = ELF64_R_SYM (rel[1].r_info);
+ if (r_symndx2 < symtab_hdr->sh_info
+ || (r_type2 != R_PPC64_REL14
+ && r_type2 != R_PPC64_REL14_BRTAKEN
+ && r_type2 != R_PPC64_REL14_BRNTAKEN
+ && r_type2 != R_PPC64_REL24))
+ break;
+
+ h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info];
+ while (h2->root.type == bfd_link_hash_indirect
+ || h2->root.type == bfd_link_hash_warning)
+ h2 = (struct elf_link_hash_entry *) h2->root.u.i.link;
+ if (h2 == NULL || h2 != htab->tls_get_addr)
+ break;
+
+ /* OK, it checks out. Replace the call. */
+ offset = rel[1].r_offset;
+ insn1 = bfd_get_32 (output_bfd,
+ contents + rel->r_offset - 2);
+ insn3 = bfd_get_32 (output_bfd,
+ contents + offset + 4);
+ if ((tls_mask & tls_gd) != 0)
{
- r_symndx = 0;
- rel[-1].r_addend = htab->tls_sec->vma + DTP_OFFSET;
- rel->r_addend = htab->tls_sec->vma + DTP_OFFSET;
+ /* IE */
+ insn1 &= (1 << 26) - (1 << 2);
+ insn1 |= 58 << 26; /* ld */
+ insn2 = 0x7c636a14; /* add 3,3,13 */
+ rel[1].r_info = ELF64_R_INFO (r_symndx2, R_PPC64_NONE);
+ if ((tls_mask & TLS_EXPLICIT) == 0)
+ r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
+ + R_PPC64_GOT_TPREL16_DS);
+ else
+ r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
}
else
- r_symndx = ELF64_R_SYM (rel[-1].r_info);
- rel[-1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_HA);
- rel->r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_LO);
- rel->r_offset += 2;
- }
- if (insn3 == NOP
- || insn3 == CROR_151515 || insn3 == CROR_313131)
- {
- insn3 = insn2;
- insn2 = NOP;
- rel->r_offset += 4;
+ {
+ /* LE */
+ insn1 = 0x3c6d0000; /* addis 3,13,0 */
+ insn2 = 0x38630000; /* addi 3,3,0 */
+ if (tls_gd == 0)
+ {
+ /* Was an LD reloc. */
+ r_symndx = 0;
+ rel->r_addend = htab->tls_sec->vma + DTP_OFFSET;
+ rel[1].r_addend = htab->tls_sec->vma + DTP_OFFSET;
+ }
+ r_type = R_PPC64_TPREL16_HA;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
+ rel[1].r_info = ELF64_R_INFO (r_symndx,
+ R_PPC64_TPREL16_LO);
+ rel[1].r_offset += 2;
+ }
+ if (insn3 == NOP
+ || insn3 == CROR_151515 || insn3 == CROR_313131)
+ {
+ insn3 = insn2;
+ insn2 = NOP;
+ rel[1].r_offset += 4;
+ }
+ bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
+ bfd_put_32 (output_bfd, insn2, contents + offset);
+ bfd_put_32 (output_bfd, insn3, contents + offset + 4);
+ if (tls_gd == 0)
+ {
+ /* We changed the symbol on an LD reloc. Start over
+ in order to get h, sym, sec etc. right. */
+ rel--;
+ continue;
+ }
}
- bfd_put_32 (output_bfd, insn1, contents + rel[-1].r_offset - 2);
- bfd_put_32 (output_bfd, insn2, contents + offset);
- bfd_put_32 (output_bfd, insn3, contents + offset + 4);
- /* Do the relocs again. */
- rel -= 2;
- tls_get_addr_type = 0;
- continue;
}
- tls_get_addr_type = 0;
break;
case R_PPC64_DTPMOD64:
- if ((tls_type & TLS_GD_LD) == 0)
+ if (rel + 1 < relend
+ && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)
+ && rel[1].r_offset == rel->r_offset + 8)
{
- if ((tls_type & TLS_TPREL) != 0)
- r_type = R_PPC64_TPREL64;
- else
+ if ((tls_mask & TLS_GD) == 0)
+ {
+ rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_NONE);
+ if ((tls_mask & TLS_TPRELGD) != 0)
+ r_type = R_PPC64_TPREL64;
+ else
+ {
+ bfd_put_64 (output_bfd, (bfd_vma) 1,
+ contents + rel->r_offset);
+ r_type = R_PPC64_NONE;
+ }
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
+ }
+ }
+ else
+ {
+ if ((tls_mask & TLS_LD) == 0)
{
bfd_put_64 (output_bfd, (bfd_vma) 1,
contents + rel->r_offset);
r_type = R_PPC64_NONE;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
}
- rel->r_info = ELF64_R_INFO (r_symndx, r_type);
- if ((tls_type & TLS_LD) == 0)
- rel[1].r_info = 0;
}
break;
case R_PPC64_TPREL64:
- if ((tls_type & TLS_TPREL) == 0)
+ if ((tls_mask & TLS_TPREL) == 0)
{
r_type = R_PPC64_NONE;
rel->r_info = ELF64_R_INFO (r_symndx, r_type);
@@ -7437,14 +7527,14 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC64_GOT_TLSGD16_LO:
case R_PPC64_GOT_TLSGD16_HI:
case R_PPC64_GOT_TLSGD16_HA:
- tls_type = TLS_TLS | TLS_GD_LD;
+ tls_type = TLS_TLS | TLS_GD;
goto dogot;
case R_PPC64_GOT_TLSLD16:
case R_PPC64_GOT_TLSLD16_LO:
case R_PPC64_GOT_TLSLD16_HI:
case R_PPC64_GOT_TLSLD16_HA:
- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
+ tls_type = TLS_TLS | TLS_LD;
goto dogot;
case R_PPC64_GOT_TPREL16_DS:
@@ -7471,57 +7561,64 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
/* Relocation is to the entry for this symbol in the global
offset table. */
- struct got_entry *ent;
+ bfd_vma *offp;
bfd_vma off;
- unsigned long indx;
+ unsigned long indx = 0;
if (htab->sgot == NULL)
abort ();
- if (h != NULL)
- ent = h->got.glist;
+ if (tls_type == (TLS_TLS | TLS_LD)
+ && (h == NULL
+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
+ offp = &htab->tlsld_got.offset;
else
{
- if (local_got_ents == NULL)
- abort ();
- ent = local_got_ents[r_symndx];
- }
+ struct got_entry *ent;
- for (; ent != NULL; ent = ent->next)
- if (ent->addend == rel->r_addend
- && ent->tls_type == tls_type)
- break;
- if (ent == NULL)
- abort ();
-
- off = ent->got.offset;
- indx = 0;
- if (h != NULL)
- {
- bfd_boolean dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
- || (info->shared
- && (info->symbolic
- || h->dynindx == -1
- || (h->elf_link_hash_flags
- & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR)))
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. */
- ;
+ if (h != NULL)
+ {
+ bfd_boolean dyn = htab->elf.dynamic_sections_created;
+ if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && (info->symbolic
+ || h->dynindx == -1
+ || (h->elf_link_hash_flags
+ & ELF_LINK_FORCED_LOCAL))
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR)))
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. */
+ ;
+ else
+ {
+ indx = h->dynindx;
+ unresolved_reloc = FALSE;
+ }
+ ent = h->got.glist;
+ }
else
{
- indx = h->dynindx;
- unresolved_reloc = FALSE;
+ if (local_got_ents == NULL)
+ abort ();
+ ent = local_got_ents[r_symndx];
}
+
+ for (; ent != NULL; ent = ent->next)
+ if (ent->addend == rel->r_addend
+ && ent->tls_type == tls_type)
+ break;
+ if (ent == NULL)
+ abort ();
+ offp = &ent->got.offset;
}
/* The offset must always be a multiple of 8. We use the
least significant bit to record whether we have already
processed this entry. */
+ off = *offp;
if ((off & 1) != 0)
off &= ~1;
else
@@ -7529,32 +7626,37 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Generate relocs for the dynamic linker, except in
the case of TLSLD where we'll use one entry per
module. */
- if ((info->shared || indx != 0)
- && ent->tls_type != (TLS_TLS | TLS_GD_LD | TLS_LD))
+ *offp = off | 1;
+ if (info->shared || indx != 0)
{
outrel.r_offset = (htab->sgot->output_section->vma
+ htab->sgot->output_offset
+ off);
- if (ent->tls_type == (TLS_TLS | TLS_GD_LD))
+ if (tls_type & (TLS_LD | TLS_GD))
{
outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64);
outrel.r_addend = 0;
- loc = htab->srelgot->contents;
- loc += (htab->srelgot->reloc_count++
- * sizeof (Elf64_External_Rela));
- bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
- outrel.r_offset += 8;
+ if (tls_type == (TLS_TLS | TLS_GD))
+ {
+ loc = htab->srelgot->contents;
+ loc += (htab->srelgot->reloc_count++
+ * sizeof (Elf64_External_Rela));
+ bfd_elf64_swap_reloca_out (output_bfd,
+ &outrel, loc);
+ outrel.r_info
+ = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
+ outrel.r_offset += 8;
+ }
}
- else if (ent->tls_type == (TLS_TLS | TLS_DTPREL))
+ else if (tls_type == (TLS_TLS | TLS_DTPREL))
outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
- else if (ent->tls_type == (TLS_TLS | TLS_TPREL))
+ else if (tls_type == (TLS_TLS | TLS_TPREL))
outrel.r_info = ELF64_R_INFO (indx, R_PPC64_TPREL64);
else if (indx == 0)
outrel.r_info = ELF64_R_INFO (indx, R_PPC64_RELATIVE);
else
outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT);
- outrel.r_addend = ent->addend;
+ outrel.r_addend = rel->r_addend;
if (indx == 0)
outrel.r_addend += relocation;
loc = htab->srelgot->contents;
@@ -7565,29 +7667,27 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Init the .got section contents if we're not
emitting a reloc. */
- if (!(info->shared || indx != 0))
+ else
{
-
- relocation += ent->addend;
- if ((tls_type & TLS_TLS) != 0)
+ relocation += rel->r_addend;
+ if (tls_type != 0)
{
relocation -= htab->tls_sec->vma + DTP_OFFSET;
if ((tls_type & TLS_TPREL) != 0)
relocation += DTP_OFFSET - TP_OFFSET;
}
- if ((tls_type & TLS_GD_LD) != 0)
+ if ((tls_type & TLS_GD) != 0)
{
- if ((tls_type & TLS_LD) != 0)
- relocation = - DTP_OFFSET;
bfd_put_64 (output_bfd, relocation,
htab->sgot->contents + off + 8);
relocation = 1;
}
+ else if (tls_type == (TLS_TLS | TLS_LD))
+ relocation = 1;
bfd_put_64 (output_bfd, relocation,
htab->sgot->contents + off);
}
- ent->got.offset |= 1;
}
if (off >= (bfd_vma) -2)
@@ -7748,16 +7848,13 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
- && (((h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0)
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
{
Elf_Internal_Rela outrel;
bfd_boolean skip, relocate;
@@ -7871,7 +7968,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC64_RELATIVE:
/* We shouldn't ever see these dynamic relocs in relocatable
files. */
- /* Fall thru */
+ /* Fall through. */
case R_PPC64_PLTGOT16:
case R_PPC64_PLTGOT16_DS:
@@ -8016,11 +8113,14 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (r != bfd_reloc_ok)
{
- const char *name;
-
- if (h != NULL)
+ if (sym_name == NULL)
+ sym_name = "(null)";
+ if (r == bfd_reloc_overflow)
{
- if (h->root.type == bfd_link_hash_undefweak
+ if (warned)
+ continue;
+ if (h != NULL
+ && h->root.type == bfd_link_hash_undefweak
&& ppc64_elf_howto_table[(int) r_type]->pc_relative)
{
/* Assume this is a call protected by other code that
@@ -8032,21 +8132,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
continue;
}
- name = h->root.root.string;
- }
- else
- {
- name = bfd_elf_local_sym_name (input_bfd, sym);
- if (name == NULL)
- continue;
- }
-
- if (r == bfd_reloc_overflow)
- {
- if (warned)
- continue;
if (!((*info->callbacks->reloc_overflow)
- (info, name, ppc64_elf_howto_table[(int) r_type]->name,
+ (info, sym_name, ppc64_elf_howto_table[(int) r_type]->name,
rel->r_addend, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
@@ -8056,7 +8143,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(_("%s(%s+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, input_section),
- (long) rel->r_offset, name, (int) r);
+ (long) rel->r_offset, sym_name, (int) r);
ret = FALSE;
}
}
@@ -8100,7 +8187,6 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Create a JMP_SLOT reloc to inform the dynamic linker to
fill in the PLT entry. */
-
rela.r_offset = (htab->splt->output_section->vma
+ htab->splt->output_offset
+ ent->plt.offset);
diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h
index 707ee632aa..4b80cc56ec 100644
--- a/bfd/elf64-ppc.h
+++ b/bfd/elf64-ppc.h
@@ -21,6 +21,8 @@ bfd_boolean ppc64_elf_mark_entry_syms
PARAMS ((struct bfd_link_info *));
bfd_boolean ppc64_elf_edit_opd
PARAMS ((bfd *, struct bfd_link_info *));
+bfd_boolean ppc64_elf_tls_setup
+ PARAMS ((bfd *, struct bfd_link_info *));
bfd_boolean ppc64_elf_tls_optimize
PARAMS ((bfd *, struct bfd_link_info *));
bfd_vma ppc64_elf_toc
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 1c81edf75b..e3c7f22103 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1,5 +1,5 @@
/* IBM S/390-specific support for 64-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -373,7 +373,7 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst)
/* A relocation function which doesn't do anything. */
static bfd_reloc_status_type
s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
+ output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol ATTRIBUTE_UNUSED;
@@ -986,7 +986,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* Fall through */
case R_390_GOT12:
- case R_390_GOT16:
+ case R_390_GOT16:
case R_390_GOT32:
case R_390_GOT64:
case R_390_GOTENT:
@@ -1292,9 +1292,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- int r_type;
- struct elf_link_hash_entry *h;
elf_section_data (sec)->local_dynrel = NULL;
@@ -1305,16 +1302,31 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
{
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
+
r_symndx = ELF64_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf_s390_link_hash_entry *eh;
+ struct elf_s390_dyn_relocs **pp;
+ struct elf_s390_dyn_relocs *p;
- if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
- else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf_s390_link_hash_entry *) h;
- r_type = elf_s390_tls_transition (info,
- ELF64_R_TYPE (rel->r_info),
- r_symndx >= symtab_hdr->sh_info);
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
+ r_type = ELF64_R_TYPE (rel->r_info);
+ r_type = elf_s390_tls_transition (info, r_type, h != NULL);
switch (r_type)
{
case R_390_TLS_LDM64:
@@ -1347,14 +1359,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
if (local_got_refcounts[r_symndx] > 0)
local_got_refcounts[r_symndx] -= 1;
}
- if (r_type != R_390_TLS_IE64)
- break;
- /* Fall through */
-
- case R_390_TLS_LE64:
- if (!info->shared)
- break;
- /* Fall through */
+ break;
case R_390_8:
case R_390_12:
@@ -1366,33 +1371,9 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs)
case R_390_PC32:
case R_390_PC32DBL:
case R_390_PC64:
- if (h != NULL)
- {
- struct elf_s390_link_hash_entry *eh;
- struct elf_s390_dyn_relocs **pp;
- struct elf_s390_dyn_relocs *p;
-
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
-
- eh = (struct elf_s390_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (ELF64_R_TYPE (rel->r_info) == R_390_PC16
- || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL
- || ELF64_R_TYPE (rel->r_info) == R_390_PC32
- || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL
- || ELF64_R_TYPE (rel->r_info) == R_390_PC64)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ if (info->shared)
+ break;
+ /* Fall through */
case R_390_PLT16DBL:
case R_390_PLT32:
@@ -2226,7 +2207,6 @@ elf_s390_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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
@@ -2266,14 +2246,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) /
PLT_ENTRY_SIZE;
-
+
/* Offset in GOT is PLT index plus GOT headers(3) times 4,
addr & GOT addr. */
relocation = (plt_index + 3) * GOT_ENTRY_SIZE;
unresolved_reloc = FALSE;
if (r_type == R_390_GOTPLTENT)
- relocation += htab->sgot->output_section->vma;
+ relocation += htab->sgot->output_section->vma;
break;
}
/* Fall through. */
@@ -2371,12 +2351,10 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = htab->sgot->output_offset + off;
- /*
- * For @GOTENT the relocation is against the offset between
- * the instruction and the symbols entry in the GOT and not
- * between the start of the GOT and the symbols entry. We
- * add the vma of the GOT to get the correct value.
- */
+ /* For @GOTENT the relocation is against the offset between
+ the instruction and the symbols entry in the GOT and not
+ between the start of the GOT and the symbols entry. We
+ add the vma of the GOT to get the correct value. */
if ( r_type == R_390_GOTENT
|| r_type == R_390_GOTPLTENT)
relocation += htab->sgot->output_section->vma;
@@ -2429,17 +2407,17 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
+ htab->splt->output_offset
+ h->plt.offset);
unresolved_reloc = FALSE;
- break;
+ break;
case R_390_PLTOFF16:
case R_390_PLTOFF32:
case R_390_PLTOFF64:
- /* Relocation is to the entry for this symbol in the
- procedure linkage table relative to the start of the GOT. */
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table relative to the start of the GOT. */
/* For local symbols or if we didn't make a PLT entry for
this symbol resolve the symbol directly. */
- if ( h == NULL
+ if ( h == NULL
|| h->plt.offset == (bfd_vma) -1
|| htab->splt == NULL)
{
@@ -2447,9 +2425,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
- relocation = (htab->splt->output_section->vma
- + htab->splt->output_offset
- + h->plt.offset
+ relocation = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset
- htab->sgot->output_section->vma);
unresolved_reloc = FALSE;
break;
@@ -2500,7 +2478,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
skip = FALSE;
relocate = FALSE;
@@ -2577,7 +2554,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloc_out (output_bfd, &outrel, loc);
}
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_GD64:
case R_390_TLS_GOTIE64:
@@ -2621,7 +2598,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
@@ -2756,7 +2733,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
htab->tls_ldm_got.offset |= 1;
}
relocation = htab->sgot->output_offset + off;
- unresolved_reloc = FALSE;
+ unresolved_reloc = FALSE;
break;
case R_390_TLS_LE64:
@@ -3067,7 +3044,6 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the global offset table. Set it
up. */
-
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();
@@ -3278,11 +3254,9 @@ elf_s390_finish_dynamic_sections (output_bfd, info)
return TRUE;
}
-/*
- * Why was the hash table entry size definition changed from
- * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and
- * this is the only reason for the s390_elf64_size_info structure.
- */
+/* Why was the hash table entry size definition changed from
+ ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and
+ this is the only reason for the s390_elf64_size_info structure. */
const struct elf_size_info s390_elf64_size_info =
{
@@ -3294,10 +3268,10 @@ const struct elf_size_info s390_elf64_size_info =
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
- 8, /* hash-table entry size */
- 1, /* internal relocations per external relocations */
- 64, /* arch_size */
- 8, /* file_align */
+ 8, /* hash-table entry size. */
+ 1, /* internal relocations per external relocations. */
+ 64, /* arch_size. */
+ 8, /* file_align. */
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index c9d248e845..e4f04b552a 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -2,21 +2,21 @@
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -2067,7 +2067,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
@@ -2083,7 +2082,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* To avoid generating warning messages about truncated
relocations, set the relocation's address to be the same as
the start of this section. */
-
if (input_section->output_section != NULL)
relocation = input_section->output_section->vma;
else
@@ -2615,7 +2613,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
}
- /* FALLTHROUGH */
+ /* Fall through. */
default:
do_default:
@@ -2820,7 +2818,6 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */
-
BFD_ASSERT (h->dynindx != -1);
s = bfd_get_section_by_name (h->root.u.def.section->owner,
@@ -2923,10 +2920,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,
- (int) (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 =
PLT_ENTRY_SIZE;
@@ -3137,14 +3132,14 @@ const struct elf_size_info sparc64_elf_size_info =
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
- 4, /* hash-table entry size */
- /* internal relocations per external relocations.
+ 4, /* hash-table entry size. */
+ /* Internal relocations per external relocations.
For link purposes we use just 1 internal per
1 external, for assembly and slurp symbol table
we use 2. */
1,
- 64, /* arch_size */
- 8, /* file_align */
+ 64, /* arch_size. */
+ 8, /* file_align. */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index a3c36ff67d..f13b4d2207 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1,22 +1,22 @@
/* X86-64 specific support for 64-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -1091,9 +1091,6 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- int r_type;
- struct elf_link_hash_entry *h;
elf_section_data (sec)->local_dynrel = NULL;
@@ -1103,85 +1100,79 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
- switch ((r_type = elf64_x86_64_tls_transition (info,
- ELF64_R_TYPE (rel->r_info),
- ELF64_R_SYM (rel->r_info)
- >= symtab_hdr->sh_info)))
- {
- case R_X86_64_TLSLD:
- if (elf64_x86_64_hash_table (info)->tls_ld_got.refcount > 0)
- elf64_x86_64_hash_table (info)->tls_ld_got.refcount -= 1;
- break;
-
- case R_X86_64_TLSGD:
- case R_X86_64_GOTTPOFF:
- case R_X86_64_GOT32:
- case R_X86_64_GOTPCREL:
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->got.refcount > 0)
- h->got.refcount -= 1;
- }
- else if (local_got_refcounts != NULL)
- {
- if (local_got_refcounts[r_symndx] > 0)
- local_got_refcounts[r_symndx] -= 1;
- }
- break;
+ {
+ unsigned long r_symndx;
+ unsigned int r_type;
+ struct elf_link_hash_entry *h = NULL;
- case R_X86_64_8:
- case R_X86_64_16:
- case R_X86_64_32:
- case R_X86_64_64:
- case R_X86_64_32S:
- case R_X86_64_PC8:
- case R_X86_64_PC16:
- case R_X86_64_PC32:
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf64_x86_64_link_hash_entry *eh;
- struct elf64_x86_64_dyn_relocs **pp;
- struct elf64_x86_64_dyn_relocs *p;
+ r_symndx = ELF64_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ struct elf64_x86_64_link_hash_entry *eh;
+ struct elf64_x86_64_dyn_relocs **pp;
+ struct elf64_x86_64_dyn_relocs *p;
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ eh = (struct elf64_x86_64_link_hash_entry *) h;
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
- eh = (struct elf64_x86_64_link_hash_entry *) h;
+ r_type = ELF64_R_TYPE (rel->r_info);
+ r_type = elf64_x86_64_tls_transition (info, r_type, h != NULL);
+ switch (r_type)
+ {
+ case R_X86_64_TLSLD:
+ if (elf64_x86_64_hash_table (info)->tls_ld_got.refcount > 0)
+ elf64_x86_64_hash_table (info)->tls_ld_got.refcount -= 1;
+ break;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- if (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC8
- || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC16
- || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
- }
- }
- break;
+ case R_X86_64_TLSGD:
+ case R_X86_64_GOTTPOFF:
+ case R_X86_64_GOT32:
+ case R_X86_64_GOTPCREL:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx] -= 1;
+ }
+ break;
+ case R_X86_64_8:
+ case R_X86_64_16:
+ case R_X86_64_32:
+ case R_X86_64_64:
+ case R_X86_64_32S:
+ case R_X86_64_PC8:
+ case R_X86_64_PC16:
+ case R_X86_64_PC32:
+ if (info->shared)
+ break;
+ /* Fall thru */
- case R_X86_64_PLT32:
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- break;
+ case R_X86_64_PLT32:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
return TRUE;
}
@@ -1921,7 +1912,6 @@ 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->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
@@ -2106,7 +2096,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
skip = FALSE;
relocate = FALSE;
@@ -2330,7 +2319,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
if ((off & 1) != 0)
off &= ~1;
- else
+ else
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
@@ -2408,12 +2397,12 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
addq foo@gottpoff(%rip), %rax */
BFD_ASSERT (rel->r_offset >= 4);
for (i = 0; i < 4; i++)
- BFD_ASSERT (bfd_get_8 (input_bfd,
+ BFD_ASSERT (bfd_get_8 (input_bfd,
contents + rel->r_offset - 4 + i)
== tlsgd[i]);
BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
for (i = 0; i < 4; i++)
- BFD_ASSERT (bfd_get_8 (input_bfd,
+ BFD_ASSERT (bfd_get_8 (input_bfd,
contents + rel->r_offset + 4 + i)
== tlsgd[i+4]);
BFD_ASSERT (rel + 1 < relend);
@@ -2592,7 +2581,6 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the procedure linkage table. Set
it up. */
-
if (h->dynindx == -1
|| htab->splt == NULL
|| htab->sgotplt == NULL
@@ -2671,7 +2659,6 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the global offset table. Set it
up. */
-
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 4f9fcf75c2..724d607d3a 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -1,22 +1,22 @@
/* ELF core file support for BFD.
- Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002
+ Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
char*
elf_core_file_failing_command (abfd)
@@ -48,11 +48,11 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
}
/* See if the name in the corefile matches the executable name. */
-
corename = elf_tdata (core_bfd)->core_program;
if (corename != NULL)
{
const char* execname = strrchr (exec_bfd->filename, '/');
+
execname = execname ? execname + 1 : exec_bfd->filename;
if (strcmp(execname, corename) != 0)
@@ -71,17 +71,15 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
register set) and the floating point register set are stored in a
segment of type PT_NOTE. We handcraft a couple of extra bfd sections
that allow standard bfd access to the general registers (.reg) and the
- floating point registers (.reg2).
-
- */
+ floating point registers (.reg2). */
const bfd_target *
elf_core_file_p (abfd)
bfd *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; /* Elf program header, internal form */
+ 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; /* Elf program header, internal form. */
unsigned int phindex;
struct elf_backend_data *ebd;
struct bfd_preserve preserve;
@@ -103,7 +101,7 @@ elf_core_file_p (abfd)
if (! elf_file_p (&x_ehdr))
goto wrong;
- /* FIXME: Check EI_VERSION here ! */
+ /* FIXME: Check EI_VERSION here ! */
/* Check the address size ("class"). */
if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS)
@@ -112,11 +110,11 @@ elf_core_file_p (abfd)
/* Check the byteorder. */
switch (x_ehdr.e_ident[EI_DATA])
{
- case ELFDATA2MSB: /* Big-endian */
+ case ELFDATA2MSB: /* Big-endian. */
if (! bfd_big_endian (abfd))
goto wrong;
break;
- case ELFDATA2LSB: /* Little-endian */
+ case ELFDATA2LSB: /* Little-endian. */
if (! bfd_little_endian (abfd))
goto wrong;
break;
@@ -168,7 +166,11 @@ elf_core_file_p (abfd)
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
back = (struct elf_backend_data *) (*target_ptr)->backend_data;
- if (back->elf_machine_code == i_ehdrp->e_machine)
+ if (back->elf_machine_code == i_ehdrp->e_machine
+ || (back->elf_machine_alt1 != 0
+ && i_ehdrp->e_machine == back->elf_machine_alt1)
+ || (back->elf_machine_alt2 != 0
+ && i_ehdrp->e_machine == back->elf_machine_alt2))
{
/* target_ptr is an ELF backend which matches this
object file, so reject the generic ELF target. */
@@ -203,6 +205,7 @@ elf_core_file_p (abfd)
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
{
Elf_External_Phdr x_phdr;
+
if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof (x_phdr), abfd)
!= sizeof (x_phdr))
goto fail;
@@ -222,21 +225,17 @@ elf_core_file_p (abfd)
/* Process each program header. */
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
- {
- if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
- goto fail;
- }
+ if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
+ goto fail;
/* Save the entry point from the ELF header. */
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
/* Let the backend double check the format and override global
information. */
- if (ebd->elf_backend_object_p)
- {
- if (! (*ebd->elf_backend_object_p) (abfd))
- goto wrong;
- }
+ if (ebd->elf_backend_object_p
+ && (! (*ebd->elf_backend_object_p) (abfd)))
+ goto wrong;
bfd_preserve_finish (abfd, &preserve);
return abfd->xvec;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3170035787..962c104411 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1,5 +1,5 @@
/* ELF linking support for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,14 +31,15 @@ _bfd_elf_create_got_section (abfd, info)
struct bfd_link_info *info;
{
flagword flags;
- register asection *s;
+ asection *s;
struct elf_link_hash_entry *h;
struct bfd_link_hash_entry *bh;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign;
/* This function may be called more than once. */
- if (bfd_get_section_by_name (abfd, ".got") != NULL)
+ s = bfd_get_section_by_name (abfd, ".got");
+ if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0)
return TRUE;
switch (bed->s->arch_size)
@@ -111,7 +112,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
struct bfd_link_info *info;
{
flagword flags, pltflags;
- register asection *s;
+ asection *s;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign;
@@ -272,7 +273,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
}
/* We don't put any version information in the dynamic string
- table. */
+ table. */
name = h->root.root.string;
p = strchr (name, ELF_VER_CHR);
if (p == NULL)
@@ -525,18 +526,19 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
s->_raw_size = align_power (s->_raw_size, lsect->alignment);
- /* Is there a hole we have to provide? If so check whether the segment is
- too big already */
+ /* Is there a hole we have to provide? If so check whether the
+ segment is too big already */
if (lsect->hole_size)
{
lsect->hole_offset = s->_raw_size;
s->_raw_size += lsect->hole_size;
if (lsect->hole_offset > lsect->max_hole_offset)
{
- (*_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);
+ (*_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);
bfd_set_error (bfd_error_bad_value);
return (elf_linker_section_t *)0;
diff --git a/bfd/elflink.h b/bfd/elflink.h
index a70f873af6..7d2d2e24ea 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -2,21 +2,21 @@
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* ELF linker code. */
@@ -1168,6 +1168,8 @@ elf_link_add_object_symbols (abfd, info)
Elf_External_Versym *extversym = NULL;
Elf_External_Versym *ever;
struct elf_link_hash_entry *weaks;
+ struct elf_link_hash_entry **nondeflt_vers = NULL;
+ bfd_size_type nondeflt_vers_cnt = 0;
Elf_Internal_Sym *isymbuf = NULL;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymend;
@@ -1997,6 +1999,23 @@ elf_link_add_object_symbols (abfd, info)
override, dt_needed))
goto error_free_vers;
+ if (definition && (abfd->flags & DYNAMIC) == 0)
+ {
+ char *p = strchr (name, ELF_VER_CHR);
+ if (p != NULL && p[1] != ELF_VER_CHR)
+ {
+ /* Queue non-default versions so that .symver x, x@FOO
+ aliases can be checked. */
+ if (! nondeflt_vers)
+ {
+ amt = (isymend - isym + 1)
+ * sizeof (struct elf_link_hash_entry *);
+ nondeflt_vers = bfd_malloc (amt);
+ }
+ nondeflt_vers [nondeflt_vers_cnt++] = h;
+ }
+ }
+
if (dynsym && h->dynindx == -1)
{
if (! _bfd_elf_link_record_dynamic_symbol (info, h))
@@ -2071,6 +2090,55 @@ elf_link_add_object_symbols (abfd, info)
}
}
+ /* Now that all the symbols from this input file are created, handle
+ .symver foo, foo@BAR such that any relocs against foo become foo@BAR. */
+ if (nondeflt_vers != NULL)
+ {
+ bfd_size_type cnt, symidx;
+
+ for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt)
+ {
+ struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi;
+ char *shortname, *p;
+
+ p = strchr (h->root.root.string, ELF_VER_CHR);
+ if (p == NULL
+ || (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak))
+ continue;
+
+ amt = p - h->root.root.string;
+ shortname = bfd_malloc (amt + 1);
+ memcpy (shortname, h->root.root.string, amt);
+ shortname[amt] = '\0';
+
+ hi = (struct elf_link_hash_entry *)
+ bfd_link_hash_lookup (info->hash, shortname,
+ FALSE, FALSE, FALSE);
+ if (hi != NULL
+ && hi->root.type == h->root.type
+ && hi->root.u.def.value == h->root.u.def.value
+ && hi->root.u.def.section == h->root.u.def.section)
+ {
+ (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
+ hi->root.type = bfd_link_hash_indirect;
+ hi->root.u.i.link = (struct bfd_link_hash_entry *) h;
+ (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
+ sym_hash = elf_sym_hashes (abfd);
+ if (sym_hash)
+ for (symidx = 0; symidx < extsymcount; ++symidx)
+ if (sym_hash[symidx] == hi)
+ {
+ sym_hash[symidx] = h;
+ break;
+ }
+ }
+ free (shortname);
+ }
+ free (nondeflt_vers);
+ nondeflt_vers = NULL;
+ }
+
if (extversym != NULL)
{
free (extversym);
@@ -2277,6 +2345,8 @@ elf_link_add_object_symbols (abfd, info)
return TRUE;
error_free_vers:
+ if (nondeflt_vers != NULL)
+ free (nondeflt_vers);
if (extversym != NULL)
free (extversym);
error_free_sym:
@@ -2509,7 +2579,10 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
swap_in = bed->s->swap_reloca_in;
else
- abort ();
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return FALSE;
+ }
erela = external_relocs;
erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
@@ -4878,18 +4951,24 @@ elf_bfd_final_link (abfd, info)
merged = FALSE;
for (o = abfd->sections; o != (asection *) NULL; o = o->next)
{
+ struct bfd_elf_section_data *esdo = elf_section_data (o);
o->reloc_count = 0;
for (p = o->link_order_head; p != NULL; p = p->next)
{
+ unsigned int reloc_count = 0;
+ struct bfd_elf_section_data *esdi = NULL;
+ unsigned int *rel_count1;
+
if (p->type == bfd_section_reloc_link_order
|| p->type == bfd_symbol_reloc_link_order)
- ++o->reloc_count;
+ reloc_count = 1;
else if (p->type == bfd_indirect_link_order)
{
asection *sec;
sec = p->u.indirect.section;
+ esdi = elf_section_data (sec);
/* Mark all sections which are to be included in the
link. This will normally be every section. We need
@@ -4901,7 +4980,7 @@ elf_bfd_final_link (abfd, info)
merged = TRUE;
if (info->relocateable || info->emitrelocations)
- o->reloc_count += sec->reloc_count;
+ reloc_count = sec->reloc_count;
else if (bed->elf_backend_count_relocs)
{
Elf_Internal_Rela * relocs;
@@ -4910,8 +4989,7 @@ elf_bfd_final_link (abfd, info)
(abfd, sec, (PTR) NULL,
(Elf_Internal_Rela *) NULL, info->keep_memory));
- o->reloc_count
- += (*bed->elf_backend_count_relocs) (sec, relocs);
+ reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
if (elf_section_data (o)->relocs != relocs)
free (relocs);
@@ -4954,6 +5032,56 @@ elf_bfd_final_link (abfd, info)
}
}
}
+
+ if (reloc_count == 0)
+ continue;
+
+ o->reloc_count += reloc_count;
+
+ /* MIPS may have a mix of REL and RELA relocs on sections.
+ To support this curious ABI we keep reloc counts in
+ elf_section_data too. We must be careful to add the
+ relocations from the input section to the right output
+ count. FIXME: Get rid of one count. We have
+ o->reloc_count == esdo->rel_count + esdo->rel_count2. */
+ rel_count1 = &esdo->rel_count;
+ if (esdi != NULL)
+ {
+ bfd_boolean same_size;
+ bfd_size_type entsize1;
+
+ entsize1 = esdi->rel_hdr.sh_entsize;
+ BFD_ASSERT (entsize1 == sizeof (Elf_External_Rel)
+ || entsize1 == sizeof (Elf_External_Rela));
+ same_size = (!o->use_rela_p
+ == (entsize1 == sizeof (Elf_External_Rel)));
+
+ if (!same_size)
+ rel_count1 = &esdo->rel_count2;
+
+ if (esdi->rel_hdr2 != NULL)
+ {
+ bfd_size_type entsize2 = esdi->rel_hdr2->sh_entsize;
+ unsigned int alt_count;
+ unsigned int *rel_count2;
+
+ BFD_ASSERT (entsize2 != entsize1
+ && (entsize2 == sizeof (Elf_External_Rel)
+ || entsize2 == sizeof (Elf_External_Rela)));
+
+ rel_count2 = &esdo->rel_count2;
+ if (!same_size)
+ rel_count2 = &esdo->rel_count;
+
+ /* The following is probably too simplistic if the
+ backend counts output relocs unusually. */
+ BFD_ASSERT (bed->elf_backend_count_relocs == NULL);
+ alt_count = NUM_SHDR_ENTRIES (esdi->rel_hdr2);
+ *rel_count2 += alt_count;
+ reloc_count -= alt_count;
+ }
+ }
+ *rel_count1 += reloc_count;
}
if (o->reloc_count > 0)
@@ -4987,63 +5115,6 @@ elf_bfd_final_link (abfd, info)
if (! _bfd_elf_compute_section_file_positions (abfd, info))
goto error_return;
- /* Figure out how many relocations we will have in each section.
- Just using RELOC_COUNT isn't good enough since that doesn't
- maintain a separate value for REL vs. RELA relocations. */
- if (emit_relocs)
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
- for (o = sub->sections; o != NULL; o = o->next)
- {
- asection *output_section;
-
- if (! o->linker_mark)
- {
- /* This section was omitted from the link. */
- continue;
- }
-
- output_section = o->output_section;
-
- if (output_section != NULL
- && (o->flags & SEC_RELOC) != 0)
- {
- struct bfd_elf_section_data *esdi
- = elf_section_data (o);
- struct bfd_elf_section_data *esdo
- = elf_section_data (output_section);
- unsigned int *rel_count;
- unsigned int *rel_count2;
- bfd_size_type entsize;
- bfd_size_type entsize2;
-
- /* We must be careful to add the relocations from the
- input section to the right output count. */
- entsize = esdi->rel_hdr.sh_entsize;
- entsize2 = esdi->rel_hdr2 ? esdi->rel_hdr2->sh_entsize : 0;
- BFD_ASSERT ((entsize == sizeof (Elf_External_Rel)
- || entsize == sizeof (Elf_External_Rela))
- && entsize2 != entsize
- && (entsize2 == 0
- || entsize2 == sizeof (Elf_External_Rel)
- || entsize2 == sizeof (Elf_External_Rela)));
- if (entsize == esdo->rel_hdr.sh_entsize)
- {
- rel_count = &esdo->rel_count;
- rel_count2 = &esdo->rel_count2;
- }
- else
- {
- rel_count = &esdo->rel_count2;
- rel_count2 = &esdo->rel_count;
- }
-
- *rel_count += NUM_SHDR_ENTRIES (& esdi->rel_hdr);
- if (esdi->rel_hdr2)
- *rel_count2 += NUM_SHDR_ENTRIES (esdi->rel_hdr2);
- output_section->flags |= SEC_RELOC;
- }
- }
-
/* That created the reloc sections. Set their sizes, and assign
them file positions, and allocate some buffers. */
for (o = abfd->sections; o != NULL; o = o->next)
@@ -6096,8 +6167,7 @@ elf_link_output_extsym (h, data)
referenced by regular files, because we will already have issued
warnings for them. */
if (! finfo->info->relocateable
- && ! finfo->info->allow_shlib_undefined
- && ! finfo->info->shared
+ && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined)
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 00a0e88c1c..b2d745bdfb 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -275,9 +275,11 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit PC relative reference. */
+ /* 16 bit PC relative reference. Note that the ABI document has a typo
+ and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+ We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@@ -772,9 +774,11 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit PC relative reference. */
+ /* 16 bit PC relative reference. Note that the ABI document has a typo
+ and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+ We do the right thing here. */
HOWTO (R_MIPS_PC16, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
TRUE, /* pc_relative */
@@ -1837,7 +1841,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
/* There is no BFD reloc for R_MIPS_REL32. */
{ BFD_RELOC_CTOR, R_MIPS_32 },
{ BFD_RELOC_64, R_MIPS_64 },
- { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
+ { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
{ BFD_RELOC_HI16_S, R_MIPS_HI16 },
{ BFD_RELOC_LO16, R_MIPS_LO16 },
{ BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index df48866911..d1a78abfcc 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -102,6 +102,7 @@ struct elfNN_ia64_dyn_sym_info
/* TRUE for the different kinds of linker data we want created. */
unsigned want_got : 1;
+ unsigned want_gotx : 1;
unsigned want_fptr : 1;
unsigned want_ltoff_fptr : 1;
unsigned want_plt : 1;
@@ -154,6 +155,12 @@ struct elfNN_ia64_link_hash_table
struct elfNN_ia64_local_hash_table loc_hash_table;
};
+struct elfNN_ia64_allocate_data
+{
+ struct bfd_link_info *info;
+ bfd_size_type ofs;
+};
+
#define elfNN_ia64_hash_table(p) \
((struct elfNN_ia64_link_hash_table *) ((p)->hash))
@@ -169,6 +176,8 @@ static void elfNN_ia64_info_to_howto
static bfd_boolean elfNN_ia64_relax_section
PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
bfd_boolean *again));
+static void elfNN_ia64_relax_ldxmov
+ PARAMS((bfd *abfd, bfd_byte *contents, bfd_vma off));
static bfd_boolean is_unwind_section_name
PARAMS ((bfd *abfd, const char *));
static bfd_boolean elfNN_ia64_section_from_shdr
@@ -299,6 +308,8 @@ static bfd_vma elfNN_ia64_dtprel_base
PARAMS ((struct bfd_link_info *info));
static int elfNN_ia64_unwind_entry_compare
PARAMS ((const PTR, const PTR));
+static bfd_boolean elfNN_ia64_choose_gp
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
static bfd_boolean elfNN_ia64_final_link
PARAMS ((bfd *abfd, struct bfd_link_info *info));
static bfd_boolean elfNN_ia64_relocate_section
@@ -645,37 +656,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
#define DYNAMIC_INTERPRETER(abfd) \
(elfNN_ia64_aix_vec (abfd->xvec) ? AIX_DYNAMIC_INTERPRETER : ELF_DYNAMIC_INTERPRETER)
-/* Select out of range branch fixup type. Note that Itanium does
- not support brl, and so it gets emulated by the kernel. */
-#undef USE_BRL
-
-#ifdef USE_BRL
static const bfd_byte oor_brl[16] =
{
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */
0x00, 0x00, 0x00, 0xc0
};
-#else
-static const bfd_byte oor_ip[48] =
-{
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */
- 0x01, 0x00, 0x00, 0x60,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */
- 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */
- 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */
- 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */
- 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
- 0x60, 0x00, 0x80, 0x00 /* br b6;; */
-};
-#endif
-/* These functions do relaxation for IA-64 ELF.
-
- This is primarily to support branches to targets out of range;
- relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV is handled in
- relocate_section directly. */
+/* These functions do relaxation for IA-64 ELF. */
static bfd_boolean
elfNN_ia64_relax_section (abfd, sec, link_info, again)
@@ -701,6 +689,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
struct one_fixup *fixups = NULL;
bfd_boolean changed_contents = FALSE;
bfd_boolean changed_relocs = FALSE;
+ bfd_boolean changed_got = FALSE;
+ bfd_vma gp = 0;
/* Assume we're not going to change any sizes, and we'll only need
one pass. */
@@ -728,24 +718,6 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
ia64_info = elfNN_ia64_hash_table (link_info);
irelend = internal_relocs + sec->reloc_count;
- for (irel = internal_relocs; irel < irelend; irel++)
- {
- unsigned long r_type = ELFNN_R_TYPE (irel->r_info);
- if (r_type == R_IA64_PCREL21B
- || r_type == R_IA64_PCREL21BI
- || r_type == R_IA64_PCREL21M
- || r_type == R_IA64_PCREL21F)
- break;
- }
-
- /* No branch-type relocations. */
- if (irel == irelend)
- {
- if (elf_section_data (sec)->relocs != internal_relocs)
- free (internal_relocs);
- return TRUE;
- }
-
/* Get the section contents. */
if (elf_section_data (sec)->this_hdr.contents != NULL)
contents = elf_section_data (sec)->this_hdr.contents;
@@ -760,19 +732,33 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
goto error_return;
}
- for (; irel < irelend; irel++)
+ for (irel = internal_relocs; irel < irelend; irel++)
{
unsigned long r_type = ELFNN_R_TYPE (irel->r_info);
bfd_vma symaddr, reladdr, trampoff, toff, roff;
asection *tsec;
struct one_fixup *f;
bfd_size_type amt;
+ bfd_boolean is_branch;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
- if (r_type != R_IA64_PCREL21B
- && r_type != R_IA64_PCREL21BI
- && r_type != R_IA64_PCREL21M
- && r_type != R_IA64_PCREL21F)
- continue;
+ switch (r_type)
+ {
+ case R_IA64_PCREL21B:
+ case R_IA64_PCREL21BI:
+ case R_IA64_PCREL21M:
+ case R_IA64_PCREL21F:
+ is_branch = TRUE;
+ break;
+
+ case R_IA64_LTOFF22X:
+ case R_IA64_LDXMOV:
+ is_branch = FALSE;
+ break;
+
+ default:
+ continue;
+ }
/* Get the value of the symbol referred to by the reloc. */
if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info)
@@ -805,12 +791,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
toff = isym->st_value;
+ dyn_i = get_dyn_sym_info (ia64_info, NULL, abfd, irel, FALSE);
}
else
{
unsigned long indx;
struct elf_link_hash_entry *h;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
indx = ELFNN_R_SYM (irel->r_info) - symtab_hdr->sh_info;
h = elf_sym_hashes (abfd)[indx];
@@ -824,7 +810,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
/* For branches to dynamic symbols, we're interested instead
in a branch to the PLT entry. */
- if (dyn_i && dyn_i->want_plt2)
+ if (is_branch && dyn_i && dyn_i->want_plt2)
{
/* Internal branches shouldn't be sent to the PLT.
Leave this for now and we'll give an error later. */
@@ -834,6 +820,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
tsec = ia64_info->plt_sec;
toff = dyn_i->plt2_offset;
}
+
+ /* Can't do anything else with dynamic symbols. */
+ else if (elfNN_ia64_dynamic_symbol_p (h, link_info))
+ continue;
+
else
{
/* We can't do anthing with undefined symbols. */
@@ -852,103 +843,140 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
+ irel->r_addend);
roff = irel->r_offset;
- reladdr = (sec->output_section->vma
- + sec->output_offset
- + roff) & (bfd_vma) -4;
- /* If the branch is in range, no need to do anything. */
- if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000
- && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0)
- continue;
+ if (is_branch)
+ {
+ reladdr = (sec->output_section->vma
+ + sec->output_offset
+ + roff) & (bfd_vma) -4;
- /* If the branch and target are in the same section, you've
- got one honking big section and we can't help you. You'll
- get an error message later. */
- if (tsec == sec)
- continue;
+ /* If the branch is in range, no need to do anything. */
+ if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000
+ && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0)
+ continue;
- /* Look for an existing fixup to this address. */
- for (f = fixups; f ; f = f->next)
- if (f->tsec == tsec && f->toff == toff)
- break;
+ /* If the branch and target are in the same section, you've
+ got one honking big section and we can't help you. You'll
+ get an error message later. */
+ if (tsec == sec)
+ continue;
- if (f == NULL)
- {
- /* Two alternatives: If it's a branch to a PLT entry, we can
- make a copy of the FULL_PLT entry. Otherwise, we'll have
- to use a `brl' insn to get where we're going. */
+ /* Look for an existing fixup to this address. */
+ for (f = fixups; f ; f = f->next)
+ if (f->tsec == tsec && f->toff == toff)
+ break;
+
+ if (f == NULL)
+ {
+ /* Two alternatives: If it's a branch to a PLT entry, we can
+ make a copy of the FULL_PLT entry. Otherwise, we'll have
+ to use a `brl' insn to get where we're going. */
+
+ size_t size;
+
+ if (tsec == ia64_info->plt_sec)
+ size = sizeof (plt_full_entry);
+ else
+ {
+ size = sizeof (oor_brl);
+ }
+
+ /* Resize the current section to make room for the new branch. */
+ trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16;
+ amt = trampoff + size;
+ contents = (bfd_byte *) bfd_realloc (contents, amt);
+ if (contents == NULL)
+ goto error_return;
+ sec->_cooked_size = amt;
- size_t size;
+ if (tsec == ia64_info->plt_sec)
+ {
+ memcpy (contents + trampoff, plt_full_entry, size);
+
+ /* Hijack the old relocation for use as the PLTOFF reloc. */
+ irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
+ R_IA64_PLTOFF22);
+ irel->r_offset = trampoff;
+ }
+ else
+ {
+ memcpy (contents + trampoff, oor_brl, size);
+ irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
+ R_IA64_PCREL60B);
+ irel->r_offset = trampoff + 2;
+ }
- if (tsec == ia64_info->plt_sec)
- size = sizeof (plt_full_entry);
+ /* Record the fixup so we don't do it again this section. */
+ f = (struct one_fixup *)
+ bfd_malloc ((bfd_size_type) sizeof (*f));
+ f->next = fixups;
+ f->tsec = tsec;
+ f->toff = toff;
+ f->trampoff = trampoff;
+ fixups = f;
+ }
else
{
-#ifdef USE_BRL
- size = sizeof (oor_brl);
-#else
- size = sizeof (oor_ip);
-#endif
+ /* Nop out the reloc, since we're finalizing things here. */
+ irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE);
}
- /* Resize the current section to make room for the new branch. */
- trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16;
- amt = trampoff + size;
- contents = (bfd_byte *) bfd_realloc (contents, amt);
- if (contents == NULL)
+ /* Fix up the existing branch to hit the trampoline. Hope like
+ hell this doesn't overflow too. */
+ if (elfNN_ia64_install_value (abfd, contents + roff,
+ f->trampoff - (roff & (bfd_vma) -4),
+ r_type) != bfd_reloc_ok)
goto error_return;
- sec->_cooked_size = amt;
- if (tsec == ia64_info->plt_sec)
+ changed_contents = TRUE;
+ changed_relocs = TRUE;
+ }
+ else
+ {
+ /* Fetch the gp. */
+ if (gp == 0)
{
- memcpy (contents + trampoff, plt_full_entry, size);
+ bfd *obfd = sec->output_section->owner;
+ gp = _bfd_get_gp_value (obfd);
+ if (gp == 0)
+ {
+ if (!elfNN_ia64_choose_gp (obfd, link_info))
+ goto error_return;
+ gp = _bfd_get_gp_value (obfd);
+ }
+ }
- /* Hijack the old relocation for use as the PLTOFF reloc. */
+ /* If the data is out of range, do nothing. */
+ if ((bfd_signed_vma) (symaddr - gp) >= 0x200000
+ ||(bfd_signed_vma) (symaddr - gp) < -0x200000)
+ continue;
+
+ if (r_type == R_IA64_LTOFF22X)
+ {
irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
- R_IA64_PLTOFF22);
- irel->r_offset = trampoff;
+ R_IA64_GPREL22);
+ changed_relocs = TRUE;
+ if (dyn_i->want_gotx)
+ {
+ dyn_i->want_gotx = 0;
+ changed_got |= !dyn_i->want_got;
+ }
}
else
{
-#ifdef USE_BRL
- memcpy (contents + trampoff, oor_brl, size);
- irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
- R_IA64_PCREL60B);
- irel->r_offset = trampoff + 2;
-#else
- memcpy (contents + trampoff, oor_ip, size);
- irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
- R_IA64_PCREL64I);
- irel->r_addend -= 16;
- irel->r_offset = trampoff + 2;
-#endif
+ elfNN_ia64_relax_ldxmov (abfd, contents, roff);
+ irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE);
+ changed_contents = TRUE;
+ changed_relocs = TRUE;
}
-
- /* Record the fixup so we don't do it again this section. */
- f = (struct one_fixup *) bfd_malloc ((bfd_size_type) sizeof (*f));
- f->next = fixups;
- f->tsec = tsec;
- f->toff = toff;
- f->trampoff = trampoff;
- fixups = f;
- }
- else
- {
- /* Nop out the reloc, since we're finalizing things here. */
- irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE);
}
-
- /* Fix up the existing branch to hit the trampoline. Hope like
- hell this doesn't overflow too. */
- if (elfNN_ia64_install_value (abfd, contents + roff,
- f->trampoff - (roff & (bfd_vma) -4),
- r_type) != bfd_reloc_ok)
- goto error_return;
-
- changed_contents = TRUE;
- changed_relocs = TRUE;
}
+ /* ??? If we created fixups, this may push the code segment large
+ enough that the data segment moves, which will change the GP.
+ Reset the GP so that we re-calculate next round. We need to
+ do this at the _beginning_ of the next round; now will not do. */
+
/* Clean up and go home. */
while (fixups)
{
@@ -989,6 +1017,21 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
elf_section_data (sec)->relocs = internal_relocs;
}
+ if (changed_got)
+ {
+ struct elfNN_ia64_allocate_data data;
+ data.info = link_info;
+ data.ofs = 0;
+
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data);
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data);
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data);
+ ia64_info->got_sec->_raw_size = data.ofs;
+ ia64_info->got_sec->_cooked_size = data.ofs;
+
+ /* ??? Resize .rela.got too. */
+ }
+
*again = changed_contents || changed_relocs;
return TRUE;
@@ -1003,6 +1046,39 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
free (internal_relocs);
return FALSE;
}
+
+static void
+elfNN_ia64_relax_ldxmov (abfd, contents, off)
+ bfd *abfd;
+ bfd_byte *contents;
+ bfd_vma off;
+{
+ int shift, r1, r3;
+ bfd_vma dword, insn;
+
+ switch ((int)off & 0x3)
+ {
+ case 0: shift = 5; break;
+ case 1: shift = 14; off += 3; break;
+ case 2: shift = 23; off += 6; break;
+ case 3:
+ abort ();
+ }
+
+ dword = bfd_get_64 (abfd, contents + off);
+ insn = (dword >> shift) & 0x1ffffffffffLL;
+
+ r1 = (insn >> 6) & 127;
+ r3 = (insn >> 20) & 127;
+ if (r1 == r3)
+ insn = 0x8000000; /* nop */
+ else
+ insn = (insn & 0x7f01fff) | 0x10800000000LL; /* (qp) mov r1 = r3 */
+
+ dword &= ~(0x1ffffffffffLL << shift);
+ dword |= (insn << shift);
+ bfd_put_64 (abfd, dword, contents + off);
+}
/* Return TRUE if NAME is an unwind table section name. */
@@ -2125,15 +2201,16 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
{
enum {
NEED_GOT = 1,
- NEED_FPTR = 2,
- NEED_PLTOFF = 4,
- NEED_MIN_PLT = 8,
- NEED_FULL_PLT = 16,
- NEED_DYNREL = 32,
- NEED_LTOFF_FPTR = 64,
- NEED_TPREL = 128,
- NEED_DTPMOD = 256,
- NEED_DTPREL = 512
+ NEED_GOTX = 2,
+ NEED_FPTR = 4,
+ NEED_PLTOFF = 8,
+ NEED_MIN_PLT = 16,
+ NEED_FULL_PLT = 32,
+ NEED_DYNREL = 64,
+ NEED_LTOFF_FPTR = 128,
+ NEED_TPREL = 256,
+ NEED_DTPMOD = 512,
+ NEED_DTPREL = 1024
};
struct elf_link_hash_entry *h = NULL;
@@ -2230,11 +2307,14 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
break;
case R_IA64_LTOFF22:
- case R_IA64_LTOFF22X:
case R_IA64_LTOFF64I:
need_entry = NEED_GOT;
break;
+ case R_IA64_LTOFF22X:
+ need_entry = NEED_GOTX;
+ break;
+
case R_IA64_PLTOFF22:
case R_IA64_PLTOFF64I:
case R_IA64_PLTOFF64MSB:
@@ -2316,7 +2396,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
dyn_i->h = h;
/* Create what's needed. */
- if (need_entry & (NEED_GOT | NEED_TPREL | NEED_DTPMOD | NEED_DTPREL))
+ if (need_entry & (NEED_GOT | NEED_GOTX | NEED_TPREL
+ | NEED_DTPMOD | NEED_DTPREL))
{
if (!got)
{
@@ -2326,6 +2407,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
}
if (need_entry & NEED_GOT)
dyn_i->want_got = 1;
+ if (need_entry & NEED_GOTX)
+ dyn_i->want_gotx = 1;
if (need_entry & NEED_TPREL)
dyn_i->want_tprel = 1;
if (need_entry & NEED_DTPMOD)
@@ -2385,12 +2468,6 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
return TRUE;
}
-struct elfNN_ia64_allocate_data
-{
- struct bfd_link_info *info;
- bfd_size_type ofs;
-};
-
/* For cleanliness, and potentially faster dynamic loading, allocate
external GOT entries first. */
@@ -2401,7 +2478,7 @@ allocate_global_data_got (dyn_i, data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
- if (dyn_i->want_got
+ if ((dyn_i->want_got || dyn_i->want_gotx)
&& ! dyn_i->want_fptr
&& (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)
|| (elfNN_ia64_aix_vec (x->info->hash->creator)
@@ -2473,7 +2550,7 @@ allocate_local_got (dyn_i, data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
- if (dyn_i->want_got
+ if ((dyn_i->want_got || dyn_i->want_gotx)
&& ! (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)
|| elfNN_ia64_aix_vec (x->info->hash->creator)))
{
@@ -2699,7 +2776,7 @@ allocate_dynrel_entries (dyn_i, data)
/* Take care of the GOT and PLT relocations. */
- if (((dynamic_symbol || shared) && dyn_i->want_got)
+ if (((dynamic_symbol || shared) && (dyn_i->want_got || dyn_i->want_gotx))
|| (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1))
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
if ((dynamic_symbol || shared) && dyn_i->want_tprel)
@@ -3516,125 +3593,148 @@ elfNN_ia64_unwind_entry_compare (a, b)
return (av < bv ? -1 : av > bv ? 1 : 0);
}
+/* Make sure we've got ourselves a nice fat __gp value. */
static bfd_boolean
-elfNN_ia64_final_link (abfd, info)
+elfNN_ia64_choose_gp (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
+ bfd_vma min_vma = (bfd_vma) -1, max_vma = 0;
+ bfd_vma min_short_vma = min_vma, max_short_vma = 0;
+ struct elf_link_hash_entry *gp;
+ bfd_vma gp_val;
+ asection *os;
struct elfNN_ia64_link_hash_table *ia64_info;
- asection *unwind_output_sec;
ia64_info = elfNN_ia64_hash_table (info);
- /* Make sure we've got ourselves a nice fat __gp value. */
- if (!info->relocateable)
+ /* Find the min and max vma of all sections marked short. Also collect
+ min and max vma of any type, for use in selecting a nice gp. */
+ for (os = abfd->sections; os ; os = os->next)
{
- bfd_vma min_vma = (bfd_vma) -1, max_vma = 0;
- bfd_vma min_short_vma = min_vma, max_short_vma = 0;
- struct elf_link_hash_entry *gp;
- bfd_vma gp_val;
- asection *os;
+ bfd_vma lo, hi;
+
+ if ((os->flags & SEC_ALLOC) == 0)
+ continue;
- /* Find the min and max vma of all sections marked short. Also
- collect min and max vma of any type, for use in selecting a
- nice gp. */
- for (os = abfd->sections; os ; os = os->next)
+ lo = os->vma;
+ hi = os->vma + os->_raw_size;
+ if (hi < lo)
+ hi = (bfd_vma) -1;
+
+ if (min_vma > lo)
+ min_vma = lo;
+ if (max_vma < hi)
+ max_vma = hi;
+ if (os->flags & SEC_SMALL_DATA)
{
- bfd_vma lo, hi;
+ if (min_short_vma > lo)
+ min_short_vma = lo;
+ if (max_short_vma < hi)
+ max_short_vma = hi;
+ }
+ }
- if ((os->flags & SEC_ALLOC) == 0)
- continue;
+ /* See if the user wants to force a value. */
+ gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
+ FALSE, FALSE);
+
+ if (gp
+ && (gp->root.type == bfd_link_hash_defined
+ || gp->root.type == bfd_link_hash_defweak))
+ {
+ asection *gp_sec = gp->root.u.def.section;
+ gp_val = (gp->root.u.def.value
+ + gp_sec->output_section->vma
+ + gp_sec->output_offset);
+ }
+ else
+ {
+ /* Pick a sensible value. */
- lo = os->vma;
- hi = os->vma + os->_raw_size;
- if (hi < lo)
- hi = (bfd_vma) -1;
+ asection *got_sec = ia64_info->got_sec;
- if (min_vma > lo)
- min_vma = lo;
- if (max_vma < hi)
- max_vma = hi;
- if (os->flags & SEC_SMALL_DATA)
- {
- if (min_short_vma > lo)
- min_short_vma = lo;
- if (max_short_vma < hi)
- max_short_vma = hi;
- }
+ /* Start with just the address of the .got. */
+ if (got_sec)
+ gp_val = got_sec->output_section->vma;
+ else if (max_short_vma != 0)
+ gp_val = min_short_vma;
+ else
+ gp_val = min_vma;
+
+ /* If it is possible to address the entire image, but we
+ don't with the choice above, adjust. */
+ if (max_vma - min_vma < 0x400000
+ && max_vma - gp_val <= 0x200000
+ && gp_val - min_vma > 0x200000)
+ gp_val = min_vma + 0x200000;
+ else if (max_short_vma != 0)
+ {
+ /* If we don't cover all the short data, adjust. */
+ if (max_short_vma - gp_val >= 0x200000)
+ gp_val = min_short_vma + 0x200000;
+
+ /* If we're addressing stuff past the end, adjust back. */
+ if (gp_val > max_vma)
+ gp_val = max_vma - 0x200000 + 8;
}
+ }
- /* See if the user wants to force a value. */
- gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
- FALSE, FALSE);
+ /* Validate whether all SHF_IA_64_SHORT sections are within
+ range of the chosen GP. */
- if (gp
- && (gp->root.type == bfd_link_hash_defined
- || gp->root.type == bfd_link_hash_defweak))
+ if (max_short_vma != 0)
+ {
+ if (max_short_vma - min_short_vma >= 0x400000)
{
- asection *gp_sec = gp->root.u.def.section;
- gp_val = (gp->root.u.def.value
- + gp_sec->output_section->vma
- + gp_sec->output_offset);
+ (*_bfd_error_handler)
+ (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
+ bfd_get_filename (abfd),
+ (unsigned long) (max_short_vma - min_short_vma));
+ return FALSE;
}
- else
+ else if ((gp_val > min_short_vma
+ && gp_val - min_short_vma > 0x200000)
+ || (gp_val < max_short_vma
+ && max_short_vma - gp_val >= 0x200000))
{
- /* Pick a sensible value. */
+ (*_bfd_error_handler)
+ (_("%s: __gp does not cover short data segment"),
+ bfd_get_filename (abfd));
+ return FALSE;
+ }
+ }
- asection *got_sec = ia64_info->got_sec;
+ _bfd_set_gp_value (abfd, gp_val);
- /* Start with just the address of the .got. */
- if (got_sec)
- gp_val = got_sec->output_section->vma;
- else if (max_short_vma != 0)
- gp_val = min_short_vma;
- else
- gp_val = min_vma;
-
- /* If it is possible to address the entire image, but we
- don't with the choice above, adjust. */
- if (max_vma - min_vma < 0x400000
- && max_vma - gp_val <= 0x200000
- && gp_val - min_vma > 0x200000)
- gp_val = min_vma + 0x200000;
- else if (max_short_vma != 0)
- {
- /* If we don't cover all the short data, adjust. */
- if (max_short_vma - gp_val >= 0x200000)
- gp_val = min_short_vma + 0x200000;
+ return TRUE;
+}
- /* If we're addressing stuff past the end, adjust back. */
- if (gp_val > max_vma)
- gp_val = max_vma - 0x200000 + 8;
- }
- }
+static bfd_boolean
+elfNN_ia64_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *unwind_output_sec;
+
+ ia64_info = elfNN_ia64_hash_table (info);
- /* Validate whether all SHF_IA_64_SHORT sections are within
- range of the chosen GP. */
+ /* Make sure we've got ourselves a nice fat __gp value. */
+ if (!info->relocateable)
+ {
+ bfd_vma gp_val = _bfd_get_gp_value (abfd);
+ struct elf_link_hash_entry *gp;
- if (max_short_vma != 0)
+ if (gp_val == 0)
{
- if (max_short_vma - min_short_vma >= 0x400000)
- {
- (*_bfd_error_handler)
- (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
- bfd_get_filename (abfd),
- (unsigned long) (max_short_vma - min_short_vma));
- return FALSE;
- }
- else if ((gp_val > min_short_vma
- && gp_val - min_short_vma > 0x200000)
- || (gp_val < max_short_vma
- && max_short_vma - gp_val >= 0x200000))
- {
- (*_bfd_error_handler)
- (_("%s: __gp does not cover short data segment"),
- bfd_get_filename (abfd));
- return FALSE;
- }
+ if (! elfNN_ia64_choose_gp (abfd, info))
+ return FALSE;
+ gp_val = _bfd_get_gp_value (abfd);
}
- _bfd_set_gp_value (abfd, gp_val);
-
+ gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
+ FALSE, FALSE);
if (gp)
{
gp->root.type = bfd_link_hash_defined;
@@ -3828,7 +3928,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
else if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
@@ -3926,7 +4025,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
srel, rel->r_offset, dyn_r_type,
dynindx, addend);
}
- /* FALLTHRU */
+ /* Fall through. */
case R_IA64_LTV32MSB:
case R_IA64_LTV32LSB:
@@ -4536,7 +4635,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);
}
- /* Initialize the PLT0 entry */
+ /* Initialize the PLT0 entry. */
if (ia64_info->plt_sec)
{
bfd_byte *loc = ia64_info->plt_sec->contents;
@@ -4555,7 +4654,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
return TRUE;
}
-/* ELF file flag handling: */
+/* ELF file flag handling: */
/* Function to keep IA-64 specific file flags. */
static bfd_boolean
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 1410519848..6ca4f063af 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9,21 +9,21 @@
Traditional MIPS targets support added by Koundinya.K, Dansk Data
Elektronik & Operations Research Group. <kk@ddeorg.soft.net>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file handles functionality common to the different MIPS ABI's. */
@@ -359,17 +359,17 @@ typedef struct
loader for use by the static exception system. */
typedef struct runtime_pdr {
- bfd_vma adr; /* memory address of start of procedure */
- long regmask; /* save register mask */
- long regoffset; /* save register offset */
- long fregmask; /* save floating point register mask */
- long fregoffset; /* save floating point register offset */
- long frameoffset; /* frame size */
- short framereg; /* frame pointer register */
- short pcreg; /* offset or reg of return pc */
- long irpss; /* index into the runtime string table */
+ bfd_vma adr; /* Memory address of start of procedure. */
+ long regmask; /* Save register mask. */
+ long regoffset; /* Save register offset. */
+ long fregmask; /* Save floating point register mask. */
+ long fregoffset; /* Save floating point register offset. */
+ long frameoffset; /* Frame size. */
+ short framereg; /* Frame pointer register. */
+ short pcreg; /* Offset or reg of return pc. */
+ long irpss; /* Index into the runtime string table. */
long reserved;
- struct exception_info *exception_info;/* pointer to exception array */
+ struct exception_info *exception_info;/* Pointer to exception array. */
} RPDR, *pRPDR;
#define cbRPDR sizeof (RPDR)
#define rpdNil ((pRPDR) 0)
@@ -496,7 +496,6 @@ static struct mips_got_info *mips_elf_got_for_ibfd
static bfd *reldyn_sorting_bfd;
/* Nonzero if ABFD is using the N32 ABI. */
-
#define ABI_N32_P(abfd) \
((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
@@ -2130,7 +2129,7 @@ mips_elf_bfd2got_entry_eq (entry1, entry2)
return e1->bfd == e2->bfd;
}
-/* In a multi-got link, determine the GOT to be used for IBDF. G must
+/* In a multi-got link, determine the GOT to be used for IBFD. G must
be the master GOT data. */
static struct mips_got_info *
@@ -3095,7 +3094,6 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
addresses. */
symbol = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
symbol = 0;
@@ -3317,12 +3315,6 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
value &= howto->dst_mask;
break;
- case R_MIPS_GNU_REL16_S2:
- value = symbol + mips_elf_sign_extend (addend << 2, 18) - p;
- overflowed_p = mips_elf_overflow_p (value, 18);
- value = (value >> 2) & howto->dst_mask;
- break;
-
case R_MIPS_GNU_REL_HI16:
/* Instead of subtracting 'p' here, we should be subtracting the
equivalent value for the LO part of the reloc, since the value
@@ -3451,8 +3443,10 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
break;
case R_MIPS_PC16:
- value = mips_elf_sign_extend (addend, 16) + symbol - p;
- overflowed_p = mips_elf_overflow_p (value, 16);
+ case R_MIPS_GNU_REL16_S2:
+ value = mips_elf_sign_extend (addend << 2, 18) + symbol - p;
+ overflowed_p = mips_elf_overflow_p (value, 18);
+ value = (value >> 2) & howto->dst_mask;
break;
case R_MIPS_GOT_HI16:
diff --git a/bfd/format.c b/bfd/format.c
index 8cc7b7a167..9af6efcbab 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -1,23 +1,23 @@
/* Generic BFD support for file formats.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
SECTION
@@ -52,7 +52,7 @@ FUNCTION
bfd_check_format
SYNOPSIS
- bfd_boolean bfd_check_format(bfd *abfd, bfd_format format);
+ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
DESCRIPTION
Verify if the file attached to the BFD @var{abfd} is compatible
@@ -98,7 +98,8 @@ FUNCTION
bfd_check_format_matches
SYNOPSIS
- bfd_boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching);
+ bfd_boolean bfd_check_format_matches (bfd *abfd, bfd_format format,
+ char ***matching);
DESCRIPTION
Like <<bfd_check_format>>, except when it returns FALSE with
@@ -210,7 +211,7 @@ bfd_check_format_matches (abfd, format, matching)
if (*target == &binary_vec)
continue;
- abfd->xvec = *target; /* Change BFD's target temporarily */
+ abfd->xvec = *target; /* Change BFD's target temporarily. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return FALSE;
@@ -224,7 +225,8 @@ bfd_check_format_matches (abfd, format, matching)
temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
if (temp)
- { /* This format checks out as ok! */
+ {
+ /* This format checks out as ok! */
right_targ = temp;
/* If this is the default target, accept it, even if other
@@ -279,6 +281,7 @@ bfd_check_format_matches (abfd, format, matching)
{
/* Try partial matches. */
right_targ = ar_right_targ;
+
if (right_targ == bfd_default_vector[0])
{
match_count = 1;
@@ -286,12 +289,11 @@ bfd_check_format_matches (abfd, format, matching)
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 (*matching_vector) * match_count);
- }
+ memcpy (matching_vector,
+ matching_vector + _bfd_target_vector_entries,
+ sizeof (*matching_vector) * match_count);
}
}
@@ -361,7 +363,7 @@ FUNCTION
bfd_set_format
SYNOPSIS
- bfd_boolean bfd_set_format(bfd *abfd, bfd_format format);
+ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
DESCRIPTION
This function sets the file format of the BFD @var{abfd} to the
@@ -402,7 +404,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
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 222b23dcb5..14978ba862 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -850,6 +850,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_LO16",
"BFD_RELOC_PCREL_HI16_S",
"BFD_RELOC_PCREL_LO16",
+ "BFD_RELOC_MIPSEMB_16_PCREL_S2",
"BFD_RELOC_MIPS_LITERAL",
"BFD_RELOC_MIPS_GOT16",
"BFD_RELOC_MIPS_CALL16",
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index c0279e5e88..1beec22af0 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -866,7 +866,8 @@ typedef struct
#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
- ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
+ ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
+ (abfd, filehdr, aouthdr))
#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
@@ -891,7 +892,8 @@ typedef struct
((coff_backend_info (abfd)->_bfd_coff_print_aux)\
(abfd, file, base, symbol, aux, indaux))
-#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\
+#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
+ reloc, data, src_ptr, dst_ptr)\
((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
@@ -919,7 +921,8 @@ typedef struct
#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
(obfd, info, ibfd, sec, rel, adjustedp))
-#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\
+#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
+ value, string, cp, coll, hashp)\
((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
(info, abfd, name, flags, section, value, string, cp, coll, hashp))
diff --git a/bfd/po/da.po b/bfd/po/da.po
index 89ed7d0ec4..cf0121a307 100644
--- a/bfd/po/da.po
+++ b/bfd/po/da.po
@@ -1,12 +1,12 @@
# Danish messages for bfd.
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-# Keld Simonsen <keld@dkuug.dk>, 2002
+# Keld Simonsen <keld@dkuug.dk>, 2002-2003
#
msgid ""
msgstr ""
"Project-Id-Version: bfd 2.12.91\n"
"POT-Creation-Date: 2002-07-23 15:55-0400\n"
-"PO-Revision-Date: 2002-11-09 23:25+0100\n"
+"PO-Revision-Date: 2003-03-01 23:25+0100\n"
"Last-Translator: Keld Simonsen <keld@dkuug.dk>\n"
"Language-Team: Danish <dansk@klid.dk>\n"
"MIME-Version: 1.0\n"
@@ -1179,14 +1179,14 @@ msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
msgstr "%s: fejl: ujusteret relokeringstype %d på %08x relokering %08x\n"
#: elf32-sh64.c:677
-#, fuzzy, c-format
+#, c-format
msgid "%s: could not write out added .cranges entries"
-msgstr "%s: kunne ikke udskrive tilføjede .crangives-poster"
+msgstr "%s: kunne ikke udskrive tilføjede .cranges-poster"
#: elf32-sh64.c:739
-#, fuzzy, c-format
+#, c-format
msgid "%s: could not write out sorted .cranges entries"
-msgstr "%s: kunne ikke udskrive sorterede crangives-poster"
+msgstr "%s: kunne ikke udskrive sorterede cranges-poster"
#: elf32-sparc.c:1535 elf64-sparc.c:2224
#, c-format
@@ -1204,22 +1204,22 @@ msgid "%s: linking little endian files with big endian files"
msgstr "%s: lænker little endian-filer med big endian-filer"
#: elf32-v850.c:682
-#, fuzzy, c-format
+#, c-format
msgid "Variable `%s' cannot occupy in multiple small data regions"
msgstr "Variabel \"%s\" kan ikke befinde sig i flere små dataområder"
#: elf32-v850.c:685
-#, fuzzy, c-format
+#, c-format
msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions"
-msgstr "Variabel \"%s\" kan kun være i et af de små, tomme og bittesmå dataområder"
+msgstr "Variabel \"%s\" kan kun være i ét af de små, tomme og bittesmå dataområder"
#: elf32-v850.c:688
-#, fuzzy, c-format
+#, c-format
msgid "Variable `%s' cannot be in both small and zero data regions simultaneously"
msgstr "Variabel \"%s\" kan ikke være i både små og tomme dataområder samtidigt"
#: elf32-v850.c:691
-#, fuzzy, c-format
+#, c-format
msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously"
msgstr "Variabel \"%s\" kan ikke være i både små og bittesmå dataområder samtidigt"
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 9f8a952c59..45660c8387 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2080,7 +2080,10 @@ ENUM
BFD_RELOC_PCREL_LO16
ENUMDOC
Like BFD_RELOC_LO16, but PC relative.
-
+ENUM
+ BFD_RELOC_MIPSEMB_16_PCREL_S2
+ENUMDOC
+ Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC.
ENUM
BFD_RELOC_MIPS_LITERAL
ENUMDOC
@@ -2150,7 +2153,6 @@ ENUMX
ENUMDOC
Fujitsu Frv Relocations.
COMMENT
-COMMENT
ENUMDOC
MIPS ELF relocations.
diff --git a/bfd/syms.c b/bfd/syms.c
index d95589bec0..d65a8689ca 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1,24 +1,24 @@
/* Generic symbol-table support for the BFD library.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
SECTION
@@ -74,9 +74,9 @@ SUBSECTION
| if (storage_needed < 0)
| FAIL
|
-| if (storage_needed == 0) {
-| return ;
-| }
+| if (storage_needed == 0)
+| return;
+|
| symbol_table = (asymbol **) xmalloc (storage_needed);
| ...
| number_of_symbols =
@@ -85,9 +85,8 @@ SUBSECTION
| if (number_of_symbols < 0)
| FAIL
|
-| for (i = 0; i < number_of_symbols; i++) {
-| process_symbol (symbol_table[i]);
-| }
+| for (i = 0; i < number_of_symbols; i++)
+| process_symbol (symbol_table[i]);
All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
@@ -108,25 +107,26 @@ SUBSECTION
example showing the creation of a symbol table with only one element:
| #include "bfd.h"
-| main()
+| int main (void)
| {
| bfd *abfd;
| asymbol *ptrs[2];
| asymbol *new;
|
-| abfd = bfd_openw("foo","a.out-sunos-big");
-| bfd_set_format(abfd, bfd_object);
-| new = bfd_make_empty_symbol(abfd);
+| abfd = bfd_openw ("foo","a.out-sunos-big");
+| bfd_set_format (abfd, bfd_object);
+| new = bfd_make_empty_symbol (abfd);
| new->name = "dummy_symbol";
-| new->section = bfd_make_section_old_way(abfd, ".text");
+| new->section = bfd_make_section_old_way (abfd, ".text");
| new->flags = BSF_GLOBAL;
| new->value = 0x12345;
|
| ptrs[0] = new;
| ptrs[1] = (asymbol *)0;
|
-| bfd_set_symtab(abfd, ptrs, 1);
-| bfd_close(abfd);
+| bfd_set_symtab (abfd, ptrs, 1);
+| bfd_close (abfd);
+| return 0;
| }
|
| ./makesym
@@ -192,7 +192,7 @@ CODE_FRAGMENT
. instead, except that some symbols point to the global sections
. bfd_{abs,com,und}_section. This could be fixed by making
. these globals be per-bfd (or per-target-flavor). FIXME. *}
-. struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *}
+. struct bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *}
.
. {* The text of the symbol. The name is left alone, and not copied; the
. application may not alter it. *}
@@ -346,7 +346,7 @@ FUNCTION
bfd_is_local_label
SYNOPSIS
- bfd_boolean bfd_is_local_label(bfd *abfd, asymbol *sym);
+ bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
DESCRIPTION
Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
@@ -438,7 +438,7 @@ FUNCTION
bfd_print_symbol_vandf
SYNOPSIS
- void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol);
+ void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol);
DESCRIPTION
Print the value and flags of the @var{symbol} supplied to the
@@ -451,16 +451,14 @@ bfd_print_symbol_vandf (abfd, arg, symbol)
asymbol *symbol;
{
FILE *file = (FILE *) arg;
+
flagword type = symbol->flags;
+
if (symbol->section != (asection *) NULL)
- {
- bfd_fprintf_vma (abfd, file,
- symbol->value + symbol->section->vma);
- }
+ bfd_fprintf_vma (abfd, file,
+ symbol->value + symbol->section->vma);
else
- {
- bfd_fprintf_vma (abfd, file, symbol->value);
- }
+ bfd_fprintf_vma (abfd, file, symbol->value);
/* This presumes that a symbol can not be both BSF_DEBUGGING and
BSF_DYNAMIC, nor more than one of BSF_FUNCTION, BSF_FILE, and
@@ -504,7 +502,7 @@ FUNCTION
_bfd_generic_make_empty_symbol
SYNOPSIS
- asymbol *_bfd_generic_make_empty_symbol (bfd *);
+ asymbol * _bfd_generic_make_empty_symbol (bfd *);
DESCRIPTION
Create a new <<asymbol>> structure for the BFD @var{abfd}
@@ -634,7 +632,7 @@ DESCRIPTION
class of @var{symbol}, or '?' for an unknown class.
SYNOPSIS
- int bfd_decode_symclass(asymbol *symbol);
+ int bfd_decode_symclass (asymbol *symbol);
*/
int
bfd_decode_symclass (symbol)
@@ -726,7 +724,7 @@ DESCRIPTION
calling this function.
SYNOPSIS
- void bfd_symbol_info(asymbol *symbol, symbol_info *ret);
+ void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
*/
void
@@ -749,7 +747,7 @@ FUNCTION
bfd_copy_private_symbol_data
SYNOPSIS
- bfd_boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
+ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
DESCRIPTION
Copy private symbol information from @var{isym} in the BFD
@@ -816,7 +814,6 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
an asymbol. We don't worry about the sym argument we are passed;
we just return the asymbol the minisymbol points to. */
-/*ARGSUSED*/
asymbol *
_bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
bfd *abfd ATTRIBUTE_UNUSED;
@@ -1245,12 +1242,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
else
#endif
{
- /* Cache non-existant or invalid. Do binary search on
- indextable. */
-
long low, high;
long mid = -1;
+ /* Cache non-existant or invalid. Do binary search on
+ indextable. */
indexentry = NULL;
low = 0;
@@ -1305,9 +1301,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
case N_SLINE:
case N_DSLINE:
case N_BSLINE:
- /* A line number. The value is relative to the start of the
- current function. */
- val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF);
+ /* A line number. If the function was specified, then the value
+ is relative to the start of the function. Otherwise, the
+ value is an absolute address. */
+ val = ((indexentry->function_name ? indexentry->val : 0)
+ + bfd_get_32 (abfd, stab + VALOFF));
/* If this line starts before our desired offset, or if it's
the first line we've been able to find, use it. The
!saw_line check works around a bug in GCC 2.95.3, which emits
@@ -1376,7 +1374,6 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
/* This will typically be something like main:F(0,1), so we want
to clobber the colon. It's OK to change the name, since the
string is in our own local storage anyhow. */
-
s = strchr (indexentry->function_name, ':');
if (s != NULL)
*s = '\0';
diff --git a/bfd/targets.c b/bfd/targets.c
index c541c11ab5..2211e124a7 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -763,7 +763,7 @@ static const bfd_target * const _bfd_target_vector[] = {
#endif
&aout0_big_vec,
#if 0
- /* We have no way of distinguishing these from other a.out variants */
+ /* We have no way of distinguishing these from other a.out variants. */
&aout_arm_big_vec,
&aout_arm_little_vec,
/* No one seems to use this. */
@@ -909,7 +909,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_powerpcle_pei_vec,
&cris_aout_vec,
#ifdef BFD64
- &demo_64_vec, /* Only compiled if host has long-long support */
+ &demo_64_vec, /* Only compiled if host has long-long support. */
#endif
&ecoff_big_vec,
&ecoff_biglittle_vec,
@@ -1011,7 +1011,7 @@ static const bfd_target * const _bfd_target_vector[] = {
#endif
&ppcboot_vec,
#if 0
- /* We have no way of distinguishing these from other a.out variants */
+ /* We have no way of distinguishing these from other a.out variants. */
&riscix_vec,
#endif
#ifdef BFD64
@@ -1221,7 +1221,7 @@ FUNCTION
bfd_find_target
SYNOPSIS
- const bfd_target *bfd_find_target(const char *target_name, bfd *abfd);
+ const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
DESCRIPTION
Return a pointer to the transfer vector for the object target
@@ -1274,7 +1274,7 @@ FUNCTION
bfd_target_list
SYNOPSIS
- const char **bfd_target_list(void);
+ const char ** bfd_target_list (void);
DESCRIPTION
Return a freshly malloced NULL-terminated
@@ -1319,7 +1319,9 @@ FUNCTION
bfd_seach_for_target
SYNOPSIS
- const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);
+ const bfd_target * bfd_search_for_target (int (* search_func)
+ (const bfd_target *, void *),
+ void *);
DESCRIPTION
Return a pointer to the first transfer vector in the list of
diff --git a/bfd/version.h b/bfd/version.h
index 32e8805c95..d2517704a8 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030207
+#define BFD_VERSION_DATE 20030305
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/config.guess b/config.guess
index ca12b79a54..4fc21ecc3a 100755
--- a/config.guess
+++ b/config.guess
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2003-01-03'
+timestamp='2003-01-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -242,65 +242,47 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- eval $set_cc_for_build
- cat <<EOF >$dummy.s
- .data
-\$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
-main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
- if test "$?" = 0 ; then
- case `$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- 2-1307)
- UNAME_MACHINE="alphaev68"
- ;;
- 3-1307)
- UNAME_MACHINE="alphaev7"
- ;;
- esac
- fi
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
@@ -1152,7 +1134,11 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
diff --git a/config.sub b/config.sub
index 04baf3d80d..5f94062aaf 100755
--- a/config.sub
+++ b/config.sub
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2003-01-03'
+timestamp='2003-02-03'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -257,7 +257,7 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
@@ -296,7 +296,7 @@ case $basic_machine in
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
@@ -329,11 +329,13 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -925,6 +927,14 @@ case $basic_machine in
basic_machine=tic54x-unknown
os=-coff
;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -1027,7 +1037,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sh64)
@@ -1227,6 +1237,12 @@ case $os in
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
-none)
;;
*)
diff --git a/config/ChangeLog b/config/ChangeLog
index 15c7c3e0ae..091f6fd71c 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mh-dgux: Delete.
+
2002-12-28 Alexandre Oliva <aoliva@redhat.com>
* acx.m4: Name cache variables properly.
diff --git a/config/mh-dgux b/config/mh-dgux
deleted file mode 100644
index b55fb2fe0b..0000000000
--- a/config/mh-dgux
+++ /dev/null
@@ -1,2 +0,0 @@
-RANLIB=true
-
diff --git a/configure b/configure
index 39ee865f68..7cf1f55446 100755
--- a/configure
+++ b/configure
@@ -16,6 +16,9 @@ ac_help="$ac_help
Don't force sequential configuration of
sub-packages for the host, target or build
machine, or of any sub-packages at all"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -33,7 +36,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -148,7 +150,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -319,11 +320,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -489,16 +485,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -585,7 +577,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:589: checking host system type" >&5
+echo "configure:581: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -606,7 +598,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:610: checking target system type" >&5
+echo "configure:602: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -624,7 +616,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:628: checking build system type" >&5
+echo "configure:620: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -693,15 +685,6 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-# clear some things potentially inherited from environment.
-
-enable_threads=no
-enable_shared=no
-enable_libstdcxx_v3=yes
-floating_point=default
-gas=default
-x11=default
-
### we might need to use some other shell than /bin/sh for running subshells
### If we are on Windows, search for the shell. This will permit people
### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
@@ -736,15 +719,6 @@ esac
config_shell=${CONFIG_SHELL-/bin/sh}
-## this is a little touchy and won't always work, but...
-##
-## if the argv[[0]] starts with a slash then it is an absolute name that can (and
-## must) be used as is.
-##
-## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the
-## path. Since PATH might include "." we also add `pwd` to the end of PATH.
-##
-
progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
@@ -805,8 +779,6 @@ fi
#
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
-libstdcxx_version="target-libstdc++-v3"
-
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
@@ -827,7 +799,7 @@ libgcj="target-libffi \
target_libs="target-libiberty \
target-libgloss \
target-newlib \
- ${libstdcxx_version} \
+ target-libstdc++-v3 \
target-libf2c \
${libgcj} \
target-libobjc"
@@ -971,22 +943,22 @@ case "${host}" in
;;
i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi"
- ;;
+ ;;
i[3456]86-*-mingw32*)
# noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv"
- noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
- ;;
+ noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
+ ;;
i[3456]86-*-beos*)
- noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
- ;;
+ noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
+ ;;
*-*-cygwin*)
- noconfigdirs="autoconf automake send-pr rcs guile perl"
+ noconfigdirs="autoconf automake send-pr rcs guile perl"
;;
*-*-netbsd*)
noconfigdirs="rcs"
;;
ppc*-*-pe)
- noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
+ noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
;;
powerpc-*-beos*)
noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
@@ -1016,9 +988,20 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ *-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+ ;;
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ *-*-kaos*)
+ # Remove unsupported stuff on all kaOS configurations.
+ skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
+ skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
+ skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
*-*-netbsd*)
# Skip some stuff on all NetBSD configurations.
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
@@ -1032,7 +1015,7 @@ case "${target}" in
esac
;;
*-*-netware)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -1076,11 +1059,11 @@ case "${target}" in
noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
noconfigdirs="$noconfigdirs expect dejagnu"
# the C++ libraries don't build on top of CE's C libraries
- noconfigdirs="$noconfigdirs ${libstdcxx_version}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3"
noconfigdirs="$noconfigdirs target-newlib"
case "${host}" in
*-*-cygwin*) ;; # keep gdb and readline
- *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
+ *) noconfigdirs="$noconfigdirs gdb readline"
;;
esac
;;
@@ -1115,19 +1098,19 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
;;
avr-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
c4x-*-* | tic4x-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
c54x*-*-* | tic54x-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
;;
cris-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
d10v-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
d30v-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
@@ -1142,7 +1125,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss"
;;
h8500-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
;;
hppa*64*-*-linux* | parisc*64*-*-linux*)
# In this case, it's because the hppa64-linux target is for
@@ -1188,7 +1171,7 @@ case "${target}" in
# This section makes it possible to build newlib natively on linux.
# If we are using a cross compiler then don't configure newlib.
if test x${is_cross_compiler} != xno ; then
- noconfigdirs="$noconfigdirs target-newlib"
+ noconfigdirs="$noconfigdirs target-newlib"
fi
noconfigdirs="$noconfigdirs target-libgloss"
# If we are not using a cross compiler, do configure newlib.
@@ -1221,7 +1204,7 @@ case "${target}" in
esac
;;
i[3456]86-*-pe)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
i[3456]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
@@ -1238,10 +1221,10 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
;;
i[3456]86-*-beos*)
- noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
- ;;
+ noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
+ ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
m68k-*-elf*)
noconfigdirs="$noconfigdirs ${libgcj}"
@@ -1280,9 +1263,6 @@ case "${target}" in
powerpc-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
- powerpc-*-darwin*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
- ;;
powerpc-*-eabi)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -1322,7 +1302,7 @@ case "${target}" in
;;
mipstx39-*-*)
noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
- ;;
+ ;;
mips*-*-linux*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
@@ -1364,7 +1344,7 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
v810-*-*)
- noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
;;
v850-*-*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -1382,7 +1362,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
ip2k-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
*-*-linux*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
@@ -1408,19 +1388,19 @@ esac
# go away some day.
# NB: embedded tabs in this IF block -- do not untabify
if test x"${enable_languages+set}" != xset; then
- if test x"${LANGUAGES+set}" = xset; then
- enable_languages="${LANGUAGES}"
- echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
- else
- enable_languages=all
- fi
+ if test x"${LANGUAGES+set}" = xset; then
+ enable_languages="${LANGUAGES}"
+ echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+ else
+ enable_languages=all
+ fi
else
- if test x"${enable_languages}" = x ||
- test x"${enable_languages}" = xyes;
- then
- echo configure.in: --enable-languages needs at least one language argument 1>&2
- exit 1
- fi
+ if test x"${enable_languages}" = x ||
+ test x"${enable_languages}" = xyes;
+ then
+ echo configure.in: --enable-languages needs at least one language argument 1>&2
+ exit 1
+ fi
fi
enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
@@ -1429,64 +1409,60 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/
# front ends it requires, even if some are required indirectly.
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
- case $lang in
- ..)
- ;;
+ case $lang in
+ ..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[*]/config-lang.in)
- ;;
+ ${srcdir}/gcc/[*]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
- for other in $this_lang_requires
- do
- case ,${enable_languages}, in
- *,$other,*)
- ;;
- *,all,*)
- ;;
- *,$lang_alias,*)
- echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
- enable_languages="$enable_languages,$other"
- ;;
- esac
- done
- ;;
- esac
+ lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
+ for other in $this_lang_requires
+ do
+ case ,${enable_languages}, in
+ *,$other,*) ;;
+ *,all,*) ;;
+ *,$lang_alias,*)
+ echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+ esac
done
subdirs=
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
- case $lang in
- ..) ;;
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[*]/config-lang.in) ;;
- *)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
- this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
- build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
- if test "x$lang_alias" = x
- then
- echo "$lang doesn't set \$language." 1>&2
- exit 1
- fi
- case ${build_by_default},${enable_languages}, in
- *,$lang_alias,*) add_this_lang=yes ;;
- no,*) add_this_lang=no ;;
- *,all,*) add_this_lang=yes ;;
- *) add_this_lang=no ;;
- esac
- if test x"${add_this_lang}" = xyes; then
- eval target_libs='"$target_libs "'\"$this_lang_libs\"
- else
- eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
- fi
- ;;
- esac
+ case $lang in
+ ..) ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+ ${srcdir}/gcc/[*]/config-lang.in) ;;
+ *)
+ lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
+ build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
+ if test "x$lang_alias" = x
+ then
+ echo "$lang doesn't set \$language." 1>&2
+ exit 1
+ fi
+ case ${build_by_default},${enable_languages}, in
+ *,$lang_alias,*) add_this_lang=yes ;;
+ no,*) add_this_lang=no ;;
+ *,all,*) add_this_lang=yes ;;
+ *) add_this_lang=no ;;
+ esac
+ if test x"${add_this_lang}" = xyes; then
+ eval target_libs='"$target_libs "'\"$this_lang_libs\"
+ else
+ eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
+ fi
+ ;;
+ esac
done
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
@@ -1691,7 +1667,6 @@ case "${host}" in
;;
m88k-dg-dgux*)
tentative_cc="gcc -Wall -ansi -D__using_DGUX"
- host_makefile_frag="config/mh-dgux"
;;
m88k-harris-cxux*)
# Under CX/UX, we want to tell the compiler to use ANSI mode.
@@ -1909,24 +1884,6 @@ if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-
extra_host_args="$extra_host_args --with-newlib"
fi
-# We default to --with-shared on platforms where -fpic is meaningless.
-# Well, we don't yet, but we will.
-if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then
- case "${target}" in
- alpha*-dec-osf*) enable_shared=yes ;;
- alpha*-*-linux*) enable_shared=yes ;;
- mips-sgi-irix5*) enable_shared=yes ;;
- *) enable_shared=no ;;
- esac
-fi
-
-case "${enable_shared}" in
- yes) shared=yes ;;
- no) shared=no ;;
- "") shared=no ;;
- *) shared=yes ;;
-esac
-
# Default to using --with-stabs for certain targets.
if test x${with_stabs} = x ; then
@@ -2302,12 +2259,10 @@ esac
# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
# binutils tools will find libbfd.so.
-if test "${shared}" = "yes" ; then
- SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
-else
- SET_LIB_PATH=
-fi
-
+case "${enable_shared}" in
+ no | "") SET_LIB_PATH= ;;
+ *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
+esac
case "${host}" in
*-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
@@ -2604,7 +2559,7 @@ esac
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
fi
if test "x${use_gnu_ld}" = x &&
@@ -2704,8 +2659,6 @@ ospace_frag=${srcdir}/${ospace_frag}
-
-
# Build module lists & subconfigure args.
@@ -2748,7 +2701,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
# Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2752: checking for $ac_word" >&5
+echo "configure:2705: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2781,7 +2734,7 @@ if test -z "$ac_cv_prog_AR" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2785: checking for $ac_word" >&5
+echo "configure:2738: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2820,7 +2773,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2824: checking for $ac_word" >&5
+echo "configure:2777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2853,7 +2806,7 @@ if test -z "$ac_cv_prog_AS" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2857: checking for $ac_word" >&5
+echo "configure:2810: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2892,7 +2845,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2896: checking for $ac_word" >&5
+echo "configure:2849: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2925,7 +2878,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2929: checking for $ac_word" >&5
+echo "configure:2882: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2964,7 +2917,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2968: checking for $ac_word" >&5
+echo "configure:2921: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2997,7 +2950,7 @@ if test -z "$ac_cv_prog_LD" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3001: checking for $ac_word" >&5
+echo "configure:2954: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3036,7 +2989,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3040: checking for $ac_word" >&5
+echo "configure:2993: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3069,7 +3022,7 @@ if test -z "$ac_cv_prog_NM" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3073: checking for $ac_word" >&5
+echo "configure:3026: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3108,7 +3061,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3112: checking for $ac_word" >&5
+echo "configure:3065: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3141,7 +3094,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3145: checking for $ac_word" >&5
+echo "configure:3098: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3180,7 +3133,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3184: checking for $ac_word" >&5
+echo "configure:3137: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3213,7 +3166,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3217: checking for $ac_word" >&5
+echo "configure:3170: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3252,7 +3205,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3256: checking for $ac_word" >&5
+echo "configure:3209: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3285,7 +3238,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3289: checking for $ac_word" >&5
+echo "configure:3242: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3324,7 +3277,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3328: checking for $ac_word" >&5
+echo "configure:3281: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3357,7 +3310,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3361: checking for $ac_word" >&5
+echo "configure:3314: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3405,7 +3358,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3409: checking for $ac_word" >&5
+echo "configure:3362: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3438,7 +3391,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3442: checking for $ac_word" >&5
+echo "configure:3395: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3477,7 +3430,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3481: checking for $ac_word" >&5
+echo "configure:3434: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3510,7 +3463,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3514: checking for $ac_word" >&5
+echo "configure:3467: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3549,7 +3502,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3553: checking for $ac_word" >&5
+echo "configure:3506: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3582,7 +3535,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3586: checking for $ac_word" >&5
+echo "configure:3539: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3621,7 +3574,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3625: checking for $ac_word" >&5
+echo "configure:3578: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3654,7 +3607,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3658: checking for $ac_word" >&5
+echo "configure:3611: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3693,7 +3646,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3697: checking for $ac_word" >&5
+echo "configure:3650: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3726,7 +3679,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3730: checking for $ac_word" >&5
+echo "configure:3683: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3765,7 +3718,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3769: checking for $ac_word" >&5
+echo "configure:3722: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3798,7 +3751,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3802: checking for $ac_word" >&5
+echo "configure:3755: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3837,7 +3790,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3841: checking for $ac_word" >&5
+echo "configure:3794: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3870,7 +3823,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3874: checking for $ac_word" >&5
+echo "configure:3827: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3936,6 +3889,28 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:3894: checking whether to enable maintainer-specific portions of Makefiles" >&5
+# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+
+
+if test "$USE_MAINTAINER_MODE" = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+MAINT=$MAINTAINER_MODE_TRUE
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -4113,8 +4088,6 @@ s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
s%@BUILD_PREFIX@%$BUILD_PREFIX%g
s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
s%@configlinks@%$configlinks%g
-s%@enable_shared@%$enable_shared%g
-s%@enable_threads@%$enable_threads%g
s%@enable_version_specific_runtime_libs@%$enable_version_specific_runtime_libs%g
s%@gcc_version_trigger@%$gcc_version_trigger%g
s%@gcc_version@%$gcc_version%g
@@ -4192,6 +4165,9 @@ s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g
s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g
s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g
s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
CEOF
EOF
diff --git a/configure.in b/configure.in
index 19c1357d25..eb473b8a5c 100644
--- a/configure.in
+++ b/configure.in
@@ -25,15 +25,6 @@ AC_ARG_PROGRAM
sinclude(config/acx.m4)
-# clear some things potentially inherited from environment.
-
-enable_threads=no
-enable_shared=no
-enable_libstdcxx_v3=yes
-floating_point=default
-gas=default
-x11=default
-
### we might need to use some other shell than /bin/sh for running subshells
### If we are on Windows, search for the shell. This will permit people
### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
@@ -68,15 +59,6 @@ esac
config_shell=${CONFIG_SHELL-/bin/sh}
-## this is a little touchy and won't always work, but...
-##
-## if the argv[[0]] starts with a slash then it is an absolute name that can (and
-## must) be used as is.
-##
-## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the
-## path. Since PATH might include "." we also add `pwd` to the end of PATH.
-##
-
progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
@@ -137,8 +119,6 @@ fi
#
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
-libstdcxx_version="target-libstdc++-v3"
-
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
@@ -159,7 +139,7 @@ libgcj="target-libffi \
target_libs="target-libiberty \
target-libgloss \
target-newlib \
- ${libstdcxx_version} \
+ target-libstdc++-v3 \
target-libf2c \
${libgcj} \
target-libobjc"
@@ -303,22 +283,22 @@ case "${host}" in
;;
i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*)
noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi"
- ;;
+ ;;
i[[3456]]86-*-mingw32*)
# noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv"
- noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
- ;;
+ noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
+ ;;
i[[3456]]86-*-beos*)
- noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
- ;;
+ noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
+ ;;
*-*-cygwin*)
- noconfigdirs="autoconf automake send-pr rcs guile perl"
+ noconfigdirs="autoconf automake send-pr rcs guile perl"
;;
*-*-netbsd*)
noconfigdirs="rcs"
;;
ppc*-*-pe)
- noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
+ noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
;;
powerpc-*-beos*)
noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
@@ -348,9 +328,20 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ *-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+ ;;
*-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ *-*-kaos*)
+ # Remove unsupported stuff on all kaOS configurations.
+ skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
+ skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
+ skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
*-*-netbsd*)
# Skip some stuff on all NetBSD configurations.
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
@@ -364,7 +355,7 @@ case "${target}" in
esac
;;
*-*-netware)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -408,11 +399,11 @@ case "${target}" in
noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
noconfigdirs="$noconfigdirs expect dejagnu"
# the C++ libraries don't build on top of CE's C libraries
- noconfigdirs="$noconfigdirs ${libstdcxx_version}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3"
noconfigdirs="$noconfigdirs target-newlib"
case "${host}" in
*-*-cygwin*) ;; # keep gdb and readline
- *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
+ *) noconfigdirs="$noconfigdirs gdb readline"
;;
esac
;;
@@ -447,19 +438,19 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
;;
avr-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
c4x-*-* | tic4x-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
c54x*-*-* | tic54x-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
;;
cris-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
d10v-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
d30v-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
@@ -474,7 +465,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss"
;;
h8500-*-*)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
;;
hppa*64*-*-linux* | parisc*64*-*-linux*)
# In this case, it's because the hppa64-linux target is for
@@ -520,7 +511,7 @@ case "${target}" in
# This section makes it possible to build newlib natively on linux.
# If we are using a cross compiler then don't configure newlib.
if test x${is_cross_compiler} != xno ; then
- noconfigdirs="$noconfigdirs target-newlib"
+ noconfigdirs="$noconfigdirs target-newlib"
fi
noconfigdirs="$noconfigdirs target-libgloss"
# If we are not using a cross compiler, do configure newlib.
@@ -553,7 +544,7 @@ case "${target}" in
esac
;;
i[[3456]]86-*-pe)
- noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
i[[3456]]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
@@ -570,10 +561,10 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
;;
i[[3456]]86-*-beos*)
- noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
- ;;
+ noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
+ ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
m68k-*-elf*)
noconfigdirs="$noconfigdirs ${libgcj}"
@@ -612,9 +603,6 @@ case "${target}" in
powerpc-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
- powerpc-*-darwin*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
- ;;
powerpc-*-eabi)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -654,7 +642,7 @@ case "${target}" in
;;
mipstx39-*-*)
noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips
- ;;
+ ;;
mips*-*-linux*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
@@ -696,7 +684,7 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
v810-*-*)
- noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
;;
v850-*-*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -714,7 +702,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
ip2k-*-*)
- noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
*-*-linux*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
@@ -740,19 +728,19 @@ esac
# go away some day.
# NB: embedded tabs in this IF block -- do not untabify
if test x"${enable_languages+set}" != xset; then
- if test x"${LANGUAGES+set}" = xset; then
- enable_languages="${LANGUAGES}"
- echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
- else
- enable_languages=all
- fi
+ if test x"${LANGUAGES+set}" = xset; then
+ enable_languages="${LANGUAGES}"
+ echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+ else
+ enable_languages=all
+ fi
else
- if test x"${enable_languages}" = x ||
- test x"${enable_languages}" = xyes;
- then
- echo configure.in: --enable-languages needs at least one language argument 1>&2
- exit 1
- fi
+ if test x"${enable_languages}" = x ||
+ test x"${enable_languages}" = xyes;
+ then
+ echo configure.in: --enable-languages needs at least one language argument 1>&2
+ exit 1
+ fi
fi
enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
@@ -761,64 +749,60 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e
# front ends it requires, even if some are required indirectly.
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
- case $lang in
- ..)
- ;;
+ case $lang in
+ ..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[[*]]/config-lang.in)
- ;;
+ ${srcdir}/gcc/[[*]]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang`
- for other in $this_lang_requires
- do
- case ,${enable_languages}, in
- *,$other,*)
- ;;
- *,all,*)
- ;;
- *,$lang_alias,*)
- echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
- enable_languages="$enable_languages,$other"
- ;;
- esac
- done
- ;;
- esac
+ lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
+ this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang`
+ for other in $this_lang_requires
+ do
+ case ,${enable_languages}, in
+ *,$other,*) ;;
+ *,all,*) ;;
+ *,$lang_alias,*)
+ echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+ esac
done
subdirs=
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
- case $lang in
- ..) ;;
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[[*]]/config-lang.in) ;;
- *)
- lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang`
- build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang`
- if test "x$lang_alias" = x
- then
- echo "$lang doesn't set \$language." 1>&2
- exit 1
- fi
- case ${build_by_default},${enable_languages}, in
- *,$lang_alias,*) add_this_lang=yes ;;
- no,*) add_this_lang=no ;;
- *,all,*) add_this_lang=yes ;;
- *) add_this_lang=no ;;
- esac
- if test x"${add_this_lang}" = xyes; then
- eval target_libs='"$target_libs "'\"$this_lang_libs\"
- else
- eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
- fi
- ;;
- esac
+ case $lang in
+ ..) ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+ ${srcdir}/gcc/[[*]]/config-lang.in) ;;
+ *)
+ lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
+ this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang`
+ this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang`
+ build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang`
+ if test "x$lang_alias" = x
+ then
+ echo "$lang doesn't set \$language." 1>&2
+ exit 1
+ fi
+ case ${build_by_default},${enable_languages}, in
+ *,$lang_alias,*) add_this_lang=yes ;;
+ no,*) add_this_lang=no ;;
+ *,all,*) add_this_lang=yes ;;
+ *) add_this_lang=no ;;
+ esac
+ if test x"${add_this_lang}" = xyes; then
+ eval target_libs='"$target_libs "'\"$this_lang_libs\"
+ else
+ eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
+ fi
+ ;;
+ esac
done
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
@@ -1023,7 +1007,6 @@ case "${host}" in
;;
m88k-dg-dgux*)
tentative_cc="gcc -Wall -ansi -D__using_DGUX"
- host_makefile_frag="config/mh-dgux"
;;
m88k-harris-cxux*)
# Under CX/UX, we want to tell the compiler to use ANSI mode.
@@ -1241,24 +1224,6 @@ if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-
extra_host_args="$extra_host_args --with-newlib"
fi
-# We default to --with-shared on platforms where -fpic is meaningless.
-# Well, we don't yet, but we will.
-if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then
- case "${target}" in
- alpha*-dec-osf*) enable_shared=yes ;;
- alpha*-*-linux*) enable_shared=yes ;;
- mips-sgi-irix5*) enable_shared=yes ;;
- *) enable_shared=no ;;
- esac
-fi
-
-case "${enable_shared}" in
- yes) shared=yes ;;
- no) shared=no ;;
- "") shared=no ;;
- *) shared=yes ;;
-esac
-
# Default to using --with-stabs for certain targets.
if test x${with_stabs} = x ; then
@@ -1634,12 +1599,10 @@ esac
# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
# binutils tools will find libbfd.so.
-if test "${shared}" = "yes" ; then
- SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
-else
- SET_LIB_PATH=
-fi
-
+case "${enable_shared}" in
+ no | "") SET_LIB_PATH= ;;
+ *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
+esac
case "${host}" in
*-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
@@ -1935,7 +1898,7 @@ esac
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
fi
if test "x${use_gnu_ld}" = x &&
@@ -2026,8 +1989,6 @@ AC_SUBST(RPATH_ENVVAR)
AC_SUBST(BUILD_PREFIX)
AC_SUBST(BUILD_PREFIX_1)
AC_SUBST(configlinks)
-AC_SUBST(enable_shared)
-AC_SUBST(enable_threads)
AC_SUBST(enable_version_specific_runtime_libs)
AC_SUBST(gcc_version_trigger)
AC_SUBST(gcc_version)
@@ -2126,4 +2087,23 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+AC_MSG_RESULT($USE_MAINTAINER_MODE)
+AC_SUBST(MAINTAINER_MODE_TRUE)
+AC_SUBST(MAINTAINER_MODE_FALSE)
+if test "$USE_MAINTAINER_MODE" = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+MAINT=$MAINTAINER_MODE_TRUE
+AC_SUBST(MAINT)dnl
+
AC_OUTPUT(Makefile)
diff --git a/include/ChangeLog b/include/ChangeLog
index 829d187740..c98e61e436 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,15 @@
+2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h: Document return value of physmem routines.
+
+2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (physmem_total, physmem_available): Prototype.
+
+2003-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * libiberty.h (lrealpath): Add declaration.
+
2003-01-31 Grant Grundler <grundler@dsl2.external.hp.com>
* hppa.h (ldwa, ldda): Add ordered opcodes.
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 88e8c96e56..e87cdd2e04 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,24 @@
+Mon Mar 3 20:35:58 2003 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E,
+ and SH2E & SH4 merge to SH4, not SH2E.
+
+2003-02-21 Ian Wienand <ianw@gelato.unsw.edu.au>
+
+ * ia64.h (SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG,
+ SHT_IA_64_PRIORITY_INIT): Define.
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * ppc64.h (IS_PPC64_TLS_RELOC): Rename from IS_TLS_RELOC.
+
+ * ppc.h: Replace DTPMOD64, TPREL64, DTPREL64 with DTPMOD32 etc.
+ (IS_PPC_TLS_RELOC): Define.
+
+2003-02-10 Nick Clifton <nickc@redhat.com>
+
+ * arm.h (EF_ARM_MAVERICK_FLOAT): Define.
+
2003-02-05 Alan Modra <amodra@bigpond.net.au>
* ppc.h: Add TLS relocs. Format.
diff --git a/include/elf/arm.h b/include/elf/arm.h
index 269a225dd0..534701753c 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -34,6 +34,7 @@
#define EF_ARM_OLD_ABI 0x100
#define EF_ARM_SOFT_FLOAT 0x200
#define EF_ARM_VFP_FLOAT 0x400
+#define EF_ARM_MAVERICK_FLOAT 0x800
/* Other constants defined in the ARM ELF spec. version B-01. */
#define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */
diff --git a/include/elf/ia64.h b/include/elf/ia64.h
index 310a7f74af..06dfa606dc 100644
--- a/include/elf/ia64.h
+++ b/include/elf/ia64.h
@@ -1,45 +1,44 @@
/* IA-64 ELF support for BFD.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-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 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. */
#ifndef _ELF_IA64_H
#define _ELF_IA64_H
/* Bits in the e_flags field of the Elf64_Ehdr: */
-#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */
-#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */
+#define EF_IA_64_MASKOS 0x0000000f /* OS-specific flags. */
+#define EF_IA_64_ARCH 0xff000000 /* Arch. version mask. */
/* ??? These four definitions are not part of the SVR4 ABI.
They were present in David's initial code drop, so it is probable
that they are used by HP/UX. */
-#define EF_IA_64_TRAPNIL (1 << 0) /* trap NIL pointer dereferences */
-#define EF_IA_64_EXT (1 << 2) /* program uses arch. extensions */
-#define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian) */
-#define EFA_IA_64_EAS2_3 0x23000000 /* ia64 EAS 2.3 */
+#define EF_IA_64_TRAPNIL (1 << 0) /* Trap NIL pointer dereferences. */
+#define EF_IA_64_EXT (1 << 2) /* Program uses arch. extensions. */
+#define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian). */
+#define EFA_IA_64_EAS2_3 0x23000000 /* IA64 EAS 2.3. */
-#define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI */
+#define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI. */
/* Not used yet. */
#define EF_IA_64_REDUCEDFP (1 << 5) /* Only FP6-FP11 used. */
-#define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */
-#define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */
+#define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */
+#define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */
/* Not used yet. */
#define EF_IA_64_ABSOLUTE (1 << 8) /* Load at absolute addresses. */
@@ -54,13 +53,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Bits in the sh_flags field of Elf64_Shdr: */
-#define SHF_IA_64_SHORT 0x10000000 /* section near gp */
-#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */
+#define SHF_IA_64_SHORT 0x10000000 /* Section near gp. */
+#define SHF_IA_64_NORECOV 0x20000000 /* Spec insns w/o recovery. */
/* Possible values for sh_type in Elf64_Shdr: */
-#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */
-#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
+#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* Extension bits. */
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* Unwind bits. */
+#define SHT_IA_64_LOPSREG (SHT_LOPROC + 0x8000000)
+/* ABI says (SHT_LOPROC + 0xfffffff) but I think it's a typo -- this makes sense. */
+#define SHT_IA_64_HIPSREG (SHT_LOPROC + 0x8ffffff)
+#define SHT_IA_64_PRIORITY_INIT (SHT_LOPROC + 0x9000000)
/* SHT_IA_64_HP_OPT_ANOT is only generated by HPUX compilers for its
optimization annotation section. GCC does not generate it but we
@@ -74,8 +77,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Possible values for p_type in Elf64_Phdr: */
-#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */
-#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */
+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* Arch extension bits, */
+#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* IA64 unwind bits. */
/* HP-UX specific values for p_type in Elf64_Phdr.
These values are currently just used to make
@@ -92,10 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This section only used by HP-UX, The HP linker gives weak symbols
precedence over regular common symbols. We want common to override
weak. Using this common instead of SHN_COMMON does that. */
-
#define SHN_IA_64_ANSI_COMMON 0xFF00
-/* ia64-specific relocation types: */
+/* IA64-specific relocation types: */
/* Relocs apply to specific instructions within a bundle. The least
significant 2 bits of the address indicate which instruction in the
diff --git a/include/elf/ppc.h b/include/elf/ppc.h
index 21c6743795..52bcc1e055 100644
--- a/include/elf/ppc.h
+++ b/include/elf/ppc.h
@@ -73,17 +73,17 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type)
/* Relocs added to support TLS. */
RELOC_NUMBER (R_PPC_TLS, 67)
- RELOC_NUMBER (R_PPC_DTPMOD64, 68)
+ RELOC_NUMBER (R_PPC_DTPMOD32, 68)
RELOC_NUMBER (R_PPC_TPREL16, 69)
RELOC_NUMBER (R_PPC_TPREL16_LO, 70)
RELOC_NUMBER (R_PPC_TPREL16_HI, 71)
RELOC_NUMBER (R_PPC_TPREL16_HA, 72)
- RELOC_NUMBER (R_PPC_TPREL64, 73)
+ RELOC_NUMBER (R_PPC_TPREL32, 73)
RELOC_NUMBER (R_PPC_DTPREL16, 74)
RELOC_NUMBER (R_PPC_DTPREL16_LO, 75)
RELOC_NUMBER (R_PPC_DTPREL16_HI, 76)
RELOC_NUMBER (R_PPC_DTPREL16_HA, 77)
- RELOC_NUMBER (R_PPC_DTPREL64, 78)
+ RELOC_NUMBER (R_PPC_DTPREL32, 78)
RELOC_NUMBER (R_PPC_GOT_TLSGD16, 79)
RELOC_NUMBER (R_PPC_GOT_TLSGD16_LO, 80)
RELOC_NUMBER (R_PPC_GOT_TLSGD16_HI, 81)
@@ -130,6 +130,8 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type)
END_RELOC_NUMBERS (R_PPC_max)
+#define IS_PPC_TLS_RELOC(R) \
+ ((R) >= R_PPC_TLS && (R) <= R_PPC_GOT_DTPREL16_HA)
/* Processor specific flags for the ELF header e_flags field. */
diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h
index 8b80187171..ee2b0ea533 100644
--- a/include/elf/ppc64.h
+++ b/include/elf/ppc64.h
@@ -143,7 +143,7 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type)
END_RELOC_NUMBERS (R_PPC64_max)
-#define IS_TLS_RELOC(R) \
+#define IS_PPC64_TLS_RELOC(R) \
((R) >= R_PPC64_TLS && (R) <= R_PPC64_DTPREL16_HIGHESTA)
/* Specify the start of the .glink section. */
diff --git a/include/elf/sh.h b/include/elf/sh.h
index 41bf0bf696..00a5f2adce 100644
--- a/include/elf/sh.h
+++ b/include/elf/sh.h
@@ -56,7 +56,8 @@
: (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \
|| ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \
? EF_SH4 \
- : ((mach1) > (mach2) ? (mach1) : (mach2)))
+ : (((mach1) == EF_SH2E ? 7 : (mach1)) > ((mach2) == EF_SH2E ? 7 : (mach2)) \
+ ? (mach1) : (mach2)))
/* Flags for the st_other symbol field.
Keep away from the STV_ visibility flags (bit 0..1). */
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index b36341ddba..f60f7b169f 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,3 +1,17 @@
+2003-02-27 Andrew Cagney <cagney@redhat.com>
+
+ * remote-sim.h (sim_open, sim_load, sim_create_inferior): Rename
+ _bfd to bfd.
+
+2003-02-20 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-sim.h (SIM_RC): Delete unused SIM_RC_UNKNOWN_BREAKPOINT,
+ SIM_RC_INSUFFICIENT_RESOURCES and SIM_RC_DUPLICATE_BREAKPOINT.
+ (sim_set_breakpoint, sim_clear_breakpoint): Delete declarations.
+ (sim_clear_all_breakpoints, sim_enable_breakpoint): Ditto.
+ (sim_enable_all_breakpoints, sim_disable_breakpoint): Ditto.
+ (sim_disable_all_breakpoints): Ditto.
+
2002-12-26 Kazu Hirata <kazu@cs.umass.edu>
* sim-h8300.h: Remove ^M.
diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h
index 14d90b444f..a49ba1a89e 100644
--- a/include/gdb/remote-sim.h
+++ b/include/gdb/remote-sim.h
@@ -58,16 +58,13 @@ typedef enum {
typedef enum {
SIM_RC_FAIL = 0,
- SIM_RC_OK = 1,
- SIM_RC_UNKNOWN_BREAKPOINT = 2,
- SIM_RC_INSUFFICIENT_RESOURCES = 3,
- SIM_RC_DUPLICATE_BREAKPOINT = 4
+ SIM_RC_OK = 1
} SIM_RC;
/* The bfd struct, as an opaque type. */
-struct _bfd;
+struct bfd;
/* Main simulator entry points. */
@@ -108,7 +105,7 @@ struct _bfd;
sim_create_inferior. FIXME: What should the state of the simulator
be? */
-SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv));
+SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv));
/* Destory a simulator instance.
@@ -145,7 +142,7 @@ void sim_close PARAMS ((SIM_DESC sd, int quitting));
Such manipulation should probably (?) occure in
sim_create_inferior. */
-SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty));
+SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty));
/* Prepare to run the simulated program.
@@ -165,7 +162,7 @@ SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tt
address space (according to the applicable ABI) and the program
counter and stack pointer set accordingly. */
-SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct _bfd *abfd, char **argv, char **env));
+SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct bfd *abfd, char **argv, char **env));
/* Fetch LENGTH bytes of the simulated program's memory. Start fetch
@@ -278,19 +275,6 @@ void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc));
void sim_do_command PARAMS ((SIM_DESC sd, char *cmd));
-/* Call these functions to set and clear breakpoints at ADDR. */
-
-SIM_RC sim_set_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
-SIM_RC sim_clear_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
-SIM_RC sim_clear_all_breakpoints PARAMS ((SIM_DESC sd));
-
-/* These functions are used to enable and disable breakpoints. */
-
-SIM_RC sim_enable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
-SIM_RC sim_disable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
-SIM_RC sim_enable_all_breakpoints PARAMS ((SIM_DESC sd));
-SIM_RC sim_disable_all_breakpoints PARAMS ((SIM_DESC sd));
-
#ifdef __cplusplus
}
#endif
diff --git a/include/libiberty.h b/include/libiberty.h
index f9916c58c7..676ceaba4a 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -85,6 +85,10 @@ extern char *basename ();
extern const char *lbasename PARAMS ((const char *));
+/* A well-defined realpath () that is always compiled in. */
+
+extern char *lrealpath PARAMS ((const char *));
+
/* Concatenate an arbitrary number of strings. You must pass NULL as
the last argument of this function, to terminate the list of
strings. Allocates memory using xmalloc. */
@@ -242,6 +246,10 @@ extern char *xstrdup PARAMS ((const char *)) ATTRIBUTE_MALLOC;
extern PTR xmemdup PARAMS ((const PTR, size_t, size_t)) ATTRIBUTE_MALLOC;
+/* Physical memory routines. Return values are in BYTES. */
+extern double physmem_total PARAMS ((void));
+extern double physmem_available PARAMS ((void));
+
/* hex character manipulation routines */
#define _hex_array_size 256
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index c7c4484cc8..f04439c3e8 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,7 @@
+2003-02-21 Noida D.Venkatasubramanian <dvenkat@noida.hcltech.com>
+
+ * h8300.h (ldmac, stmac): Replace MACREG with MS32 and MD32.
+
2003-01-23 Alan Modra <amodra@bigpond.net.au>
* m68hc11.h (cpu6812s): Define.
diff --git a/include/opcode/h8300.h b/include/opcode/h8300.h
index 4141c575e5..034c7bc9d1 100644
--- a/include/opcode/h8300.h
+++ b/include/opcode/h8300.h
@@ -1,5 +1,5 @@
/* Opcode table for the H8/300
- Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2002
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>.
@@ -48,7 +48,7 @@ typedef int op_type;
#define L_32 0x04
#define L_P 0x08
#define L_24 0x10
-#define MEMRELAX 0x20 /* move insn which may relax */
+#define MEMRELAX 0x20 /* Move insn which may relax. */
#define SRC 0x40
#define DST 0x80
@@ -66,10 +66,10 @@ typedef int op_type;
#define DBIT 0x80000
#define DISPREG 0x100000
#define IGNORE 0x200000
-#define E 0x400000 /* FIXME: end of nibble sequence? */
+#define E 0x400000 /* FIXME: end of nibble sequence? */
#define L_2 0x800000
-#define B30 0x1000000 /* bit 3 must be low */
-#define B31 0x2000000 /* bit 3 must be high */
+#define B30 0x1000000 /* Bit 3 must be low. */
+#define B31 0x2000000 /* Bit 3 must be high. */
#define CCR 0x4000000
#define ABS 0x8000000
#define ABSJMP 0x10000000
@@ -77,54 +77,57 @@ typedef int op_type;
#define PCREL 0x40000000
#define MEMIND 0x80000000
-#define IMM3 IMM|L_3
-#define IMM2 IMM|L_2
+#define IMM3 IMM | L_3
+#define IMM2 IMM | L_2
-#define SIZE (L_2|L_3|L_8|L_16|L_32|L_P|L_24)
-#define MODE (REG|IMM|DISP|IND|INC|DEC|CCR|ABS|MEMIND|EXR)
+#define SIZE (L_2 | L_3 | L_8 | L_16 | L_32 | L_P | L_24)
+#define MODE (REG | IMM | DISP | IND | INC | DEC | CCR | ABS | MEMIND | EXR)
-#define RD8 (DST|L_8|REG)
-#define RD16 (DST|L_16|REG)
-#define RD32 (DST|L_32|REG)
-#define RS8 (SRC|L_8|REG)
-#define RS16 (SRC|L_16|REG)
-#define RS32 (SRC|L_32|REG)
+#define RD8 (DST | L_8 | REG)
+#define RD16 (DST | L_16 | REG)
+#define RD32 (DST | L_32 | REG)
+#define RS8 (SRC | L_8 | REG)
+#define RS16 (SRC | L_16 | REG)
+#define RS32 (SRC | L_32 | REG)
-#define RSP (SRC|L_P|REG)
-#define RDP (DST|L_P|REG)
+#define RSP (SRC | L_P | REG)
+#define RDP (DST | L_P | REG)
-#define IMM8 (IMM|SRC|L_8)
-#define IMM16 (IMM|SRC|L_16)
-#define IMM32 (IMM|SRC|L_32)
+#define IMM8 (IMM | SRC | L_8)
+#define IMM16 (IMM | SRC | L_16)
+#define IMM32 (IMM | SRC | L_32)
-#define ABS8SRC (SRC|ABS|L_8|ABS8MEM)
-#define ABS8DST (DST|ABS|L_8|ABS8MEM)
+#define ABS8SRC (SRC | ABS | L_8 | ABS8MEM)
+#define ABS8DST (DST | ABS | L_8 | ABS8MEM)
-#define DISP8 (PCREL|L_8)
-#define DISP16 (PCREL|L_16)
+#define DISP8 (PCREL | L_8)
+#define DISP16 (PCREL | L_16)
-#define DISP8SRC (DISP|L_8|SRC)
-#define DISP16SRC (DISP|L_16|SRC)
+#define DISP8SRC (DISP | L_8 | SRC)
+#define DISP16SRC (DISP | L_16 | SRC)
-#define DISP8DST (DISP|L_8|DST)
-#define DISP16DST (DISP|L_16|DST)
+#define DISP8DST (DISP | L_8 | DST)
+#define DISP16DST (DISP | L_16 | DST)
-#define ABS16SRC (SRC|ABS|L_16)
-#define ABS16DST (DST|ABS|L_16)
-#define ABS24SRC (SRC|ABS|L_24)
-#define ABS24DST (DST|ABS|L_24)
-#define ABS32SRC (SRC|ABS|L_32)
-#define ABS32DST (DST|ABS|L_32)
+#define ABS16SRC (SRC | ABS | L_16)
+#define ABS16DST (DST | ABS | L_16)
+#define ABS24SRC (SRC | ABS | L_24)
+#define ABS24DST (DST | ABS | L_24)
+#define ABS32SRC (SRC | ABS | L_32)
+#define ABS32DST (DST | ABS | L_32)
-#define RDDEC (DST|DEC)
-#define RSINC (SRC|INC)
-#define RDINC (DST|INC)
+#define RDDEC (DST | DEC)
+#define RSINC (SRC | INC)
+#define RDINC (DST | INC)
-#define RDIND (DST|IND)
-#define RSIND (SRC|IND)
+#define RDIND (DST | IND)
+#define RSIND (SRC | IND)
+
+#define MS32 (SRC | L_32 | MACREG)
+#define MD32 (DST | L_32 | MACREG)
#if 1
-#define OR8 RS8 /* ??? OR as in One Register? */
+#define OR8 RS8 /* ??? OR as in One Register? */
#define OR16 RS16
#define OR32 RS32
#else
@@ -211,7 +214,7 @@ struct h8_opcode
#define PREFIXLDC 0x0,0x1,0x4,0x0
-#define O(op, size) (op*4+size)
+#define O(op, size) (op * 4 + size)
#define O_RECOMPILE 0
#define O_ADD 1
@@ -316,7 +319,6 @@ struct h8_opcode
#define SL 2
#define SN 3
-
/* FIXME: Lots of insns have "E, 0, 0, 0, 0" in the nibble code sequences.
Methinks the zeroes aren't necessary. Once confirmed, nuke 'em. */
@@ -596,8 +598,8 @@ const struct h8_opcode h8_opcodes[] =
NEW_SOP(O(O_CLRMAC,SN),1,2,"clrmac"),{{E, 0, 0}},{{0x0,0x1,0xa,0x0,E}} EOP,
NEW_SOP(O(O_MAC,SL),1,2,"mac"),{{RSINC,RDINC,E}},{{0x0,0x1,0x6,0x0,0x6,0xd,B30|RSINC,B30|RDINC,E}} EOP,
- NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MACREG,E}},{{0x0,0x3,MACREG,RS32,E}} EOP,
- NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MACREG,RD32,E}},{{0x0,0x2,MACREG,RD32,E}} EOP,
+ NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MD32,E}},{{0x0,0x3,MD32,RS32,E}} EOP,
+ NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MS32,RD32,E}},{{0x0,0x2,MS32,RD32,E}} EOP,
NEW_SOP(O(O_LDM,SL),0,6,"ldm.l"),{{RSINC, RS32, E}},{{ 0x0,0x1,IGNORE,0x0,0x6,0xD,0x7,IGNORE,E}}EOP,
NEW_SOP(O(O_STM,SL),0,6,"stm.l"),{{RS32, RDDEC, E}},{{0x0,0x1,IGNORE,0x0,0x6,0xD,0xF,IGNORE,E}}EOP,
{0, 0, 0, NULL, {{0,0,0}}, {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}}
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 57acfc068e..b3e904f975 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,112 @@
+2003-03-03 Mark Mitchell <mark@codesourcery.com>
+
+ * cplus-dem.c: Add license exception to copyright notice.
+
+2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * physmem.c: Formatting changes from upstream.
+
+2003-02-24 Danny Smith <dannysmith@users.source.forge.net>
+
+ * physmem.c (physmem_total): Add _WIN32 support.
+ (physmem_available): Likewise.
+
+2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Test for
+ GSI_PHYSMEM.
+ (physmem_available) [HAVE_TABLE]: Test for TBL_VMSTATS.
+
+2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in: Check for sys/systemcfg.h and
+ _system_configuration.
+ * physmem.c: Add support for AIX. Tweek formatting as per
+ upstream coreutils beta.
+
+2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ Richard Earnshaw <rearnsha@arm.com>
+ Geoffrey Keating <geoffk@apple.com>
+
+ * configure.in: Check for sys/sysctl.h and sysctl.
+ * physmem.c: Add support for *bsd and darwin.
+ * Makefile.in: Generate depedency for physmem.o.
+
+2003-02-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Use getsysinfo on
+ Tru64 UNIX.
+ (physmem_available) [HAVE_TABLE && HAVE_SYS_TABLE_H]: Use table on
+ Tru64 UNIX.
+
+ * configure.in (AC_CHECK_HEADERS): Check for sys/sysinfo.h,
+ machine/hal_sysinfo.h, sys/table.h.
+ (checkfuncs, AC_CHECKFUNCS): Check for getsysinfo, table.
+ * configure, config.in: Regenerate.
+
+2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * physmem.c (physmem_total, physmem_available): De-ANSI-fy.
+ * configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and
+ pstat_getdynamic.
+
+2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (CFILES): Add physmem.c.
+ (REQUIRED_OFILES): Add physmem.o.
+ * configure.in: Check for sys/pstat.h.
+ (checkfuncs): Add pstat_getstatic and pstat_getdynamic.
+ * physmem.c: New file, copied from textutils.
+
+ * config.in, configure: Regenerated.
+
+2003-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (CFILES): Add lrealpath.c.
+ (REQUIRED_OFILES): Add lrealpath.o.
+ (lrealpath.o): Add rule.
+ * aclocal.m4 (libiberty_NEED_DECLARATION): Add.
+ * configure.in: Add realpath and canonicalize_file_name to
+ checkfuncs and AC_CHECK_FUNCS. Use libiberty_NEED_DECLARATION
+ for canonicalize_file_name.
+ * lrealpath.c: New file.
+ * make-relative-prefix.c: Update documentation.
+ (make_relative_prefix): Simplify. Use lbasename and lrealpath.
+ * config.in: Regenerated.
+ * configure: Regenerated.
+ * functions.texi: Regenerated.
+
+2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl>
+
+ * cplus_dem.c: Fix typo: intializes -> initializes.
+
+2003-02-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to
+ config.status.
+ * configure: Rebuilt.
+
+2003-02-13 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR c++/7612.
+ * cplus-dem.c (demangle_signature): Call string_delete.
+ Remove extra string_init.
+ (demangle_arm_hp_template): Call string_delete instead of
+ string_clear. Add missing string_delete call.
+ (demangle_qualified): Add missing string_delete call.
+ (do_type): Remove unused variable btype. Add missing string_delete
+ call. Call string_delete instead of string_clear.
+ (demangle_fund_type): Move variable btype inside of the switch
+ statement. Add missing string_delete call.
+ (do_arg): Call string_delete instead of string_clear. Remove extra
+ string_init.
+ (demangle_nested_args): Free work->previous_argument.
+
+2003-02-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * acconfig.h: New file. Add uintptr_t.
+ * config.in: Regenerated.
+
2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
* libiberty.texi: Update to GFDL 1.2.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 761c674c40..064179669b 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -137,6 +137,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \
hashtab.c hex.c \
index.c insque.c \
lbasename.c \
+ lrealpath.c \
make-relative-prefix.c \
make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \
memset.c mkstemps.c \
@@ -144,7 +145,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \
partition.c \
pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \
pex-unix.c pex-win32.c \
- putenv.c \
+ physmem.c putenv.c \
random.c regex.c rename.c rindex.c \
safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \
splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \
@@ -165,10 +166,11 @@ REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \
getopt.o getopt1.o getpwd.o getruntime.o \
hashtab.o hex.o \
lbasename.o \
+ lrealpath.o \
make-relative-prefix.o \
make-temp-file.o \
objalloc.o obstack.o \
- partition.o @pexecute@ \
+ partition.o physmem.o @pexecute@ \
safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \
strsignal.o \
ternary.o \
@@ -443,6 +445,7 @@ hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
+lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
@@ -463,6 +466,7 @@ pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+physmem.o: config.h $(INCDIR)/libiberty.h
putenv.o: config.h $(INCDIR)/ansidecl.h
random.o: $(INCDIR)/ansidecl.h
regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
diff --git a/libiberty/acconfig.h b/libiberty/acconfig.h
new file mode 100644
index 0000000000..364cb41da7
--- /dev/null
+++ b/libiberty/acconfig.h
@@ -0,0 +1,3 @@
+/* Define to `unsigned long' if <sys/types.h> doesn't define. */
+#undef uintptr_t
+
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index 103e246de7..6c5dc6ac64 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -87,6 +87,35 @@ then AC_DEFINE(NEED_DECLARATION_ERRNO, 1,
fi
])
+dnl See whether we need a declaration for a function.
+AC_DEFUN(libiberty_NEED_DECLARATION,
+[AC_MSG_CHECKING([whether $1 must be declared])
+AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
+[AC_TRY_COMPILE([
+#include "confdefs.h"
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],
+[char *(*pfn) = (char *(*)) $1],
+libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)])
+AC_MSG_RESULT($libiberty_cv_decl_needed_$1)
+if test $libiberty_cv_decl_needed_$1 = yes; then
+ AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
+ [Define if $1 is not declared in system header files.])
+fi
+])dnl
+
# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
diff --git a/libiberty/config.in b/libiberty/config.in
index e06bbce857..f0e174696c 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
@@ -15,6 +15,9 @@
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
+/* Define if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
@@ -30,6 +33,9 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
+/* Define to `unsigned long' if <sys/types.h> doesn't define. */
+#undef uintptr_t
+
/* Define if you have the _doprnt function. */
#undef HAVE__DOPRNT
@@ -57,6 +63,9 @@
/* Define if you have the calloc function. */
#undef HAVE_CALLOC
+/* Define if you have the canonicalize_file_name function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define if you have the clock function. */
#undef HAVE_CLOCK
@@ -72,6 +81,9 @@
/* Define if you have the getrusage function. */
#undef HAVE_GETRUSAGE
+/* Define if you have the getsysinfo function. */
+#undef HAVE_GETSYSINFO
+
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
@@ -105,12 +117,21 @@
/* Define if you have the psignal function. */
#undef HAVE_PSIGNAL
+/* Define if you have the pstat_getdynamic function. */
+#undef HAVE_PSTAT_GETDYNAMIC
+
+/* Define if you have the pstat_getstatic function. */
+#undef HAVE_PSTAT_GETSTATIC
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the random function. */
#undef HAVE_RANDOM
+/* Define if you have the realpath function. */
+#undef HAVE_REALPATH
+
/* Define if you have the rename function. */
#undef HAVE_RENAME
@@ -162,6 +183,15 @@
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
+/* Define if you have the sysctl function. */
+#undef HAVE_SYSCTL
+
+/* Define if you have the sysmp function. */
+#undef HAVE_SYSMP
+
+/* Define if you have the table function. */
+#undef HAVE_TABLE
+
/* Define if you have the times function. */
#undef HAVE_TIMES
@@ -192,6 +222,9 @@
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define if you have the <machine/hal_sysinfo.h> header file. */
+#undef HAVE_MACHINE_HAL_SYSINFO_H
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -210,12 +243,30 @@
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define if you have the <sys/pstat.h> header file. */
+#undef HAVE_SYS_PSTAT_H
+
/* Define if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
+/* Define if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define if you have the <sys/sysinfo.h> header file. */
+#undef HAVE_SYS_SYSINFO_H
+
+/* Define if you have the <sys/sysmp.h> header file. */
+#undef HAVE_SYS_SYSMP_H
+
+/* Define if you have the <sys/systemcfg.h> header file. */
+#undef HAVE_SYS_SYSTEMCFG_H
+
+/* Define if you have the <sys/table.h> header file. */
+#undef HAVE_SYS_TABLE_H
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
@@ -240,6 +291,9 @@
/* Define if you have the sys_siglist variable. */
#undef HAVE_SYS_SIGLIST
+/* Define if you have the _system_configuration variable. */
+#undef HAVE__SYSTEM_CONFIGURATION
+
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
systems. This function is required for alloca.c support on those
systems. */
@@ -252,3 +306,6 @@
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
+/* Define if canonicalize_file_name is not declared in system header files. */
+#undef NEED_DECLARATION_CANONICALIZE_FILE_NAME
+
diff --git a/libiberty/configure b/libiberty/configure
index 86037aebbe..3f46ebfc38 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1356,7 +1356,7 @@ else
fi
echo "$ac_t""$CPP" 1>&6
-for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h
+for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1735,9 +1735,11 @@ funcs="$funcs waitpid"
# Also in the old function.def file: alloca, vfork, getopt.
-vars="sys_errlist sys_nerr sys_siglist"
+vars="sys_errlist sys_nerr sys_siglist _system_configuration"
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
+checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
+checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
@@ -1745,12 +1747,12 @@ if test "x" = "y"; then
for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1749: checking for $ac_func" >&5
+echo "configure:1751: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1754 "configure"
+#line 1756 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1773,7 +1775,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1800,12 +1802,12 @@ done
for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1804: checking for $ac_func" >&5
+echo "configure:1806: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1809 "configure"
+#line 1811 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1828,7 +1830,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1855,12 +1857,12 @@ done
for ac_func in memmove memset putenv random rename rindex sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1859: checking for $ac_func" >&5
+echo "configure:1861: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1864 "configure"
+#line 1866 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1883,7 +1885,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1910,12 +1912,12 @@ done
for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1914: checking for $ac_func" >&5
+echo "configure:1916: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1919 "configure"
+#line 1921 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1938,7 +1940,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1965,12 +1967,12 @@ done
for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1969: checking for $ac_func" >&5
+echo "configure:1971: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 1976 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1993,7 +1995,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2020,12 +2022,12 @@ done
for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2024: checking for $ac_func" >&5
+echo "configure:2026: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2029 "configure"
+#line 2031 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2048,7 +2050,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2075,12 +2077,12 @@ done
for ac_func in sysconf times sbrk gettimeofday ffs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2079: checking for $ac_func" >&5
+echo "configure:2081: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2084 "configure"
+#line 2086 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2103,7 +2105,117 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2136: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2141 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in realpath canonicalize_file_name
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2191: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2196 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2139,6 +2251,10 @@ EOF
#define HAVE_SYS_SIGLIST 1
EOF
+ cat >> confdefs.h <<\EOF
+#define HAVE__SYSTEM_CONFIGURATION 1
+EOF
+
fi
# For each of these functions, if the host does not provide the
@@ -2333,7 +2449,7 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2337: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2453: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2344,12 +2460,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2348 "configure"
+#line 2464 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -2375,19 +2491,19 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2379: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2495: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
for ac_func in $funcs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2386: checking for $ac_func" >&5
+echo "configure:2502: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2391 "configure"
+#line 2507 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2410,7 +2526,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2437,12 +2553,12 @@ done
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2441: checking whether alloca needs Cray hooks" >&5
+echo "configure:2557: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2446 "configure"
+#line 2562 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2467,12 +2583,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2471: checking for $ac_func" >&5
+echo "configure:2587: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2476 "configure"
+#line 2592 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2495,7 +2611,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2521,7 +2637,7 @@ fi
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2525: checking stack direction for C alloca" >&5
+echo "configure:2641: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2529,7 +2645,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2533 "configure"
+#line 2649 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2548,7 +2664,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2570,17 +2686,17 @@ EOF
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2574: checking for vfork.h" >&5
+echo "configure:2690: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2579 "configure"
+#line 2695 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2605,18 +2721,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2609: checking for working vfork" >&5
+echo "configure:2725: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2615: checking for vfork" >&5
+echo "configure:2731: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2620 "configure"
+#line 2736 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2639,7 +2755,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2661,7 +2777,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2665 "configure"
+#line 2781 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2756,7 +2872,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2788,12 +2904,12 @@ fi
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2792: checking for $ac_func" >&5
+echo "configure:2908: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
+#line 2913 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2816,7 +2932,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2846,12 +2962,12 @@ done
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2850: checking for $ac_func" >&5
+echo "configure:2966: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2855 "configure"
+#line 2971 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2874,7 +2990,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2902,19 +3018,19 @@ done
for v in $vars; do
echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2906: checking for $v" >&5
+echo "configure:3022: checking for $v" >&5
if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2911 "configure"
+#line 3027 "configure"
#include "confdefs.h"
int *p;
int main() {
extern int $v []; p = $v;
; return 0; }
EOF
-if { (eval echo configure:2918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "libiberty_cv_var_$v=yes"
else
@@ -2940,12 +3056,12 @@ EOF
for ac_func in $checkfuncs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2944: checking for $ac_func" >&5
+echo "configure:3060: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2949 "configure"
+#line 3065 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2968,7 +3084,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2992,6 +3108,54 @@ else
fi
done
+ echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
+echo "configure:3113: checking whether canonicalize_file_name must be declared" >&5
+if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3118 "configure"
+#include "confdefs.h"
+
+#include "confdefs.h"
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) canonicalize_file_name
+; return 0; }
+EOF
+if { (eval echo configure:3140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ libiberty_cv_decl_needed_canonicalize_file_name=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ libiberty_cv_decl_needed_canonicalize_file_name=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6
+if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
+EOF
+
+fi
+
fi
# Figure out which version of pexecute to use.
@@ -3004,21 +3168,21 @@ case "${host}" in
esac
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3012: checking for $ac_hdr" >&5
+echo "configure:3176: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3017 "configure"
+#line 3181 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3047,12 +3211,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3051: checking for $ac_func" >&5
+echo "configure:3215: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3056 "configure"
+#line 3220 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3075,7 +3239,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3100,7 +3264,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3104: checking for working mmap" >&5
+echo "configure:3268: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3108,7 +3272,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3112 "configure"
+#line 3276 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3136,24 +3300,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -3261,7 +3412,7 @@ main()
}
EOF
-if { (eval echo configure:3265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -3285,7 +3436,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3289: checking for working strncmp" >&5
+echo "configure:3440: checking for working strncmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3293,7 +3444,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3297 "configure"
+#line 3448 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3357,7 +3508,7 @@ main ()
}
EOF
-if { (eval echo configure:3361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strncmp_works=yes
else
@@ -3772,6 +3923,7 @@ with_build_subdir=${with_build_subdir}
with_multisubdir=${with_multisubdir}
ac_configure_args="--enable-multilib ${ac_configure_args}"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
libiberty_topdir=${libiberty_topdir}
EOF
diff --git a/libiberty/configure.in b/libiberty/configure.in
index 1329f1352d..5b38660f10 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -142,7 +142,7 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
@@ -204,9 +204,11 @@ funcs="$funcs waitpid"
# Also in the old function.def file: alloca, vfork, getopt.
-vars="sys_errlist sys_nerr sys_siglist"
+vars="sys_errlist sys_nerr sys_siglist _system_configuration"
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
+checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
+checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
@@ -218,9 +220,12 @@ if test "x" = "y"; then
AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs)
+ AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl)
+ AC_CHECK_FUNCS(realpath canonicalize_file_name)
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
+ AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])
fi
# For each of these functions, if the host does not provide the
@@ -424,6 +429,7 @@ if test -z "${setobjs}"; then
fi
done
AC_CHECK_FUNCS($checkfuncs)
+ libiberty_NEED_DECLARATION(canonicalize_file_name)
fi
# Figure out which version of pexecute to use.
@@ -466,5 +472,6 @@ with_build_subdir=${with_build_subdir}
with_multisubdir=${with_multisubdir}
ac_configure_args="--enable-multilib ${ac_configure_args}"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
libiberty_topdir=${libiberty_topdir}
)
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index f42d6181d4..af35bc1311 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -11,6 +11,15 @@ modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
+In addition to the permissions in the GNU Library General Public
+License, the Free Software Foundation gives you unlimited permission
+to link the compiled version of this file into combinations with other
+programs, and to distribute those combinations without any restriction
+coming from the use of this file. (The Library Public License
+restrictions do apply in other respects; for example, they cover
+modification of the file, and distribution when not linked into a
+combined executable.)
+
Libiberty 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
@@ -1064,7 +1073,7 @@ ada_demangle (mangled, option)
/* This function performs most of what cplus_demangle use to do, but
to be able to demangle a name with a B, K or n code, we need to
have a longer term memory of what types have been seen. The original
- now intializes and cleans up the squangle code info, while internal
+ now initializes and cleans up the squangle code info, while internal
calls go directly to this routine to avoid resetting that info. */
static char *
@@ -1429,6 +1438,7 @@ demangle_signature (work, mangled, declp)
{
string_append (&s, SCOPE_STRING (work));
string_prepends (declp, &s);
+ string_delete (&s);
}
oldmangled = NULL;
expect_func = 1;
@@ -1508,7 +1518,6 @@ demangle_signature (work, mangled, declp)
{
/* Read the return type. */
string return_type;
- string_init (&return_type);
(*mangled)++;
success = do_type (work, mangled, &return_type);
@@ -2321,7 +2330,7 @@ demangle_arm_hp_template (work, mangled, n, declp)
string_append (declp, "<");
while (1)
{
- string_clear (&arg);
+ string_delete (&arg);
switch (**mangled)
{
case 'T':
@@ -2378,7 +2387,7 @@ demangle_arm_hp_template (work, mangled, n, declp)
string_append (declp, "<");
/* should do error checking here */
while (args < e) {
- string_clear (&arg);
+ string_delete (&arg);
/* Check for type or literal here */
switch (*args)
@@ -2393,6 +2402,7 @@ demangle_arm_hp_template (work, mangled, n, declp)
goto cfront_template_args_done;
string_append (&arg, "(");
string_appends (&arg, &type_str);
+ string_delete (&type_str);
string_append (&arg, ")");
if (*args != 'L')
goto cfront_template_args_done;
@@ -3350,6 +3360,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
}
else
{
+ string_delete (&last_name);
success = do_type (work, mangled, &last_name);
if (!success)
break;
@@ -3492,10 +3503,8 @@ do_type (work, mangled, result)
string decl;
const char *remembered_type;
int type_quals;
- string btype;
type_kind_t tk = tk_none;
- string_init (&btype);
string_init (&decl);
string_init (result);
@@ -3613,6 +3622,7 @@ do_type (work, mangled, result)
string temp;
do_type (work, mangled, &temp);
string_prepends (&decl, &temp);
+ string_delete (&temp);
}
else if (**mangled == 't')
{
@@ -3623,7 +3633,7 @@ do_type (work, mangled, result)
if (success)
{
string_prependn (&decl, temp.b, temp.p - temp.b);
- string_clear (&temp);
+ string_delete (&temp);
}
else
break;
@@ -3803,11 +3813,8 @@ demangle_fund_type (work, mangled, result)
int success = 1;
char buf[10];
unsigned int dec = 0;
- string btype;
type_kind_t tk = tk_integral;
- string_init (&btype);
-
/* First pick off any type qualifiers. There can be more than one. */
while (!done)
@@ -3979,8 +3986,11 @@ demangle_fund_type (work, mangled, result)
}
case 't':
{
+ string btype;
+ string_init (&btype);
success = demangle_template (work, mangled, &btype, 0, 1, 1);
string_appends (result, &btype);
+ string_delete (&btype);
break;
}
default:
@@ -4182,12 +4192,9 @@ do_arg (work, mangled, result)
do not want to add additional types to the back-referenceable
type vector when processing a repeated type. */
if (work->previous_argument)
- string_clear (work->previous_argument);
+ string_delete (work->previous_argument);
else
- {
- work->previous_argument = (string*) xmalloc (sizeof (string));
- string_init (work->previous_argument);
- }
+ work->previous_argument = (string*) xmalloc (sizeof (string));
if (!do_type (work, mangled, work->previous_argument))
return 0;
@@ -4551,7 +4558,10 @@ demangle_nested_args (work, mangled, declp)
/* Restore the previous_argument field. */
if (work->previous_argument)
- string_delete (work->previous_argument);
+ {
+ string_delete (work->previous_argument);
+ free ((char *) work->previous_argument);
+ }
work->previous_argument = saved_previous_argument;
--work->forgetting_types;
work->nrepeats = saved_nrepeats;
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 18b2480a78..2c7b9e1276 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -392,19 +392,38 @@ and a path ending in @code{/} returns the empty string after it.
@end deftypefn
-@c make-relative-prefix.c:24
-@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix})
+@c lrealpath.c:25
+@deftypefn Replacement {const char*} lrealpath (const char *@var{name})
+
+Given a pointer to a string containing a pathname, returns a canonical
+version of the filename. Symlinks will be resolved, and ``.'' and ``..''
+components will be simplified. The returned value will be allocated using
+@code{xmalloc} or @code{malloc}.
-Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string
-that gets to @var{prefix} starting with the directory portion of @var{progname} and
-a relative pathname of the difference between @var{bin_prefix} and @var{prefix}.
+@end deftypefn
-For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix}
-is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc},
-then this function will return @code{/red/green/blue/../../omega/}.
+@c make-relative-prefix.c:24
+@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix})
-The return value is normally allocated via @code{malloc}. If no relative prefix
-can be found, return @code{NULL}.
+Given three paths @var{progname}, @var{bin_prefix}, @var{prefix},
+return the path that is in the same position relative to
+@var{progname}'s directory as @var{prefix} is relative to
+@var{bin_prefix}. That is, a string starting with the directory
+portion of @var{progname}, followed by a relative pathname of the
+difference between @var{bin_prefix} and @var{prefix}.
+
+If @var{progname} does not contain any directory separators,
+@code{make_relative_prefix} will search @env{PATH} to find a program
+named @var{progname}. Also, if @var{progname} is a symbolic link,
+the symbolic link will be resolved.
+
+For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta},
+@var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is
+@code{/red/green/blue/gcc}, then this function will return
+@code{/red/green/blue/../../omega/}.
+
+The return value is normally allocated via @code{malloc}. If no
+relative prefix can be found, return @code{NULL}.
@end deftypefn
diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
new file mode 100644
index 0000000000..b001b38ef6
--- /dev/null
+++ b/libiberty/lrealpath.c
@@ -0,0 +1,128 @@
+/* Libiberty realpath. Like realpath, but more consistent behavior.
+ Based on gdb_realpath from GDB.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of the libiberty 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. */
+
+/*
+
+@deftypefn Replacement {const char*} lrealpath (const char *@var{name})
+
+Given a pointer to a string containing a pathname, returns a canonical
+version of the filename. Symlinks will be resolved, and ``.'' and ``..''
+components will be simplified. The returned value will be allocated using
+@code{malloc}, or @code{NULL} will be returned on a memory allocation error.
+
+@end deftypefn
+
+*/
+
+#include "config.h"
+#include "ansidecl.h"
+#include "libiberty.h"
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* On GNU libc systems the declaration is only visible with _GNU_SOURCE. */
+#if defined(HAVE_CANONICALIZE_FILE_NAME) \
+ && defined(NEED_DECLARATION_CANONICALIZE_FILE_NAME)
+extern char *canonicalize_file_name (const char *);
+#endif
+
+#if defined(HAVE_REALPATH)
+# if defined (PATH_MAX)
+# define REALPATH_LIMIT PATH_MAX
+# else
+# if defined (MAXPATHLEN)
+# define REALPATH_LIMIT MAXPATHLEN
+# endif
+# endif
+#endif
+
+char *
+lrealpath (filename)
+ const char *filename;
+{
+ /* Method 1: The system has a compile time upper bound on a filename
+ path. Use that and realpath() to canonicalize the name. This is
+ the most common case. Note that, if there isn't a compile time
+ upper bound, you want to avoid realpath() at all costs. */
+#if defined(REALPATH_LIMIT)
+ {
+ char buf[REALPATH_LIMIT];
+ const char *rp = realpath (filename, buf);
+ if (rp == NULL)
+ rp = filename;
+ return strdup (rp);
+ }
+#endif /* REALPATH_LIMIT */
+
+ /* Method 2: The host system (i.e., GNU) has the function
+ canonicalize_file_name() which malloc's a chunk of memory and
+ returns that, use that. */
+#if defined(HAVE_CANONICALIZE_FILE_NAME)
+ {
+ char *rp = canonicalize_file_name (filename);
+ if (rp == NULL)
+ return strdup (filename);
+ else
+ return rp;
+ }
+#endif
+
+ /* Method 3: Now we're getting desperate! The system doesn't have a
+ compile time buffer size and no alternative function. Query the
+ OS, using pathconf(), for the buffer limit. Care is needed
+ though, some systems do not limit PATH_MAX (return -1 for
+ pathconf()) making it impossible to pass a correctly sized buffer
+ to realpath() (it could always overflow). On those systems, we
+ skip this. */
+#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H)
+ {
+ /* Find out the max path size. */
+ long path_max = pathconf ("/", _PC_PATH_MAX);
+ if (path_max > 0)
+ {
+ /* PATH_MAX is bounded. */
+ char *buf, *rp, *ret;
+ buf = malloc (path_max);
+ if (buf == NULL)
+ return NULL;
+ rp = realpath (filename, buf);
+ ret = strdup (rp ? rp : filename);
+ free (buf);
+ return ret;
+ }
+ }
+#endif
+
+ /* This system is a lost cause, just duplicate the filename. */
+ return strdup (filename);
+}
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
index c208cdce02..dc4f8d5259 100644
--- a/libiberty/make-relative-prefix.c
+++ b/libiberty/make-relative-prefix.c
@@ -23,16 +23,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix})
-Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string
-that gets to @var{prefix} starting with the directory portion of @var{progname} and
-a relative pathname of the difference between @var{bin_prefix} and @var{prefix}.
-
-For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix}
-is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc},
-then this function will return @code{/red/green/blue/../../omega/}.
-
-The return value is normally allocated via @code{malloc}. If no relative prefix
-can be found, return @code{NULL}.
+Given three paths @var{progname}, @var{bin_prefix}, @var{prefix},
+return the path that is in the same position relative to
+@var{progname}'s directory as @var{prefix} is relative to
+@var{bin_prefix}. That is, a string starting with the directory
+portion of @var{progname}, followed by a relative pathname of the
+difference between @var{bin_prefix} and @var{prefix}.
+
+If @var{progname} does not contain any directory separators,
+@code{make_relative_prefix} will search @env{PATH} to find a program
+named @var{progname}. Also, if @var{progname} is a symbolic link,
+the symbolic link will be resolved.
+
+For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta},
+@var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is
+@code{/red/green/blue/gcc}, then this function will return
+@code{/red/green/blue/../../omega/}.
+
+The return value is normally allocated via @code{malloc}. If no
+relative prefix can be found, return @code{NULL}.
@end deftypefn
@@ -223,19 +232,14 @@ make_relative_prefix (progname, bin_prefix, prefix)
int prog_num, bin_num, prefix_num;
int i, n, common;
int needed_len;
- char *ret, *ptr;
+ char *ret, *ptr, *full_progname = NULL;
if (progname == NULL || bin_prefix == NULL || prefix == NULL)
return NULL;
- prog_dirs = split_directories (progname, &prog_num);
- bin_dirs = split_directories (bin_prefix, &bin_num);
- if (bin_dirs == NULL || prog_dirs == NULL)
- return NULL;
-
/* If there is no full pathname, try to find the program by checking in each
of the directories specified in the PATH environment variable. */
- if (prog_num == 1)
+ if (lbasename (progname) == progname)
{
char *temp;
@@ -278,14 +282,7 @@ make_relative_prefix (progname, bin_prefix, prefix)
#endif
)
{
- free_split_directories (prog_dirs);
progname = nstore;
- prog_dirs = split_directories (progname, &prog_num);
- if (prog_dirs == NULL)
- {
- free_split_directories (bin_dirs);
- return NULL;
- }
break;
}
@@ -299,6 +296,16 @@ make_relative_prefix (progname, bin_prefix, prefix)
}
}
+ full_progname = lrealpath (progname);
+ if (full_progname == NULL)
+ return NULL;
+
+ prog_dirs = split_directories (full_progname, &prog_num);
+ bin_dirs = split_directories (bin_prefix, &bin_num);
+ free (full_progname);
+ if (bin_dirs == NULL || prog_dirs == NULL)
+ return NULL;
+
/* Remove the program name from comparison of directory names. */
prog_num--;
diff --git a/libiberty/physmem.c b/libiberty/physmem.c
new file mode 100644
index 0000000000..9185c1224e
--- /dev/null
+++ b/libiberty/physmem.c
@@ -0,0 +1,305 @@
+/* Calculate the size of physical memory.
+ Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+
+ 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, 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. */
+
+/* Written by Paul Eggert. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_SYS_PSTAT_H
+# include <sys/pstat.h>
+#endif
+
+#if HAVE_SYS_SYSMP_H
+# include <sys/sysmp.h>
+#endif
+
+#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
+# include <sys/sysinfo.h>
+# include <machine/hal_sysinfo.h>
+#endif
+
+#if HAVE_SYS_TABLE_H
+# include <sys/table.h>
+#endif
+
+#include <sys/types.h>
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#if HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+#if HAVE_SYS_SYSTEMCFG_H
+# include <sys/systemcfg.h>
+#endif
+
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* MEMORYSTATUSEX is missing from older windows headers, so define
+ a local replacement. */
+typedef struct
+{
+ DWORD dwLength;
+ DWORD dwMemoryLoad;
+ DWORDLONG ullTotalPhys;
+ DWORDLONG ullAvailPhys;
+ DWORDLONG ullTotalPageFile;
+ DWORDLONG ullAvailPageFile;
+ DWORDLONG ullTotalVirtual;
+ DWORDLONG ullAvailVirtual;
+ DWORDLONG ullAvailExtendedVirtual;
+} lMEMORYSTATUSEX;
+typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
+#endif
+
+#include "libiberty.h"
+
+/* Return the total amount of physical memory. */
+double
+physmem_total ()
+{
+#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
+ { /* This works on linux-gnu, solaris2 and cygwin. */
+ double pages = sysconf (_SC_PHYS_PAGES);
+ double pagesize = sysconf (_SC_PAGESIZE);
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+#endif
+
+#if HAVE_PSTAT_GETSTATIC
+ { /* This works on hpux11. */
+ struct pst_static pss;
+ if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
+ {
+ double pages = pss.physical_memory;
+ double pagesize = pss.page_size;
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+ }
+#endif
+
+#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
+ { /* This works on irix6. */
+ struct rminfo realmem;
+ if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
+ {
+ double pagesize = sysconf (_SC_PAGESIZE);
+ double pages = realmem.physmem;
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+ }
+#endif
+
+#if HAVE_GETSYSINFO && defined GSI_PHYSMEM
+ { /* This works on Tru64 UNIX V4/5. */
+ int physmem;
+
+ if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
+ NULL, NULL, NULL) == 1)
+ {
+ double kbytes = physmem;
+
+ if (0 <= kbytes)
+ return kbytes * 1024.0;
+ }
+ }
+#endif
+
+#if HAVE_SYSCTL && defined HW_PHYSMEM
+ { /* This works on *bsd and darwin. */
+ unsigned int physmem;
+ size_t len = sizeof physmem;
+ static int mib[2] = { CTL_HW, HW_PHYSMEM };
+
+ if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
+ && len == sizeof (physmem))
+ return (double) physmem;
+ }
+#endif
+
+#if HAVE__SYSTEM_CONFIGURATION
+ /* This works on AIX. */
+ return _system_configuration.physmem;
+#endif
+
+#if defined _WIN32
+ { /* this works on windows */
+ PFN_MS_EX pfnex;
+ HMODULE h = GetModuleHandle ("kernel32.dll");
+
+ if (!h)
+ return 0.0;
+
+ /* Use GlobalMemoryStatusEx if available. */
+ if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
+ {
+ lMEMORYSTATUSEX lms_ex;
+ lms_ex.dwLength = sizeof lms_ex;
+ if (!pfnex (&lms_ex))
+ return 0.0;
+ return (double) lms_ex.ullTotalPhys;
+ }
+
+ /* Fall back to GlobalMemoryStatus which is always available.
+ but returns wrong results for physical memory > 4GB. */
+ else
+ {
+ MEMORYSTATUS ms;
+ GlobalMemoryStatus (&ms);
+ return (double) ms.dwTotalPhys;
+ }
+ }
+#endif
+
+ /* Return 0 if we can't determine the value. */
+ return 0;
+}
+
+/* Return the amount of physical memory available. */
+double
+physmem_available ()
+{
+#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
+ { /* This works on linux-gnu, solaris2 and cygwin. */
+ double pages = sysconf (_SC_AVPHYS_PAGES);
+ double pagesize = sysconf (_SC_PAGESIZE);
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+#endif
+
+#if HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC
+ { /* This works on hpux11. */
+ struct pst_static pss;
+ struct pst_dynamic psd;
+ if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
+ && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
+ {
+ double pages = psd.psd_free;
+ double pagesize = pss.page_size;
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+ }
+#endif
+
+#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
+ { /* This works on irix6. */
+ struct rminfo realmem;
+ if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
+ {
+ double pagesize = sysconf (_SC_PAGESIZE);
+ double pages = realmem.availrmem;
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+ }
+#endif
+
+#if HAVE_TABLE && defined TBL_VMSTATS
+ { /* This works on Tru64 UNIX V4/5. */
+ struct tbl_vmstats vmstats;
+
+ if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
+ {
+ double pages = vmstats.free_count;
+ double pagesize = vmstats.pagesize;
+
+ if (0 <= pages && 0 <= pagesize)
+ return pages * pagesize;
+ }
+ }
+#endif
+
+#if HAVE_SYSCTL && defined HW_USERMEM
+ { /* This works on *bsd and darwin. */
+ unsigned int usermem;
+ size_t len = sizeof usermem;
+ static int mib[2] = { CTL_HW, HW_USERMEM };
+
+ if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
+ && len == sizeof (usermem))
+ return (double) usermem;
+ }
+#endif
+
+#if defined _WIN32
+ { /* this works on windows */
+ PFN_MS_EX pfnex;
+ HMODULE h = GetModuleHandle ("kernel32.dll");
+
+ if (!h)
+ return 0.0;
+
+ /* Use GlobalMemoryStatusEx if available. */
+ if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
+ {
+ lMEMORYSTATUSEX lms_ex;
+ lms_ex.dwLength = sizeof lms_ex;
+ if (!pfnex (&lms_ex))
+ return 0.0;
+ return (double) lms_ex.ullAvailPhys;
+ }
+
+ /* Fall back to GlobalMemoryStatus which is always available.
+ but returns wrong results for physical memory > 4GB */
+ else
+ {
+ MEMORYSTATUS ms;
+ GlobalMemoryStatus (&ms);
+ return (double) ms.dwAvailPhys;
+ }
+ }
+#endif
+
+ /* Guess 25% of physical memory. */
+ return physmem_total () / 4;
+}
+
+
+#if DEBUG
+
+# include <stdio.h>
+# include <stdlib.h>
+
+int
+main ()
+{
+ printf ("%12.f %12.f\n", physmem_total (), physmem_available ());
+ exit (0);
+}
+
+#endif /* DEBUG */
+
+/*
+Local Variables:
+compile-command: "gcc -DDEBUG -DHAVE_CONFIG_H -I.. -g -O -Wall -W physmem.c"
+End:
+*/
diff --git a/libtool.m4 b/libtool.m4
index 3f452bcba2..eca1da32ec 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -144,6 +144,19 @@ case $host in
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -155,6 +168,7 @@ case $host in
LD="${LD-ld} -64"
;;
esac
+ fi
fi
rm -rf conftest*
;;
diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh
index bdc67f97cf..9059b1a002 100644
--- a/ltcf-cxx.sh
+++ b/ltcf-cxx.sh
@@ -2,7 +2,7 @@
# ltcf-cxx.sh - Create a C++ compiler specific configuration
#
-# Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# Original C++ support by:Gary V. Vaughan <gvv@techie.com>
@@ -68,11 +68,16 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
# Set up default GNU C++ configuration
# Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
- egrep 'GNU ld' > /dev/null; then
- with_gnu_ld=yes
-
+ # archiving commands below assume that GNU ld is being used. The
+ # assumption here is that the linker is going to be the same as that
+ # used by the C compiler. For the purposes of GCC, this is ok, but
+ # if someone uses g++ along with a non-GNU C compiler that doesn't
+ # use GNU ld, we may lose. This is ok for the toolchain tree, since
+ # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava,
+ # anyway, and those use both gcc and g++, so the settings are bound
+ # to be the same.
+
+ if test "$with_gnu_ld" = yes; then
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
@@ -92,7 +97,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
whole_archive_flag_spec=
fi
else
- with_gnu_ld=no
wlarc=
# A generic and very simple default shared library creation
@@ -110,7 +114,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
else
with_gcc=no
- with_gnu_ld=no
wlarc=
fi
@@ -323,7 +326,7 @@ case $host_os in
if test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
- archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+ archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
fi
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -610,9 +613,9 @@ case $host_os in
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
no_undefined_flag=' ${wl}-z ${wl}defs'
if $CC --version | egrep -v '^2\.7' > /dev/null; then
- archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
+ archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
@@ -621,9 +624,9 @@ case $host_os in
else
# g++ 2.7 appears to require `-G' NOT `-shared' on this
# platform.
- archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
+ archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
diff --git a/ltcf-gcj.sh b/ltcf-gcj.sh
index d33278a596..2d704975c8 100644
--- a/ltcf-gcj.sh
+++ b/ltcf-gcj.sh
@@ -2,7 +2,7 @@
# ltcf-gcj.sh - Create a GCJ compiler specific configuration
#
-# Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# Original GCJ support by:
@@ -492,9 +492,9 @@ else
solaris*)
no_undefined_flag=' ${wl}-z ${wl}defs'
- archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
+ archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
diff --git a/ltconfig b/ltconfig
index 5ccefe0463..7a4d63579f 100755
--- a/ltconfig
+++ b/ltconfig
@@ -1186,6 +1186,11 @@ hpux9* | hpux10* | hpux11*)
;;
irix5* | irix6*)
+ if test "$with_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi
version_type=irix
need_lib_prefix=no
need_version=no
@@ -1197,9 +1202,12 @@ irix5* | irix6*)
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 78a8842dc1..42cf2571cf 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,23 @@
+2003-02-25 Alan Modra <amodra@bigpond.net.au>
+
+ * hppa-dis.c: Formatting.
+
+2003-02-25 Matthew Wilcox <willy@debian.org>
+
+ * hppa-dis.c (print_insn_hppa): Implement fcnv instruction modifiers.
+
+ * hppa-dis.c (print_insn_hppa <2 bit space register>): Do not print
+ the space register when the value is zero.
+
+2003-02-23 Elias Athanasopoulos <elathan@phys.uoa.gr>
+
+ * mips-dis.c (print_mips_disassembler_options): Make 'i' unsigned,
+ use ARRAY_SIZE in loops.
+
+2003-02-12 Dave Brolley <brolley@redhat.com>
+
+ * fr30-desc.c: Regenerate.
+
2003-02-06 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
* i386-dis.c (dq_mode, Edq): Define.
diff --git a/opcodes/fr30-desc.c b/opcodes/fr30-desc.c
index a404f9ba40..a263da7206 100644
--- a/opcodes/fr30-desc.c
+++ b/opcodes/fr30-desc.c
@@ -325,6 +325,7 @@ const CGEN_IFLD fr30_cgen_ifld_table[] =
{ FR30_F_I8, "f-i8", 0, 16, 4, 8, { 0, { (1<<MACH_BASE) } } },
{ FR30_F_I20_4, "f-i20-4", 0, 16, 8, 4, { 0, { (1<<MACH_BASE) } } },
{ FR30_F_I20_16, "f-i20-16", 16, 16, 0, 16, { 0, { (1<<MACH_BASE) } } },
+ { FR30_F_I20, "f-i20", 0, 0, 0, 0,{ 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ FR30_F_I32, "f-i32", 16, 32, 0, 32, { 0|A(SIGN_OPT), { (1<<MACH_BASE) } } },
{ FR30_F_UDISP6, "f-udisp6", 0, 16, 8, 4, { 0, { (1<<MACH_BASE) } } },
{ FR30_F_DISP8, "f-disp8", 0, 16, 4, 8, { 0, { (1<<MACH_BASE) } } },
@@ -357,8 +358,8 @@ const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD [];
const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &fr30_cgen_ifld_table[23] } },
- { 0, { (const PTR) &fr30_cgen_ifld_table[24] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_4] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_16] } },
{ 0, { (const PTR) 0 } }
};
@@ -379,39 +380,39 @@ const CGEN_OPERAND fr30_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", FR30_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &fr30_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* Ri: destination register */
{ "Ri", FR30_OPERAND_RI, HW_H_GR, 12, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RI] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rj: source register */
{ "Rj", FR30_OPERAND_RJ, HW_H_GR, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[9] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* Ric: target register coproc insn */
{ "Ric", FR30_OPERAND_RIC, HW_H_GR, 12, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[14] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RIC] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rjc: source register coproc insn */
{ "Rjc", FR30_OPERAND_RJC, HW_H_GR, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJC] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRi: coprocessor register */
{ "CRi", FR30_OPERAND_CRI, HW_H_CR, 12, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRj: coprocessor register */
{ "CRj", FR30_OPERAND_CRJ, HW_H_CR, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[15] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rs1: dedicated register */
{ "Rs1", FR30_OPERAND_RS1, HW_H_DR, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS1] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rs2: dedicated register */
{ "Rs2", FR30_OPERAND_RS2, HW_H_DR, 12, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS2] } },
{ 0, { (1<<MACH_BASE) } } },
/* R13: General Register 13 */
{ "R13", FR30_OPERAND_R13, HW_H_R13, 0, 0,
@@ -431,51 +432,51 @@ const CGEN_OPERAND fr30_cgen_operand_table[] =
{ 0, { (1<<MACH_BASE) } } },
/* u4: 4 bit unsigned immediate */
{ "u4", FR30_OPERAND_U4, HW_H_UINT, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[17] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u4c: 4 bit unsigned immediate */
{ "u4c", FR30_OPERAND_U4C, HW_H_UINT, 12, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[18] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4C] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u8: 8 bit unsigned immediate */
{ "u8", FR30_OPERAND_U8, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[21] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U8] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* i8: 8 bit unsigned immediate */
{ "i8", FR30_OPERAND_I8, HW_H_UINT, 4, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[22] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I8] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* udisp6: 6 bit unsigned immediate */
{ "udisp6", FR30_OPERAND_UDISP6, HW_H_UINT, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[26] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_UDISP6] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* disp8: 8 bit signed immediate */
{ "disp8", FR30_OPERAND_DISP8, HW_H_SINT, 4, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[27] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP8] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* disp9: 9 bit signed immediate */
{ "disp9", FR30_OPERAND_DISP9, HW_H_SINT, 4, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[28] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP9] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* disp10: 10 bit signed immediate */
{ "disp10", FR30_OPERAND_DISP10, HW_H_SINT, 4, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[29] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP10] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* s10: 10 bit signed immediate */
{ "s10", FR30_OPERAND_S10, HW_H_SINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[30] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_S10] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u10: 10 bit unsigned immediate */
{ "u10", FR30_OPERAND_U10, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[31] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U10] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* i32: 32 bit immediate */
{ "i32", FR30_OPERAND_I32, HW_H_UINT, 0, 32,
- { 0, { (const PTR) &fr30_cgen_ifld_table[25] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I32] } },
{ 0|A(HASH_PREFIX)|A(SIGN_OPT), { (1<<MACH_BASE) } } },
/* m4: 4 bit negative immediate */
{ "m4", FR30_OPERAND_M4, HW_H_SINT, 8, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[20] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_M4] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* i20: 20 bit immediate */
{ "i20", FR30_OPERAND_I20, HW_H_UINT, 0, 20,
@@ -483,47 +484,47 @@ const CGEN_OPERAND fr30_cgen_operand_table[] =
{ 0|A(HASH_PREFIX)|A(VIRTUAL), { (1<<MACH_BASE) } } },
/* dir8: 8 bit direct address */
{ "dir8", FR30_OPERAND_DIR8, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[33] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR8] } },
{ 0, { (1<<MACH_BASE) } } },
/* dir9: 9 bit direct address */
{ "dir9", FR30_OPERAND_DIR9, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[34] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR9] } },
{ 0, { (1<<MACH_BASE) } } },
/* dir10: 10 bit direct address */
{ "dir10", FR30_OPERAND_DIR10, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[35] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR10] } },
{ 0, { (1<<MACH_BASE) } } },
/* label9: 9 bit pc relative address */
{ "label9", FR30_OPERAND_LABEL9, HW_H_IADDR, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[32] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL9] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* label12: 12 bit pc relative address */
{ "label12", FR30_OPERAND_LABEL12, HW_H_IADDR, 5, 11,
- { 0, { (const PTR) &fr30_cgen_ifld_table[36] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL12] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* reglist_low_ld: 8 bit low register mask for ldm */
{ "reglist_low_ld", FR30_OPERAND_REGLIST_LOW_LD, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[40] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_LD] } },
{ 0, { (1<<MACH_BASE) } } },
/* reglist_hi_ld: 8 bit high register mask for ldm */
{ "reglist_hi_ld", FR30_OPERAND_REGLIST_HI_LD, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[39] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_LD] } },
{ 0, { (1<<MACH_BASE) } } },
/* reglist_low_st: 8 bit low register mask for stm */
{ "reglist_low_st", FR30_OPERAND_REGLIST_LOW_ST, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[38] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_ST] } },
{ 0, { (1<<MACH_BASE) } } },
/* reglist_hi_st: 8 bit high register mask for stm */
{ "reglist_hi_st", FR30_OPERAND_REGLIST_HI_ST, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[37] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_ST] } },
{ 0, { (1<<MACH_BASE) } } },
/* cc: condition codes */
{ "cc", FR30_OPERAND_CC, HW_H_UINT, 4, 4,
- { 0, { (const PTR) &fr30_cgen_ifld_table[7] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CC] } },
{ 0, { (1<<MACH_BASE) } } },
/* ccc: coprocessor calc */
{ "ccc", FR30_OPERAND_CCC, HW_H_UINT, 0, 8,
- { 0, { (const PTR) &fr30_cgen_ifld_table[8] } },
+ { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CCC] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* nbit: negative bit */
{ "nbit", FR30_OPERAND_NBIT, HW_H_NBIT, 0, 0,
diff --git a/opcodes/hppa-dis.c b/opcodes/hppa-dis.c
index d9ab9dd99d..5f33297d75 100644
--- a/opcodes/hppa-dis.c
+++ b/opcodes/hppa-dis.c
@@ -1,5 +1,5 @@
/* Disassembler for the PA-RISC. Somewhat derived from sparc-pinsn.c.
- Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
+ Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Integer register names, indexed by the numbers which appear in the
opcodes. */
-static const char *const reg_names[] =
+static const char *const reg_names[] =
{"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
"r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
"r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1",
@@ -34,10 +34,10 @@ static const char *const reg_names[] =
/* Floating point register names, indexed by the numbers which appear in the
opcodes. */
-static const char *const fp_reg_names[] =
- {"fpsr", "fpe2", "fpe4", "fpe6",
- "fr4", "fr5", "fr6", "fr7", "fr8",
- "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
+static const char *const fp_reg_names[] =
+ {"fpsr", "fpe2", "fpe4", "fpe6",
+ "fr4", "fr5", "fr6", "fr7", "fr8",
+ "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
"fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
"fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"};
@@ -123,6 +123,8 @@ static const char *const short_bytes_compl_names[] = {
"", ",b,m", ",e", ",e,m"
};
static const char *const float_format_names[] = {",sgl", ",dbl", "", ",quad"};
+static const char *const fcnv_fixed_names[] = {",w", ",dw", "", ",qw"};
+static const char *const fcnv_ufixed_names[] = {",uw", ",udw", "", ",uqw"};
static const char *const float_comp_names[] =
{
",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
@@ -136,7 +138,7 @@ static const char *const saturation_names[] = {",us", ",ss", 0, ""};
static const char *const read_write_names[] = {",r", ",w"};
static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" };
-/* For a bunch of different instructions form an index into a
+/* For a bunch of different instructions form an index into a
completer name table. */
#define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \
GET_FIELD (insn, 18, 18) << 1)
@@ -194,8 +196,8 @@ fput_fp_reg_r (reg, info)
if (reg < 4)
(*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1);
else
- (*info->fprintf_func) (info->stream, "%sR", reg ? fp_reg_names[reg]
- : "fr0");
+ (*info->fprintf_func) (info->stream, "%sR",
+ reg ? fp_reg_names[reg] : "fr0");
}
static void
@@ -336,8 +338,8 @@ extract_12 (word)
unsigned word;
{
return sign_extend (GET_FIELD (word, 19, 28) |
- GET_FIELD (word, 29, 29) << 10 |
- (word & 0x1) << 11, 12) << 2;
+ GET_FIELD (word, 29, 29) << 10 |
+ (word & 0x1) << 11, 12) << 2;
}
/* Extract a 17 bit constant from branch instructions, returning the
@@ -348,9 +350,9 @@ extract_17 (word)
unsigned word;
{
return sign_extend (GET_FIELD (word, 19, 28) |
- GET_FIELD (word, 29, 29) << 10 |
- GET_FIELD (word, 11, 15) << 11 |
- (word & 0x1) << 16, 17) << 2;
+ GET_FIELD (word, 29, 29) << 10 |
+ GET_FIELD (word, 11, 15) << 11 |
+ (word & 0x1) << 16, 17) << 2;
}
static int
@@ -358,10 +360,10 @@ extract_22 (word)
unsigned word;
{
return sign_extend (GET_FIELD (word, 19, 28) |
- GET_FIELD (word, 29, 29) << 10 |
- GET_FIELD (word, 11, 15) << 11 |
- GET_FIELD (word, 6, 10) << 16 |
- (word & 0x1) << 21, 22) << 2;
+ GET_FIELD (word, 29, 29) << 10 |
+ GET_FIELD (word, 11, 15) << 11 |
+ GET_FIELD (word, 6, 10) << 16 |
+ (word & 0x1) << 21, 22) << 2;
}
/* Print one instruction. */
@@ -397,7 +399,7 @@ print_insn_hppa (memaddr, info)
#endif
(*info->fprintf_func) (info->stream, "%s", opcode->name);
- if (!strchr ("cfCY?-+nHNZFIuv", opcode->args[0]))
+ if (!strchr ("cfCY?-+nHNZFIuv{", opcode->args[0]))
(*info->fprintf_func) (info->stream, " ");
for (s = opcode->args; *s != '\0'; ++s)
{
@@ -417,7 +419,7 @@ print_insn_hppa (memaddr, info)
fput_reg (GET_FIELD (insn, 27, 31), info);
break;
- /* Handle floating point registers. */
+ /* Handle floating point registers. */
case 'f':
switch (*++s)
{
@@ -437,21 +439,19 @@ print_insn_hppa (memaddr, info)
fput_fp_reg (GET_FIELD (insn, 6, 10), info);
break;
- /* 'fA' will not generate a space before the regsiter
- name. Normally that is fine. Except that it
- causes problems with xmpyu which has no FP format
- completer. */
+ /* 'fA' will not generate a space before the regsiter
+ name. Normally that is fine. Except that it
+ causes problems with xmpyu which has no FP format
+ completer. */
case 'X':
fputs_filtered (" ", info);
-
- /* FALLTHRU */
+ /* FALLTHRU */
case 'A':
if (GET_FIELD (insn, 24, 24))
fput_fp_reg_r (GET_FIELD (insn, 6, 10), info);
else
fput_fp_reg (GET_FIELD (insn, 6, 10), info);
-
break;
case 'b':
if (GET_FIELD (insn, 25, 25))
@@ -516,14 +516,13 @@ print_insn_hppa (memaddr, info)
break;
}
- /* 'fe' will not generate a space before the register
- name. Normally that is fine. Except that it
- causes problems with fstw fe,y(b) which has no FP
- format completer. */
+ /* 'fe' will not generate a space before the register
+ name. Normally that is fine. Except that it
+ causes problems with fstw fe,y(b) which has no FP
+ format completer. */
case 'E':
fputs_filtered (" ", info);
-
- /* FALLTHRU */
+ /* FALLTHRU */
case 'e':
if (GET_FIELD (insn, 30, 30))
@@ -541,41 +540,52 @@ print_insn_hppa (memaddr, info)
fput_const (extract_5_load (insn), info);
break;
case 's':
- (*info->fprintf_func) (info->stream,
- "sr%d", GET_FIELD (insn, 16, 17));
+ {
+ int space = GET_FIELD (insn, 16, 17);
+ /* Zero means implicit addressing, not use of sr0. */
+ if (space != 0)
+ (*info->fprintf_func) (info->stream, "sr%d", space);
+ }
break;
case 'S':
- (*info->fprintf_func) (info->stream, "sr%d", extract_3 (insn));
+ (*info->fprintf_func) (info->stream, "sr%d",
+ extract_3 (insn));
break;
- /* Handle completers. */
+ /* Handle completers. */
case 'c':
switch (*++s)
{
case 'x':
- (*info->fprintf_func) (info->stream, "%s",
- index_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s",
+ index_compl_names[GET_COMPL (insn)]);
break;
case 'X':
- (*info->fprintf_func) (info->stream, "%s ",
- index_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ index_compl_names[GET_COMPL (insn)]);
break;
case 'm':
- (*info->fprintf_func) (info->stream, "%s",
- short_ldst_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s",
+ short_ldst_compl_names[GET_COMPL (insn)]);
break;
case 'M':
- (*info->fprintf_func) (info->stream, "%s ",
- short_ldst_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ short_ldst_compl_names[GET_COMPL (insn)]);
break;
case 'A':
- (*info->fprintf_func) (info->stream, "%s ",
- short_bytes_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ short_bytes_compl_names[GET_COMPL (insn)]);
break;
case 's':
- (*info->fprintf_func) (info->stream, "%s",
- short_bytes_compl_names[GET_COMPL (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s",
+ short_bytes_compl_names[GET_COMPL (insn)]);
break;
case 'c':
case 'C':
@@ -618,8 +628,9 @@ print_insn_hppa (memaddr, info)
(*info->fprintf_func) (info->stream, ",l");
break;
case 'w':
- (*info->fprintf_func) (info->stream, "%s ",
- read_write_names[GET_FIELD (insn, 25, 25)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ read_write_names[GET_FIELD (insn, 25, 25)]);
break;
case 'W':
(*info->fprintf_func) (info->stream, ",w");
@@ -644,18 +655,18 @@ print_insn_hppa (memaddr, info)
break;
case 'a':
(*info->fprintf_func)
- (info->stream, "%s", add_compl_names[GET_FIELD
- (insn, 20, 21)]);
+ (info->stream, "%s",
+ add_compl_names[GET_FIELD (insn, 20, 21)]);
break;
case 'Y':
(*info->fprintf_func)
- (info->stream, ",dc%s", add_compl_names[GET_FIELD
- (insn, 20, 21)]);
+ (info->stream, ",dc%s",
+ add_compl_names[GET_FIELD (insn, 20, 21)]);
break;
case 'y':
(*info->fprintf_func)
- (info->stream, ",c%s", add_compl_names[GET_FIELD
- (insn, 20, 21)]);
+ (info->stream, ",c%s",
+ add_compl_names[GET_FIELD (insn, 20, 21)]);
break;
case 'v':
if (GET_FIELD (insn, 20, 20))
@@ -684,28 +695,28 @@ print_insn_hppa (memaddr, info)
/* EXTRD/W has a following condition. */
if (*(s + 1) == '?')
(*info->fprintf_func)
- (info->stream, "%s", signed_unsigned_names[GET_FIELD
- (insn, 21, 21)]);
+ (info->stream, "%s",
+ signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
else
(*info->fprintf_func)
- (info->stream, "%s ", signed_unsigned_names[GET_FIELD
- (insn, 21, 21)]);
+ (info->stream, "%s ",
+ signed_unsigned_names[GET_FIELD (insn, 21, 21)]);
break;
case 'h':
(*info->fprintf_func)
- (info->stream, "%s", mix_half_names[GET_FIELD
- (insn, 17, 17)]);
+ (info->stream, "%s",
+ mix_half_names[GET_FIELD (insn, 17, 17)]);
break;
case 'H':
(*info->fprintf_func)
- (info->stream, "%s ", saturation_names[GET_FIELD
- (insn, 24, 25)]);
+ (info->stream, "%s ",
+ saturation_names[GET_FIELD (insn, 24, 25)]);
break;
case '*':
(*info->fprintf_func)
- (info->stream, ",%d%d%d%d ",
- GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21),
- GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25));
+ (info->stream, ",%d%d%d%d ",
+ GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21),
+ GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25));
break;
case 'q':
@@ -766,85 +777,101 @@ print_insn_hppa (memaddr, info)
}
break;
- /* Handle conditions. */
+ /* Handle conditions. */
case '?':
{
s++;
switch (*s)
{
case 'f':
- (*info->fprintf_func) (info->stream, "%s ",
- float_comp_names[GET_FIELD
- (insn, 27, 31)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ float_comp_names[GET_FIELD (insn, 27, 31)]);
break;
- /* these four conditions are for the set of instructions
+ /* these four conditions are for the set of instructions
which distinguish true/false conditions by opcode
rather than by the 'f' bit (sigh): comb, comib,
addb, addib */
case 't':
- fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18)],
- info);
+ fputs_filtered
+ (compare_cond_names[GET_FIELD (insn, 16, 18)], info);
break;
case 'n':
- fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18)
- + GET_FIELD (insn, 4, 4) * 8], info);
+ fputs_filtered
+ (compare_cond_names[GET_FIELD (insn, 16, 18)
+ + GET_FIELD (insn, 4, 4) * 8],
+ info);
break;
case 'N':
- fputs_filtered (compare_cond_64_names[GET_FIELD (insn, 16, 18)
- + GET_FIELD (insn, 2, 2) * 8], info);
+ fputs_filtered
+ (compare_cond_64_names[GET_FIELD (insn, 16, 18)
+ + GET_FIELD (insn, 2, 2) * 8],
+ info);
break;
case 'Q':
- fputs_filtered (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)],
- info);
+ fputs_filtered
+ (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)],
+ info);
break;
case '@':
- fputs_filtered (add_cond_names[GET_FIELD (insn, 16, 18)
- + GET_FIELD (insn, 4, 4) * 8], info);
+ fputs_filtered
+ (add_cond_names[GET_FIELD (insn, 16, 18)
+ + GET_FIELD (insn, 4, 4) * 8],
+ info);
break;
case 's':
- (*info->fprintf_func) (info->stream, "%s ",
- compare_cond_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ compare_cond_names[GET_COND (insn)]);
break;
case 'S':
- (*info->fprintf_func) (info->stream, "%s ",
- compare_cond_64_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ compare_cond_64_names[GET_COND (insn)]);
break;
case 'a':
- (*info->fprintf_func) (info->stream, "%s ",
- add_cond_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ add_cond_names[GET_COND (insn)]);
break;
case 'A':
- (*info->fprintf_func) (info->stream, "%s ",
- add_cond_64_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ add_cond_64_names[GET_COND (insn)]);
break;
case 'd':
- (*info->fprintf_func) (info->stream, "%s",
- add_cond_names[GET_FIELD (insn, 16, 18)]);
+ (*info->fprintf_func)
+ (info->stream, "%s",
+ add_cond_names[GET_FIELD (insn, 16, 18)]);
break;
case 'W':
- (*info->fprintf_func)
+ (*info->fprintf_func)
(info->stream, "%s",
- wide_add_cond_names[GET_FIELD (insn, 16, 18) +
- GET_FIELD (insn, 4, 4) * 8]);
+ wide_add_cond_names[GET_FIELD (insn, 16, 18) +
+ GET_FIELD (insn, 4, 4) * 8]);
break;
case 'l':
- (*info->fprintf_func) (info->stream, "%s ",
- logical_cond_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ logical_cond_names[GET_COND (insn)]);
break;
case 'L':
- (*info->fprintf_func) (info->stream, "%s ",
- logical_cond_64_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ logical_cond_64_names[GET_COND (insn)]);
break;
case 'u':
- (*info->fprintf_func) (info->stream, "%s ",
- unit_cond_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ unit_cond_names[GET_COND (insn)]);
break;
case 'U':
- (*info->fprintf_func) (info->stream, "%s ",
- unit_cond_64_names[GET_COND (insn)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ unit_cond_64_names[GET_COND (insn)]);
break;
case 'y':
case 'x':
@@ -859,8 +886,9 @@ print_insn_hppa (memaddr, info)
(*info->fprintf_func) (info->stream, " ");
break;
case 'X':
- (*info->fprintf_func) (info->stream, "%s ",
- shift_cond_64_names[GET_FIELD (insn, 16, 18)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ shift_cond_64_names[GET_FIELD (insn, 16, 18)]);
break;
case 'B':
(*info->fprintf_func)
@@ -921,14 +949,13 @@ print_insn_hppa (memaddr, info)
(*info->fprintf_func) (info->stream, " ");
break;
case 'w':
- (*info->print_address_func) (memaddr + 8 + extract_12 (insn),
- info);
+ (*info->print_address_func)
+ (memaddr + 8 + extract_12 (insn), info);
break;
case 'W':
/* 17 bit PC-relative branch. */
- (*info->print_address_func) ((memaddr + 8
- + extract_17 (insn)),
- info);
+ (*info->print_address_func)
+ ((memaddr + 8 + extract_17 (insn)), info);
break;
case 'z':
/* 17 bit displacement. This is an offset from a register
@@ -946,25 +973,25 @@ print_insn_hppa (memaddr, info)
/* be,l %sr0,%r31 implicit output. */
(*info->fprintf_func) (info->stream, "%%sr0,%%r31");
break;
-
+
case '@':
(*info->fprintf_func) (info->stream, "0");
break;
case '.':
(*info->fprintf_func) (info->stream, "%d",
- GET_FIELD (insn, 24, 25));
+ GET_FIELD (insn, 24, 25));
break;
case '*':
(*info->fprintf_func) (info->stream, "%d",
- GET_FIELD (insn, 22, 25));
+ GET_FIELD (insn, 22, 25));
break;
case '!':
(*info->fprintf_func) (info->stream, "%%sar");
break;
case 'p':
(*info->fprintf_func) (info->stream, "%d",
- 31 - GET_FIELD (insn, 22, 26));
+ 31 - GET_FIELD (insn, 22, 26));
break;
case '~':
{
@@ -976,7 +1003,7 @@ print_insn_hppa (memaddr, info)
}
case 'P':
(*info->fprintf_func) (info->stream, "%d",
- GET_FIELD (insn, 22, 26));
+ GET_FIELD (insn, 22, 26));
break;
case 'q':
{
@@ -988,7 +1015,7 @@ print_insn_hppa (memaddr, info)
}
case 'T':
(*info->fprintf_func) (info->stream, "%d",
- 32 - GET_FIELD (insn, 27, 31));
+ 32 - GET_FIELD (insn, 27, 31));
break;
case '%':
{
@@ -1016,7 +1043,8 @@ print_insn_hppa (memaddr, info)
fput_const (GET_FIELD (insn, 6, 31), info);
break;
case 'v':
- (*info->fprintf_func) (info->stream, ",%d", GET_FIELD (insn, 23, 25));
+ (*info->fprintf_func) (info->stream, ",%d",
+ GET_FIELD (insn, 23, 25));
break;
case 'O':
fput_const ((GET_FIELD (insn, 6,20) << 5 |
@@ -1038,47 +1066,48 @@ print_insn_hppa (memaddr, info)
GET_FIELD (insn, 27, 31)), info);
break;
case 'u':
- (*info->fprintf_func) (info->stream, ",%d", GET_FIELD (insn, 23, 25));
+ (*info->fprintf_func) (info->stream, ",%d",
+ GET_FIELD (insn, 23, 25));
break;
case 'F':
/* if no destination completer and not before a completer
for fcmp, need a space here */
if (s[1] == 'G' || s[1] == '?')
- fputs_filtered (float_format_names[GET_FIELD (insn, 19, 20)],
- info);
+ fputs_filtered
+ (float_format_names[GET_FIELD (insn, 19, 20)], info);
else
- (*info->fprintf_func) (info->stream, "%s ",
- float_format_names[GET_FIELD
- (insn, 19, 20)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ float_format_names[GET_FIELD (insn, 19, 20)]);
break;
case 'G':
- (*info->fprintf_func) (info->stream, "%s ",
- float_format_names[GET_FIELD (insn,
- 17, 18)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ float_format_names[GET_FIELD (insn, 17, 18)]);
break;
case 'H':
if (GET_FIELD (insn, 26, 26) == 1)
(*info->fprintf_func) (info->stream, "%s ",
- float_format_names[0]);
+ float_format_names[0]);
else
(*info->fprintf_func) (info->stream, "%s ",
- float_format_names[1]);
+ float_format_names[1]);
break;
case 'I':
/* if no destination completer and not before a completer
for fcmp, need a space here */
if (s[1] == '?')
- fputs_filtered (float_format_names[GET_FIELD (insn, 20, 20)],
- info);
+ fputs_filtered
+ (float_format_names[GET_FIELD (insn, 20, 20)], info);
else
- (*info->fprintf_func) (info->stream, "%s ",
- float_format_names[GET_FIELD
- (insn, 20, 20)]);
+ (*info->fprintf_func)
+ (info->stream, "%s ",
+ float_format_names[GET_FIELD (insn, 20, 20)]);
break;
- case 'J':
- fput_const (extract_14 (insn), info);
- break;
+ case 'J':
+ fput_const (extract_14 (insn), info);
+ break;
case '#':
{
@@ -1095,7 +1124,7 @@ print_insn_hppa (memaddr, info)
fput_const (disp, info);
break;
}
- case 'K':
+ case 'K':
case 'd':
{
int sign = GET_FIELD (insn, 31, 31);
@@ -1131,11 +1160,33 @@ print_insn_hppa (memaddr, info)
break;
}
- /* ?!? FIXME */
case '_':
+ break; /* Dealt with by '{' */
+
case '{':
- fputs_filtered ("Disassembler botch.\n", info);
- break;
+ {
+ int sub = GET_FIELD (insn, 14, 16);
+ int df = GET_FIELD (insn, 17, 18);
+ int sf = GET_FIELD (insn, 19, 20);
+ const char * const * source = float_format_names;
+ const char * const * dest = float_format_names;
+ char *t = "";
+ if (sub == 4)
+ {
+ fputs_filtered (",UND ", info);
+ break;
+ }
+ if ((sub & 3) == 3)
+ t = ",t";
+ if ((sub & 3) == 1)
+ source = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
+ if (sub & 2)
+ dest = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names;
+
+ (*info->fprintf_func) (info->stream, "%s%s%s ",
+ t, source[sf], dest[df]);
+ break;
+ }
case 'm':
{
@@ -1181,9 +1232,8 @@ print_insn_hppa (memaddr, info)
}
case 'X':
- (*info->print_address_func) ((memaddr + 8
- + extract_22 (insn)),
- info);
+ (*info->print_address_func)
+ (memaddr + 8 + extract_22 (insn), info);
break;
case 'L':
fputs_filtered (",%r2", info);
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index 176ffeb469..1ed436a0d0 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -1758,7 +1758,7 @@ void
print_mips_disassembler_options (stream)
FILE *stream;
{
- int i;
+ unsigned int i;
fprintf (stream, _("\n\
The following MIPS specific disassembler options are supported for use\n\
@@ -1793,14 +1793,14 @@ with the -M switch (multiple options should be separated by commas):\n"));
fprintf (stream, _("\n\
For the options above, the following values are supported for \"ABI\":\n\
"));
- for (i = 0; mips_abi_choices[i].name != NULL; i++)
+ for (i = 0; i < ARRAY_SIZE (mips_abi_choices); i++)
fprintf (stream, " %s", mips_abi_choices[i].name);
fprintf (stream, _("\n"));
fprintf (stream, _("\n\
For the options above, The following values are supported for \"ARCH\":\n\
"));
- for (i = 0; mips_arch_choices[i].name != NULL; i++)
+ for (i = 0; i < ARRAY_SIZE (mips_arch_choices); i++)
if (*mips_arch_choices[i].name != '\0')
fprintf (stream, " %s", mips_arch_choices[i].name);
fprintf (stream, _("\n"));