summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 14:03:36 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 14:03:36 +0000
commitde7cd2700ed72ead7af9d7335a5dd53e1e18ed6a (patch)
tree039a1b42834e41a0eae83bb616b58307e010d63e /gnu/usr.bin/binutils
parent80569f10d304683516f20f86bbafb107127ff63e (diff)
Import binutils-2.11.2
- only the binutils package (no gdb here) - don't import libiberty and texinfo, they are elsewhere - remove all .info* generated files
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/gprof/MAINTAINERS1
-rw-r--r--gnu/usr.bin/binutils/gprof/acconfig.h2
-rw-r--r--gnu/usr.bin/binutils/gprof/acinclude.m414
-rw-r--r--gnu/usr.bin/binutils/gprof/aclocal.m4769
-rw-r--r--gnu/usr.bin/binutils/gprof/bb_exit_func.c129
-rw-r--r--gnu/usr.bin/binutils/gprof/bbconv.pl19
-rw-r--r--gnu/usr.bin/binutils/gprof/corefile.c315
-rw-r--r--gnu/usr.bin/binutils/gprof/corefile.h45
-rw-r--r--gnu/usr.bin/binutils/gprof/dep-in.sed17
-rw-r--r--gnu/usr.bin/binutils/gprof/gconfig.in6
-rw-r--r--gnu/usr.bin/binutils/gprof/po/gprof.pot179
-rw-r--r--gnu/usr.bin/binutils/intl/ChangeLog5
-rw-r--r--gnu/usr.bin/binutils/intl/explodename.c13
-rw-r--r--gnu/usr.bin/binutils/ld/configdoc.texi1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr1200.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr4433.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/crisaout.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/criself.sh103
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/crislinux.sh41
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32_i860.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh57
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh12
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh15
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh44
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh44
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh11
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh16
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh13
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh13
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mipspe.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shpe.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/tic54xcoff.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/armcoff.em7
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/armelf.em1250
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/armelf_oabi.em7
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/beos.em6
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/m68kcoff.em245
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/m68kelf.em193
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/ticoff.em202
-rw-r--r--gnu/usr.bin/binutils/ld/ldver.texi2
-rw-r--r--gnu/usr.bin/binutils/ld/pe-dll.c295
-rw-r--r--gnu/usr.bin/binutils/ld/pe-dll.h2
-rw-r--r--gnu/usr.bin/binutils/ld/po/POTFILES.in2
-rw-r--r--gnu/usr.bin/binutils/ld/po/ld.pot756
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/crisaout.sc131
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elf32avr.sc8
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfd10v.sc2
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfd30v.sc6
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfi370.sc2
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc361
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc361
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/h8300s.sc107
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/i386beos.sc2
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/tic54xcoff.sc52
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/v850.sc68
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-selective/5.cc32
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-shared/symbolic.dat8
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.exp70
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.s4
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.t9
77 files changed, 3381 insertions, 2902 deletions
diff --git a/gnu/usr.bin/binutils/gprof/MAINTAINERS b/gnu/usr.bin/binutils/gprof/MAINTAINERS
new file mode 100644
index 00000000000..d59a3bd7f88
--- /dev/null
+++ b/gnu/usr.bin/binutils/gprof/MAINTAINERS
@@ -0,0 +1 @@
+See ../binutils/MAINTAINERS
diff --git a/gnu/usr.bin/binutils/gprof/acconfig.h b/gnu/usr.bin/binutils/gprof/acconfig.h
new file mode 100644
index 00000000000..11991ddbcd8
--- /dev/null
+++ b/gnu/usr.bin/binutils/gprof/acconfig.h
@@ -0,0 +1,2 @@
+/* Define as the size of a pointer in the target profile file format. */
+#undef GMON_PTR_SIZE
diff --git a/gnu/usr.bin/binutils/gprof/acinclude.m4 b/gnu/usr.bin/binutils/gprof/acinclude.m4
new file mode 100644
index 00000000000..c01c95cd231
--- /dev/null
+++ b/gnu/usr.bin/binutils/gprof/acinclude.m4
@@ -0,0 +1,14 @@
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_SUBST(LIBTOOL)
+])
+
+sinclude(../gettext.m4)
+ifelse(yes,no,[
+AC_DEFUN([CY_WITH_NLS],)
+AC_SUBST(INTLLIBS)
+])
diff --git a/gnu/usr.bin/binutils/gprof/aclocal.m4 b/gnu/usr.bin/binutils/gprof/aclocal.m4
index c8a994ccab4..ec952ca69a0 100644
--- a/gnu/usr.bin/binutils/gprof/aclocal.m4
+++ b/gnu/usr.bin/binutils/gprof/aclocal.m4
@@ -10,6 +10,21 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_SUBST(LIBTOOL)
+])
+
+sinclude(../gettext.m4)
+ifelse(yes,no,[
+AC_DEFUN([CY_WITH_NLS],)
+AC_SUBST(INTLLIBS)
+])
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -102,415 +117,6 @@ else
fi
AC_SUBST($1)])
-
-# serial 40 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-
-# Save cache, so that ltconfig can load it
-AC_CACHE_SAVE
-
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
-|| AC_MSG_ERROR([libtool configure failed])
-
-# Reload cache, that may have been modified by ltconfig
-AC_CACHE_LOAD
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
-])
-
-AC_DEFUN(AC_LIBTOOL_SETUP,
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-dnl
-
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
-esac
-
-# Check for any special flags to pass to ltconfig.
-libtool_flags="--cache-file=$cache_file"
-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
-[libtool_flags="$libtool_flags --enable-dlopen"])
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[libtool_flags="$libtool_flags --enable-win32-dll"])
-AC_ARG_ENABLE(libtool-lock,
- [ --disable-libtool-lock avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case "$lt_target" in
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case "`/usr/bin/file conftest.o`" in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-])
-esac
-])
-
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
-
-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
-
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_SHARED, [dnl
-define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)])
-
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_STATIC, [dnl
-define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
-
-
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
-define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
-])
-
-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)])
-
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AC_PROG_LD,
-[AC_ARG_WITH(gnu-ld,
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
- case "$ac_prog" in
- # Accept absolute paths.
-changequote(,)dnl
- [\\/]* | [A-Za-z]:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
-changequote([,])dnl
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(ac_cv_path_LD,
-[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
- test "$with_gnu_ld" != no && break
- else
- test "$with_gnu_ld" != yes && break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$ac_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])
-
-AC_DEFUN(AC_PROG_LD_GNU,
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
-else
- ac_cv_prog_gnu_ld=no
-fi])
-])
-
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AC_PROG_NM,
-[AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(ac_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- ac_cv_path_NM="$NM"
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
- break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
- break
- else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
-fi])
-NM="$ac_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
-
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN(AC_CHECK_LIBM,
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case "$lt_target" in
-*-*-beos* | *-*-cygwin*)
- # These system don't have libm
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, main, LIBM="-lm")
- ;;
-esac
-])
-
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library, adds --enable-ltdl-convenience to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case "$enable_ltdl_convenience" in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
-])
-
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library, and adds --enable-ltdl-install to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, main,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- INCLTDL=
- fi
-])
-
-dnl old names
-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
-
-dnl This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])dnl
-
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
@@ -534,351 +140,6 @@ for am_file in <<$1>>; do
done<<>>dnl>>)
changequote([,]))])
-# This file is derived from `gettext.m4'. The difference is that the
-# included macros assume Cygnus-style source and build trees.
-
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 3
-
-AC_DEFUN(CY_WITH_NLS,
- [AC_MSG_CHECKING([whether NLS is requested])
- dnl Default is enabled NLS
- AC_ARG_ENABLE(nls,
- [ --disable-nls do not use Native Language Support],
- USE_NLS=$enableval, USE_NLS=yes)
- AC_MSG_RESULT($USE_NLS)
- AC_SUBST(USE_NLS)
-
- USE_INCLUDED_LIBINTL=no
-
- dnl If we use NLS figure out what method
- if test "$USE_NLS" = "yes"; then
- AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
- AC_MSG_CHECKING([whether included gettext is requested])
- AC_ARG_WITH(included-gettext,
- [ --with-included-gettext use the GNU gettext library included here],
- nls_cv_force_use_gnu_gettext=$withval,
- nls_cv_force_use_gnu_gettext=no)
- AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
-
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- dnl User does not insist on using GNU NLS library. Figure out what
- dnl to use. If gettext or catgets are available (in this order) we
- dnl use this. Else we have to fall back to GNU NLS library.
- dnl catgets is only used if permitted by option --with-catgets.
- nls_cv_header_intl=
- nls_cv_header_libgt=
- CATOBJEXT=NONE
-
- AC_CHECK_HEADER(libintl.h,
- [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
- [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
- gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
-
- if test "$gt_cv_func_gettext_libc" != "yes"; then
- AC_CHECK_LIB(intl, bindtextdomain,
- [AC_CACHE_CHECK([for gettext in libintl],
- gt_cv_func_gettext_libintl,
- [AC_TRY_LINK([], [return (int) gettext ("")],
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)])])
- fi
-
- if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes"; then
- AC_DEFINE(HAVE_GETTEXT, 1,
- [Define as 1 if you have gettext and don't want to use GNU gettext.])
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
- if test "$MSGFMT" != "no"; then
- AC_CHECK_FUNCS(dcgettext)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr],
- [CATOBJEXT=.gmo
- DATADIRNAME=share],
- [CATOBJEXT=.mo
- DATADIRNAME=lib])
- INSTOBJEXT=.mo
- fi
- fi
- ])
-
- dnl In the standard gettext, we would now check for catgets.
- dnl However, we never want to use catgets for our releases.
-
- if test "$CATOBJEXT" = "NONE"; then
- dnl Neither gettext nor catgets in included in the C library.
- dnl Fall back on GNU gettext library.
- nls_cv_use_gnu_gettext=yes
- fi
- fi
-
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- dnl Mark actions used to generate GNU NLS library.
- INTLOBJS="\$(GETTOBJS)"
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_SUBST(MSGFMT)
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.gmo
- INSTOBJEXT=.mo
- DATADIRNAME=share
- INTLDEPS='$(top_builddir)/../intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=libintl.h
- nls_cv_header_libgt=libgettext.h
- fi
-
- dnl Test whether we really found GNU xgettext.
- if test "$XGETTEXT" != ":"; then
- dnl If it is no GNU xgettext we define it as : so that the
- dnl Makefiles still can work.
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
- : ;
- else
- AC_MSG_RESULT(
- [found xgettext programs is not GNU xgettext; ignore it])
- XGETTEXT=":"
- fi
- fi
-
- # We need to process the po/ directory.
- POSUB=po
- else
- DATADIRNAME=share
- nls_cv_header_intl=libintl.h
- nls_cv_header_libgt=libgettext.h
- fi
-
- # If this is used in GNU gettext we have to set USE_NLS to `yes'
- # because some of the sources are only built for this goal.
- if test "$PACKAGE" = gettext; then
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
- fi
-
- dnl These rules are solely for the distribution goal. While doing this
- dnl we only have to keep exactly one list of the available catalogs
- dnl in configure.in.
- for lang in $ALL_LINGUAS; do
- GMOFILES="$GMOFILES $lang.gmo"
- POFILES="$POFILES $lang.po"
- done
-
- dnl Make all variables we use known to autoconf.
- AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATALOGS)
- AC_SUBST(CATOBJEXT)
- AC_SUBST(DATADIRNAME)
- AC_SUBST(GMOFILES)
- AC_SUBST(INSTOBJEXT)
- AC_SUBST(INTLDEPS)
- AC_SUBST(INTLLIBS)
- AC_SUBST(INTLOBJS)
- AC_SUBST(POFILES)
- AC_SUBST(POSUB)
- ])
-
-AC_DEFUN(CY_GNU_GETTEXT,
- [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_OFF_T])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
-
- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h])
- AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
-
- if test "${ac_cv_func_stpcpy+set}" != "set"; then
- AC_CHECK_FUNCS(stpcpy)
- fi
- if test "${ac_cv_func_stpcpy}" = "yes"; then
- AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
- fi
-
- AM_LC_MESSAGES
- CY_WITH_NLS
-
- if test "x$CATOBJEXT" != "x"; then
- if test "x$ALL_LINGUAS" = "x"; then
- LINGUAS=
- else
- AC_MSG_CHECKING(for catalogs to be installed)
- NEW_LINGUAS=
- for lang in ${LINGUAS=$ALL_LINGUAS}; do
- case "$ALL_LINGUAS" in
- *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
- esac
- done
- LINGUAS=$NEW_LINGUAS
- AC_MSG_RESULT($LINGUAS)
- fi
-
- dnl Construct list of names of catalog files to be constructed.
- if test -n "$LINGUAS"; then
- for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
- fi
- fi
-
- dnl The reference to <locale.h> in the installed <libintl.h> file
- dnl must be resolved because we cannot expect the users of this
- dnl to define HAVE_LOCALE_H.
- if test $ac_cv_header_locale_h = yes; then
- INCLUDE_LOCALE_H="#include <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. Take care yourself. */"
- fi
- AC_SUBST(INCLUDE_LOCALE_H)
-
- dnl Determine which catalog format we have (if any is needed)
- dnl For now we know about two different formats:
- dnl Linux libc-5 and the normal X/Open format
- if test -f $srcdir/po2tbl.sed.in; then
- if test "$CATOBJEXT" = ".cat"; then
- AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
-
- dnl Transform the SED scripts while copying because some dumb SEDs
- dnl cannot handle comments.
- sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
- fi
- dnl po2tbl.sed is always needed.
- sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
- $srcdir/po2tbl.sed.in > po2tbl.sed
- fi
-
- dnl In the intl/Makefile.in we have a special dependency which makes
- dnl only sense for gettext. We comment this out for non-gettext
- dnl packages.
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- fi
- AC_SUBST(GT_NO)
- AC_SUBST(GT_YES)
-
- MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
- AC_SUBST(MKINSTALLDIRS)
-
- dnl *** For now the libtool support in intl/Makefile is not for real.
- l=
- AC_SUBST(l)
-
- dnl Generate list of files to be processed by xgettext which will
- dnl be included in po/Makefile. But only do this if the po directory
- dnl exists in srcdir.
- if test -d $srcdir/po; then
- test -d po || mkdir po
- if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
- posrcprefix="$srcdir/"
- else
- posrcprefix="../$srcdir/"
- fi
- else
- posrcprefix="../"
- fi
- rm -f po/POTFILES
- sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
- < $srcdir/po/POTFILES.in > po/POTFILES
- fi
- ])
-
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 1996.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-AC_DEFUN(AM_LC_MESSAGES,
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
- if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
- [Define if your locale.h file contains LC_MESSAGES.])
- fi
- fi])
-
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
diff --git a/gnu/usr.bin/binutils/gprof/bb_exit_func.c b/gnu/usr.bin/binutils/gprof/bb_exit_func.c
index 813321566c7..33f9296cef5 100644
--- a/gnu/usr.bin/binutils/gprof/bb_exit_func.c
+++ b/gnu/usr.bin/binutils/gprof/bb_exit_func.c
@@ -1,78 +1,93 @@
-/*
- * Copyright (c) 1994 David Mosberger-Tang.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- *
- * __bb_exit_func() dumps all the basic-block statistics linked into
- * the bb_head chain to .d files.
- */
+/* bb_exit_func.c - dumps all the basic-block statistics linked into
+ the bb_head chain to .d files.
+
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU Binutils.
+
+ 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 code was contributed by:
+
+ David Mosberger-Tang <David.Mosberger@acm.org> */
+
#include <stdio.h>
#include <strings.h>
#include "bfd.h"
#include "gmon_out.h"
/* structure emitted by -a */
-struct bb {
- long zero_word;
- const char *filename;
- long *counts;
- long ncounts;
- struct bb *next;
- const unsigned long *addresses;
+struct bb
+{
+ long zero_word;
+ const char *filename;
+ long *counts;
+ long ncounts;
+ struct bb *next;
+ const unsigned long *addresses;
};
-struct bb *__bb_head = (struct bb *)0;
+struct bb *__bb_head = (struct bb *) 0;
void
__bb_exit_func (void)
{
- const int version = GMON_VERSION;
- struct gmon_hdr ghdr;
- struct bb *ptr;
- FILE *fp;
- /*
- * GEN_GMON_CNT_FILE should be defined on systems with mcleanup()
- * functions that do not write basic-block to gmon.out. In such
- * cases profiling with "-pg -a" would result in a gmon.out file
- * without basic-block info (because the file written here would
- * be overwritten. Thus, a separate file is generated instead.
- * The two files can easily be combined by specifying them
- * on gprof's command line (and possibly generating a gmon.sum
- * file with "gprof -s").
- */
+ const int version = GMON_VERSION;
+ struct gmon_hdr ghdr;
+ struct bb *ptr;
+ FILE *fp;
+ /* GEN_GMON_CNT_FILE should be defined on systems with mcleanup()
+ functions that do not write basic-block to gmon.out. In such
+ cases profiling with "-pg -a" would result in a gmon.out file
+ without basic-block info (because the file written here would be
+ overwritten. Thus, a separate file is generated instead. The
+ two files can easily be combined by specifying them on gprof's
+ command line (and possibly generating a gmon.sum file with "gprof
+ -s"). */
#ifndef GEN_GMON_CNT_FILE
# define OUT_NAME "gmon.out"
#else
# define OUT_NAME "gmon.cnt"
#endif
- fp = fopen(OUT_NAME, "wb");
- if (!fp) {
- perror(OUT_NAME);
- return;
- } /* if */
- memcpy(&ghdr.cookie[0], GMON_MAGIC, 4);
- memcpy(&ghdr.version, &version, sizeof(version));
- fwrite(&ghdr, sizeof(ghdr), 1, fp);
-
- for (ptr = __bb_head; ptr != 0; ptr = ptr->next) {
- u_int ncounts = ptr->ncounts;
- u_char tag;
- u_int i;
+ fp = fopen (OUT_NAME, "wb");
+ if (!fp)
+ {
+ perror (OUT_NAME);
+ return;
+ }
+ memcpy (&ghdr.cookie[0], GMON_MAGIC, 4);
+ memcpy (&ghdr.version, &version, sizeof (version));
+ fwrite (&ghdr, sizeof (ghdr), 1, fp);
- tag = GMON_TAG_BB_COUNT;
- fwrite(&tag, sizeof(tag), 1, fp);
- fwrite(&ncounts, sizeof(ncounts), 1, fp);
+ for (ptr = __bb_head; ptr != 0; ptr = ptr->next)
+ {
+ u_int ncounts = ptr->ncounts;
+ u_char tag;
+ u_int i;
- for (i = 0; i < ncounts; ++i) {
- fwrite(&ptr->addresses[i], sizeof(ptr->addresses[0]), 1, fp);
- fwrite(&ptr->counts[i], sizeof(ptr->counts[0]), 1, fp);
- } /* for */
- } /* for */
- fclose (fp);
-} /* __bb_exit_func */
+ tag = GMON_TAG_BB_COUNT;
+ fwrite (&tag, sizeof (tag), 1, fp);
+ fwrite (&ncounts, sizeof (ncounts), 1, fp);
- /*** end of __bb_exit_func.c ***/
+ for (i = 0; i < ncounts; ++i)
+ {
+ fwrite (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1, fp);
+ fwrite (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp);
+ }
+ }
+ fclose (fp);
+}
diff --git a/gnu/usr.bin/binutils/gprof/bbconv.pl b/gnu/usr.bin/binutils/gprof/bbconv.pl
index 7312f5162fe..d83c00e2db9 100644
--- a/gnu/usr.bin/binutils/gprof/bbconv.pl
+++ b/gnu/usr.bin/binutils/gprof/bbconv.pl
@@ -2,6 +2,25 @@
# This script converts a "bb.out" file into a format
# suitable for processing by gprof
+#
+# Copyright 2001 Free Software Foundation, Inc.
+#
+# This file is part of GNU Binutils.
+#
+# 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.
# Write a new-style gmon header
diff --git a/gnu/usr.bin/binutils/gprof/corefile.c b/gnu/usr.bin/binutils/gprof/corefile.c
index 790fc286208..82db0f685ed 100644
--- a/gnu/usr.bin/binutils/gprof/corefile.c
+++ b/gnu/usr.bin/binutils/gprof/corefile.c
@@ -1,3 +1,24 @@
+/* corefile.c
+
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
#include "libiberty.h"
#include "gprof.h"
#include "corefile.h"
@@ -13,7 +34,8 @@ int min_insn_size;
int offset_to_code;
/* For mapping symbols to specific .o files during file ordering. */
-struct function_map {
+struct function_map
+{
char *function_name;
char *file_name;
};
@@ -21,9 +43,9 @@ struct function_map {
struct function_map *symbol_map;
unsigned int symbol_map_count;
-extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
-extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
@@ -112,6 +134,7 @@ DEFUN (read_function_mappings, (filename), const char *filename)
symbol_map_count = count;
}
+
void
DEFUN (core_init, (a_out_name), const char *a_out_name)
{
@@ -129,7 +152,7 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
done (1);
}
- /* get core's text section: */
+ /* Get core's text section. */
core_text_sect = bfd_get_section_by_name (core_bfd, ".text");
if (!core_text_sect)
{
@@ -142,9 +165,9 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
}
}
- /* read core's symbol table: */
+ /* Read core's symbol table. */
- /* this will probably give us more than we need, but that's ok: */
+ /* This will probably give us more than we need, but that's ok. */
core_num_syms = bfd_get_symtab_upper_bound (core_bfd);
if (core_num_syms < 0)
{
@@ -155,6 +178,7 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
core_syms = (asymbol **) xmalloc (core_num_syms);
core_num_syms = bfd_canonicalize_symtab (core_bfd, core_syms);
+
if (core_num_syms < 0)
{
fprintf (stderr, "%s: %s: %s\n", whoami, a_out_name,
@@ -184,10 +208,8 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
read_function_mappings (function_mapping_file);
}
+/* Read in the text space of an a.out file. */
-/*
- * Read in the text space of an a.out file
- */
void
DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
{
@@ -199,6 +221,7 @@ DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
whoami, (unsigned long) core_text_sect->_raw_size);
done (1);
}
+
if (!bfd_get_section_contents (core_bfd, core_text_sect, core_text_space,
0, core_text_sect->_raw_size))
{
@@ -206,10 +229,9 @@ DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
free (core_text_space);
core_text_space = 0;
}
+
if (!core_text_space)
- {
- fprintf (stderr, _("%s: can't do -c\n"), whoami);
- }
+ fprintf (stderr, _("%s: can't do -c\n"), whoami);
}
@@ -248,12 +270,11 @@ DEFUN (find_call, (parent, p_lowpc, p_highpc),
}
}
-/*
- * Return class of symbol SYM. The returned class can be any of:
- * 0 -> symbol is not interesting to us
- * 'T' -> symbol is a global name
- * 't' -> symbol is a local (static) name
- */
+/* Return class of symbol SYM. The returned class can be any of:
+ 0 -> symbol is not interesting to us
+ 'T' -> symbol is a global name
+ 't' -> symbol is a local (static) name. */
+
static int
DEFUN (core_sym_class, (sym), asymbol * sym)
{
@@ -263,14 +284,10 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
int i;
if (sym->section == NULL || (sym->flags & BSF_DEBUGGING) != 0)
- {
- return 0;
- }
+ return 0;
- /*
- * Must be a text symbol, and static text symbols don't qualify if
- * ignore_static_funcs set.
- */
+ /* Must be a text symbol, and static text symbols
+ don't qualify if ignore_static_funcs set. */
if (ignore_static_funcs && (sym->flags & BSF_LOCAL))
{
DBG (AOUTDEBUG, printf ("[core_sym_class] %s: not a function\n",
@@ -282,81 +299,65 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
i = syminfo.type;
if (i == 'T')
- {
- return i; /* it's a global symbol */
- }
+ return i; /* It's a global symbol. */
if (i == 'W')
- {
- /* Treat weak symbols as text symbols. FIXME: a weak symbol may
- also be a data symbol. */
- return 'T';
- }
+ /* Treat weak symbols as text symbols. FIXME: a weak symbol may
+ also be a data symbol. */
+ return 'T';
if (i != 't')
{
- /* not a static text symbol */
+ /* Not a static text symbol. */
DBG (AOUTDEBUG, printf ("[core_sym_class] %s is of class %c\n",
sym->name, i));
return 0;
}
- /* do some more filtering on static function-names: */
-
+ /* Do some more filtering on static function-names. */
if (ignore_static_funcs)
- {
- return 0;
- }
- /*
- * Can't zero-length name or funny characters in name, where
- * `funny' includes: `.' (.o file names) and `$' (Pascal labels).
- */
+ return 0;
+
+ /* Can't zero-length name or funny characters in name, where
+ `funny' includes: `.' (.o file names) and `$' (Pascal labels). */
if (!sym->name || sym->name[0] == '\0')
- {
- return 0;
- }
+ return 0;
for (name = sym->name; *name; ++name)
{
if (*name == '.' || *name == '$')
- {
- return 0;
- }
+ return 0;
}
- /*
- * On systems where the C compiler adds an underscore to all
- * names, static names without underscores seem usually to be
- * labels in hand written assembler in the library. We don't want
- * these names. This is certainly necessary on a Sparc running
- * SunOS 4.1 (try profiling a program that does a lot of
- * division). I don't know whether it has harmful side effects on
- * other systems. Perhaps it should be made configurable.
- */
+
+ /* On systems where the C compiler adds an underscore to all
+ names, static names without underscores seem usually to be
+ labels in hand written assembler in the library. We don't want
+ these names. This is certainly necessary on a Sparc running
+ SunOS 4.1 (try profiling a program that does a lot of
+ division). I don't know whether it has harmful side effects on
+ other systems. Perhaps it should be made configurable. */
sym_prefix = bfd_get_symbol_leading_char (core_bfd);
+
if ((sym_prefix && sym_prefix != sym->name[0])
- /*
- * GCC may add special symbols to help gdb figure out the file
- * language. We want to ignore these, since sometimes they mask
- * the real function. (dj@ctron)
- */
+ /* GCC may add special symbols to help gdb figure out the file
+ language. We want to ignore these, since sometimes they mask
+ the real function. (dj@ctron) */
|| !strncmp (sym->name, "__gnu_compiled", 14)
|| !strncmp (sym->name, "___gnu_compiled", 15))
{
return 0;
}
- /* If the object file supports marking of function symbols, then we can
- zap anything that doesn't have BSF_FUNCTION set. */
+ /* If the object file supports marking of function symbols, then
+ we can zap anything that doesn't have BSF_FUNCTION set. */
if (ignore_non_functions && (sym->flags & BSF_FUNCTION) == 0)
return 0;
- return 't'; /* it's a static text symbol */
+ return 't'; /* It's a static text symbol. */
}
+/* Get whatever source info we can get regarding address ADDR. */
-/*
- * Get whatever source info we can get regarding address ADDR:
- */
static bool
DEFUN (get_src_info, (addr, filename, name, line_num),
bfd_vma addr AND const char **filename AND const char **name
@@ -386,11 +387,9 @@ DEFUN (get_src_info, (addr, filename, name, line_num),
}
}
+/* Read in symbol table from core.
+ One symbol per function is entered. */
-/*
- * Read in symbol table from core. One symbol per function is
- * entered.
- */
void
core_create_function_syms (core_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED;
@@ -400,17 +399,16 @@ core_create_function_syms (core_bfd)
long i, found, skip;
unsigned int j;
- /* pass 1 - determine upper bound on number of function names: */
+ /* Pass 1 - determine upper bound on number of function names. */
symtab.len = 0;
+
for (i = 0; i < core_num_syms; ++i)
{
if (!core_sym_class (core_syms[i]))
- {
- continue;
- }
+ continue;
/* This should be replaced with a binary search or hashed
- search. Gross.
+ search. Gross.
Don't create a symtab entry for a function that has
a mapping to a file, unless it's the first function
@@ -420,12 +418,13 @@ core_create_function_syms (core_bfd)
if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
{
if (j > 0 && ! strcmp (symbol_map [j].file_name,
- symbol_map [j - 1].file_name))
+ symbol_map [j - 1].file_name))
skip = 1;
break;
}
+
if (!skip)
- ++symtab.len;
+ ++symtab.len;
}
if (symtab.len == 0)
@@ -434,15 +433,16 @@ core_create_function_syms (core_bfd)
done (1);
}
- /* the "+ 2" is for the sentinels: */
+ /* The "+ 2" is for the sentinels. */
symtab.base = (Sym *) xmalloc ((symtab.len + 2) * sizeof (Sym));
- /* pass 2 - create symbols: */
-
+ /* Pass 2 - create symbols. */
symtab.limit = symtab.base;
+
for (i = 0; i < core_num_syms; ++i)
{
class = core_sym_class (core_syms[i]);
+
if (!class)
{
DBG (AOUTDEBUG,
@@ -451,16 +451,17 @@ core_create_function_syms (core_bfd)
core_syms[i]->name));
continue;
}
+
/* This should be replaced with a binary search or hashed
search. Gross. */
-
skip = 0;
found = 0;
+
for (j = 0; j < symbol_map_count; j++)
if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
{
if (j > 0 && ! strcmp (symbol_map [j].file_name,
- symbol_map [j - 1].file_name))
+ symbol_map [j - 1].file_name))
skip = 1;
else
found = j;
@@ -472,9 +473,9 @@ core_create_function_syms (core_bfd)
sym_init (symtab.limit);
- /* symbol offsets are always section-relative: */
-
+ /* Symbol offsets are always section-relative. */
symtab.limit->addr = core_syms[i]->value + core_syms[i]->section->vma;
+
if (symbol_map_count
&& !strcmp (core_syms[i]->name, symbol_map[found].function_name))
{
@@ -487,35 +488,30 @@ core_create_function_syms (core_bfd)
symtab.limit->mapped = 0;
}
- /* Lookup filename and line number, if we can */
-
+ /* Lookup filename and line number, if we can. */
{
const char *filename, *func_name;
-
+
if (get_src_info (symtab.limit->addr, &filename, &func_name,
&symtab.limit->line_num))
{
symtab.limit->file = source_file_lookup_path (filename);
/* FIXME: Checking __osf__ here does not work with a cross
- gprof. */
+ gprof. */
#ifdef __osf__
- /*
- * Suppress symbols that are not function names. This is
- * useful to suppress code-labels and aliases.
- *
- * This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
- * labels do not appear in the symbol table info, so this isn't
- * necessary.
- */
+ /* Suppress symbols that are not function names. This is
+ useful to suppress code-labels and aliases.
+
+ This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
+ labels do not appear in the symbol table info, so this isn't
+ necessary. */
if (strcmp (symtab.limit->name, func_name) != 0)
{
- /*
- * The symbol's address maps to a different name, so
- * it can't be a function-entry point. This happens
- * for labels, for example.
- */
+ /* The symbol's address maps to a different name, so
+ it can't be a function-entry point. This happens
+ for labels, for example. */
DBG (AOUTDEBUG,
printf ("[core_create_function_syms: rej %s (maps to %s)\n",
symtab.limit->name, func_name));
@@ -527,23 +523,18 @@ core_create_function_syms (core_bfd)
symtab.limit->is_func = TRUE;
symtab.limit->is_bb_head = TRUE;
+
if (class == 't')
- {
- symtab.limit->is_static = TRUE;
- }
+ symtab.limit->is_static = TRUE;
min_vma = MIN (symtab.limit->addr, min_vma);
max_vma = MAX (symtab.limit->addr, max_vma);
- /*
- * If we see "main" without an initial '_', we assume names
- * are *not* prefixed by '_'.
- */
+ /* If we see "main" without an initial '_', we assume names
+ are *not* prefixed by '_'. */
if (symtab.limit->name[0] == 'm' && discard_underscores
&& strcmp (symtab.limit->name, "main") == 0)
- {
- discard_underscores = 0;
- }
+ discard_underscores = 0;
DBG (AOUTDEBUG, printf ("[core_create_function_syms] %ld %s 0x%lx\n",
(long) (symtab.limit - symtab.base),
@@ -552,8 +543,7 @@ core_create_function_syms (core_bfd)
++symtab.limit;
}
- /* create sentinels: */
-
+ /* Create sentinels. */
sym_init (symtab.limit);
symtab.limit->name = "<locore>";
symtab.limit->addr = 0;
@@ -570,11 +560,9 @@ core_create_function_syms (core_bfd)
symtab_finalize (&symtab);
}
+/* Read in symbol table from core.
+ One symbol per line of source code is entered. */
-/*
- * Read in symbol table from core. One symbol per line of source code
- * is entered.
- */
void
DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
{
@@ -586,43 +574,40 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
const char *filename;
int prev_line_num;
Sym_Table ltab;
- /*
- * Create symbols for functions as usual. This is necessary in
- * cases where parts of a program were not compiled with -g. For
- * those parts we still want to get info at the function level:
- */
+
+ /* Create symbols for functions as usual. This is necessary in
+ cases where parts of a program were not compiled with -g. For
+ those parts we still want to get info at the function level. */
core_create_function_syms (core_bfd);
- /* pass 1 - counter number of symbols: */
-
- /*
- * To find all line information, walk through all possible
- * text-space addresses (one by one!) and get the debugging
- * info for each address. When the debugging info changes,
- * it is time to create a new symbol.
- *
- * Of course, this is rather slow and it would be better if
- * bfd would provide an iterator for enumerating all line infos
- */
+ /* Pass 1 - counter number of symbols. */
+
+ /* To find all line information, walk through all possible
+ text-space addresses (one by one!) and get the debugging
+ info for each address. When the debugging info changes,
+ it is time to create a new symbol.
+
+ Of course, this is rather slow and it would be better if
+ bfd would provide an iterator for enumerating all line infos. */
prev_name_len = PATH_MAX;
prev_filename_len = PATH_MAX;
prev_name = xmalloc (prev_name_len);
prev_filename = xmalloc (prev_filename_len);
ltab.len = 0;
prev_line_num = 0;
+
for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
int len;
vma = core_text_sect->vma + offset;
+
if (!get_src_info (vma, &filename, &dummy.name, &dummy.line_num)
|| (prev_line_num == dummy.line_num
&& prev_name != NULL
&& strcmp (prev_name, dummy.name) == 0
&& strcmp (prev_filename, filename) == 0))
- {
- continue;
- }
+ continue;
++ltab.len;
prev_line_num = dummy.line_num;
@@ -634,15 +619,17 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
free (prev_name);
prev_name = xmalloc (prev_name_len);
}
- strcpy (prev_name, dummy.name);
+ strcpy (prev_name, dummy.name);
len = strlen (filename);
+
if (len >= prev_filename_len)
{
prev_filename_len = len + 1024;
free (prev_filename);
prev_filename = xmalloc (prev_filename_len);
}
+
strcpy (prev_filename, filename);
min_vma = MIN (vma, min_vma);
@@ -652,12 +639,12 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
free (prev_name);
free (prev_filename);
- /* make room for function symbols, too: */
+ /* Make room for function symbols, too. */
ltab.len += symtab.len;
ltab.base = (Sym *) xmalloc (ltab.len * sizeof (Sym));
ltab.limit = ltab.base;
- /* pass 2 - create symbols: */
+ /* Pass 2 - create symbols. */
/* We now set is_static as we go along, rather than by running
through the symbol table at the end.
@@ -675,31 +662,28 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
Perhaps symtab_finalize should be modified to make this
distinction as well, but the current fix works and the code is a
lot cleaner now. */
-
prev = 0;
+
for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
sym_init (ltab.limit);
+
if (!get_src_info (core_text_sect->vma + offset, &filename,
&ltab.limit->name, &ltab.limit->line_num)
|| (prev && prev->line_num == ltab.limit->line_num
&& strcmp (prev->name, ltab.limit->name) == 0
&& strcmp (prev->file->name, filename) == 0))
- {
- continue;
- }
+ continue;
- /* make name pointer a malloc'ed string: */
+ /* Make name pointer a malloc'ed string. */
ltab.limit->name = xstrdup (ltab.limit->name);
ltab.limit->file = source_file_lookup_path (filename);
ltab.limit->addr = core_text_sect->vma + offset;
/* Set is_static based on the enclosing function, using either:
- * 1) the previous symbol, if it's from the same function, or
- * 2) a symtab lookup
- */
-
+ 1) the previous symbol, if it's from the same function, or
+ 2) a symtab lookup. */
if (prev && ltab.limit->file == prev->file &&
strcmp (ltab.limit->name, prev->name) == 0)
{
@@ -713,15 +697,11 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
prev = ltab.limit;
- /*
- * If we see "main" without an initial '_', we assume names
- * are *not* prefixed by '_'.
- */
+ /* If we see "main" without an initial '_', we assume names
+ are *not* prefixed by '_'. */
if (ltab.limit->name[0] == 'm' && discard_underscores
&& strcmp (ltab.limit->name, "main") == 0)
- {
- discard_underscores = 0;
- }
+ discard_underscores = 0;
DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
(unsigned long) (ltab.limit - ltab.base),
@@ -730,22 +710,19 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
++ltab.limit;
}
- /* update sentinels: */
-
+ /* Update sentinels. */
sentinel = sym_lookup (&symtab, 0);
+
if (strcmp (sentinel->name, "<locore>") == 0
&& min_vma <= sentinel->end_addr)
- {
- sentinel->end_addr = min_vma - 1;
- }
+ sentinel->end_addr = min_vma - 1;
sentinel = sym_lookup (&symtab, ~0);
+
if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr)
- {
- sentinel->addr = max_vma + 1;
- }
+ sentinel->addr = max_vma + 1;
- /* copy in function symbols: */
+ /* Copy in function symbols. */
memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
ltab.limit += symtab.len;
@@ -757,10 +734,8 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
done (1);
}
- /* finalize ltab and make it symbol table: */
-
+ /* Finalize ltab and make it symbol table. */
symtab_finalize (&ltab);
free (symtab.base);
symtab = ltab;
-
}
diff --git a/gnu/usr.bin/binutils/gprof/corefile.h b/gnu/usr.bin/binutils/gprof/corefile.h
index b396f8500b2..a876d620b85 100644
--- a/gnu/usr.bin/binutils/gprof/corefile.h
+++ b/gnu/usr.bin/binutils/gprof/corefile.h
@@ -1,21 +1,40 @@
+/* corefile.h
+
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+This file is part of GNU Binutils.
+
+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. */
+
#ifndef corefile_h
#define corefile_h
#include "bfd.h"
-extern bfd *core_bfd; /* bfd for core-file */
-extern int core_num_syms; /* # of entries in symbol-table */
-extern asymbol **core_syms; /* symbol table in a.out */
-extern asection *core_text_sect; /* core text section */
-extern PTR core_text_space; /* text space of a.out in core */
-
-extern int min_insn_size; /* size of smallest instruction, in bytes */
-extern int offset_to_code; /* offset (in bytes) of code from entry
- address of routine */
+extern bfd *core_bfd; /* BFD for core-file. */
+extern int core_num_syms; /* # of entries in symbol-table. */
+extern asymbol **core_syms; /* Symbol table in a.out. */
+extern asection *core_text_sect;/* Core text section. */
+extern PTR core_text_space; /* Text space of a.out in core. */
+extern int min_insn_size; /* Size of smallest instruction, in bytes. */
+extern int offset_to_code; /* Offset (in bytes) of code from entry
+ address of routine. */
-extern void core_init PARAMS ((const char *a_out_name));
-extern void core_get_text_space PARAMS ((bfd * core_bfd));
-extern void core_create_function_syms PARAMS ((bfd * core_bfd));
-extern void core_create_line_syms PARAMS ((bfd * core_bfd));
+extern void core_init PARAMS ((const char *));
+extern void core_get_text_space PARAMS ((bfd *));
+extern void core_create_function_syms PARAMS ((bfd *));
+extern void core_create_line_syms PARAMS ((bfd *));
#endif /* corefile_h */
diff --git a/gnu/usr.bin/binutils/gprof/dep-in.sed b/gnu/usr.bin/binutils/gprof/dep-in.sed
new file mode 100644
index 00000000000..f61921a4828
--- /dev/null
+++ b/gnu/usr.bin/binutils/gprof/dep-in.sed
@@ -0,0 +1,17 @@
+:loop
+/\\$/N
+/\\$/b loop
+
+s!@INCDIR@!$(INCDIR)!g
+s!@BFDDIR@!$(BFDDIR)!g
+s!@SRCDIR@/!!g
+s!@OBJDIR@/!!g
+
+s/\\\n */ /g
+
+s/ *$//
+s/ */ /g
+/:$/d
+
+s/\(.\{50\}[^ ]*\) /\1 \\\
+ /g
diff --git a/gnu/usr.bin/binutils/gprof/gconfig.in b/gnu/usr.bin/binutils/gprof/gconfig.in
index b528f4be885..20674bbb211 100644
--- a/gnu/usr.bin/binutils/gprof/gconfig.in
+++ b/gnu/usr.bin/binutils/gprof/gconfig.in
@@ -43,6 +43,9 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define as the size of a pointer in the target profile file format. */
+#undef GMON_PTR_SIZE
+
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -103,6 +106,9 @@
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define if you have the <sys/gmon_out.h> header file. */
+#undef HAVE_SYS_GMON_OUT_H
+
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
diff --git a/gnu/usr.bin/binutils/gprof/po/gprof.pot b/gnu/usr.bin/binutils/gprof/po/gprof.pot
index fe28232e5ef..06b13ebefbb 100644
--- a/gnu/usr.bin/binutils/gprof/po/gprof.pot
+++ b/gnu/usr.bin/binutils/gprof/po/gprof.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-04-05 14:09+0930\n"
+"POT-Creation-Date: 2000-07-27 16:32-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -33,27 +33,27 @@ msgstr ""
msgid "[find_call] 0x%lx: bsr"
msgstr ""
-#: basic_blocks.c:134 call_graph.c:70 hist.c:105
+#: basic_blocks.c:123 call_graph.c:86 hist.c:122
#, c-format
msgid "%s: %s: unexpected end of file\n"
msgstr ""
-#: basic_blocks.c:215
+#: basic_blocks.c:198
#, c-format
msgid "%s: warning: ignoring basic-block exec counts (use -l or --line)\n"
msgstr ""
#. FIXME: This only works if bfd_vma is unsigned long.
-#: basic_blocks.c:324 basic_blocks.c:333
+#: basic_blocks.c:296 basic_blocks.c:306
#, c-format
msgid "%s:%d: (%s:0x%lx) %lu executions\n"
msgstr ""
-#: basic_blocks.c:325 basic_blocks.c:334
+#: basic_blocks.c:297 basic_blocks.c:307
msgid "<unknown>"
msgstr ""
-#: basic_blocks.c:596
+#: basic_blocks.c:551
#, c-format
msgid ""
"\n"
@@ -64,268 +64,262 @@ msgid ""
"\n"
msgstr ""
-#: basic_blocks.c:620
+#: basic_blocks.c:575
msgid ""
"\n"
"Execution Summary:\n"
"\n"
msgstr ""
-#: basic_blocks.c:621
+#: basic_blocks.c:576
#, c-format
msgid "%9ld Executable lines in this file\n"
msgstr ""
-#: basic_blocks.c:623
+#: basic_blocks.c:578
#, c-format
msgid "%9ld Lines executed\n"
msgstr ""
-#: basic_blocks.c:624
+#: basic_blocks.c:579
#, c-format
msgid "%9.2f Percent of the file executed\n"
msgstr ""
-#: basic_blocks.c:628
+#: basic_blocks.c:583
#, c-format
msgid ""
"\n"
"%9lu Total number of line executions\n"
msgstr ""
-#: basic_blocks.c:630
+#: basic_blocks.c:585
#, c-format
msgid "%9.2f Average executions per line\n"
msgstr ""
-#: call_graph.c:48
+#: call_graph.c:66
#, c-format
msgid "[cg_tally] arc from %s to %s traversed %lu times\n"
msgstr ""
-#: cg_print.c:39
+#: cg_print.c:54
msgid ""
"\t\t Call graph (explanation follows)\n"
"\n"
msgstr ""
-#: cg_print.c:43
+#: cg_print.c:56
msgid ""
"\t\t\tCall graph\n"
"\n"
msgstr ""
-#: cg_print.c:46 hist.c:385
+#: cg_print.c:59 hist.c:391
#, c-format
msgid ""
"\n"
"granularity: each sample hit covers %ld byte(s)"
msgstr ""
-#: cg_print.c:50
+#: cg_print.c:63
msgid ""
" for %.2f%% of %.2f seconds\n"
"\n"
msgstr ""
-#: cg_print.c:55
+#: cg_print.c:67
msgid ""
" no time propagated\n"
"\n"
msgstr ""
-#: cg_print.c:64 cg_print.c:67 cg_print.c:69
+#: cg_print.c:76 cg_print.c:79 cg_print.c:81
msgid "called"
msgstr ""
-#: cg_print.c:64 cg_print.c:69
+#: cg_print.c:76 cg_print.c:81
msgid "total"
msgstr ""
-#: cg_print.c:64
+#: cg_print.c:76
msgid "parents"
msgstr ""
-#: cg_print.c:66 cg_print.c:67
+#: cg_print.c:78 cg_print.c:79
msgid "index"
msgstr ""
-#: cg_print.c:66
+#: cg_print.c:78
msgid "%time"
msgstr ""
-#: cg_print.c:66 cg_print.c:67
+#: cg_print.c:78 cg_print.c:79
msgid "self"
msgstr ""
-#: cg_print.c:66
+#: cg_print.c:78
msgid "descendents"
msgstr ""
-#: cg_print.c:67 hist.c:409
+#: cg_print.c:79 hist.c:416
msgid "name"
msgstr ""
-#: cg_print.c:69
+#: cg_print.c:81
msgid "children"
msgstr ""
-#: cg_print.c:74
+#: cg_print.c:86
msgid "index %% time self children called name\n"
msgstr ""
-#: cg_print.c:101
+#: cg_print.c:109
#, c-format
msgid " <cycle %d as a whole> [%d]\n"
msgstr ""
-#: cg_print.c:353
+#: cg_print.c:335
#, c-format
msgid "%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s <spontaneous>\n"
msgstr ""
-#: cg_print.c:354
+#: cg_print.c:336
#, c-format
msgid "%6.6s %5.5s %7.7s %7.7s %7.7s %7.7s <spontaneous>\n"
msgstr ""
-#: cg_print.c:587
+#: cg_print.c:570
msgid ""
"Index by function name\n"
"\n"
msgstr ""
-#: cg_print.c:644 cg_print.c:653
+#: cg_print.c:627 cg_print.c:636
#, c-format
msgid "<cycle %d>"
msgstr ""
-#: corefile.c:39
+#: corefile.c:61
#, c-format
msgid "%s: could not open %s.\n"
msgstr ""
-#: corefile.c:53 corefile.c:87
+#: corefile.c:75 corefile.c:109
#, c-format
msgid "%s: unable to parse mapping file %s.\n"
msgstr ""
-#: corefile.c:128
+#: corefile.c:151
#, c-format
msgid "%s: %s: not in a.out format\n"
msgstr ""
-#: corefile.c:139
+#: corefile.c:162
#, c-format
msgid "%s: can't find .text section in %s\n"
msgstr ""
-#: corefile.c:198
+#: corefile.c:220
#, c-format
msgid "%s: ran out room for %lu bytes of text space\n"
msgstr ""
-#: corefile.c:211
+#: corefile.c:234
#, c-format
msgid "%s: can't do -c\n"
msgstr ""
-#: corefile.c:243
+#: corefile.c:265
#, c-format
msgid "%s: -c not supported on architecture %s\n"
msgstr ""
-#: corefile.c:433
+#: corefile.c:432
#, c-format
msgid "%s: file `%s' has no symbols\n"
msgstr ""
-#: corefile.c:755
+#: corefile.c:732
#, c-format
msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n"
msgstr ""
-#: gmon_io.c:33 gmon_io.c:55
+#: gmon_io.c:50 gmon_io.c:71
#, c-format
msgid "%s: bfd_vma has unexpected size of %ld bytes\n"
msgstr ""
-#: gmon_io.c:87 gmon_io.c:182
+#: gmon_io.c:107 gmon_io.c:199
#, c-format
msgid "%s: file too short to be a gmon file\n"
msgstr ""
-#: gmon_io.c:97 gmon_io.c:215
+#: gmon_io.c:117 gmon_io.c:233
#, c-format
msgid "%s: file `%s' has bad magic cookie\n"
msgstr ""
-#: gmon_io.c:108
+#: gmon_io.c:128
#, c-format
msgid "%s: file `%s' has unsupported version %d\n"
msgstr ""
-#: gmon_io.c:138
+#: gmon_io.c:158
#, c-format
msgid "%s: %s: found bad tag %d (file corrupted?)\n"
msgstr ""
-#: gmon_io.c:203
+#: gmon_io.c:221
#, c-format
msgid "%s: profiling rate incompatible with first gmon file\n"
msgstr ""
-#: gmon_io.c:232
+#: gmon_io.c:250
#, c-format
msgid "%s: incompatible with first gmon file\n"
msgstr ""
-#: gmon_io.c:258
+#: gmon_io.c:278
#, c-format
msgid "%s: file '%s' does not appear to be in gmon.out format\n"
msgstr ""
-#: gmon_io.c:280
+#: gmon_io.c:299
#, c-format
msgid "%s: unexpected EOF after reading %d/%d bins\n"
msgstr ""
-#: gmon_io.c:315
+#: gmon_io.c:335
msgid "time is in ticks, not seconds\n"
msgstr ""
-#: gmon_io.c:321 gmon_io.c:461
+#: gmon_io.c:341 gmon_io.c:475
#, c-format
msgid "%s: don't know how to deal with file format %d\n"
msgstr ""
-#: gmon_io.c:328
+#: gmon_io.c:348
#, c-format
msgid "File `%s' (version %d) contains:\n"
msgstr ""
-#: gmon_io.c:330
+#: gmon_io.c:350
#, c-format
msgid "\t%d histogram record%s\n"
msgstr ""
-#: gmon_io.c:332
+#: gmon_io.c:352
#, c-format
msgid "\t%d call-graph record%s\n"
msgstr ""
-#: gmon_io.c:334
+#: gmon_io.c:354
#, c-format
msgid "\t%d basic-block count record%s\n"
msgstr ""
-#: gprof.c:59
-msgid ""
-"@(#) Copyright (c) 1983 Regents of the University of California.\n"
-" All rights reserved.\n"
-msgstr ""
-
-#: gprof.c:144
+#: gprof.c:145
#, c-format
msgid ""
"Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n"
@@ -339,117 +333,122 @@ msgid ""
"\t[--no-static] [--print-path] [--separate-files]\n"
"\t[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n"
"\t[--version] [--width=n] [--ignore-non-functions]\n"
-"\t[--demangle] [--no-demangle]\n"
+"\t[--demangle[=STYLE]] [--no-demangle]\n"
"\t[image-file] [profile-file...]\n"
msgstr ""
-#: gprof.c:160
+#: gprof.c:161
#, c-format
msgid "Report bugs to %s\n"
msgstr ""
-#: gprof.c:229
+#: gprof.c:230
#, c-format
msgid "%s: debugging not supported; -d ignored\n"
msgstr ""
-#: gprof.c:309
+#: gprof.c:310
#, c-format
msgid "%s: unknown file format %s\n"
msgstr ""
#. This output is intended to follow the GNU standards document.
-#: gprof.c:393
+#: gprof.c:394
#, c-format
msgid "GNU gprof %s\n"
msgstr ""
-#: gprof.c:394
+#: gprof.c:395
msgid ""
"Based on BSD gprof, copyright 1983 Regents of the University of California.\n"
msgstr ""
-#: gprof.c:395
+#: gprof.c:396
msgid ""
"This program is free software. This program has absolutely no warranty.\n"
msgstr ""
-#: gprof.c:441
+#: gprof.c:437
+#, c-format
+msgid "%s: unknown demangling style `%s'\n"
+msgstr ""
+
+#: gprof.c:457
#, c-format
msgid ""
"%s: Only one of --function-ordering and --file-ordering may be specified.\n"
msgstr ""
-#: gprof.c:541
+#: gprof.c:557
#, c-format
msgid "%s: sorry, file format `prof' is not yet supported\n"
msgstr ""
-#: gprof.c:602
+#: gprof.c:618
#, c-format
msgid "%s: gmon.out file is missing histogram\n"
msgstr ""
-#: gprof.c:609
+#: gprof.c:625
#, c-format
msgid "%s: gmon.out file is missing call-graph data\n"
msgstr ""
-#: hist.c:143
+#: hist.c:158
#, c-format
msgid "%s: `%s' is incompatible with first gmon file\n"
msgstr ""
-#: hist.c:159
+#: hist.c:174
#, c-format
msgid "%s: %s: unexpected EOF after reading %d of %d samples\n"
msgstr ""
-#: hist.c:381
+#: hist.c:387
#, c-format
msgid "%c%c/call"
msgstr ""
-#: hist.c:389
+#: hist.c:395
msgid ""
" for %.2f%% of %.2f %s\n"
"\n"
msgstr ""
-#: hist.c:395
+#: hist.c:401
#, c-format
msgid ""
"\n"
"Each sample counts as %g %s.\n"
msgstr ""
-#: hist.c:400
+#: hist.c:406
msgid ""
" no time accumulated\n"
"\n"
msgstr ""
-#: hist.c:406
+#: hist.c:413
msgid "cumulative"
msgstr ""
-#: hist.c:406
+#: hist.c:413
msgid "self "
msgstr ""
-#: hist.c:406
+#: hist.c:413
msgid "total "
msgstr ""
-#: hist.c:408
+#: hist.c:415
msgid "time"
msgstr ""
-#: hist.c:408
+#: hist.c:415
msgid "calls"
msgstr ""
-#: hist.c:517
+#: hist.c:504
msgid ""
"\n"
"\n"
@@ -457,16 +456,16 @@ msgid ""
"flat profile:\n"
msgstr ""
-#: hist.c:523
+#: hist.c:510
msgid "Flat profile:\n"
msgstr ""
-#: source.c:140
+#: source.c:163
#, c-format
msgid "%s: could not locate `%s'\n"
msgstr ""
-#: source.c:200
+#: source.c:238
#, c-format
msgid "*** File %s:\n"
msgstr ""
diff --git a/gnu/usr.bin/binutils/intl/ChangeLog b/gnu/usr.bin/binutils/intl/ChangeLog
index d9d86dd7d1a..ecff6f6b2cd 100644
--- a/gnu/usr.bin/binutils/intl/ChangeLog
+++ b/gnu/usr.bin/binutils/intl/ChangeLog
@@ -1,8 +1,3 @@
-2000-06-04 Philippe De Muyter <phdm@macqel.be>
-
- * explodename.c: Include stdlib.h and string.h only if they exist.
- Use strings.h eventually. (already in gettext-0.10.35 since 1998-04-27)
-
1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
* intlh.inst.in: Reformat copyright.
diff --git a/gnu/usr.bin/binutils/intl/explodename.c b/gnu/usr.bin/binutils/intl/explodename.c
index 8066dc29962..37c46e9d7b8 100644
--- a/gnu/usr.bin/binutils/intl/explodename.c
+++ b/gnu/usr.bin/binutils/intl/explodename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify
@@ -19,15 +19,8 @@
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "loadinfo.h"
diff --git a/gnu/usr.bin/binutils/ld/configdoc.texi b/gnu/usr.bin/binutils/ld/configdoc.texi
index 3a367277e50..8d1acad1ef1 100644
--- a/gnu/usr.bin/binutils/ld/configdoc.texi
+++ b/gnu/usr.bin/binutils/ld/configdoc.texi
@@ -5,6 +5,7 @@
@c 2. Specific target machines
@set H8300
@set I960
+@set TICOFF
@c 3. Properties of this configuration
@clear SingleFormat
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
index 8c79b6495da..338b9ceb2e1 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
@@ -4,7 +4,8 @@ OUTPUT_FORMAT="elf32-littlearm"
BIG_OUTPUT_FORMAT="elf32-bigarm"
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
TEXT_START_ADDR=0x8000
-TEMPLATE_NAME=armelf
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
index a85e8bd2b09..d04d967b87a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
@@ -4,7 +4,8 @@ OUTPUT_FORMAT="elf32-littlearm"
BIG_OUTPUT_FORMAT="elf32-bigarm"
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
MAXPAGESIZE=0x8000
-TEMPLATE_NAME=armelf
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
GENERATE_SHLIB_SCRIPT=yes
DATA_START_SYMBOLS='__data_start = . ;';
@@ -12,8 +13,4 @@ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
-# This needs to be high enough so that we can load ld.so below it,
-# yet low enough to stay away from the mmap area at 0x40000000.
-# Also, it is small enough so that relocs which are pointing
-# at absolute 0 will still be fixed up.
-TEXT_START_ADDR=0x02000000
+TEXT_START_ADDR=0x00008000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh b/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
index 5f833ade6dc..24607e5f6ff 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
@@ -9,3 +9,4 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=1K
DATA_LENGTH=0
EEPROM_LENGTH=64
+STACK=0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh b/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
index d8e45df9d4c..e85ef8621a9 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=2K
DATA_LENGTH=128
EEPROM_LENGTH=128
+STACK=0x0DF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh b/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
index 125a2036fd8..179fe1c6765 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=4K
DATA_LENGTH=128
EEPROM_LENGTH=256
+STACK=0x0DF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh b/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
index fb36aecb0ab..07fc57ec06e 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=4K
DATA_LENGTH=256
EEPROM_LENGTH=256
+STACK=0x15F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh b/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
index fef39795b2c..f3700bd8c36 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=8K
DATA_LENGTH=512
EEPROM_LENGTH=512
+STACK=0x25F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
index e727e8ba561..ca5a61e54b5 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
@@ -7,6 +7,6 @@ EMBEDDED=yes
TEMPLATE_NAME=generic
TEXT_LENGTH=128K
-DATA_LENGTH=4K
+DATA_LENGTH=4000
EEPROM_LENGTH=4K
-
+STACK=0x0FFF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
index 6319892b56a..fa5522216e3 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
@@ -1,4 +1,4 @@
-ARCH=avr:4
+ARCH=avr:5
MACHINE=
SCRIPT_NAME=elf32avr
OUTPUT_FORMAT="elf32-avr"
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=16K
DATA_LENGTH=1K
EEPROM_LENGTH=512
+STACK=0x45F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
index 1b7d14b4bde..4d60895650c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
@@ -7,6 +7,6 @@ EMBEDDED=yes
TEMPLATE_NAME=generic
TEXT_LENGTH=64K
-DATA_LENGTH=4K
+DATA_LENGTH=4000
EEPROM_LENGTH=2K
-
+STACK=0x0FFF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/crisaout.sh b/gnu/usr.bin/binutils/ld/emulparams/crisaout.sh
new file mode 100644
index 00000000000..bb9135aa81b
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/crisaout.sh
@@ -0,0 +1,7 @@
+# This is for embedded products and elinux (no MMU) with a.out.
+SCRIPT_NAME=crisaout
+OUTPUT_FORMAT="a.out-cris"
+TARGET_PAGE_SIZE=2
+TEXT_START_ADDR=0
+NONPAGED_TEXT_START_ADDR=0
+ARCH=cris
diff --git a/gnu/usr.bin/binutils/ld/emulparams/criself.sh b/gnu/usr.bin/binutils/ld/emulparams/criself.sh
new file mode 100644
index 00000000000..4acd56a35b5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/criself.sh
@@ -0,0 +1,103 @@
+# This is for embedded products (no MMU) with ELF.
+MACHINE=
+SCRIPT_NAME=elf
+TEMPLATE_NAME=elf32
+
+# Symbols have underscore prepended.
+OUTPUT_FORMAT="elf32-us-cris"
+ARCH=cris
+MAXPAGESIZE=32
+ENTRY=__start
+EMBEDDED=yes
+ALIGNMENT=32
+TEXT_START_ADDR=0
+
+# Put crt0 for flash/eprom etc. in this section.
+INITIAL_READONLY_SECTIONS='.startup : { KEEP(*(.startup)) }'
+
+# TEXT_START_SYMBOLS doesn't get what we want which is the start of
+# all read-only sections; there's at least .init and .fini before it.
+# We have to resort to trickery.
+#
+# The __start dance is to get us through assumptions about entry
+# symbols, and to clear _start for normal use with sane programs.
+EXECUTABLE_SYMBOLS='
+PROVIDE (__Stext = .);
+__start = DEFINED(__start) ? __start :
+ DEFINED(_start) ? _start :
+ DEFINED(start) ? start :
+ DEFINED(.startup) ? .startup + 2 : 2;
+'
+
+# Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
+OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);'
+DATA_START_SYMBOLS='PROVIDE (__Sdata = .);'
+
+# Smuggle an "OTHER_DATA_END_SYMBOLS" here.
+OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);'
+
+# If .bss does not immediately follow .data but has its own start
+# address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we
+# use ADDR(.bss) there. Instead, we use the symbol support for the
+# end symbol.
+OTHER_BSS_END_SYMBOLS='
+ PROVIDE (__Ebss = .);
+ PROVIDE (__end = .);
+ __Sbss = SIZEOF (.sbss) != 0 ? ADDR (.sbss) : ADDR (.bss);
+ PROVIDE (_bss_start = __Sbss);
+'
+
+INIT_START='
+ . = ALIGN(2);
+ ___init__start = .;
+ PROVIDE (___do_global_ctors = .);
+ SHORT (0xe1fc); /* push srp */
+ SHORT (0xbe7e);
+'
+
+INIT_END='
+ SHORT (0x0d3e); /* jump [sp+] */
+ PROVIDE (__init__end = .);
+ PROVIDE (___init__end = .);
+'
+
+FINI_START='
+ . = ALIGN (2);
+ ___fini__start = .;
+ PROVIDE (___do_global_dtors = .);
+ SHORT (0xe1fc); /* push srp */
+ SHORT (0xbe7e);
+'
+
+FINI_END='
+ SHORT (0x0d3e); /* jump [sp+] */
+ PROVIDE (__fini__end = .);
+ ___fini__end = .;
+'
+
+CTOR_START='
+ PROVIDE (___ctors = .);
+ ___elf_ctors_dtors_begin = .;
+'
+
+CTOR_END='
+ PROVIDE (___ctors_end = .);
+'
+
+DTOR_START='
+ PROVIDE (___dtors = .);
+'
+
+CTOR_END='
+ PROVIDE (___dtors_end = .);
+ ___elf_ctors_dtors_end = .;
+'
+
+
+# Smuggle an "OTHER_ALL_END_SYMBOLS" here.
+# Also add the other symbols provided for rsim/xsim and elinux.
+OTHER_RELOCATING_SECTIONS='
+PROVIDE (__Eall = .);
+PROVIDE (__Endmem = 0x10000000);
+PROVIDE (__Stacksize = 0);
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh b/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh
new file mode 100644
index 00000000000..6be4f5803f6
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh
@@ -0,0 +1,41 @@
+# This is an approximation of what we want for a real linux system (with MMU and ELF).
+MACHINE=
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-cris"
+ARCH=cris
+TEMPLATE_NAME=elf32
+
+ENTRY=_start
+
+# Needed? Perhaps should be page-size alignment.
+ALIGNMENT=32
+GENERATE_SHLIB_SCRIPT=yes
+
+# Is this high enough and low enough?
+TEXT_START_ADDR=0x80000
+
+MAXPAGESIZE=8192
+
+# FIXME: GOT, PLT...
+
+# We don't do the hoops through DEFINED to provide [_]*start, as it
+# doesn't work with --gc-sections, and the start-name is pretty fixed
+# anyway.
+TEXT_START_SYMBOLS='PROVIDE (__Stext = .);'
+
+# Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
+OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);'
+DATA_START_SYMBOLS='PROVIDE (__Sdata = .);'
+
+# Smuggle an "OTHER_DATA_END_SYMBOLS" here.
+OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);'
+OTHER_BSS_SYMBOLS='PROVIDE (__Sbss = .);'
+OTHER_BSS_END_SYMBOLS='PROVIDE (__Ebss = .);'
+
+# Smuggle an "OTHER_ALL_END_SYMBOLS" here.
+# Also add the other symbols provided for rsim/xsim and elinux.
+OTHER_RELOCATING_SECTIONS='
+PROVIDE (__Eall = .);
+PROVIDE(__Endmem = 0x10000000);
+PROVIDE(__Stacksize = 0);
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_i860.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_i860.sh
new file mode 100644
index 00000000000..531c493f5c5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_i860.sh
@@ -0,0 +1,8 @@
+# A work in progress...
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i860-little"
+BIG_OUTPUT_FORMAT="elf32-i860"
+LITTLE_OUTPUT_FORMAT="elf32-i860-little"
+PAGE_SIZE=0x1000
+MAXPAGESIZE=0x1000
+ARCH=i860
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh
new file mode 100644
index 00000000000..f6d1cf265be
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh
@@ -0,0 +1,31 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-tradbigmips"
+BIG_OUTPUT_FORMAT="elf32-tradbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
+TEXT_START_ADDR=0x0400000
+DATA_ADDR=0x10000000
+MAXPAGESIZE=0x40000
+NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x0
+TEXT_DYNAMIC=
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+'
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
+ARCH=mips
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh
new file mode 100644
index 00000000000..74959f84136
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh
@@ -0,0 +1,18 @@
+TEMPLATE_NAME=elf32
+# If you change this, please also look at:
+# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
+GENERATE_SHLIB_SCRIPT=yes
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-powerpcle"
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x10000
+ARCH=powerpc
+MACHINE=
+BSS_PLT=
+EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
+OTHER_BSS_END_SYMBOLS='__end = .;'
+OTHER_READWRITE_SECTIONS='
+ .fixup : { *(.fixup) }
+ .got1 : { *(.got1) }
+ .got2 : { *(.got2) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh
new file mode 100644
index 00000000000..90d7d64e896
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh
@@ -0,0 +1,31 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-tradlittlemips"
+BIG_OUTPUT_FORMAT="elf32-tradbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
+TEXT_START_ADDR=0x0400000
+DATA_ADDR=0x10000000
+MAXPAGESIZE=0x40000
+NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x0
+TEXT_DYNAMIC=
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+'
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
+ARCH=mips
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
index b1f7b8c0f9e..2d063873075 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
@@ -33,54 +33,20 @@ GENERATE_SHLIB_SCRIPT=yes
# This code gets inserted into the generic elf32.sc linker script
# and allows us to define our own command line switches.
-PARSE_AND_LIST_ARGS='
-
+PARSE_AND_LIST_PROLOGUE='
#define OPTION_BASE_FILE 300
+'
-#include "getopt.h"
-
-static struct option longopts[] =
-{
+PARSE_AND_LIST_LONGOPTS='
{"base-file", required_argument, NULL, OPTION_BASE_FILE},
- {NULL, no_argument, NULL, 0}
-};
-
-static void
-gld_elf32mcore_list_options (file)
- FILE * file;
-{
- fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
-}
-
-static int
-gld_elf32mcore_parse_args (argc, argv)
- int argc;
- char ** argv;
-{
- int longind;
- int optc;
- int prevoptind = optind;
- int prevopterr = opterr;
- int wanterror;
- static int lastoptind = -1;
-
- if (lastoptind != optind)
- opterr = 0;
-
- wanterror = opterr;
- lastoptind = optind;
-
- optc = getopt_long_only (argc, argv, "-", longopts, & longind);
- opterr = prevopterr;
+'
- switch (optc)
- {
- default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
+PARSE_AND_LIST_OPTIONS='
+ fprintf (file, _(" --base_file <basefile>\n"));
+ fprintf (file, _("\t\t\tGenerate a base file for relocatable DLLs\n"));
+'
+PARSE_AND_LIST_ARGS_CASES='
case OPTION_BASE_FILE:
link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
if (link_info.base_file == NULL)
@@ -91,9 +57,4 @@ gld_elf32mcore_parse_args (argc, argv)
xexit (1);
}
break;
- }
-
- return 1;
-}
-
'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
index 9996c7b6745..7c458a22ca3 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
@@ -1,8 +1,18 @@
TEMPLATE_NAME=elf32
+# If you change this, please also look at:
+# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
GENERATE_SHLIB_SCRIPT=yes
-SCRIPT_NAME=elfppc
+SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x10000000
MAXPAGESIZE=0x10000
ARCH=powerpc
MACHINE=
+BSS_PLT=
+OTHER_RELOCATING_SECTIONS='
+ /DISCARD/ : { *(.fixup) }
+'
+OTHER_READWRITE_SECTIONS='
+ .got1 : { *(.got1) }
+ .got2 : { *(.got2) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh
new file mode 100644
index 00000000000..e25a170dbed
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh
@@ -0,0 +1,18 @@
+TEMPLATE_NAME=elf32
+# If you change this, please also look at:
+# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
+GENERATE_SHLIB_SCRIPT=yes
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-powerpc"
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x10000
+ARCH=powerpc
+MACHINE=
+BSS_PLT=
+EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
+OTHER_BSS_END_SYMBOLS='__end = .;'
+OTHER_READWRITE_SECTIONS='
+ .fixup : { *(.fixup) }
+ .got1 : { *(.got1) }
+ .got2 : { *(.got2) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh
new file mode 100644
index 00000000000..fff59924cb3
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh
@@ -0,0 +1,15 @@
+# See genscripts.sh and ../scripttempl/elf.sc for the meaning of these.
+SCRIPT_NAME=elf
+ELFSIZE=64
+TEMPLATE_NAME=elf32
+OUTPUT_FORMAT="elf64-ia64-little"
+ARCH=ia64
+MACHINE=
+MAXPAGESIZE=0x10000
+TEXT_START_ADDR="0x4000000000000000"
+DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))"
+GENERATE_SHLIB_SCRIPT=yes
+NOP=0x00300000010070000002000001000400 # a bundle full of nops
+OTHER_GOT_SECTIONS='.IA_64.pltoff : { *(.IA_64.pltoff) }'
+OTHER_PLT_RELOC_SECTIONS='.rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }'
+OTHER_READONLY_SECTIONS='.opd : { *(.opd) } .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) }'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh
new file mode 100644
index 00000000000..f3d917cfb76
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh
@@ -0,0 +1,44 @@
+# This is an ELF platform.
+SCRIPT_NAME=elf
+
+# Handle both big- and little-ended 64-bit MIPS objects.
+ARCH=mips
+OUTPUT_FORMAT="elf64-tradbigmips"
+BIG_OUTPUT_FORMAT="elf64-tradbigmips"
+LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
+
+# Note that the elf32 template is used for 64-bit emulations as well
+# as 32-bit emulations.
+ELFSIZE=64
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+TEXT_START_ADDR=0x10000000
+DATA_ADDR=0x0400000000
+MAXPAGESIZE=0x100000
+NONPAGED_TEXT_START_ADDR=0x10000000
+SHLIB_TEXT_START_ADDR=0x0
+TEXT_DYNAMIC=
+ENTRY=__start
+
+# GOT-related settings.
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+'
+
+# Magic symbols.
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+
+# Magic sections.
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh
new file mode 100644
index 00000000000..ac2dcfc76b4
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh
@@ -0,0 +1,44 @@
+# This is an ELF platform.
+SCRIPT_NAME=elf
+
+# Handle both big- and little-ended 64-bit MIPS objects.
+ARCH=mips
+OUTPUT_FORMAT="elf64-tradlittlemips"
+BIG_OUTPUT_FORMAT="elf64-tradbigmips"
+LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
+
+# Note that the elf32 template is used for 64-bit emulations as well
+# as 32-bit emulations.
+ELFSIZE=64
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+TEXT_START_ADDR=0x10000000
+DATA_ADDR=0x0400000000
+MAXPAGESIZE=0x100000
+NONPAGED_TEXT_START_ADDR=0x10000000
+SHLIB_TEXT_START_ADDR=0x0
+TEXT_DYNAMIC=
+ENTRY=__start
+
+# GOT-related settings.
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_GOT_SECTIONS='
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+'
+
+# Magic symbols.
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+
+# Magic sections.
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh
new file mode 100644
index 00000000000..32e7719de6c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh
@@ -0,0 +1,10 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x40000000
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x40000000
+ARCH=i386
+MACHINE=
+NOP=0x9090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh
new file mode 100644
index 00000000000..635748f6388
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh
@@ -0,0 +1,11 @@
+SCRIPT_NAME=elf
+ELFSIZE=64
+OUTPUT_FORMAT="elf64-x86-64"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x100000
+NONPAGED_TEXT_START_ADDR=0x400000
+ARCH=i386
+MACHINE=
+NOP=0x9090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh b/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh
new file mode 100644
index 00000000000..0a982984d01
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh
@@ -0,0 +1,16 @@
+SCRIPT_NAME=elf
+ELFSIZE=32
+OUTPUT_FORMAT="elf32-hppa-linux"
+TEXT_START_ADDR=0x10000
+TARGET_PAGE_SIZE=0x10000
+MAXPAGESIZE=0x10000
+ARCH=hppa
+MACHINE=hppa1.1 # We use 1.1 specific features.
+NOP=0x08000240
+START="_start"
+OTHER_READONLY_SECTIONS='.PARISC.unwind : { *(.PARISC.unwind) } '
+DATA_START_SYMBOLS='PROVIDE ($global$ = .);'
+DATA_PLT=
+GENERATE_SHLIB_SCRIPT=yes
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=hppaelf
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh
new file mode 100644
index 00000000000..2f6713e9dac
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh
@@ -0,0 +1,13 @@
+MACHINE=
+SCRIPT_NAME=elfm68hc11
+OUTPUT_FORMAT="elf32-m68hc11"
+ROM_START_ADDR=0x08000
+ROM_SIZE=0x8000
+RAM_START_ADDR=0x01100
+RAM_SIZE=0x6F00
+TEXT_MEMORY=text
+DATA_MEMORY=data
+ARCH=m68hc11
+MAXPAGESIZE=32
+EMBEDDED=yes
+GENERIC_BOARD=no
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh
new file mode 100644
index 00000000000..0f3016e2974
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh
@@ -0,0 +1,9 @@
+MACHINE=
+SCRIPT_NAME=elfm68hc11
+OUTPUT_FORMAT="elf32-m68hc11"
+TEXT_MEMORY=text
+DATA_MEMORY=data
+ARCH=m68hc11
+MAXPAGESIZE=32
+GENERIC_BOARD=yes
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh
new file mode 100644
index 00000000000..1d9134c17f2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh
@@ -0,0 +1,13 @@
+MACHINE=
+SCRIPT_NAME=elfm68hc12
+OUTPUT_FORMAT="elf32-m68hc12"
+ROM_START_ADDR=0x08000
+ROM_SIZE=0x8000
+RAM_START_ADDR=0x01100
+RAM_SIZE=0x6F00
+TEXT_MEMORY=text
+DATA_MEMORY=data
+ARCH=m68hc12
+MAXPAGESIZE=32
+EMBEDDED=yes
+GENERIC_BOARD=no
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh
new file mode 100644
index 00000000000..211978a3269
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh
@@ -0,0 +1,9 @@
+MACHINE=
+SCRIPT_NAME=elfm68hc12
+OUTPUT_FORMAT="elf32-m68hc12"
+TEXT_MEMORY=text
+DATA_MEMORY=data
+ARCH=m68hc12
+MAXPAGESIZE=32
+GENERIC_BOARD=yes
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mipspe.sh b/gnu/usr.bin/binutils/ld/emulparams/mipspe.sh
index 34674526c51..9dd9ce761ef 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/mipspe.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/mipspe.sh
@@ -6,3 +6,4 @@ RELOCATEABLE_OUTPUT_FORMAT="ecoff-littlemips"
TEMPLATE_NAME=pe
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
+ENTRY="_mainCRTStartup"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh
new file mode 100644
index 00000000000..d7b7631fe63
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh
@@ -0,0 +1,14 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-shbig-linux"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x10000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+
+OTHER_READWRITE_SECTIONS='
+ .note.ABI-tag : { *(.note.ABI-tag) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh
new file mode 100644
index 00000000000..191def73bf9
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh
@@ -0,0 +1,14 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-sh-linux"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x10000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+
+OTHER_READWRITE_SECTIONS='
+ .note.ABI-tag : { *(.note.ABI-tag) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shpe.sh b/gnu/usr.bin/binutils/ld/emulparams/shpe.sh
index 2f8664ccddc..44aeef33be4 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shpe.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shpe.sh
@@ -4,3 +4,6 @@ OUTPUT_FORMAT="pei-shl"
TEMPLATE_NAME=pe
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
+ENTRY="_mainCRTStartup"
+SUBSYSTEM=PE_DEF_SUBSYSTEM
+INITIAL_SYMBOL_CHAR=\"_\"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/tic54xcoff.sh b/gnu/usr.bin/binutils/ld/emulparams/tic54xcoff.sh
new file mode 100644
index 00000000000..70c1ee2ce60
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/tic54xcoff.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=tic54xcoff
+OUTPUT_FORMAT="coff1-c54x"
+ARCH=tic54x
+ENTRY=_c_int00
+TEXT_START_ADDR=0x0080
+TARGET_PAGE_SIZE=0x1000
+TEMPLATE_NAME=ticoff
+OUTPUT_FORMAT_TEMPLATE=tic54x
diff --git a/gnu/usr.bin/binutils/ld/emultempl/armcoff.em b/gnu/usr.bin/binutils/ld/emultempl/armcoff.em
index d73b3d172fb..ab7084351cb 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/armcoff.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/armcoff.em
@@ -4,7 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -32,12 +33,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ld.h"
#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
#include "ldmisc.h"
#include "ldexp.h"
#include "ldlang.h"
+#include "ldfile.h"
+#include "ldemul.h"
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
diff --git a/gnu/usr.bin/binutils/ld/emultempl/armelf.em b/gnu/usr.bin/binutils/ld/emultempl/armelf.em
index 9abf7f1655c..0d1b8ed9b15 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/armelf.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/armelf.em
@@ -1,137 +1,32 @@
# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-ELFSIZE=32
-cat >e${EMULATION_NAME}.c <<EOF
-/* This file is is generated by a shell script. DO NOT EDIT! */
-
-/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
- Written by Steve Chamberlain steve@cygnus.com
-
-This file is part of GLD, the Gnu Linker.
-
-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. */
-
-#define TARGET_IS_${EMULATION_NAME}
-
-#include "bfd.h"
-#include "sysdep.h"
-
-#include <ctype.h>
-
-#include "bfdlink.h"
-#include "getopt.h"
-
-#include "ld.h"
-#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
-#include "ldmisc.h"
-
-#include "ldexp.h"
-#include "ldlang.h"
-#include "ldgram.h"
-
-static boolean gld${EMULATION_NAME}_open_dynamic_archive
- PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
-static void gld${EMULATION_NAME}_after_open PARAMS ((void));
-static void gld${EMULATION_NAME}_check_needed
- PARAMS ((lang_input_statement_type *));
-static void gld${EMULATION_NAME}_stat_needed
- PARAMS ((lang_input_statement_type *));
-static boolean gld${EMULATION_NAME}_search_needed
- PARAMS ((const char *, const char *, int));
-static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int));
-static void gld${EMULATION_NAME}_vercheck
- PARAMS ((lang_input_statement_type *));
-static void gld${EMULATION_NAME}_find_statement_assignment
- PARAMS ((lang_statement_union_type *));
-static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *));
-static boolean gld${EMULATION_NAME}_place_orphan
- PARAMS ((lang_input_statement_type *, asection *));
-static void gld${EMULATION_NAME}_place_section
- PARAMS ((lang_statement_union_type *));
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-static int gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
-static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
-static void gld${EMULATION_NAME}_finish PARAMS ((void));
+# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# This file is sourced from elf32.em, and defines extra arm-elf
+# specific routines.
+#
+cat >>e${EMULATION_NAME}.c <<EOF
-
static int no_pipeline_knowledge = 0;
-static char * thumb_entry_symbol = NULL;
-
-#define OPTION_THUMB_ENTRY 301
+static char *thumb_entry_symbol = NULL;
-static struct option longopts[] =
-{
- { "no-pipeline-knowledge", no_argument, NULL, 'p'},
- { "thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
- { NULL, no_argument, NULL, 0 }
-};
-
-static void
-gld${EMULATION_NAME}_list_options (file)
- FILE * file;
-{
- fprintf (file, _(" -p --no-pipeline-knowledge Stop the linker knowing about the pipeline length\n"));
- fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
-}
-
-static int
-gld${EMULATION_NAME}_parse_args (argc, argv)
- int argc;
- char ** argv;
-{
- int longind;
- int optc;
- int prevoptind = optind;
- int prevopterr = opterr;
- int wanterror;
- static int lastoptind = -1;
-
- if (lastoptind != optind)
- opterr = 0;
-
- wanterror = opterr;
- lastoptind = optind;
-
- optc = getopt_long_only (argc, argv, "-p", longopts, & longind);
- opterr = prevopterr;
-
- switch (optc)
- {
- default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
-
- case 'p':
- no_pipeline_knowledge = 1;
- break;
-
- case OPTION_THUMB_ENTRY:
- thumb_entry_symbol = optarg;
- break;
- }
-
- return 1;
-}
-
static void
gld${EMULATION_NAME}_before_parse ()
@@ -143,174 +38,12 @@ gld${EMULATION_NAME}_before_parse ()
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
}
-/* Try to open a dynamic archive. This is where we know that ELF
- dynamic libraries have an extension of .so. */
-static boolean
-gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
- const char *arch;
- search_dirs_type *search;
- lang_input_statement_type *entry;
-{
- const char *filename;
- char *string;
-
- if (! entry->is_archive)
- return false;
-
- filename = entry->filename;
-
- string = (char *) xmalloc (strlen (search->name)
- + strlen (filename)
- + strlen (arch)
- + sizeof "/lib.so");
-
- sprintf (string, "%s/lib%s%s.so", search->name, filename, arch);
-
- if (! ldfile_try_open_bfd (string, entry))
- {
- free (string);
- return false;
- }
-
- entry->filename = string;
-
- /* We have found a dynamic object to include in the link. The ELF
- backend linker will create a DT_NEEDED entry in the .dynamic
- section naming this file. If this file includes a DT_SONAME
- entry, it will be used. Otherwise, the ELF linker will just use
- the name of the file. For an archive found by searching, like
- this one, the DT_NEEDED entry should consist of just the name of
- the file, without the path information used to find it. Note
- that we only need to do this if we have a dynamic object; an
- archive will never be referenced by a DT_NEEDED entry.
-
- FIXME: This approach--using bfd_elf_set_dt_needed_name--is not
- very pretty. I haven't been able to think of anything that is
- pretty, though. */
- if (bfd_check_format (entry->the_bfd, bfd_object)
- && (entry->the_bfd->flags & DYNAMIC) != 0)
- {
- char *needed_name;
-
- ASSERT (entry->is_archive && entry->search_dirs_flag);
- needed_name = (char *) xmalloc (strlen (filename)
- + strlen (arch)
- + sizeof "lib.so");
- sprintf (needed_name, "lib%s%s.so", filename, arch);
- bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
- }
-
- return true;
-}
-
-EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
-cat >>e${EMULATION_NAME}.c <<EOF
-
-/* For a native linker, check the file /etc/ld.so.conf for directories
- in which we may find shared libraries. /etc/ld.so.conf is really
- only meaningful on Linux, but we check it on other systems anyhow. */
-
-static boolean gld${EMULATION_NAME}_check_ld_so_conf
- PARAMS ((const char *, int));
-
-static boolean
-gld${EMULATION_NAME}_check_ld_so_conf (name, force)
- const char *name;
- int force;
-{
- static boolean initialized;
- static char *ld_so_conf;
-
- if (! initialized)
- {
- FILE *f;
-
- f = fopen ("/etc/ld.so.conf", FOPEN_RT);
- if (f != NULL)
- {
- char *b;
- size_t len, alloc;
- int c;
-
- len = 0;
- alloc = 100;
- b = (char *) xmalloc (alloc);
-
- while ((c = getc (f)) != EOF)
- {
- if (len + 1 >= alloc)
- {
- alloc *= 2;
- b = (char *) xrealloc (b, alloc);
- }
- if (c != ':'
- && c != ' '
- && c != '\t'
- && c != '\n'
- && c != ',')
- {
- b[len] = c;
- ++len;
- }
- else
- {
- if (len > 0 && b[len - 1] != ':')
- {
- b[len] = ':';
- ++len;
- }
- }
- }
-
- if (len > 0 && b[len - 1] == ':')
- --len;
-
- if (len > 0)
- b[len] = '\0';
- else
- {
- free (b);
- b = NULL;
- }
-
- fclose (f);
-
- ld_so_conf = b;
- }
-
- initialized = true;
- }
-
- if (ld_so_conf == NULL)
- return false;
-
- return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
-}
-
-EOF
- ;;
- esac
-fi
-cat >>e${EMULATION_NAME}.c <<EOF
-
-/* These variables are required to pass information back and forth
- between after_open and check_needed and stat_needed and vercheck. */
-
-static struct bfd_link_needed_list *global_needed;
-static struct stat global_stat;
-static boolean global_found;
-static struct bfd_link_needed_list *global_vercheck_needed;
-static boolean global_vercheck_failed;
+static void arm_elf_after_open PARAMS((void));
static void
-gld${EMULATION_NAME}_after_open ()
+arm_elf_after_open ()
{
- struct bfd_link_needed_list *needed, *l;
-
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
{
/* The arm backend needs special fields in the output hash structure.
@@ -330,819 +63,20 @@ gld${EMULATION_NAME}_after_open ()
}
}
- /* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || link_info.shared)
- return;
-
- /* Get the list of files which appear in DT_NEEDED entries in
- dynamic objects included in the link (often there will be none).
- For each such file, we want to track down the corresponding
- library, and include the symbol table in the link. This is what
- the runtime dynamic linker will do. Tracking the files down here
- permits one dynamic object to include another without requiring
- special action by the person doing the link. Note that the
- needed list can actually grow while we are stepping through this
- loop. */
- needed = bfd_elf_get_needed_list (output_bfd, &link_info);
- for (l = needed; l != NULL; l = l->next)
- {
- struct bfd_link_needed_list *ll;
- int force;
-
- /* If we've already seen this file, skip it. */
- for (ll = needed; ll != l; ll = ll->next)
- if (strcmp (ll->name, l->name) == 0)
- break;
- if (ll != l)
- continue;
-
- /* See if this file was included in the link explicitly. */
- global_needed = l;
- global_found = false;
- lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
- if (global_found)
- continue;
-
- /* We need to find this file and include the symbol table. We
- want to search for the file in the same way that the dynamic
- linker will search. That means that we want to use
- rpath_link, rpath, then the environment variable
- LD_LIBRARY_PATH (native only), then the linker script
- LIB_SEARCH_DIRS. We do not search using the -L arguments.
-
- We search twice. The first time, we skip objects which may
- introduce version mismatches. The second time, we force
- their use. See gld${EMULATION_NAME}_vercheck comment. */
- for (force = 0; force < 2; force++)
- {
- const char *lib_path;
- size_t len;
- search_dirs_type *search;
-
- if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
- l->name, force))
- break;
- if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
- l->name, force))
- break;
- if (command_line.rpath_link == NULL
- && command_line.rpath == NULL)
- {
- lib_path = (const char *) getenv ("LD_RUN_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
- force))
- break;
- }
-EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
-cat >>e${EMULATION_NAME}.c <<EOF
- lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
- break;
-EOF
- ;;
- esac
-fi
-cat >>e${EMULATION_NAME}.c <<EOF
- len = strlen (l->name);
- for (search = search_head; search != NULL; search = search->next)
- {
- char *filename;
-
- if (search->cmdline)
- continue;
- filename = (char *) xmalloc (strlen (search->name) + len + 2);
- sprintf (filename, "%s/%s", search->name, l->name);
- if (gld${EMULATION_NAME}_try_needed (filename, force))
- break;
- free (filename);
- }
- if (search != NULL)
- break;
-EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
-cat >>e${EMULATION_NAME}.c <<EOF
- if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
- break;
-EOF
- ;;
- esac
-fi
-cat >>e${EMULATION_NAME}.c <<EOF
- }
-
- if (force < 2)
- continue;
-
- einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
- l->name, l->by);
- }
-}
-
-/* Search for a needed file in a path. */
-
-static boolean
-gld${EMULATION_NAME}_search_needed (path, name, force)
- const char *path;
- const char *name;
- int force;
-{
- const char *s;
- size_t len;
-
- if (path == NULL || *path == '\0')
- return false;
- len = strlen (name);
- while (1)
- {
- char *filename, *sset;
-
- s = strchr (path, ':');
- if (s == NULL)
- s = path + strlen (path);
-
- filename = (char *) xmalloc (s - path + len + 2);
- if (s == path)
- sset = filename;
- else
- {
- memcpy (filename, path, s - path);
- filename[s - path] = '/';
- sset = filename + (s - path) + 1;
- }
- strcpy (sset, name);
-
- if (gld${EMULATION_NAME}_try_needed (filename, force))
- return true;
-
- free (filename);
-
- if (*s == '\0')
- break;
- path = s + 1;
- }
-
- return false;
-}
-
-/* This function is called for each possible name for a dynamic object
- named by a DT_NEEDED entry. The FORCE parameter indicates whether
- to skip the check for a conflicting version. */
-
-static boolean
-gld${EMULATION_NAME}_try_needed (name, force)
- const char *name;
- int force;
-{
- bfd *abfd;
-
- abfd = bfd_openr (name, bfd_get_target (output_bfd));
- if (abfd == NULL)
- return false;
- if (! bfd_check_format (abfd, bfd_object))
- {
- (void) bfd_close (abfd);
- return false;
- }
- if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
- {
- (void) bfd_close (abfd);
- return false;
- }
-
- /* Check whether this object would include any conflicting library
- versions. If FORCE is set, then we skip this check; we use this
- the second time around, if we couldn't find any compatible
- instance of the shared library. */
-
- if (! force)
- {
- struct bfd_link_needed_list *needed;
-
- if (! bfd_elf_get_bfd_needed_list (abfd, &needed))
- einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd);
-
- if (needed != NULL)
- {
- global_vercheck_needed = needed;
- global_vercheck_failed = false;
- lang_for_each_input_file (gld${EMULATION_NAME}_vercheck);
- if (global_vercheck_failed)
- {
- (void) bfd_close (abfd);
- /* Return false to force the caller to move on to try
- another file on the search path. */
- return false;
- }
-
- /* But wait! It gets much worse. On Linux, if a shared
- library does not use libc at all, we are supposed to skip
- it the first time around in case we encounter a shared
- library later on with the same name which does use the
- version of libc that we want. This is much too horrible
- to use on any system other than Linux. */
-
-EOF
-case ${target} in
- *-*-linux-gnu*)
- cat >>e${EMULATION_NAME}.c <<EOF
- {
- struct bfd_link_needed_list *l;
-
- for (l = needed; l != NULL; l = l->next)
- if (strncmp (l->name, "libc.so", 7) == 0)
- break;
- if (l == NULL)
- {
- (void) bfd_close (abfd);
- return false;
- }
- }
-
-EOF
- ;;
-esac
-cat >>e${EMULATION_NAME}.c <<EOF
- }
- }
-
- /* We've found a dynamic object matching the DT_NEEDED entry. */
-
- /* We have already checked that there is no other input file of the
- same name. We must now check again that we are not including the
- same file twice. We need to do this because on many systems
- libc.so is a symlink to, e.g., libc.so.1. The SONAME entry will
- reference libc.so.1. If we have already included libc.so, we
- don't want to include libc.so.1 if they are the same file, and we
- can only check that using stat. */
-
- if (bfd_stat (abfd, &global_stat) != 0)
- einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd);
- global_found = false;
- lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed);
- if (global_found)
- {
- /* Return true to indicate that we found the file, even though
- we aren't going to do anything with it. */
- return true;
- }
-
- /* Tell the ELF backend that don't want the output file to have a
- DT_NEEDED entry for this file. */
- bfd_elf_set_dt_needed_name (abfd, "");
-
- /* Add this file into the symbol table. */
- if (! bfd_link_add_symbols (abfd, &link_info))
- einfo ("%F%B: could not read symbols: %E\n", abfd);
-
- return true;
-}
-
-/* See if an input file matches a DT_NEEDED entry by name. */
-
-static void
-gld${EMULATION_NAME}_check_needed (s)
- lang_input_statement_type *s;
-{
- if (global_found)
- return;
-
- if (s->filename != NULL
- && strcmp (s->filename, global_needed->name) == 0)
- {
- global_found = true;
- return;
- }
-
- if (s->the_bfd != NULL)
- {
- const char *soname;
-
- soname = bfd_elf_get_dt_soname (s->the_bfd);
- if (soname != NULL
- && strcmp (soname, global_needed->name) == 0)
- {
- global_found = true;
- return;
- }
- }
-
- if (s->search_dirs_flag
- && s->filename != NULL
- && strchr (global_needed->name, '/') == NULL)
- {
- const char *f;
-
- f = strrchr (s->filename, '/');
- if (f != NULL
- && strcmp (f + 1, global_needed->name) == 0)
- {
- global_found = true;
- return;
- }
- }
+ /* Call the standard elf routine. */
+ gld${EMULATION_NAME}_after_open ();
}
-/* See if an input file matches a DT_NEEDED entry by running stat on
- the file. */
-static void
-gld${EMULATION_NAME}_stat_needed (s)
- lang_input_statement_type *s;
-{
- struct stat st;
- const char *suffix;
- const char *soname;
- const char *f;
-
- if (global_found)
- return;
- if (s->the_bfd == NULL)
- return;
-
- if (bfd_stat (s->the_bfd, &st) != 0)
- {
- einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
- return;
- }
-
- if (st.st_dev == global_stat.st_dev
- && st.st_ino == global_stat.st_ino)
- {
- global_found = true;
- return;
- }
-
- /* We issue a warning if it looks like we are including two
- different versions of the same shared library. For example,
- there may be a problem if -lc picks up libc.so.6 but some other
- shared library has a DT_NEEDED entry of libc.so.5. This is a
- hueristic test, and it will only work if the name looks like
- NAME.so.VERSION. FIXME: Depending on file names is error-prone.
- If we really want to issue warnings about mixing version numbers
- of shared libraries, we need to find a better way. */
-
- if (strchr (global_needed->name, '/') != NULL)
- return;
- suffix = strstr (global_needed->name, ".so.");
- if (suffix == NULL)
- return;
- suffix += sizeof ".so." - 1;
-
- soname = bfd_elf_get_dt_soname (s->the_bfd);
- if (soname == NULL)
- soname = s->filename;
-
- f = strrchr (soname, '/');
- if (f != NULL)
- ++f;
- else
- f = soname;
-
- if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0)
- einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
- global_needed->name, global_needed->by, f);
-}
-
-/* On Linux, it's possible to have different versions of the same
- shared library linked against different versions of libc. The
- dynamic linker somehow tags which libc version to use in
- /etc/ld.so.cache, and, based on the libc that it sees in the
- executable, chooses which version of the shared library to use.
-
- We try to do a similar check here by checking whether this shared
- library needs any other shared libraries which may conflict with
- libraries we have already included in the link. If it does, we
- skip it, and try to find another shared library farther on down the
- link path.
-
- This is called via lang_for_each_input_file.
- GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object
- which we ar checking. This sets GLOBAL_VERCHECK_FAILED if we find
- a conflicting version. */
+static void arm_elf_before_allocation PARAMS ((void));
static void
-gld${EMULATION_NAME}_vercheck (s)
- lang_input_statement_type *s;
+arm_elf_before_allocation ()
{
- const char *soname, *f;
- struct bfd_link_needed_list *l;
-
- if (global_vercheck_failed)
- return;
- if (s->the_bfd == NULL
- || (bfd_get_file_flags (s->the_bfd) & DYNAMIC) == 0)
- return;
-
- soname = bfd_elf_get_dt_soname (s->the_bfd);
- if (soname == NULL)
- soname = bfd_get_filename (s->the_bfd);
-
- f = strrchr (soname, '/');
- if (f != NULL)
- ++f;
- else
- f = soname;
-
- for (l = global_vercheck_needed; l != NULL; l = l->next)
- {
- const char *suffix;
-
- if (strcmp (f, l->name) == 0)
- {
- /* Probably can't happen, but it's an easy check. */
- continue;
- }
-
- if (strchr (l->name, '/') != NULL)
- continue;
-
- suffix = strstr (l->name, ".so.");
- if (suffix == NULL)
- continue;
+ /* Call the standard elf routine. */
+ gld${EMULATION_NAME}_before_allocation ();
- suffix += sizeof ".so." - 1;
-
- if (strncmp (f, l->name, suffix - l->name) == 0)
- {
- /* Here we know that S is a dynamic object FOO.SO.VER1, and
- the object we are considering needs a dynamic object
- FOO.SO.VER2, and VER1 and VER2 are different. This
- appears to be a version mismatch, so we tell the caller
- to try a different version of this library. */
- global_vercheck_failed = true;
- return;
- }
- }
-}
-
-/* Place an orphan section. We use this to put random SHF_ALLOC
- sections in the right segment. */
-
-static asection *hold_section;
-static lang_output_section_statement_type *hold_use;
-static lang_output_section_statement_type *hold_text;
-static lang_output_section_statement_type *hold_rodata;
-static lang_output_section_statement_type *hold_data;
-static lang_output_section_statement_type *hold_bss;
-static lang_output_section_statement_type *hold_rel;
-static lang_output_section_statement_type *hold_interp;
-
-/*ARGSUSED*/
-static boolean
-gld${EMULATION_NAME}_place_orphan (file, s)
- lang_input_statement_type *file;
- asection *s;
-{
- lang_output_section_statement_type *place;
- asection *snew, **pps;
- lang_statement_list_type *old;
- lang_statement_list_type add;
- etree_type *address;
- const char *secname, *ps;
- const char *outsecname;
- lang_output_section_statement_type *os;
-
- if ((s->flags & SEC_ALLOC) == 0)
- return false;
-
- /* Look through the script to see where to place this section. */
- hold_section = s;
- hold_use = NULL;
- lang_for_each_statement (gld${EMULATION_NAME}_place_section);
-
- if (hold_use != NULL)
- {
- /* We have already placed a section with this name. */
- wild_doit (&hold_use->children, s, hold_use, file);
- return true;
- }
-
- secname = bfd_get_section_name (s->owner, s);
-
- /* If this is a final link, then always put .gnu.warning.SYMBOL
- sections into the .text section to get them out of the way. */
- if (! link_info.shared
- && ! link_info.relocateable
- && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
- && hold_text != NULL)
- {
- wild_doit (&hold_text->children, s, hold_text, file);
- return true;
- }
-
- /* Decide which segment the section should go in based on the
- section name and section flags. We put loadable .note sections
- right after the .interp section, so that the PT_NOTE segment is
- stored right after the program headers where the OS can read it
- in the first page. */
- place = NULL;
- if (s->flags & SEC_EXCLUDE)
- return false;
- else if ((s->flags & SEC_LOAD) != 0
- && strncmp (secname, ".note", 4) == 0
- && hold_interp != NULL)
- place = hold_interp;
- else if ((s->flags & SEC_HAS_CONTENTS) == 0
- && hold_bss != NULL)
- place = hold_bss;
- else if ((s->flags & SEC_READONLY) == 0
- && hold_data != NULL)
- place = hold_data;
- else if (strncmp (secname, ".rel", 4) == 0
- && hold_rel != NULL)
- place = hold_rel;
- else if ((s->flags & SEC_CODE) == 0
- && (s->flags & SEC_READONLY) != 0
- && hold_rodata != NULL)
- place = hold_rodata;
- else if ((s->flags & SEC_READONLY) != 0
- && hold_text != NULL)
- place = hold_text;
- if (place == NULL)
- return false;
-
- /* Choose a unique name for the section. This will be needed if the
- same section name appears in the input file with different
- loadable or allocateable characteristics. */
- outsecname = secname;
- if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
- {
- unsigned int len;
- char *newname;
- unsigned int i;
-
- len = strlen (outsecname);
- newname = xmalloc (len + 5);
- strcpy (newname, outsecname);
- i = 0;
- do
- {
- sprintf (newname + len, "%d", i);
- ++i;
- }
- while (bfd_get_section_by_name (output_bfd, newname) != NULL);
-
- outsecname = newname;
- }
-
- /* Create the section in the output file, and put it in the right
- place. This shuffling is to make the output file look neater. */
- snew = bfd_make_section (output_bfd, outsecname);
- if (snew == NULL)
- einfo ("%P%F: output format %s cannot represent section called %s\n",
- output_bfd->xvec->name, outsecname);
- if (place->bfd_section != NULL)
- {
- for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
- ;
- *pps = snew->next;
- snew->next = place->bfd_section->next;
- place->bfd_section->next = snew;
- }
-
- /* Start building a list of statements for this section. */
- old = stat_ptr;
- stat_ptr = &add;
- lang_list_init (stat_ptr);
-
- /* If the name of the section is representable in C, then create
- symbols to mark the start and the end of the section. */
- for (ps = outsecname; *ps != '\0'; ps++)
- if (! isalnum ((unsigned char) *ps) && *ps != '_')
- break;
- if (*ps == '\0' && config.build_constructors)
- {
- char *symname;
-
- symname = (char *) xmalloc (ps - outsecname + sizeof "__start_");
- sprintf (symname, "__start_%s", outsecname);
- lang_add_assignment (exp_assop ('=', symname,
- exp_unop (ALIGN_K,
- exp_intop ((bfd_vma) 1
- << s->alignment_power))));
- }
-
- if (! link_info.relocateable)
- address = NULL;
- else
- address = exp_intop ((bfd_vma) 0);
-
- lang_enter_output_section_statement (outsecname, address, 0,
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
- (etree_type *) NULL);
-
- os = lang_output_section_statement_lookup (outsecname);
- wild_doit (&os->children, s, os, file);
-
- lang_leave_output_section_statement
- ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL,
- "*default*");
- stat_ptr = &add;
-
- if (*ps == '\0' && config.build_constructors)
- {
- char *symname;
-
- symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_");
- sprintf (symname, "__stop_%s", outsecname);
- lang_add_assignment (exp_assop ('=', symname,
- exp_nameop (NAME, ".")));
- }
-
- /* Now stick the new statement list right after PLACE. */
- *add.tail = place->header.next;
- place->header.next = add.head;
-
- stat_ptr = old;
-
- return true;
-}
-
-static void
-gld${EMULATION_NAME}_place_section (s)
- lang_statement_union_type *s;
-{
- lang_output_section_statement_type *os;
-
- if (s->header.type != lang_output_section_statement_enum)
- return;
-
- os = &s->output_section_statement;
-
- if (strcmp (os->name, hold_section->name) == 0
- && os->bfd_section != NULL
- && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC))
- == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC))))
- hold_use = os;
-
- if (strcmp (os->name, ".text") == 0)
- hold_text = os;
- else if (strcmp (os->name, ".rodata") == 0)
- hold_rodata = os;
- else if (strcmp (os->name, ".data") == 0)
- hold_data = os;
- else if (strcmp (os->name, ".bss") == 0)
- hold_bss = os;
- else if (hold_rel == NULL
- && os->bfd_section != NULL
- && (os->bfd_section->flags & SEC_ALLOC) != 0
- && strncmp (os->name, ".rel", 4) == 0)
- hold_rel = os;
- else if (strcmp (os->name, ".interp") == 0)
- hold_interp = os;
-}
-
-/* Look through an expression for an assignment statement. */
-
-static void
-gld${EMULATION_NAME}_find_exp_assignment (exp)
- etree_type *exp;
-{
- struct bfd_link_hash_entry *h;
-
- switch (exp->type.node_class)
- {
- case etree_provide:
- h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
- false, false, false);
- if (h == NULL)
- break;
-
- /* We call record_link_assignment even if the symbol is defined.
- This is because if it is defined by a dynamic object, we
- actually want to use the value defined by the linker script,
- not the value from the dynamic object (because we are setting
- symbols like etext). If the symbol is defined by a regular
- object, then, as it happens, calling record_link_assignment
- will do no harm. */
-
- /* Fall through. */
- case etree_assign:
- if (strcmp (exp->assign.dst, ".") != 0)
- {
- if (! (bfd_elf${ELFSIZE}_record_link_assignment
- (output_bfd, &link_info, exp->assign.dst,
- exp->type.node_class == etree_provide ? true : false)))
- einfo ("%P%F: failed to record assignment to %s: %E\n",
- exp->assign.dst);
- }
- gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
- break;
-
- case etree_binary:
- gld${EMULATION_NAME}_find_exp_assignment (exp->binary.lhs);
- gld${EMULATION_NAME}_find_exp_assignment (exp->binary.rhs);
- break;
-
- case etree_trinary:
- gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.cond);
- gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.lhs);
- gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.rhs);
- break;
-
- case etree_unary:
- gld${EMULATION_NAME}_find_exp_assignment (exp->unary.child);
- break;
-
- default:
- break;
- }
-}
-
-/* This is called by the before_allocation routine via
- lang_for_each_statement. It locates any assignment statements, and
- tells the ELF backend about them, in case they are assignments to
- symbols which are referred to by dynamic objects. */
-
-static void
-gld${EMULATION_NAME}_find_statement_assignment (s)
- lang_statement_union_type *s;
-{
- if (s->header.type == lang_assignment_statement_enum)
- gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
-}
-
-/* This is called after the sections have been attached to output
- sections, but before any sizes or addresses have been set. */
-
-static void
-gld${EMULATION_NAME}_before_allocation ()
-{
- const char *rpath;
- asection *sinterp;
-
- /* If we are going to make any variable assignments, we need to let
- the ELF backend know about them in case the variables are
- referred to by dynamic objects. */
- lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);
-
- /* Let the ELF backend work out the sizes of any sections required
- by dynamic linking. */
- rpath = command_line.rpath;
- if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
- if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
- (output_bfd, command_line.soname, rpath,
- command_line.export_dynamic, command_line.filter_shlib,
- (const char * const *) command_line.auxiliary_filters,
- &link_info, &sinterp, lang_elf_version_info)))
- einfo ("%P%F: failed to set dynamic section sizes: %E\n");
-
- /* Let the user override the dynamic linker we are using. */
- if (command_line.interpreter != NULL
- && sinterp != NULL)
- {
- sinterp->contents = (bfd_byte *) command_line.interpreter;
- sinterp->_raw_size = strlen (command_line.interpreter) + 1;
- }
-
- /* Look for any sections named .gnu.warning. As a GNU extensions,
- we treat such sections as containing warning messages. We print
- out the warning message, and then zero out the section size so
- that it does not get copied into the output file. */
-
- {
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- asection *s;
- bfd_size_type sz;
- char *msg;
- boolean ret;
-
- if (is->just_syms_flag)
- continue;
-
- s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
- if (s == NULL)
- continue;
-
- sz = bfd_section_size (is->the_bfd, s);
- msg = xmalloc ((size_t) sz + 1);
- if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
- einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
- is->the_bfd);
- msg[sz] = '\0';
- ret = link_info.callbacks->warning (&link_info, msg,
- (const char *) NULL,
- is->the_bfd, (asection *) NULL,
- (bfd_vma) 0);
- ASSERT (ret);
- free (msg);
-
- /* Clobber the section size, so that we don't waste copying the
- warning into the output file. */
- s->_raw_size = 0;
- }
- }
-
- /* we should be able to set the size of the interworking stub section */
+ /* We should be able to set the size of the interworking stub section */
/* Here we rummage through the found bfds to collect glue information */
/* FIXME: should this be based on a command line option? krk@cygnus.com */
@@ -1162,6 +96,9 @@ gld${EMULATION_NAME}_before_allocation ()
bfd_elf32_arm_allocate_interworking_sections (& link_info);
}
+
+static void gld${EMULATION_NAME}_finish PARAMS ((void));
+
static void
gld${EMULATION_NAME}_finish PARAMS((void))
{
@@ -1170,7 +107,8 @@ gld${EMULATION_NAME}_finish PARAMS((void))
if (thumb_entry_symbol == NULL)
return;
- h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+ h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
+ false, false, true);
if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
@@ -1202,92 +140,48 @@ gld${EMULATION_NAME}_finish PARAMS((void))
entry_symbol = buffer;
}
else
- einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol);
+ einfo (_("%P: warning: connot find thumb start symbol %s\n"),
+ thumb_entry_symbol);
}
-static char *
-gld${EMULATION_NAME}_get_script (isfile)
- int *isfile;
EOF
-if test -n "$COMPILE_IN"
-then
-# Scripts compiled in.
+# Define some shell vars to insert bits of code into the standard elf
+# parse_args and list_options functions.
+#
+PARSE_AND_LIST_PROLOGUE='
+#define OPTION_THUMB_ENTRY 301
+'
-# sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
+PARSE_AND_LIST_SHORTOPTS=p
-cat >>e${EMULATION_NAME}.c <<EOF
-{
- *isfile = 0;
-
- if (link_info.relocateable == true && config.build_constructors == true)
- return
-EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-if test -n "$GENERATE_SHLIB_SCRIPT" ; then
- echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c
- sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c
-fi
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+PARSE_AND_LIST_LONGOPTS='
+ { "no-pipeline-knowledge", no_argument, NULL, '\'p\''},
+ { "thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+'
-else
-# Scripts read from the filesystem.
+PARSE_AND_LIST_OPTIONS='
+ fprintf (file, _(" -p --no-pipeline-knowledge Stop the linker knowing about the pipeline length\n"));
+ fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
+'
-cat >>e${EMULATION_NAME}.c <<EOF
-{
- *isfile = 1;
+PARSE_AND_LIST_ARGS_CASES='
+ case '\'p\'':
+ no_pipeline_knowledge = 1;
+ break;
- if (link_info.relocateable == true && config.build_constructors == true)
- return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
- return "ldscripts/${EMULATION_NAME}.xr";
- else if (!config.text_read_only)
- return "ldscripts/${EMULATION_NAME}.xbn";
- else if (!config.magic_demand_paged)
- return "ldscripts/${EMULATION_NAME}.xn";
- else if (link_info.shared)
- return "ldscripts/${EMULATION_NAME}.xs";
- else
- return "ldscripts/${EMULATION_NAME}.x";
-}
-EOF
+ case OPTION_THUMB_ENTRY:
+ thumb_entry_symbol = optarg;
+ break;
+'
-fi
+# We have our own after_open and before_allocation functions, but they call
+# the standard routines, so give them a different name.
+LDEMUL_AFTER_OPEN=arm_elf_after_open
+LDEMUL_BEFORE_ALLOCATION=arm_elf_before_allocation
-cat >>e${EMULATION_NAME}.c <<EOF
+# Replace the elf before_parse function with our own.
+LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- gld${EMULATION_NAME}_after_open,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld${EMULATION_NAME}_before_allocation,
- gld${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld${EMULATION_NAME}_finish,
- NULL, /* create output section statements */
- gld${EMULATION_NAME}_open_dynamic_archive,
- gld${EMULATION_NAME}_place_orphan,
- NULL, /* set symbols */
- gld${EMULATION_NAME}_parse_args,
- NULL, /* unrecognized file */
- gld${EMULATION_NAME}_list_options,
- NULL, /* recognized file */
- NULL /* find_potential_libraries */
-};
-EOF
+# Call the extra arm-elf function
+LDEMUL_FINISH=gld${EMULATION_NAME}_finish
diff --git a/gnu/usr.bin/binutils/ld/emultempl/armelf_oabi.em b/gnu/usr.bin/binutils/ld/emultempl/armelf_oabi.em
index d8ca87ab0ad..1f2deb385d6 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/armelf_oabi.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/armelf_oabi.em
@@ -4,7 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -39,12 +40,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ld.h"
#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
#include "ldmisc.h"
#include "ldexp.h"
#include "ldlang.h"
+#include "ldfile.h"
+#include "ldemul.h"
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
diff --git a/gnu/usr.bin/binutils/ld/emultempl/beos.em b/gnu/usr.bin/binutils/ld/emultempl/beos.em
index 2c14fbcce3c..3c9e3edc9b2 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/beos.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/beos.em
@@ -2,7 +2,7 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 2000 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
@@ -35,11 +35,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldgram.h"
#include "ldexp.h"
#include "ldlang.h"
+#include "ldfile.h"
#include "ldemul.h"
#include "ldlex.h"
#include "ldmisc.h"
#include "ldctor.h"
-#include "ldfile.h"
#include "coff/internal.h"
#include "../bfd/libcoff.h"
@@ -739,7 +739,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* Look up the output section. The Microsoft specs say sections names in
image files never contain a '\$'. Fortunately, lang_..._lookup creates
the section if it doesn't exist. */
- output_secname = buystring (secname);
+ output_secname = xstrdup (secname);
ps = strchr (output_secname + 1, '\$');
*ps = 0;
os = lang_output_section_statement_lookup (output_secname);
diff --git a/gnu/usr.bin/binutils/ld/emultempl/m68kcoff.em b/gnu/usr.bin/binutils/ld/emultempl/m68kcoff.em
new file mode 100644
index 00000000000..078324fcc58
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emultempl/m68kcoff.em
@@ -0,0 +1,245 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is is generated by a shell script. DO NOT EDIT! */
+
+/* Handle embedded relocs for m68k.
+ Copyright 2000 Free Software Foundation, Inc.
+ Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on generic.em
+ by Steve Chamberlain <steve@cygnus.com>, embedded relocs code based on
+ mipsecoff.em by Ian Lance Taylor <ian@cygnus.com>.
+
+This file is part of GLD, the Gnu Linker.
+
+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. */
+
+#define TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+
+#include "ld.h"
+#include "ldmain.h"
+#include "ldfile.h"
+#include "ldemul.h"
+#include "ldmisc.h"
+
+static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+static void check_sections PARAMS ((bfd *, asection *, PTR));
+static void gld${EMULATION_NAME}_after_allocation PARAMS ((void));
+static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+
+static void
+gld${EMULATION_NAME}_before_parse ()
+{
+#ifndef TARGET_ /* I.e., if not generic. */
+ ldfile_set_output_arch ("`echo ${ARCH}`");
+#endif /* not TARGET_ */
+}
+
+/* This function is run after all the input files have been opened.
+ We create a .emreloc section for each input file with a non zero
+ .data section. The BFD backend will fill in these sections with
+ magic numbers which can be used to relocate the data section at run
+ time. */
+
+static void
+gld${EMULATION_NAME}_after_open ()
+{
+ bfd *abfd;
+
+ if (! command_line.embedded_relocs
+ || link_info.relocateable)
+ return;
+
+ for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
+ {
+ asection *datasec;
+
+ /* As first-order business, make sure that each input BFD is COFF. It
+ better be, as we are directly calling a COFF backend function. */
+ if (bfd_get_flavour (abfd) != bfd_target_coff_flavour)
+ einfo ("%F%B: all input objects must be COFF for --embedded-relocs\n");
+
+ datasec = bfd_get_section_by_name (abfd, ".data");
+
+ /* Note that we assume that the reloc_count field has already
+ been set up. We could call bfd_get_reloc_upper_bound, but
+ that returns the size of a memory buffer rather than a reloc
+ count. We do not want to call bfd_canonicalize_reloc,
+ because although it would always work it would force us to
+ read in the relocs into BFD canonical form, which would waste
+ a significant amount of time and memory. */
+ if (datasec != NULL && datasec->reloc_count > 0)
+ {
+ asection *relsec;
+
+ relsec = bfd_make_section (abfd, ".emreloc");
+ if (relsec == NULL
+ || ! bfd_set_section_flags (abfd, relsec,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY))
+ || ! bfd_set_section_alignment (abfd, relsec, 2)
+ || ! bfd_set_section_size (abfd, relsec,
+ datasec->reloc_count * 12))
+ einfo ("%F%B: can not create .emreloc section: %E\n");
+ }
+
+ /* Double check that all other data sections are empty, as is
+ required for embedded PIC code. */
+ bfd_map_over_sections (abfd, check_sections, (PTR) datasec);
+ }
+}
+
+/* Check that of the data sections, only the .data section has
+ relocs. This is called via bfd_map_over_sections. */
+
+static void
+check_sections (abfd, sec, datasec)
+ bfd *abfd;
+ asection *sec;
+ PTR datasec;
+{
+ if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ && sec != (asection *) datasec
+ && sec->reloc_count != 0)
+ einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
+ abfd, bfd_get_section_name (abfd, sec));
+}
+
+/* This function is called after the section sizes and offsets have
+ been set. If we are generating embedded relocs, it calls a special
+ BFD backend routine to do the work. */
+
+static void
+gld${EMULATION_NAME}_after_allocation ()
+{
+ bfd *abfd;
+
+ if (! command_line.embedded_relocs
+ || link_info.relocateable)
+ return;
+
+ for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
+ {
+ asection *datasec, *relsec;
+ char *errmsg;
+
+ datasec = bfd_get_section_by_name (abfd, ".data");
+
+ if (datasec == NULL || datasec->reloc_count == 0)
+ continue;
+
+ relsec = bfd_get_section_by_name (abfd, ".emreloc");
+ ASSERT (relsec != NULL);
+
+ if (! bfd_m68k_coff_create_embedded_relocs (abfd, &link_info,
+ datasec, relsec,
+ &errmsg))
+ {
+ if (errmsg == NULL)
+ einfo ("%B%X: can not create runtime reloc information: %E\n",
+ abfd);
+ else
+ einfo ("%X%B: can not create runtime reloc information: %s\n",
+ abfd, errmsg);
+ }
+ }
+}
+
+static char *
+gld${EMULATION_NAME}_get_script(isfile)
+ int *isfile;
+EOF
+
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc="-f stringify.sed"
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{
+ *isfile = 0;
+
+ if (link_info.relocateable == true && config.build_constructors == true)
+ return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
+
+else
+# Scripts read from the filesystem.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{
+ *isfile = 1;
+
+ if (link_info.relocateable == true && config.build_constructors == true)
+ return "ldscripts/${EMULATION_NAME}.xu";
+ else if (link_info.relocateable == true)
+ return "ldscripts/${EMULATION_NAME}.xr";
+ else if (!config.text_read_only)
+ return "ldscripts/${EMULATION_NAME}.xbn";
+ else if (!config.magic_demand_paged)
+ return "ldscripts/${EMULATION_NAME}.xn";
+ else
+ return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+{
+ gld${EMULATION_NAME}_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ gld${EMULATION_NAME}_after_open,
+ gld${EMULATION_NAME}_after_allocation,
+ set_output_arch_default,
+ ldemul_default_target,
+ before_allocation_default,
+ gld${EMULATION_NAME}_get_script,
+ "${EMULATION_NAME}",
+ "${OUTPUT_FORMAT}",
+ NULL, /* finish */
+ NULL, /* create output section statements */
+ NULL, /* open dynamic archive */
+ NULL, /* place orphan */
+ NULL, /* set symbols */
+ NULL, /* parse args */
+ NULL, /* unrecognized file */
+ NULL, /* list options */
+ NULL, /* recognized file */
+ NULL /* find_potential_libraries */
+};
+EOF
diff --git a/gnu/usr.bin/binutils/ld/emultempl/m68kelf.em b/gnu/usr.bin/binutils/ld/emultempl/m68kelf.em
new file mode 100644
index 00000000000..cb3b86bbfef
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emultempl/m68kelf.em
@@ -0,0 +1,193 @@
+# This shell script emits a C file. -*- C -*-
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on armelf.em
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file is sourced from elf32.em, and defines some extra routines for m68k
+# embedded systems using ELF and for some other systems using m68k ELF. While
+# it is sourced from elf32.em for all m68k ELF configurations, here we include
+# only the features we want depending on the configuration.
+
+case ${target} in
+ m68*-*-elf)
+ echo "#define SUPPORT_EMBEDDED_RELOCS" >>e${EMULATION_NAME}.c
+ ;;
+esac
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+static void m68k_elf_after_open PARAMS ((void));
+#ifdef SUPPORT_EMBEDDED_RELOCS
+static void check_sections PARAMS ((bfd *, asection *, PTR));
+#endif
+static void m68k_elf_after_allocation PARAMS ((void));
+
+/* This function is run after all the input files have been opened. */
+
+static void
+m68k_elf_after_open ()
+{
+ /* Call the standard elf routine. */
+ gld${EMULATION_NAME}_after_open ();
+
+#ifdef SUPPORT_EMBEDDED_RELOCS
+ if (command_line.embedded_relocs
+ && (! link_info.relocateable))
+ {
+ bfd *abfd;
+
+ /* In the embedded relocs mode we create a .emreloc section for each
+ input file with a nonzero .data section. The BFD backend will fill in
+ these sections with magic numbers which can be used to relocate the
+ data section at run time. */
+ for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
+ {
+ asection *datasec;
+
+ /* As first-order business, make sure that each input BFD is either
+ COFF or ELF. We need to call a special BFD backend function to
+ generate the embedded relocs, and we have such functions only for
+ COFF and ELF. */
+ if (bfd_get_flavour (abfd) != bfd_target_coff_flavour
+ && bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ einfo ("%F%B: all input objects must be COFF or ELF for --embedded-relocs\n");
+
+ datasec = bfd_get_section_by_name (abfd, ".data");
+
+ /* Note that we assume that the reloc_count field has already
+ been set up. We could call bfd_get_reloc_upper_bound, but
+ that returns the size of a memory buffer rather than a reloc
+ count. We do not want to call bfd_canonicalize_reloc,
+ because although it would always work it would force us to
+ read in the relocs into BFD canonical form, which would waste
+ a significant amount of time and memory. */
+ if (datasec != NULL && datasec->reloc_count > 0)
+ {
+ asection *relsec;
+
+ relsec = bfd_make_section (abfd, ".emreloc");
+ if (relsec == NULL
+ || ! bfd_set_section_flags (abfd, relsec,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY))
+ || ! bfd_set_section_alignment (abfd, relsec, 2)
+ || ! bfd_set_section_size (abfd, relsec,
+ datasec->reloc_count * 12))
+ einfo ("%F%B: can not create .emreloc section: %E\n");
+ }
+
+ /* Double check that all other data sections are empty, as is
+ required for embedded PIC code. */
+ bfd_map_over_sections (abfd, check_sections, (PTR) datasec);
+ }
+ }
+#endif /* SUPPORT_EMBEDDED_RELOCS */
+}
+
+#ifdef SUPPORT_EMBEDDED_RELOCS
+/* Check that of the data sections, only the .data section has
+ relocs. This is called via bfd_map_over_sections. */
+
+static void
+check_sections (abfd, sec, datasec)
+ bfd *abfd;
+ asection *sec;
+ PTR datasec;
+{
+ if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ && sec != (asection *) datasec
+ && sec->reloc_count != 0)
+ einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
+ abfd, bfd_get_section_name (abfd, sec));
+}
+
+#endif /* SUPPORT_EMBEDDED_RELOCS */
+
+/* This function is called after the section sizes and offsets have
+ been set. */
+
+static void
+m68k_elf_after_allocation ()
+{
+ /* Call the standard elf routine. */
+ after_allocation_default ();
+
+#ifdef SUPPORT_EMBEDDED_RELOCS
+ if (command_line.embedded_relocs
+ && (! link_info.relocateable))
+ {
+ bfd *abfd;
+
+ /* If we are generating embedded relocs, call a special BFD backend
+ routine to do the work. */
+ for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
+ {
+ asection *datasec, *relsec;
+ char *errmsg;
+
+ datasec = bfd_get_section_by_name (abfd, ".data");
+
+ if (datasec == NULL || datasec->reloc_count == 0)
+ continue;
+
+ relsec = bfd_get_section_by_name (abfd, ".emreloc");
+ ASSERT (relsec != NULL);
+
+ if (bfd_get_flavour (abfd) == bfd_target_coff_flavour)
+ {
+ if (! bfd_m68k_coff_create_embedded_relocs (abfd, &link_info,
+ datasec, relsec,
+ &errmsg))
+ {
+ if (errmsg == NULL)
+ einfo ("%B%X: can not create runtime reloc information: %E\n",
+ abfd);
+ else
+ einfo ("%X%B: can not create runtime reloc information: %s\n",
+ abfd, errmsg);
+ }
+ }
+ else if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+ {
+ if (! bfd_m68k_elf32_create_embedded_relocs (abfd, &link_info,
+ datasec, relsec,
+ &errmsg))
+ {
+ if (errmsg == NULL)
+ einfo ("%B%X: can not create runtime reloc information: %E\n",
+ abfd);
+ else
+ einfo ("%X%B: can not create runtime reloc information: %s\n",
+ abfd, errmsg);
+ }
+ }
+ else
+ abort ();
+ }
+ }
+#endif /* SUPPORT_EMBEDDED_RELOCS */
+}
+
+EOF
+
+# We have our own after_open and after_allocation functions, but they call
+# the standard routines, so give them a different name.
+LDEMUL_AFTER_OPEN=m68k_elf_after_open
+LDEMUL_AFTER_ALLOCATION=m68k_elf_after_allocation
diff --git a/gnu/usr.bin/binutils/ld/emultempl/ticoff.em b/gnu/usr.bin/binutils/ld/emultempl/ticoff.em
new file mode 100644
index 00000000000..a2ab4dbfbc2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emultempl/ticoff.em
@@ -0,0 +1,202 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
+cat >>e${EMULATION_NAME}.c <<EOF
+/* This file is part of GLD, the Gnu Linker.
+ Copyright 1999, 2000 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 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. */
+
+/* For TI COFF */
+/* Need to determine load and run pages for output sections */
+
+#define TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+
+#include "ld.h"
+#include "ldmain.h"
+#include "ldmisc.h"
+
+#include "ldexp.h"
+#include "ldlang.h"
+#include "ldfile.h"
+#include "ldemul.h"
+
+#include "getopt.h"
+
+static int coff_version;
+
+static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
+static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
+static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
+
+/* TI COFF extra command line options */
+#define OPTION_COFF_FORMAT (300 + 1)
+
+static struct option longopts[] =
+{
+ /* TI COFF options */
+ {"format", required_argument, NULL, OPTION_COFF_FORMAT },
+ {NULL, no_argument, NULL, 0}
+};
+
+static void
+gld_${EMULATION_NAME}_list_options (file)
+ FILE * file;
+{
+ fprintf (file, _(" --format 0|1|2 Specify which COFF version to use"));
+}
+
+static int
+gld_${EMULATION_NAME}_parse_args(argc, argv)
+ int argc;
+ char **argv;
+{
+ int longind;
+ int optc;
+ int prevoptind = optind;
+ int prevopterr = opterr;
+ int wanterror;
+ static int lastoptind = -1;
+
+ if (lastoptind != optind)
+ opterr = 0;
+ wanterror = opterr;
+
+ lastoptind = optind;
+
+ optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+ opterr = prevopterr;
+
+ switch (optc)
+ {
+ default:
+ if (wanterror)
+ xexit (1);
+ optind = prevoptind;
+ return 0;
+
+ case OPTION_COFF_FORMAT:
+ if ((*optarg == '0' || *optarg == '1' || *optarg == '2')
+ && optarg[1] == '\0')
+ {
+ extern void lang_add_output_format
+ PARAMS ((const char *, const char *, const char *, int));
+ static char buf[] = "coffX-${OUTPUT_FORMAT_TEMPLATE}";
+ coff_version = *optarg - '0';
+ buf[4] = *optarg;
+ lang_add_output_format (buf, NULL, NULL, 0);
+ }
+ else
+ {
+ einfo (_("%P%F: invalid COFF format version %s\n"), optarg);
+
+ }
+ break;
+ }
+ return 1;
+}
+
+static void
+gld_${EMULATION_NAME}_before_parse()
+{
+#ifndef TARGET_ /* I.e., if not generic. */
+ ldfile_set_output_arch ("`echo ${ARCH}`");
+#endif /* not TARGET_ */
+}
+
+static char *
+gld_${EMULATION_NAME}_get_script (isfile)
+ int *isfile;
+EOF
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc='s/["\\]/\\&/g
+s/$/\\n\\/
+1s/^/"/
+$s/$/n"/
+'
+cat >>e${EMULATION_NAME}.c <<EOF
+{
+ *isfile = 0;
+ if (link_info.relocateable == true && config.build_constructors == true)
+ return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
+ else if (link_info.relocateable == true)
+ return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
+ else if (!config.text_read_only)
+ return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
+ else if (!config.magic_demand_paged)
+ return `sed "$sc" ldscripts/${EMULATION_NAME}.xn`;
+ else
+ return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
+}
+EOF
+
+else
+# Scripts read from the filesystem.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{
+ *isfile = 1;
+
+ if (link_info.relocateable == true && config.build_constructors == true)
+ return "ldscripts/${EMULATION_NAME}.xu";
+ else if (link_info.relocateable == true)
+ return "ldscripts/${EMULATION_NAME}.xr";
+ else if (!config.text_read_only)
+ return "ldscripts/${EMULATION_NAME}.xbn";
+ else if (!config.magic_demand_paged)
+ return "ldscripts/${EMULATION_NAME}.xn";
+ else
+ return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+{
+ gld_${EMULATION_NAME}_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ after_open_default,
+ after_allocation_default,
+ set_output_arch_default,
+ ldemul_default_target,
+ before_allocation_default,
+ gld_${EMULATION_NAME}_get_script,
+ "${EMULATION_NAME}",
+ "${OUTPUT_FORMAT}",
+ NULL, /* finish */
+ NULL, /* create output section statements */
+ NULL, /* open dynamic archive */
+ NULL, /* place orphan */
+ NULL, /* set_symbols */
+ gld_${EMULATION_NAME}_parse_args,
+ NULL, /* unrecognized_file */
+ gld_${EMULATION_NAME}_list_options,
+ NULL, /* recognized file */
+ NULL /* find_potential_libraries */
+};
+EOF
diff --git a/gnu/usr.bin/binutils/ld/ldver.texi b/gnu/usr.bin/binutils/ld/ldver.texi
index 4c75b622163..56bdd12e9e3 100644
--- a/gnu/usr.bin/binutils/ld/ldver.texi
+++ b/gnu/usr.bin/binutils/ld/ldver.texi
@@ -1 +1 @@
-@set VERSION 2.10.1
+@set VERSION 2.11.2
diff --git a/gnu/usr.bin/binutils/ld/pe-dll.c b/gnu/usr.bin/binutils/ld/pe-dll.c
index 6b8b1af007d..717426ffbc9 100644
--- a/gnu/usr.bin/binutils/ld/pe-dll.c
+++ b/gnu/usr.bin/binutils/ld/pe-dll.c
@@ -1,5 +1,5 @@
/* Routines to help build PEI-format DLLs (Win32 etc)
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -34,6 +34,7 @@
#include "ldmisc.h"
#include "ldgram.h"
#include "ldmain.h"
+#include "ldfile.h"
#include "ldemul.h"
#include "coff/internal.h"
#include "../bfd/libcoff.h"
@@ -135,10 +136,11 @@ pe_dll_id_target (target)
const char *target;
{
int i;
- for (i=0; pe_detail_list[i].target_name; i++)
- if (strcmp (pe_detail_list[i].target_name, target) == 0)
+ for (i = 0; pe_detail_list[i].target_name; i++)
+ if (strcmp (pe_detail_list[i].target_name, target) == 0
+ || strcmp (pe_detail_list[i].object_target, target) == 0)
{
- pe_details = pe_detail_list+i;
+ pe_details = pe_detail_list + i;
return;
}
einfo (_("%XUnsupported PEI architecture: %s\n"), target);
@@ -184,7 +186,7 @@ pe_export_sort (va, vb)
/* These correspond to the entries in pe_def_file->exports[]. I use
exported_symbol_sections[i] to tag whether or not the symbol was
- defined, since we can't export symbols we don't have. */
+ defined, since we can't export symbols we don't have. */
static bfd_vma *exported_symbol_offsets;
static struct sec **exported_symbol_sections;
@@ -197,12 +199,11 @@ static const char *dll_name;
static int min_ordinal, max_ordinal;
static int *exported_symbols;
-typedef struct exclude_list_struct
- {
- char *string;
- struct exclude_list_struct *next;
- }
-exclude_list_struct;
+typedef struct exclude_list_struct {
+ char *string;
+ struct exclude_list_struct *next;
+} exclude_list_struct;
+
static struct exclude_list_struct *excludes = 0;
void
@@ -264,13 +265,13 @@ process_def_file (abfd, info)
struct bfd_link_hash_entry *blhe;
bfd *b;
struct sec *s;
- def_file_export *e=0;
+ def_file_export *e = 0;
if (!pe_def_file)
pe_def_file = def_file_empty ();
/* First, run around to all the objects looking for the .drectve
- sections, and push those into the def file too */
+ sections, and push those into the def file too. */
for (b = info->input_bfds; b; b = b->link_next)
{
@@ -285,7 +286,7 @@ process_def_file (abfd, info)
}
}
- /* Now, maybe export everything else the default way */
+ /* Now, maybe export everything else the default way. */
if (pe_dll_export_everything || pe_def_file->num_exports == 0)
{
@@ -300,14 +301,21 @@ process_def_file (abfd, info)
for (j = 0; j < nsyms; j++)
{
- if ((symbols[j]->flags & (BSF_FUNCTION | BSF_GLOBAL))
- == (BSF_FUNCTION | BSF_GLOBAL))
+ /* We should export symbols which are either global or not
+ anything at all. (.bss data is the latter) */
+ if ((symbols[j]->flags & BSF_GLOBAL)
+ || (symbols[j]->flags == BSF_NO_FLAGS))
{
const char *sn = symbols[j]->name;
if (*sn == '_')
sn++;
if (auto_export (pe_def_file, sn))
- def_file_add_export (pe_def_file, sn, 0, -1);
+ {
+ def_file_export *p;
+ p=def_file_add_export (pe_def_file, sn, 0, -1);
+ /* Fill data flag properly, from dlltool.c */
+ p->flag_data = !(symbols[j]->flags & BSF_FUNCTION);
+ }
}
}
}
@@ -316,7 +324,7 @@ process_def_file (abfd, info)
#undef NE
#define NE pe_def_file->num_exports
- /* Canonicalize the export list */
+ /* Canonicalize the export list. */
if (pe_dll_kill_ats)
{
@@ -324,8 +332,9 @@ process_def_file (abfd, info)
{
if (strchr (pe_def_file->exports[i].name, '@'))
{
- /* This will preserve internal_name, which may have been pointing
- to the same memory as name, or might not have */
+ /* This will preserve internal_name, which may have been
+ pointing to the same memory as name, or might not
+ have. */
char *tmp = xstrdup (pe_def_file->exports[i].name);
*(strchr (tmp, '@')) = 0;
pe_def_file->exports[i].name = tmp;
@@ -350,7 +359,8 @@ process_def_file (abfd, info)
}
}
- e = pe_def_file->exports; /* convenience, but watch out for it changing */
+ /* Convenience, but watch out for it changing. */
+ e = pe_def_file->exports;
exported_symbol_offsets = (bfd_vma *) xmalloc (NE * sizeof (bfd_vma));
exported_symbol_sections = (struct sec **) xmalloc (NE * sizeof (struct sec *));
@@ -374,7 +384,7 @@ process_def_file (abfd, info)
{
if (pe_dll_warn_dup_exports)
/* xgettext:c-format */
- einfo (_("%XError, duplicate EXPORT with oridinals: %s (%d vs %d)\n"),
+ einfo (_("%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"),
e[j - 1].name, e[j - 1].ordinal, e[i].ordinal);
}
else
@@ -384,7 +394,7 @@ process_def_file (abfd, info)
einfo (_("Warning, duplicate EXPORT: %s\n"),
e[j - 1].name);
}
- if (e[i].ordinal)
+ if (e[i].ordinal != -1)
e[j - 1].ordinal = e[i].ordinal;
e[j - 1].flag_private |= e[i].flag_private;
e[j - 1].flag_constant |= e[i].flag_constant;
@@ -416,7 +426,7 @@ process_def_file (abfd, info)
false, false, true);
if (blhe
- && (blhe->type == bfd_link_hash_defined
+ && (blhe->type == bfd_link_hash_defined
|| (blhe->type == bfd_link_hash_common)))
{
count_exported++;
@@ -426,11 +436,11 @@ process_def_file (abfd, info)
/* Only fill in the sections. The actual offsets are computed
in fill_exported_offsets() after common symbols are laid
out. */
- if (blhe->type == bfd_link_hash_defined)
+ if (blhe->type == bfd_link_hash_defined)
exported_symbol_sections[i] = blhe->u.def.section;
else
exported_symbol_sections[i] = blhe->u.c.p->section;
-
+
if (pe_def_file->exports[i].ordinal != -1)
{
if (max_ordinal < pe_def_file->exports[i].ordinal)
@@ -537,7 +547,7 @@ generate_edata (abfd, info)
const char *dlnp;
/* First, we need to know how many exported symbols there are,
- and what the range of ordinals is. */
+ and what the range of ordinals is. */
if (pe_def_file->name)
{
@@ -569,7 +579,7 @@ generate_edata (abfd, info)
for (i = 0; i < export_table_size; i++)
exported_symbols[i] = -1;
- /* Now we need to assign ordinals to those that don't have them */
+ /* Now we need to assign ordinals to those that don't have them. */
for (i = 0; i < NE; i++)
{
if (exported_symbol_sections[i])
@@ -581,7 +591,7 @@ generate_edata (abfd, info)
if (pi != -1)
{
/* xgettext:c-format */
- einfo (_("%XError, oridinal used twice: %d (%s vs %s)\n"),
+ einfo (_("%XError, ordinal used twice: %d (%s vs %s)\n"),
pe_def_file->exports[i].ordinal,
pe_def_file->exports[i].name,
pe_def_file->exports[pi].name);
@@ -603,7 +613,7 @@ generate_edata (abfd, info)
pe_def_file->exports[i].ordinal = next_ordinal;
}
- /* OK, now we can allocate some memory */
+ /* OK, now we can allocate some memory. */
edata_sz = (40 /* directory */
+ 4 * export_table_size /* addresses */
@@ -622,7 +632,7 @@ fill_exported_offsets (abfd, info)
{
int i;
struct bfd_link_hash_entry *blhe;
-
+
for (i = 0; i < pe_def_file->num_exports; i++)
{
char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
@@ -641,7 +651,7 @@ fill_exported_offsets (abfd, info)
if (blhe && (blhe->type == bfd_link_hash_defined))
{
exported_symbol_offsets[i] = blhe->u.def.value;
- }
+ }
free (name);
}
}
@@ -663,7 +673,7 @@ fill_edata (abfd, info)
edata_d = (unsigned char *) xmalloc (edata_sz);
- /* Note use of array pointer math here */
+ /* Note use of array pointer math here. */
edirectory = edata_d;
eaddresses = (unsigned long *) (edata_d + 40);
enameptrs = eaddresses + export_table_size;
@@ -672,7 +682,7 @@ fill_edata (abfd, info)
#define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) + edata_s->output_section->vma - image_base)
- memset (edata_d, 0, 40);
+ memset (edata_d, 0, edata_sz);
bfd_put_32 (abfd, now, edata_d + 4);
if (pe_def_file->version_major != -1)
{
@@ -691,7 +701,7 @@ fill_edata (abfd, info)
fill_exported_offsets (abfd, info);
- /* Ok, now for the filling in part */
+ /* Ok, now for the filling in part. */
hint = 0;
for (i = 0; i < export_table_size; i++)
{
@@ -702,19 +712,21 @@ fill_edata (abfd, info)
unsigned long srva = (exported_symbol_offsets[s]
+ ssec->output_section->vma
+ ssec->output_offset);
+ int ord = pe_def_file->exports[s].ordinal;
- bfd_put_32 (abfd, srva - image_base, (void *) (eaddresses + i));
+ bfd_put_32 (abfd, srva - image_base,
+ (void *) (eaddresses + ord - min_ordinal));
if (!pe_def_file->exports[s].flag_noname)
{
char *ename = pe_def_file->exports[s].name;
bfd_put_32 (abfd, ERVA (enamestr), (void *) enameptrs);
+ enameptrs++;
strcpy (enamestr, ename);
enamestr += strlen (enamestr) + 1;
- bfd_put_16 (abfd, i, (void *) eordinals);
- enameptrs++;
+ bfd_put_16 (abfd, ord - min_ordinal, (void *) eordinals);
+ eordinals++;
pe_def_file->exports[s].hint = hint++;
}
- eordinals++;
}
}
}
@@ -731,7 +743,7 @@ generate_reloc (abfd, info)
struct bfd_link_info *info;
{
- /* for .reloc stuff */
+ /* For .reloc stuff. */
reloc_data_type *reloc_data;
int total_relocs = 0;
int i;
@@ -761,18 +773,18 @@ generate_reloc (abfd, info)
asymbol **symbols;
int nsyms, symsize;
- /* if it's not loaded, we don't need to relocate it this way */
+ /* If it's not loaded, we don't need to relocate it this way. */
if (!(s->output_section->flags & SEC_LOAD))
continue;
/* I don't know why there would be a reloc for these, but I've
- seen it happen - DJ */
+ seen it happen - DJ */
if (s->output_section == &bfd_abs_section)
continue;
if (s->output_section->vma == 0)
{
- /* Huh? Shouldn't happen, but punt if it does */
+ /* Huh? Shouldn't happen, but punt if it does. */
einfo ("DJ: zero vma section reloc detected: `%s' #%d f=%d\n",
s->output_section->name, s->output_section->index,
s->output_section->flags);
@@ -800,9 +812,9 @@ generate_reloc (abfd, info)
+ sym->section->output_offset
+ sym->section->output_section->vma);
reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
-
+
#define BITS_AND_SHIFT(bits, shift) (bits * 1000 | shift)
-
+
switch BITS_AND_SHIFT (relocs[i]->howto->bitsize,
relocs[i]->howto->rightshift)
{
@@ -816,9 +828,10 @@ generate_reloc (abfd, info)
break;
case BITS_AND_SHIFT (16, 16):
reloc_data[total_relocs].type = 4;
- /* FIXME: we can't know the symbol's right value yet,
- but we probably can safely assume that CE will relocate
- us in 64k blocks, so leaving it zero is safe. */
+ /* FIXME: we can't know the symbol's right value
+ yet, but we probably can safely assume that
+ CE will relocate us in 64k blocks, so leaving
+ it zero is safe. */
reloc_data[total_relocs].extra = 0;
total_relocs++;
break;
@@ -835,31 +848,33 @@ generate_reloc (abfd, info)
}
}
free (relocs);
- /* Warning: the allocated symbols are remembered in BFD and reused
- later, so don't free them! */
- /* free (symbols); */
+ /* Warning: the allocated symbols are remembered in BFD and
+ reused later, so don't free them! */
+#if 0
+ free (symbol);
+#endif
}
}
/* At this point, we have total_relocs relocation addresses in
reloc_addresses, which are all suitable for the .reloc section.
- We must now create the new sections. */
+ We must now create the new sections. */
qsort (reloc_data, total_relocs, sizeof (*reloc_data), reloc_sort);
for (i = 0; i < total_relocs; i++)
{
unsigned long this_page = (reloc_data[i].vma >> 12);
-
+
if (this_page != sec_page)
{
reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align */
reloc_sz += 8;
sec_page = this_page;
}
-
+
reloc_sz += 2;
-
+
if (reloc_data[i].type == 4)
reloc_sz += 2;
}
@@ -887,7 +902,7 @@ generate_reloc (abfd, info)
sec_page = this_page;
page_count = 0;
}
- bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type<<12),
+ bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type << 12),
reloc_d + reloc_sz);
reloc_sz += 2;
if (reloc_data[i].type == 4)
@@ -915,7 +930,7 @@ generate_reloc (abfd, info)
static void
quoteput (s, f, needs_quotes)
char *s;
- FILE * f;
+ FILE *f;
int needs_quotes;
{
char *cp;
@@ -1098,7 +1113,7 @@ static char *dll_symname;
#define UNDSEC (asection *) &bfd_und_section
static asection *
-quick_section(abfd, name, flags, align)
+quick_section (abfd, name, flags, align)
bfd *abfd;
const char *name;
int flags;
@@ -1108,13 +1123,9 @@ quick_section(abfd, name, flags, align)
asymbol *sym;
sec = bfd_make_section_old_way (abfd, name);
- bfd_set_section_flags (abfd, sec, flags
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- );
+ bfd_set_section_flags (abfd, sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
bfd_set_section_alignment (abfd, sec, align);
- /* remember to undo this before trying to link internally! */
+ /* Remember to undo this before trying to link internally! */
sec->output_section = sec;
sym = bfd_make_empty_symbol (abfd);
@@ -1160,7 +1171,7 @@ quick_reloc (abfd, address, which_howto, symidx)
int which_howto;
int symidx;
{
- if (relcount >= (relsize-1))
+ if (relcount >= (relsize - 1))
{
relsize += 10;
if (reltab)
@@ -1181,8 +1192,8 @@ save_relocs (asection *sec)
int i;
sec->relocation = reltab;
sec->reloc_count = relcount;
- sec->orelocation = (arelent **) xmalloc ((relcount+1) * sizeof (arelent *));
- for (i=0; i<relcount; i++)
+ sec->orelocation = (arelent **) xmalloc ((relcount + 1) * sizeof (arelent *));
+ for (i = 0; i < relcount; i++)
sec->orelocation[i] = sec->relocation + i;
sec->orelocation[relcount] = 0;
sec->flags |= SEC_RELOC;
@@ -1234,14 +1245,14 @@ make_head (parent)
id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, U("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
- quick_symbol (abfd, U(""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
/* OK, pay attention here. I got confused myself looking back at
it. We create a four-byte section to mark the beginning of the
list, and we include an offset of 4 in the section, so that the
pointer to the list points to the *end* of this section, which is
- the start of the list of sections from other objects. */
+ the start of the list of sections from other objects. */
bfd_set_section_size (abfd, id2, 20);
d2 = (unsigned char *) xmalloc (20);
@@ -1268,7 +1279,7 @@ make_head (parent)
bfd_set_section_contents (abfd, id2, d2, 0, 20);
bfd_set_section_contents (abfd, id5, d5, 0, 4);
bfd_set_section_contents (abfd, id4, d4, 0, 4);
-
+
bfd_make_readable (abfd);
return abfd;
}
@@ -1310,7 +1321,7 @@ make_tail (parent)
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, U(""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U (""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, id4, 4);
d4 = (unsigned char *) xmalloc (4);
@@ -1322,9 +1333,9 @@ make_tail (parent)
id5->contents = d5;
memset (d5, 0, 4);
- len = strlen (dll_filename)+1;
+ len = strlen (dll_filename) + 1;
if (len & 1)
- len ++;
+ len++;
bfd_set_section_size (abfd, id7, len);
d7 = (unsigned char *) xmalloc (len);
id7->contents = d7;
@@ -1399,7 +1410,7 @@ make_one (exp, parent)
bfd *parent;
{
asection *tx, *id7, *id5, *id4, *id6;
- unsigned char *td, *d7, *d5, *d4, *d6 = NULL;
+ unsigned char *td = NULL, *d7, *d5, *d4, *d6 = NULL;
int len;
char *oname;
bfd *abfd;
@@ -1441,32 +1452,35 @@ make_one (exp, parent)
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
if (! exp->flag_data)
- quick_symbol (abfd, U(""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
- quick_symbol (abfd, U("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
- quick_symbol (abfd, U("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U (""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
if (pe_dll_compat_implib)
- quick_symbol (abfd, U("__imp_"), exp->internal_name, "",
- id5, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("__imp_"), exp->internal_name, "",
+ id5, BSF_GLOBAL, 0);
- bfd_set_section_size (abfd, tx, jmp_byte_count);
- td = (unsigned char *) xmalloc (jmp_byte_count);
- tx->contents = td;
- memcpy (td, jmp_bytes, jmp_byte_count);
- switch (pe_details->pe_arch)
- {
- case PE_ARCH_i386:
- quick_reloc (abfd, 2, BFD_RELOC_32, 2);
- break;
- case PE_ARCH_sh:
- quick_reloc (abfd, 8, BFD_RELOC_32, 2);
- break;
- case PE_ARCH_mips:
- quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2);
- quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */
- quick_reloc (abfd, 4, BFD_RELOC_LO16, 2);
- break;
- }
- save_relocs (tx);
+ if (! exp->flag_data)
+ {
+ bfd_set_section_size (abfd, tx, jmp_byte_count);
+ td = (unsigned char *) xmalloc (jmp_byte_count);
+ tx->contents = td;
+ memcpy (td, jmp_bytes, jmp_byte_count);
+ switch (pe_details->pe_arch)
+ {
+ case PE_ARCH_i386:
+ quick_reloc (abfd, 2, BFD_RELOC_32, 2);
+ break;
+ case PE_ARCH_sh:
+ quick_reloc (abfd, 8, BFD_RELOC_32, 2);
+ break;
+ case PE_ARCH_mips:
+ quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2);
+ quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */
+ quick_reloc (abfd, 4, BFD_RELOC_LO16, 2);
+ break;
+ }
+ save_relocs (tx);
+ }
bfd_set_section_size (abfd, id7, 4);
d7 = (unsigned char *) xmalloc (4);
@@ -1497,9 +1511,9 @@ make_one (exp, parent)
memset (d4, 0, 4);
if (exp->flag_noname)
{
- d5[0] = exp->ordinal;
- d5[1] = exp->ordinal >> 8;
- d5[3] = 0x80;
+ d4[0] = exp->ordinal;
+ d4[1] = exp->ordinal >> 8;
+ d4[3] = 0x80;
}
else
{
@@ -1523,7 +1537,7 @@ make_one (exp, parent)
memset (d6, 0, len);
d6[0] = exp->hint & 0xff;
d6[1] = exp->hint >> 8;
- strcpy (d6+2, exp->name);
+ strcpy (d6 + 2, exp->name);
}
bfd_set_symtab (abfd, symtab, symptr);
@@ -1552,7 +1566,7 @@ pe_dll_generate_implib (def, impfilename)
dll_filename = (def->name) ? def->name : dll_name;
dll_symname = xstrdup (dll_filename);
- for (i=0; dll_symname[i]; i++)
+ for (i = 0; dll_symname[i]; i++)
if (!isalnum ((unsigned char) dll_symname[i]))
dll_symname[i] = '_';
@@ -1569,21 +1583,21 @@ pe_dll_generate_implib (def, impfilename)
/* xgettext:c-format */
einfo (_("Creating library file: %s\n"), impfilename);
-
+
bfd_set_format (outarch, bfd_archive);
outarch->has_armap = 1;
- /* Work out a reasonable size of things to put onto one line. */
+ /* Work out a reasonable size of things to put onto one line. */
ar_head = make_head (outarch);
- for (i = 0; i<def->num_exports; i++)
+ for (i = 0; i < def->num_exports; i++)
{
- /* The import library doesn't know about the internal name */
+ /* The import library doesn't know about the internal name. */
char *internal = def->exports[i].internal_name;
bfd *n;
def->exports[i].internal_name = def->exports[i].name;
- n = make_one (def->exports+i, outarch);
+ n = make_one (def->exports + i, outarch);
n->next = head;
head = n;
def->exports[i].internal_name = internal;
@@ -1594,7 +1608,7 @@ pe_dll_generate_implib (def, impfilename)
if (ar_head == NULL || ar_tail == NULL)
return;
- /* Now stick them all into the archive */
+ /* Now stick them all into the archive. */
ar_head->next = head;
ar_tail->next = ar_head;
@@ -1602,7 +1616,7 @@ pe_dll_generate_implib (def, impfilename)
if (! bfd_set_archive_head (outarch, head))
einfo ("%Xbfd_set_archive_head: %s\n", bfd_errmsg (bfd_get_error ()));
-
+
if (! bfd_close (outarch))
einfo ("%Xbfd_close %s: %s\n", impfilename, bfd_errmsg (bfd_get_error ()));
@@ -1636,7 +1650,7 @@ pe_process_import_defs (output_bfd, link_info)
struct bfd_link_info *link_info;
{
def_file_module *module;
- pe_dll_id_target(bfd_get_target (output_bfd));
+ pe_dll_id_target (bfd_get_target (output_bfd));
if (!pe_def_file)
return;
@@ -1647,28 +1661,35 @@ pe_process_import_defs (output_bfd, link_info)
dll_filename = module->name;
dll_symname = xstrdup (module->name);
- for (i=0; dll_symname[i]; i++)
+ for (i = 0; dll_symname[i]; i++)
if (!isalnum (dll_symname[i]))
dll_symname[i] = '_';
do_this_dll = 0;
- for (i=0; i<pe_def_file->num_imports; i++)
+ for (i = 0; i < pe_def_file->num_imports; i++)
if (pe_def_file->imports[i].module == module)
{
def_file_export exp;
struct bfd_link_hash_entry *blhe;
- /* see if we need this import */
- char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2);
- sprintf (name, "%s%s", U(""), pe_def_file->imports[i].internal_name);
+ /* See if we need this import. */
+ char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2 + 6);
+ sprintf (name, "%s%s", U (""), pe_def_file->imports[i].internal_name);
blhe = bfd_link_hash_lookup (link_info->hash, name,
false, false, false);
+ if (!blhe || (blhe && blhe->type != bfd_link_hash_undefined))
+ {
+ sprintf (name, "%s%s", U ("_imp__"),
+ pe_def_file->imports[i].internal_name);
+ blhe = bfd_link_hash_lookup (link_info->hash, name,
+ false, false, false);
+ }
free (name);
if (blhe && blhe->type == bfd_link_hash_undefined)
{
bfd *one;
- /* we do */
+ /* We do. */
if (!do_this_dll)
{
bfd *ar_head = make_head (output_bfd);
@@ -1713,7 +1734,7 @@ pe_get16 (abfd, where)
unsigned char b[2];
bfd_seek (abfd, where, SEEK_SET);
bfd_read (b, 1, 2, abfd);
- return b[0] + (b[1]<<8);
+ return b[0] + (b[1] << 8);
}
static unsigned int
@@ -1724,7 +1745,7 @@ pe_get32 (abfd, where)
unsigned char b[4];
bfd_seek (abfd, where, SEEK_SET);
bfd_read (b, 1, 4, abfd);
- return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+ return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
#if 0 /* This is not currently used. */
@@ -1734,7 +1755,7 @@ pe_as16 (ptr)
void *ptr;
{
unsigned char *b = ptr;
- return b[0] + (b[1]<<8);
+ return b[0] + (b[1] << 8);
}
#endif
@@ -1744,7 +1765,7 @@ pe_as32 (ptr)
void *ptr;
{
unsigned char *b = ptr;
- return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+ return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
boolean
@@ -1759,7 +1780,7 @@ pe_implied_import_dll (filename)
const char *dll_name;
/* No, I can't use bfd here. kernel32.dll puts its export table in
- the middle of the .rdata section. */
+ the middle of the .rdata section. */
dll = bfd_openr (filename, pe_details->target_name);
if (!dll)
@@ -1767,7 +1788,7 @@ pe_implied_import_dll (filename)
einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ()));
return false;
}
- /* PEI dlls seem to be bfd_objects */
+ /* PEI dlls seem to be bfd_objects. */
if (!bfd_check_format (dll, bfd_object))
{
einfo ("%X%s: this doesn't appear to be a DLL\n", filename);
@@ -1775,7 +1796,7 @@ pe_implied_import_dll (filename)
}
dll_name = filename;
- for (i=0; filename[i]; i++)
+ for (i = 0; filename[i]; i++)
if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
dll_name = filename + i + 1;
@@ -1790,16 +1811,16 @@ pe_implied_import_dll (filename)
secptr = (pe_header_offset + 4 + 20 +
pe_get16 (dll, pe_header_offset + 4 + 16));
expptr = 0;
- for (i=0; i<nsections; i++)
+ for (i = 0; i < nsections; i++)
{
char sname[8];
unsigned long secptr1 = secptr + 40 * i;
unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
unsigned long vsize = pe_get32 (dll, secptr1 + 16);
unsigned long fptr = pe_get32 (dll, secptr1 + 20);
- bfd_seek(dll, secptr1, SEEK_SET);
- bfd_read(sname, 1, 8, dll);
- if (vaddr <= export_rva && vaddr+vsize > export_rva)
+ bfd_seek (dll, secptr1, SEEK_SET);
+ bfd_read (sname, 1, 8, dll);
+ if (vaddr <= export_rva && vaddr + vsize > export_rva)
{
expptr = fptr + (export_rva - vaddr);
if (export_rva + export_size > vaddr + vsize)
@@ -1814,17 +1835,17 @@ pe_implied_import_dll (filename)
erva = expdata - export_rva;
if (pe_def_file == 0)
- pe_def_file = def_file_empty();
+ pe_def_file = def_file_empty ();
- nexp = pe_as32 (expdata+24);
- name_rvas = pe_as32 (expdata+32);
- ordinals = pe_as32 (expdata+36);
- ordbase = pe_as32 (expdata+16);
- for (i=0; i<nexp; i++)
+ nexp = pe_as32 (expdata + 24);
+ name_rvas = pe_as32 (expdata + 32);
+ ordinals = pe_as32 (expdata + 36);
+ ordbase = pe_as32 (expdata + 16);
+ for (i = 0; i < nexp; i++)
{
- unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+ unsigned long name_rva = pe_as32 (erva + name_rvas + i * 4);
def_file_import *imp;
- imp = def_file_add_import (pe_def_file, erva+name_rva, dll_name,
+ imp = def_file_add_import (pe_def_file, erva + name_rva, dll_name,
i, 0);
}
diff --git a/gnu/usr.bin/binutils/ld/pe-dll.h b/gnu/usr.bin/binutils/ld/pe-dll.h
index cf9e84a2379..b1b5602ea90 100644
--- a/gnu/usr.bin/binutils/ld/pe-dll.h
+++ b/gnu/usr.bin/binutils/ld/pe-dll.h
@@ -1,5 +1,5 @@
/* pe-dll.h: Header file for routines used to build Windows DLLs.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
diff --git a/gnu/usr.bin/binutils/ld/po/POTFILES.in b/gnu/usr.bin/binutils/ld/po/POTFILES.in
index 55ae6ff2b99..f7a614d82d9 100644
--- a/gnu/usr.bin/binutils/ld/po/POTFILES.in
+++ b/gnu/usr.bin/binutils/ld/po/POTFILES.in
@@ -1,6 +1,7 @@
deffile.h
emultempl/armcoff.em
emultempl/pe.em
+ld.h
ldcref.c
ldctor.c
ldctor.h
@@ -10,7 +11,6 @@ ldexp.c
ldexp.h
ldfile.c
ldfile.h
-ld.h
ldlang.c
ldlang.h
ldlex.h
diff --git a/gnu/usr.bin/binutils/ld/po/ld.pot b/gnu/usr.bin/binutils/ld/po/ld.pot
index 6efdf65be03..584dca5a60b 100644
--- a/gnu/usr.bin/binutils/ld/po/ld.pot
+++ b/gnu/usr.bin/binutils/ld/po/ld.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-04-05 14:09+0930\n"
+"POT-Creation-Date: 2000-12-26 12:54-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -14,253 +14,287 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
-#: emultempl/armcoff.em:69
+#: emultempl/armcoff.em:70
msgid " --support-old-code Support interworking with old code\n"
msgstr ""
-#: emultempl/armcoff.em:70
+#: emultempl/armcoff.em:71
msgid " --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"
msgstr ""
-#: emultempl/armcoff.em:139
+#: emultempl/armcoff.em:140
#, c-format
msgid "Errors encountered processing file %s"
msgstr ""
-#: emultempl/armcoff.em:205 emultempl/pe.em:1035
+#: emultempl/armcoff.em:206 emultempl/pe.em:1211
msgid "%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"
msgstr ""
-#: emultempl/armcoff.em:210 emultempl/pe.em:1040
+#: emultempl/armcoff.em:211 emultempl/pe.em:1216
msgid "%P: warning: connot find thumb start symbol %s\n"
msgstr ""
-#: emultempl/pe.em:257
+#: emultempl/pe.em:266
msgid ""
" --base_file <basefile> Generate a base file for relocatable "
"DLLs\n"
msgstr ""
-#: emultempl/pe.em:258
+#: emultempl/pe.em:267
msgid ""
" --dll Set image base to the default for DLLs\n"
msgstr ""
-#: emultempl/pe.em:259
+#: emultempl/pe.em:268
msgid " --file-alignment <size> Set file alignment\n"
msgstr ""
-#: emultempl/pe.em:260
+#: emultempl/pe.em:269
msgid " --heap <size> Set initial size of the heap\n"
msgstr ""
-#: emultempl/pe.em:261
+#: emultempl/pe.em:270
msgid ""
" --image-base <address> Set start address of the executable\n"
msgstr ""
-#: emultempl/pe.em:262
+#: emultempl/pe.em:271
msgid ""
" --major-image-version <number> Set version number of the executable\n"
msgstr ""
-#: emultempl/pe.em:263
+#: emultempl/pe.em:272
msgid " --major-os-version <number> Set minimum required OS version\n"
msgstr ""
-#: emultempl/pe.em:264
+#: emultempl/pe.em:273
msgid ""
" --major-subsystem-version <number> Set minimum required OS subsystem "
"version\n"
msgstr ""
-#: emultempl/pe.em:265
+#: emultempl/pe.em:274
msgid ""
" --minor-image-version <number> Set revision number of the executable\n"
msgstr ""
-#: emultempl/pe.em:266
+#: emultempl/pe.em:275
msgid " --minor-os-version <number> Set minimum required OS revision\n"
msgstr ""
-#: emultempl/pe.em:267
+#: emultempl/pe.em:276
msgid ""
" --minor-subsystem-version <number> Set minimum required OS subsystem "
"revision\n"
msgstr ""
-#: emultempl/pe.em:268
+#: emultempl/pe.em:277
msgid " --section-alignment <size> Set section alignment\n"
msgstr ""
-#: emultempl/pe.em:269
+#: emultempl/pe.em:278
msgid " --stack <size> Set size of the initial stack\n"
msgstr ""
-#: emultempl/pe.em:270
+#: emultempl/pe.em:279
msgid ""
" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n"
msgstr ""
-#: emultempl/pe.em:271
+#: emultempl/pe.em:280
msgid ""
" --support-old-code Support interworking with old code\n"
msgstr ""
-#: emultempl/pe.em:272
+#: emultempl/pe.em:281
msgid ""
" --thumb-entry=<symbol> Set the entry point to be Thumb "
"<symbol>\n"
msgstr ""
-#: emultempl/pe.em:274
+#: emultempl/pe.em:283
msgid ""
" --add-stdcall-alias Export symbols with and without @nn\n"
msgstr ""
-#: emultempl/pe.em:275
+#: emultempl/pe.em:284
msgid " --disable-stdcall-fixup Don't link _sym to _sym@nn\n"
msgstr ""
-#: emultempl/pe.em:276
+#: emultempl/pe.em:285
msgid ""
" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"
msgstr ""
-#: emultempl/pe.em:277
+#: emultempl/pe.em:286
msgid ""
" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n"
msgstr ""
-#: emultempl/pe.em:278
+#: emultempl/pe.em:287
msgid ""
" --export-all-symbols Automatically export all globals to "
"DLL\n"
msgstr ""
-#: emultempl/pe.em:279
+#: emultempl/pe.em:288
msgid " --kill-at Remove @nn from exported symbols\n"
msgstr ""
-#: emultempl/pe.em:280
+#: emultempl/pe.em:289
msgid " --out-implib <file> Generate import library\n"
msgstr ""
-#: emultempl/pe.em:281
+#: emultempl/pe.em:290
msgid ""
" --output-def <file> Generate a .DEF file for the built DLL\n"
msgstr ""
-#: emultempl/pe.em:282
+#: emultempl/pe.em:291
msgid " --warn-duplicate-exports Warn about duplicate exports.\n"
msgstr ""
-#: emultempl/pe.em:283
+#: emultempl/pe.em:292
msgid ""
" --compat-implib Create backward compatible import "
"libs;\n"
msgstr ""
-#: emultempl/pe.em:284
+#: emultempl/pe.em:293
msgid " create __imp_<SYMBOL> as well.\n"
msgstr ""
-#: emultempl/pe.em:352
+#: emultempl/pe.em:294
+msgid ""
+" --enable-auto-image-base Automatically choose image base for "
+"DLLs\n"
+msgstr ""
+
+#: emultempl/pe.em:295
+msgid " unless user specifies one\n"
+msgstr ""
+
+#: emultempl/pe.em:296
+msgid ""
+" --disable-auto-image-base Do not auto-choose image base. "
+"(default)\n"
+msgstr ""
+
+#: emultempl/pe.em:297
+msgid ""
+" --dll-search-prefix=<string> When linking dynamically to a dll "
+"witout an\n"
+msgstr ""
+
+#: emultempl/pe.em:298
+msgid ""
+" importlib, use <string><basename>.dll "
+"\n"
+msgstr ""
+
+#: emultempl/pe.em:299
+msgid ""
+" in preference to lib<basename>.dll \n"
+msgstr ""
+
+#: emultempl/pe.em:367
msgid "%P: warning: bad version number in -subsystem option\n"
msgstr ""
-#: emultempl/pe.em:388
+#: emultempl/pe.em:403
msgid "%P%F: invalid subsystem type %s\n"
msgstr ""
-#: emultempl/pe.em:403
+#: emultempl/pe.em:418
msgid "%P%F: invalid hex number for PE parameter '%s'\n"
msgstr ""
-#: emultempl/pe.em:421
+#: emultempl/pe.em:436
msgid "%P%F: strange hex info for PE parameter '%s'\n"
msgstr ""
-#: emultempl/pe.em:460
+#: emultempl/pe.em:475
#, c-format
msgid "%s: Can't open base file %s\n"
msgstr ""
-#: emultempl/pe.em:602
+#: emultempl/pe.em:668
msgid "%P: warning, file alignment > section alignment.\n"
msgstr ""
-#: emultempl/pe.em:673 emultempl/pe.em:699
+#: emultempl/pe.em:739 emultempl/pe.em:765
#, c-format
msgid "Warning: resolving %s by linking to %s\n"
msgstr ""
-#: emultempl/pe.em:678 emultempl/pe.em:704
+#: emultempl/pe.em:744 emultempl/pe.em:770
msgid "Use --enable-stdcall-fixup to disable these warnings\n"
msgstr ""
-#: emultempl/pe.em:679 emultempl/pe.em:705
+#: emultempl/pe.em:745 emultempl/pe.em:771
msgid "Use --disable-stdcall-fixup to disable these fixups\n"
msgstr ""
-#: emultempl/pe.em:722
+#: emultempl/pe.em:788
msgid "%F%P: PE operations on non PE file.\n"
msgstr ""
-#: emultempl/pe.em:839
+#: emultempl/pe.em:1015
#, c-format
msgid "Errors encountered processing file %s\n"
msgstr ""
-#: emultempl/pe.em:862
+#: emultempl/pe.em:1038
#, c-format
msgid "Errors encountered processing file %s for interworking"
msgstr ""
-#: emultempl/pe.em:918 ldlang.c:1961 ldlang.c:4333 ldlang.c:4367 ldmain.c:996
+#: emultempl/pe.em:1094 ldlang.c:1981 ldlang.c:4347 ldlang.c:4380
+#: ldmain.c:1016
msgid "%P%F: bfd_link_hash_lookup failed: %E\n"
msgstr ""
-#: ldcref.c:162
+#: ldcref.c:158
msgid "%X%P: bfd_hash_table_init of cref table failed: %E\n"
msgstr ""
-#: ldcref.c:168
+#: ldcref.c:164
msgid "%X%P: cref_hash_lookup failed: %E\n"
msgstr ""
-#: ldcref.c:239
+#: ldcref.c:235
msgid ""
"\n"
"Cross Reference Table\n"
"\n"
msgstr ""
-#: ldcref.c:240
+#: ldcref.c:236
msgid "Symbol"
msgstr ""
-#: ldcref.c:248
+#: ldcref.c:244
msgid "File\n"
msgstr ""
-#: ldcref.c:252
+#: ldcref.c:248
msgid "No symbols\n"
msgstr ""
-#: ldcref.c:369
+#: ldcref.c:364
msgid "%P: symbol `%T' missing from main hash table\n"
msgstr ""
-#: ldcref.c:441
+#: ldcref.c:435
msgid "%B%F: could not read symbols; %E\n"
msgstr ""
-#: ldcref.c:445 ldmain.c:1064 ldmain.c:1068
+#: ldcref.c:439 ldmain.c:1082 ldmain.c:1086
msgid "%B%F: could not read symbols: %E\n"
msgstr ""
-#: ldcref.c:517 ldcref.c:524 ldmain.c:1114 ldmain.c:1121
+#: ldcref.c:511 ldcref.c:518 ldmain.c:1132 ldmain.c:1139
msgid "%B%F: could not read relocs: %E\n"
msgstr ""
@@ -268,7 +302,7 @@ msgstr ""
#. in OUTSECNAME. This reloc is from a section which is
#. mapped into a section from which references to OUTSECNAME
#. are prohibited. We must report an error.
-#: ldcref.c:542
+#: ldcref.c:536
msgid "%X%C: prohibited cross reference from %s to `%T' in %s\n"
msgstr ""
@@ -276,86 +310,86 @@ msgstr ""
msgid "%P%X: Different relocs used in set %s\n"
msgstr ""
-#: ldctor.c:106
+#: ldctor.c:107
msgid "%P%X: Different object file formats composing set %s\n"
msgstr ""
-#: ldctor.c:288 ldctor.c:302
+#: ldctor.c:289 ldctor.c:303
msgid "%P%X: %s does not support reloc %s for set %s\n"
msgstr ""
-#: ldctor.c:323
+#: ldctor.c:324
msgid "%P%X: Unsupported size %d for set %s\n"
msgstr ""
-#: ldctor.c:344
+#: ldctor.c:345
msgid ""
"\n"
"Set Symbol\n"
"\n"
msgstr ""
-#: ldemul.c:224
+#: ldemul.c:220
msgid "%S SYSLIB ignored\n"
msgstr ""
-#: ldemul.c:232
+#: ldemul.c:227
msgid "%S HLL ignored\n"
msgstr ""
-#: ldemul.c:253
+#: ldemul.c:248
msgid "%P: unrecognised emulation mode: %s\n"
msgstr ""
-#: ldemul.c:254
+#: ldemul.c:249
msgid "Supported emulations: "
msgstr ""
-#: ldemul.c:298
+#: ldemul.c:293
msgid " no emulation specific options.\n"
msgstr ""
-#: ldexp.c:157
+#: ldexp.c:154
msgid "%F%P: %s uses undefined section %s\n"
msgstr ""
-#: ldexp.c:159
+#: ldexp.c:156
msgid "%F%P: %s forward reference of section %s\n"
msgstr ""
-#: ldexp.c:271
+#: ldexp.c:268
msgid "%F%S %% by zero\n"
msgstr ""
-#: ldexp.c:278
+#: ldexp.c:275
msgid "%F%S / by zero\n"
msgstr ""
-#: ldexp.c:401
+#: ldexp.c:398
msgid "%X%S: unresolvable symbol `%s' referenced in expression\n"
msgstr ""
-#: ldexp.c:420
+#: ldexp.c:417
msgid "%F%S: undefined symbol `%s' referenced in expression\n"
msgstr ""
-#: ldexp.c:602
+#: ldexp.c:600
msgid "%F%S can not PROVIDE assignment to location counter\n"
msgstr ""
-#: ldexp.c:612
+#: ldexp.c:610
msgid "%F%S invalid assignment to location counter\n"
msgstr ""
-#: ldexp.c:616
+#: ldexp.c:614
msgid "%F%S assignment to location counter invalid outside of SECTION\n"
msgstr ""
-#: ldexp.c:626
+#: ldexp.c:624
msgid "%F%S cannot move location counter backwards (from %V to %V)\n"
msgstr ""
-#: ldexp.c:654
+#: ldexp.c:652
msgid "%P%F:%s: hash creation failed\n"
msgstr ""
@@ -367,55 +401,55 @@ msgstr ""
msgid "%F%S non constant expression for %s\n"
msgstr ""
-#: ldfile.c:108
+#: ldfile.c:102
#, c-format
msgid "attempt to open %s failed\n"
msgstr ""
-#: ldfile.c:110
+#: ldfile.c:104
#, c-format
msgid "attempt to open %s succeeded\n"
msgstr ""
-#: ldfile.c:116
+#: ldfile.c:110
msgid "%F%P: invalid BFD target `%s'\n"
msgstr ""
-#: ldfile.c:140
-msgid "%P: skipping incompatible %s when searching for %s"
+#: ldfile.c:134
+msgid "%P: skipping incompatible %s when searching for %s\n"
msgstr ""
-#: ldfile.c:232
+#: ldfile.c:226
msgid "%F%P: cannot open %s for %s: %E\n"
msgstr ""
-#: ldfile.c:235
+#: ldfile.c:229
msgid "%F%P: cannot open %s: %E\n"
msgstr ""
-#: ldfile.c:255
+#: ldfile.c:250
msgid "%F%P: cannot find %s\n"
msgstr ""
-#: ldfile.c:273 ldfile.c:288
+#: ldfile.c:269 ldfile.c:285
#, c-format
msgid "cannot find script file %s\n"
msgstr ""
-#: ldfile.c:275 ldfile.c:290
+#: ldfile.c:271 ldfile.c:287
#, c-format
msgid "opened script file %s\n"
msgstr ""
-#: ldfile.c:333
+#: ldfile.c:336
msgid "%P%F: cannot open linker script file %s: %E\n"
msgstr ""
-#: ldfile.c:374
+#: ldfile.c:373
msgid "%P%F: unknown architecture: %s\n"
msgstr ""
-#: ldfile.c:391
+#: ldfile.c:389
msgid "%P%F: target architecture respecified\n"
msgstr ""
@@ -461,162 +495,162 @@ msgstr ""
msgid "%P%F: output format %s cannot represent section called %s\n"
msgstr ""
-#: ldlang.c:970
+#: ldlang.c:969
msgid "%P: %B: warning: ignoring duplicate section `%s'\n"
msgstr ""
-#: ldlang.c:973
+#: ldlang.c:972
msgid "%P: %B: warning: ignoring duplicate `%s' section symbol `%s'\n"
msgstr ""
-#: ldlang.c:987
+#: ldlang.c:986
msgid "%P: %B: warning: duplicate section `%s' has different size\n"
msgstr ""
-#: ldlang.c:1039
+#: ldlang.c:1037
msgid "%P%F: Failed to create hash table\n"
msgstr ""
-#: ldlang.c:1422
+#: ldlang.c:1427
msgid "%B: file not recognized: %E\n"
msgstr ""
-#: ldlang.c:1423
+#: ldlang.c:1428
msgid "%B: matching formats:"
msgstr ""
-#: ldlang.c:1430
+#: ldlang.c:1435
msgid "%F%B: file not recognized: %E\n"
msgstr ""
-#: ldlang.c:1483
+#: ldlang.c:1488
msgid "%F%B: object %B in archive is not object\n"
msgstr ""
-#: ldlang.c:1489 ldlang.c:1501
+#: ldlang.c:1494 ldlang.c:1506
msgid "%F%B: could not read symbols: %E\n"
msgstr ""
-#: ldlang.c:1747
+#: ldlang.c:1766
msgid ""
"%P: warning: could not find any targets that match endianness requirement\n"
msgstr ""
-#: ldlang.c:1759
+#: ldlang.c:1779
msgid "%P%F: target %s not found\n"
msgstr ""
-#: ldlang.c:1761
+#: ldlang.c:1781
msgid "%P%F: cannot open output file %s: %E\n"
msgstr ""
-#: ldlang.c:1769
+#: ldlang.c:1791
msgid "%P%F:%s: can not make object file: %E\n"
msgstr ""
-#: ldlang.c:1773
+#: ldlang.c:1795
msgid "%P%F:%s: can not set architecture: %E\n"
msgstr ""
-#: ldlang.c:1777
+#: ldlang.c:1799
msgid "%P%F: can not create link hash table: %E\n"
msgstr ""
-#: ldlang.c:2084
+#: ldlang.c:2104
msgid " load address 0x%V"
msgstr ""
-#: ldlang.c:2214
+#: ldlang.c:2234
msgid "%W (size before relaxing)\n"
msgstr ""
-#: ldlang.c:2296
+#: ldlang.c:2316
#, c-format
msgid "Address of section %s set to "
msgstr ""
-#: ldlang.c:2445
+#: ldlang.c:2465
#, c-format
msgid "Fail with %d\n"
msgstr ""
-#: ldlang.c:2684
+#: ldlang.c:2703
msgid "%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"
msgstr ""
-#: ldlang.c:2718
+#: ldlang.c:2737
msgid "%X%P: address 0x%v of %B section %s is not within region %s\n"
msgstr ""
-#: ldlang.c:2726
+#: ldlang.c:2745
msgid "%X%P: region %s is full (%B section %s)\n"
msgstr ""
-#: ldlang.c:2775
+#: ldlang.c:2794
msgid "%P%X: Internal error on COFF shared library section %s\n"
msgstr ""
-#: ldlang.c:2816
+#: ldlang.c:2835
msgid "%P: warning: no memory region specified for section `%s'\n"
msgstr ""
-#: ldlang.c:2829
+#: ldlang.c:2848
msgid "%P: warning: changing start of section %s by %u bytes\n"
msgstr ""
-#: ldlang.c:2843
+#: ldlang.c:2862
msgid "%F%S: non constant address expression for section %s\n"
msgstr ""
-#: ldlang.c:2907
+#: ldlang.c:2927
msgid "%X%P: use an absolute load address or a load memory region, not both\n"
msgstr ""
-#: ldlang.c:3020
+#: ldlang.c:3043
msgid "%P%F: can't relax section: %E\n"
msgstr ""
-#: ldlang.c:3185
+#: ldlang.c:3210
msgid "%F%P: invalid data statement\n"
msgstr ""
-#: ldlang.c:3222
+#: ldlang.c:3247
msgid "%F%P: invalid reloc statement\n"
msgstr ""
-#: ldlang.c:3358
+#: ldlang.c:3383
msgid "%P%F:%s: can't set start address\n"
msgstr ""
-#: ldlang.c:3371 ldlang.c:3388
+#: ldlang.c:3396 ldlang.c:3413
msgid "%P%F: can't set start address\n"
msgstr ""
-#: ldlang.c:3383
+#: ldlang.c:3408
msgid "%P: warning: cannot find entry symbol %s; defaulting to %V\n"
msgstr ""
-#: ldlang.c:3393
+#: ldlang.c:3418
msgid "%P: warning: cannot find entry symbol %s; not setting start address\n"
msgstr ""
-#: ldlang.c:3435
+#: ldlang.c:3460
msgid ""
"%P: warning: %s architecture of input file `%B' is incompatible with %s "
"output\n"
msgstr ""
-#: ldlang.c:3453
+#: ldlang.c:3478
msgid "%E%X: failed to merge target specific data of file %B\n"
msgstr ""
-#: ldlang.c:3540
+#: ldlang.c:3565
msgid ""
"\n"
"Allocating common symbols\n"
msgstr ""
-#: ldlang.c:3541
+#: ldlang.c:3566
msgid ""
"Common symbol size file\n"
"\n"
@@ -625,43 +659,43 @@ msgstr ""
#. This message happens when using the
#. svr3.ifile linker script, so I have
#. disabled it.
-#: ldlang.c:3626
+#: ldlang.c:3648
msgid "%P: no [COMMON] command, defaulting to .bss\n"
msgstr ""
-#: ldlang.c:3686
+#: ldlang.c:3707
msgid "%P%F: invalid syntax in flags\n"
msgstr ""
-#: ldlang.c:4281
+#: ldlang.c:4296
msgid "%P%Fmultiple STARTUP files\n"
msgstr ""
-#: ldlang.c:4553
+#: ldlang.c:4566
msgid "%F%P: bfd_record_phdr failed: %E\n"
msgstr ""
-#: ldlang.c:4572
+#: ldlang.c:4585
msgid "%X%P: section `%s' assigned to non-existent phdr `%s'\n"
msgstr ""
-#: ldlang.c:4881
+#: ldlang.c:4893
msgid "%X%P: unknown language `%s' in version information\n"
msgstr ""
-#: ldlang.c:4930
+#: ldlang.c:4942
msgid "%X%P: duplicate version tag `%s'\n"
msgstr ""
-#: ldlang.c:4943 ldlang.c:4956
+#: ldlang.c:4955 ldlang.c:4968
msgid "%X%P: duplicate expression `%s' in version information\n"
msgstr ""
-#: ldlang.c:4993
+#: ldlang.c:5005
msgid "%X%P: unable to find version dependency `%s'\n"
msgstr ""
-#: ldlang.c:5015
+#: ldlang.c:5027
msgid "%X%P: unable to read .exports section contents"
msgstr ""
@@ -669,195 +703,199 @@ msgstr ""
msgid "%X%P: can't set BFD default target to `%s': %E\n"
msgstr ""
-#: ldmain.c:262
+#: ldmain.c:268
msgid "%P%F: -r and --mpc860c0 may not be used together\n"
msgstr ""
-#: ldmain.c:264
+#: ldmain.c:270
msgid "%P%F: --relax and -r may not be used together\n"
msgstr ""
-#: ldmain.c:266
+#: ldmain.c:272
msgid "%P%F: -r and -shared may not be used together\n"
msgstr ""
-#: ldmain.c:295
+#: ldmain.c:301
msgid "using internal linker script:\n"
msgstr ""
-#: ldmain.c:314
+#: ldmain.c:320
msgid "%P%F: no input files\n"
msgstr ""
-#: ldmain.c:319
+#: ldmain.c:325
msgid "%P: mode %s\n"
msgstr ""
-#: ldmain.c:337
+#: ldmain.c:342
msgid "%P%F: cannot open map file %s: %E\n"
msgstr ""
-#: ldmain.c:383
+#: ldmain.c:389
msgid "%P: link errors found, deleting executable `%s'\n"
msgstr ""
-#: ldmain.c:394
+#: ldmain.c:400
msgid "%F%B: final close failed: %E\n"
msgstr ""
-#: ldmain.c:418
+#: ldmain.c:424
msgid "%X%P: unable to open for source of copy `%s'\n"
msgstr ""
-#: ldmain.c:420
+#: ldmain.c:426
msgid "%X%P: unable to open for destination of copy `%s'\n"
msgstr ""
-#: ldmain.c:426
+#: ldmain.c:432
msgid "%P: Error writing file `%s'\n"
msgstr ""
-#: ldmain.c:432 pe-dll.c:1082
+#: ldmain.c:438 pe-dll.c:1097
#, c-format
msgid "%P: Error closing file `%s'\n"
msgstr ""
-#: ldmain.c:449
+#: ldmain.c:455
#, c-format
msgid "%s: total time in link: %ld.%06ld\n"
msgstr ""
-#: ldmain.c:452
+#: ldmain.c:458
#, c-format
msgid "%s: data size %ld\n"
msgstr ""
-#: ldmain.c:493
+#: ldmain.c:499
msgid "%P%F: missing argument to -m\n"
msgstr ""
-#: ldmain.c:607 ldmain.c:628 ldmain.c:659
+#: ldmain.c:624 ldmain.c:645 ldmain.c:676
msgid "%P%F: bfd_hash_table_init failed: %E\n"
msgstr ""
-#: ldmain.c:612 ldmain.c:631
+#: ldmain.c:629 ldmain.c:648
msgid "%P%F: bfd_hash_lookup failed: %E\n"
msgstr ""
-#: ldmain.c:646
+#: ldmain.c:663
msgid "%X%P: error: duplicate retain-symbols-file\n"
msgstr ""
-#: ldmain.c:690
+#: ldmain.c:707
msgid "%P%F: bfd_hash_lookup for insertion failed: %E\n"
msgstr ""
-#: ldmain.c:695
+#: ldmain.c:712
msgid "%P: `-retain-symbols-file' overrides `-s' and `-S'\n"
msgstr ""
-#: ldmain.c:772
+#: ldmain.c:788
msgid "Archive member included"
msgstr ""
-#: ldmain.c:773
+#: ldmain.c:789
msgid "because of file (symbol)"
msgstr ""
-#: ldmain.c:845
+#: ldmain.c:860
msgid "%X%C: multiple definition of `%T'\n"
msgstr ""
-#: ldmain.c:848
+#: ldmain.c:863
msgid "%D: first defined here\n"
msgstr ""
-#: ldmain.c:877
+#: ldmain.c:867
+msgid "%P: Disabling relaxation: it will not work with multiple definitions\n"
+msgstr ""
+
+#: ldmain.c:898
msgid "%B: warning: definition of `%T' overriding common\n"
msgstr ""
-#: ldmain.c:880
+#: ldmain.c:901
msgid "%B: warning: common is here\n"
msgstr ""
-#: ldmain.c:887
+#: ldmain.c:908
msgid "%B: warning: common of `%T' overridden by definition\n"
msgstr ""
-#: ldmain.c:890
+#: ldmain.c:911
msgid "%B: warning: defined here\n"
msgstr ""
-#: ldmain.c:897
+#: ldmain.c:918
msgid "%B: warning: common of `%T' overridden by larger common\n"
msgstr ""
-#: ldmain.c:900
+#: ldmain.c:921
msgid "%B: warning: larger common is here\n"
msgstr ""
-#: ldmain.c:904
+#: ldmain.c:925
msgid "%B: warning: common of `%T' overriding smaller common\n"
msgstr ""
-#: ldmain.c:907
+#: ldmain.c:928
msgid "%B: warning: smaller common is here\n"
msgstr ""
-#: ldmain.c:911
+#: ldmain.c:932
msgid "%B: warning: multiple common of `%T'\n"
msgstr ""
-#: ldmain.c:913
+#: ldmain.c:934
msgid "%B: warning: previous common is here\n"
msgstr ""
-#: ldmain.c:935 ldmain.c:974
+#: ldmain.c:955 ldmain.c:994
msgid "%P: warning: global constructor %s used\n"
msgstr ""
-#: ldmain.c:984
+#: ldmain.c:1004
msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"
msgstr ""
-#: ldmain.c:1171
+#: ldmain.c:1188
msgid "%F%P: bfd_hash_table_init failed: %E\n"
msgstr ""
-#: ldmain.c:1178
+#: ldmain.c:1195
msgid "%F%P: bfd_hash_lookup failed: %E\n"
msgstr ""
-#: ldmain.c:1198
+#: ldmain.c:1215
msgid "%C: undefined reference to `%T'\n"
msgstr ""
-#: ldmain.c:1204
+#: ldmain.c:1221
msgid "%D: more undefined references to `%T' follow\n"
msgstr ""
-#: ldmain.c:1211
+#: ldmain.c:1228
msgid "%B: undefined reference to `%T'\n"
msgstr ""
-#: ldmain.c:1217
+#: ldmain.c:1234
msgid "%B: more undefined references to `%T' follow\n"
msgstr ""
-#: ldmain.c:1238 ldmain.c:1260 ldmain.c:1280
+#: ldmain.c:1254 ldmain.c:1275 ldmain.c:1294
msgid "%P%X: generated"
msgstr ""
-#: ldmain.c:1241
+#: ldmain.c:1257
msgid " relocation truncated to fit: %s %T"
msgstr ""
-#: ldmain.c:1263
+#: ldmain.c:1278
#, c-format
msgid "dangerous relocation: %s\n"
msgstr ""
-#: ldmain.c:1283
+#: ldmain.c:1297
msgid " reloc refers to symbol `%T' which is not being output\n"
msgstr ""
@@ -897,12 +935,12 @@ msgstr ""
msgid "%P%F: please report this bug\n"
msgstr ""
-#: ldver.c:35
+#: ldver.c:39
#, c-format
msgid "GNU ld version %s (with BFD %s)\n"
msgstr ""
-#: ldver.c:42 lexsup.c:887
+#: ldver.c:46 lexsup.c:961
msgid " Supported emulations:\n"
msgstr ""
@@ -910,593 +948,635 @@ msgstr ""
msgid "%P%F: bfd_new_link_order failed\n"
msgstr ""
-#: ldwrite.c:365
+#: ldwrite.c:321
+msgid "%F%P: clone section failed: %E\n"
+msgstr ""
+
+#: ldwrite.c:360
#, c-format
msgid "%8x something else\n"
msgstr ""
-#: ldwrite.c:526
+#: ldwrite.c:543
msgid "%F%P: final link failed: %E\n"
msgstr ""
-#: lexsup.c:155 lexsup.c:238 lexsup.c:244
+#: lexsup.c:159 lexsup.c:250
msgid "KEYWORD"
msgstr ""
-#: lexsup.c:155
+#: lexsup.c:159
msgid "Shared library control for HP/UX compatibility"
msgstr ""
-#: lexsup.c:158
+#: lexsup.c:162
msgid "ARCH"
msgstr ""
-#: lexsup.c:158
+#: lexsup.c:162
msgid "Set architecture"
msgstr ""
-#: lexsup.c:160 lexsup.c:307
+#: lexsup.c:164 lexsup.c:315
msgid "TARGET"
msgstr ""
-#: lexsup.c:160
+#: lexsup.c:164
msgid "Specify target for following input files"
msgstr ""
-#: lexsup.c:162 lexsup.c:201 lexsup.c:211 lexsup.c:220 lexsup.c:291
-#: lexsup.c:314 lexsup.c:348
+#: lexsup.c:166 lexsup.c:205 lexsup.c:217 lexsup.c:226 lexsup.c:297
+#: lexsup.c:322 lexsup.c:360
msgid "FILE"
msgstr ""
-#: lexsup.c:162
+#: lexsup.c:166
msgid "Read MRI format linker script"
msgstr ""
-#: lexsup.c:164
+#: lexsup.c:168
msgid "Force common symbols to be defined"
msgstr ""
-#: lexsup.c:168 lexsup.c:338 lexsup.c:340 lexsup.c:342
+#: lexsup.c:172 lexsup.c:350 lexsup.c:352 lexsup.c:354
msgid "ADDRESS"
msgstr ""
-#: lexsup.c:168
+#: lexsup.c:172
msgid "Set start address"
msgstr ""
-#: lexsup.c:170
+#: lexsup.c:174
msgid "Export all dynamic symbols"
msgstr ""
-#: lexsup.c:172
+#: lexsup.c:176
msgid "Link big-endian objects"
msgstr ""
-#: lexsup.c:174
+#: lexsup.c:178
msgid "Link little-endian objects"
msgstr ""
-#: lexsup.c:176 lexsup.c:179
+#: lexsup.c:180 lexsup.c:183
msgid "SHLIB"
msgstr ""
-#: lexsup.c:176
+#: lexsup.c:180
msgid "Auxiliary filter for shared object symbol table"
msgstr ""
-#: lexsup.c:179
+#: lexsup.c:183
msgid "Filter for shared object symbol table"
msgstr ""
-#: lexsup.c:181
+#: lexsup.c:185
msgid "Ignored"
msgstr ""
-#: lexsup.c:183
+#: lexsup.c:187
msgid "SIZE"
msgstr ""
-#: lexsup.c:183
+#: lexsup.c:187
msgid "Small data size (if no size, same as --shared)"
msgstr ""
-#: lexsup.c:186
+#: lexsup.c:190
msgid "FILENAME"
msgstr ""
-#: lexsup.c:186
+#: lexsup.c:190
msgid "Set internal name of shared library"
msgstr ""
-#: lexsup.c:188
+#: lexsup.c:192
msgid "LIBNAME"
msgstr ""
-#: lexsup.c:188
+#: lexsup.c:192
msgid "Search for library LIBNAME"
msgstr ""
-#: lexsup.c:190
+#: lexsup.c:194
msgid "DIRECTORY"
msgstr ""
-#: lexsup.c:190
+#: lexsup.c:194
msgid "Add DIRECTORY to library search path"
msgstr ""
-#: lexsup.c:192
+#: lexsup.c:196
msgid "EMULATION"
msgstr ""
-#: lexsup.c:192
+#: lexsup.c:196
msgid "Set emulation"
msgstr ""
-#: lexsup.c:194
+#: lexsup.c:198
msgid "Print map file on standard output"
msgstr ""
-#: lexsup.c:196
+#: lexsup.c:200
msgid "Do not page align data"
msgstr ""
-#: lexsup.c:198
+#: lexsup.c:202
msgid "Do not page align data, do not make text readonly"
msgstr ""
-#: lexsup.c:201
+#: lexsup.c:205
msgid "Set output file name"
msgstr ""
-#: lexsup.c:203
+#: lexsup.c:207
msgid "Optimize output file"
msgstr ""
-#: lexsup.c:205
+#: lexsup.c:209
msgid "Ignored for SVR4 compatibility"
msgstr ""
-#: lexsup.c:207
+#: lexsup.c:213
msgid "Generate relocateable output"
msgstr ""
-#: lexsup.c:211
+#: lexsup.c:217
msgid "Just link symbols (if directory, same as --rpath)"
msgstr ""
-#: lexsup.c:214
+#: lexsup.c:220
msgid "Strip all symbols"
msgstr ""
-#: lexsup.c:216
+#: lexsup.c:222
msgid "Strip debugging symbols"
msgstr ""
-#: lexsup.c:218
+#: lexsup.c:224
msgid "Trace file opens"
msgstr ""
-#: lexsup.c:220
+#: lexsup.c:226
msgid "Read linker script"
msgstr ""
-#: lexsup.c:222 lexsup.c:234 lexsup.c:277 lexsup.c:289 lexsup.c:334
-#: lexsup.c:351 lexsup.c:368
+#: lexsup.c:228 lexsup.c:242 lexsup.c:283 lexsup.c:295 lexsup.c:344
+#: lexsup.c:363 lexsup.c:380
msgid "SYMBOL"
msgstr ""
-#: lexsup.c:222
+#: lexsup.c:228
msgid "Start with undefined reference to SYMBOL"
msgstr ""
-#: lexsup.c:224
+#: lexsup.c:230
+msgid "Don't merge orphan sections with the same name"
+msgstr ""
+
+#: lexsup.c:232
msgid "Build global constructor/destructor tables"
msgstr ""
-#: lexsup.c:226
+#: lexsup.c:234
msgid "Print version information"
msgstr ""
-#: lexsup.c:228
+#: lexsup.c:236
msgid "Print version and emulation information"
msgstr ""
-#: lexsup.c:230
+#: lexsup.c:238
msgid "Discard all local symbols"
msgstr ""
-#: lexsup.c:232
+#: lexsup.c:240
msgid "Discard temporary local symbols"
msgstr ""
-#: lexsup.c:234
+#: lexsup.c:242
msgid "Trace mentions of SYMBOL"
msgstr ""
-#: lexsup.c:236 lexsup.c:316 lexsup.c:318
+#: lexsup.c:244 lexsup.c:324 lexsup.c:326
msgid "PATH"
msgstr ""
-#: lexsup.c:236
+#: lexsup.c:244
msgid "Default search path for Solaris compatibility"
msgstr ""
-#: lexsup.c:238
-msgid "Ignored for Solaris compatibility"
-msgstr ""
-
-#: lexsup.c:240
+#: lexsup.c:246
msgid "Start a group"
msgstr ""
-#: lexsup.c:242
+#: lexsup.c:248
msgid "End a group"
msgstr ""
-#: lexsup.c:244
+#: lexsup.c:250
msgid "Ignored for SunOS compatibility"
msgstr ""
-#: lexsup.c:246
+#: lexsup.c:252
msgid "Link against shared libraries"
msgstr ""
-#: lexsup.c:252
+#: lexsup.c:258
msgid "Do not link against shared libraries"
msgstr ""
-#: lexsup.c:260
+#: lexsup.c:266
msgid "Bind global references locally"
msgstr ""
-#: lexsup.c:262
+#: lexsup.c:268
msgid "Check section addresses for overlaps (default)"
msgstr ""
-#: lexsup.c:264
+#: lexsup.c:270
msgid "Do not check section addresses for overlaps"
msgstr ""
-#: lexsup.c:267
+#: lexsup.c:273
msgid "Output cross reference table"
msgstr ""
-#: lexsup.c:269
+#: lexsup.c:275
msgid "SYMBOL=EXPRESSION"
msgstr ""
-#: lexsup.c:269
+#: lexsup.c:275
msgid "Define a symbol"
msgstr ""
-#: lexsup.c:271
-msgid "Demangle symbol names"
+#: lexsup.c:277
+msgid "[=STYLE]"
msgstr ""
-#: lexsup.c:273
+#: lexsup.c:277
+msgid "Demangle symbol names [using STYLE]"
+msgstr ""
+
+#: lexsup.c:279
msgid "PROGRAM"
msgstr ""
-#: lexsup.c:273
+#: lexsup.c:279
msgid "Set the dynamic linker to use"
msgstr ""
-#: lexsup.c:275
+#: lexsup.c:281
msgid "Generate embedded relocs"
msgstr ""
-#: lexsup.c:277
+#: lexsup.c:283
msgid "Call SYMBOL at unload-time"
msgstr ""
-#: lexsup.c:279
+#: lexsup.c:285
msgid "Force generation of file with .exe suffix"
msgstr ""
-#: lexsup.c:281
+#: lexsup.c:287
msgid "Remove unused sections (on some targets)"
msgstr ""
-#: lexsup.c:284
+#: lexsup.c:290
msgid "Don't remove unused sections (default)"
msgstr ""
-#: lexsup.c:287
+#: lexsup.c:293
msgid "Print option help"
msgstr ""
-#: lexsup.c:289
+#: lexsup.c:295
msgid "Call SYMBOL at load-time"
msgstr ""
-#: lexsup.c:291
+#: lexsup.c:297
msgid "Write a map file"
msgstr ""
-#: lexsup.c:293
+#: lexsup.c:299
msgid "Do not demangle symbol names"
msgstr ""
-#: lexsup.c:295
+#: lexsup.c:301
msgid "Use less memory and more disk I/O"
msgstr ""
-#: lexsup.c:297
+#: lexsup.c:303
msgid "Allow no undefined symbols"
msgstr ""
-#: lexsup.c:299
+#: lexsup.c:305
+msgid "Allow undefined symbols in shared objects"
+msgstr ""
+
+#: lexsup.c:307
msgid "Don't warn about mismatched input files"
msgstr ""
-#: lexsup.c:301
+#: lexsup.c:309
msgid "Turn off --whole-archive"
msgstr ""
-#: lexsup.c:303
+#: lexsup.c:311
msgid "Create an output file even if errors occur"
msgstr ""
-#: lexsup.c:307
+#: lexsup.c:315
msgid "Specify target of output file"
msgstr ""
-#: lexsup.c:309
+#: lexsup.c:317
msgid "Ignored for Linux compatibility"
msgstr ""
-#: lexsup.c:311
+#: lexsup.c:319
msgid "Relax branches on certain targets"
msgstr ""
-#: lexsup.c:314
+#: lexsup.c:322
msgid "Keep only symbols listed in FILE"
msgstr ""
-#: lexsup.c:316
+#: lexsup.c:324
msgid "Set runtime shared library search path"
msgstr ""
-#: lexsup.c:318
+#: lexsup.c:326
msgid "Set link time shared library search path"
msgstr ""
-#: lexsup.c:320
+#: lexsup.c:328
msgid "Create a shared library"
msgstr ""
-#: lexsup.c:324
+#: lexsup.c:332
msgid "Sort common symbols by size"
msgstr ""
-#: lexsup.c:328
-msgid "Split output sections for each file"
+#: lexsup.c:336
+msgid "[=SIZE]"
msgstr ""
-#: lexsup.c:330
-msgid "COUNT"
+#: lexsup.c:336
+msgid "Split output sections every SIZE octets"
msgstr ""
-#: lexsup.c:330
+#: lexsup.c:338
+msgid "[=COUNT]"
+msgstr ""
+
+#: lexsup.c:338
msgid "Split output sections every COUNT relocs"
msgstr ""
-#: lexsup.c:332
+#: lexsup.c:340
msgid "Print memory usage statistics"
msgstr ""
-#: lexsup.c:334
+#: lexsup.c:342
+msgid "Display target specific options"
+msgstr ""
+
+#: lexsup.c:344
msgid "Do task level linking"
msgstr ""
-#: lexsup.c:336
+#: lexsup.c:346
msgid "Use same format as native linker"
msgstr ""
-#: lexsup.c:338
+#: lexsup.c:348
+msgid "SECTION=ADDRESS"
+msgstr ""
+
+#: lexsup.c:348
+msgid "Set address of named section"
+msgstr ""
+
+#: lexsup.c:350
msgid "Set address of .bss section"
msgstr ""
-#: lexsup.c:340
+#: lexsup.c:352
msgid "Set address of .data section"
msgstr ""
-#: lexsup.c:342
+#: lexsup.c:354
msgid "Set address of .text section"
msgstr ""
-#: lexsup.c:344
+#: lexsup.c:356
msgid "Output lots of information during link"
msgstr ""
-#: lexsup.c:348
+#: lexsup.c:360
msgid "Read version information script"
msgstr ""
-#: lexsup.c:351
+#: lexsup.c:363
msgid ""
"Take export symbols list from .exports, using\n"
"\t\t\t\tSYMBOL as the version."
msgstr ""
-#: lexsup.c:354
+#: lexsup.c:366
msgid "Warn about duplicate common symbols"
msgstr ""
-#: lexsup.c:356
+#: lexsup.c:368
msgid "Warn if global constructors/destructors are seen"
msgstr ""
-#: lexsup.c:359
+#: lexsup.c:371
msgid "Warn if the multiple GP values are used"
msgstr ""
-#: lexsup.c:361
+#: lexsup.c:373
msgid "Warn only once per undefined symbol"
msgstr ""
-#: lexsup.c:363
+#: lexsup.c:375
msgid "Warn if start of section changes due to alignment"
msgstr ""
-#: lexsup.c:366
+#: lexsup.c:378
msgid "Include all objects from following archives"
msgstr ""
-#: lexsup.c:368
+#: lexsup.c:380
msgid "Use wrapper functions for SYMBOL"
msgstr ""
-#: lexsup.c:370
+#: lexsup.c:382
msgid "[=WORDS]"
msgstr ""
-#: lexsup.c:370
+#: lexsup.c:382
msgid ""
"Modify problematic branches in last WORDS (1-10,\n"
"\t\t\t\tdefault 5) words of a page"
msgstr ""
-#: lexsup.c:520
+#: lexsup.c:532
#, c-format
msgid "%s: use the --help option for usage information\n"
msgstr ""
-#: lexsup.c:540
+#: lexsup.c:552
msgid "%P%F: unrecognized -a option `%s'\n"
msgstr ""
-#: lexsup.c:553
+#: lexsup.c:565
msgid "%P%F: unrecognized -assert option `%s'\n"
msgstr ""
-#: lexsup.c:644
+#: lexsup.c:608
+msgid "%F%P: unknown demangling style `%s'"
+msgstr ""
+
+#: lexsup.c:667
msgid "%P%F: invalid number `%s'\n"
msgstr ""
-#: lexsup.c:816
+#: lexsup.c:845
msgid "%P%F: -shared not supported\n"
msgstr ""
-#: lexsup.c:880
-msgid "Copyright 1997 Free Software Foundation, Inc.\n"
+#: lexsup.c:879
+#, c-format
+msgid "%s: Invalid argument to option \"--section-start\"\n"
+msgstr ""
+
+#: lexsup.c:890
+#, c-format
+msgid "%s: Missing argument(s) to option \"--section-start\"\n"
+msgstr ""
+
+#: lexsup.c:954
+msgid "Copyright 2000 Free Software Foundation, Inc.\n"
msgstr ""
-#: lexsup.c:881
+#: lexsup.c:955
msgid ""
"This program is free software; you may redistribute it under the terms of\n"
"the GNU General Public License. This program has absolutely no warranty.\n"
msgstr ""
-#: lexsup.c:972
+#: lexsup.c:1047
#, c-format
msgid "%s: may not nest groups (--help for usage)\n"
msgstr ""
-#: lexsup.c:983
+#: lexsup.c:1058
#, c-format
msgid "%s: group ended before it began (--help for usage)\n"
msgstr ""
-#: lexsup.c:1000
+#: lexsup.c:1075
#, c-format
msgid "%s: Invalid argument to option \"mpc860c0\"\n"
msgstr ""
-#: lexsup.c:1056
+#: lexsup.c:1131
msgid "%P%F: invalid hex number `%s'\n"
msgstr ""
-#: lexsup.c:1068
+#: lexsup.c:1143
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: lexsup.c:1070
+#: lexsup.c:1145
msgid "Options:\n"
msgstr ""
#. Note: Various tools (such as libtool) depend upon the
#. format of the listings below - do not change them.
-#: lexsup.c:1149
+#: lexsup.c:1224
#, c-format
msgid "%s: supported targets:"
msgstr ""
-#: lexsup.c:1157
+#: lexsup.c:1232
#, c-format
msgid "%s: supported emulations: "
msgstr ""
-#: lexsup.c:1162
+#: lexsup.c:1237
#, c-format
msgid "%s: emulation specific options:\n"
msgstr ""
-#: lexsup.c:1166
+#: lexsup.c:1241
#, c-format
msgid "Report bugs to %s\n"
msgstr ""
-#: mri.c:343
+#: mri.c:321
msgid "%P%F: unknown format type %s\n"
msgstr ""
-#: pe-dll.c:144
+#: pe-dll.c:146
#, c-format
msgid "%XUnsupported PEI architecture: %s\n"
msgstr ""
-#: pe-dll.c:377
+#: pe-dll.c:387
#, c-format
-msgid "%XError, duplicate EXPORT with oridinals: %s (%d vs %d)\n"
+msgid "%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"
msgstr ""
-#: pe-dll.c:384
+#: pe-dll.c:394
#, c-format
msgid "Warning, duplicate EXPORT: %s\n"
msgstr ""
-#: pe-dll.c:446
+#: pe-dll.c:456
#, c-format
msgid "%XCannot export %s: symbol not defined\n"
msgstr ""
-#: pe-dll.c:452
+#: pe-dll.c:462
#, c-format
msgid "%XCannot export %s: symbol wrong type (%d vs %d)\n"
msgstr ""
-#: pe-dll.c:459
+#: pe-dll.c:469
#, c-format
msgid "%XCannot export %s: symbol not found\n"
msgstr ""
-#: pe-dll.c:584
+#: pe-dll.c:594
#, c-format
-msgid "%XError, oridinal used twice: %d (%s vs %s)\n"
+msgid "%XError, ordinal used twice: %d (%s vs %s)\n"
msgstr ""
-#: pe-dll.c:831
+#: pe-dll.c:844
#, c-format
msgid "%XError: %d-bit reloc in dll\n"
msgstr ""
-#: pe-dll.c:955
+#: pe-dll.c:970
#, c-format
msgid "%s: Can't open output def file %s\n"
msgstr ""
-#: pe-dll.c:1077
+#: pe-dll.c:1092
msgid "; no contents available\n"
msgstr ""
-#: pe-dll.c:1566
+#: pe-dll.c:1580
#, c-format
msgid "%XCan't open .lib file: %s\n"
msgstr ""
-#: pe-dll.c:1571
+#: pe-dll.c:1585
#, c-format
msgid "Creating library file: %s\n"
msgstr ""
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/crisaout.sc b/gnu/usr.bin/binutils/ld/scripttempl/crisaout.sc
new file mode 100644
index 00000000000..c729668a5bd
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/crisaout.sc
@@ -0,0 +1,131 @@
+cat <<EOF
+OUTPUT_FORMAT("a.out-cris")
+OUTPUT_ARCH(cris)
+ENTRY(__start)
+SECTIONS
+{
+ .text ${RELOCATING+ ${TEXT_START_ADDR}}:
+ {
+ CREATE_OBJECT_SYMBOLS;
+ ${CONSTRUCTING+ __Stext = .;}
+ ${RELOCATING+*(.startup)}
+ *(.text)
+ ${CONSTRUCTING+__start = DEFINED(__start) ? __start :
+ DEFINED(_start) ? _start :
+ DEFINED(start) ? start :
+ DEFINED(.startup) ? .startup + 2 : 2;}
+ ${RELOCATING+*(.text.*)}
+ ${RELOCATING+*(.gnu.linkonce.t*)}
+ ${RELOCATING+*(.rodata)}
+ ${RELOCATING+*(.rodata.*)}
+ ${RELOCATING+*(.gnu.linkonce.r*)}
+
+ /* Do not "provide" init-start and fini-start symbols; they might be
+ referred to weakly, so the linker would not override the zero
+ default.
+ FIXME: It's somewhat unexpected to have code emitted by the linker
+ script. Some other mechanism could probably do better. */
+ ${CONSTRUCTING+ . = ALIGN (2);}
+ ${CONSTRUCTING+ ___init__start = .;}
+ ${CONSTRUCTING+ PROVIDE (___do_global_ctors = .);}
+ ${CONSTRUCTING+ SHORT (0xe1fc); /* push srp */}
+ ${CONSTRUCTING+ SHORT (0xbe7e);}
+ ${CONSTRUCTING+ *(.init)}
+ ${CONSTRUCTING+ SHORT (0x0d3e); /* jump [sp+] */}
+ ${CONSTRUCTING+ PROVIDE (__init__end = .);}
+ ${CONSTRUCTING+ PROVIDE (___init__end = .);}
+
+ ${CONSTRUCTING+ . = ALIGN (2);}
+ ${CONSTRUCTING+ ___fini__start = .;}
+ ${CONSTRUCTING+ PROVIDE (___do_global_dtors = .);}
+ ${CONSTRUCTING+ SHORT (0xe1fc); /* push srp */}
+ ${CONSTRUCTING+ SHORT (0xbe7e);}
+ ${CONSTRUCTING+ *(.fini)}
+ ${CONSTRUCTING+ SHORT (0x0d3e); /* jump [sp+] */}
+ ${CONSTRUCTING+ PROVIDE (__fini__end = .);}
+ ${CONSTRUCTING+ ___fini__end = .;}
+
+ /* Cater to linking from ELF. */
+ ${CONSTRUCTING+ PROVIDE(___ctors = .);}
+ ${CONSTRUCTING+ ___elf_ctors_dtors_begin = .;}
+ ${CONSTRUCTING+ KEEP (*crtbegin.o(.ctors))}
+ ${CONSTRUCTING+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))}
+ ${CONSTRUCTING+ KEEP (*(SORT(.ctors.*)))}
+ ${CONSTRUCTING+ KEEP (*(.ctors))}
+ ${CONSTRUCTING+ PROVIDE(___ctors_end = .);}
+
+ ${CONSTRUCTING+ PROVIDE(___dtors = .);}
+ ${CONSTRUCTING+ KEEP (*crtbegin.o(.dtors))}
+ ${CONSTRUCTING+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))}
+ ${CONSTRUCTING+ KEEP (*(SORT(.dtors.*)))}
+ ${CONSTRUCTING+ KEEP (*(.dtors))}
+ ${CONSTRUCTING+ PROVIDE(___dtors_end = .);}
+ ${CONSTRUCTING+ ___elf_ctors_dtors_end = .;}
+
+ /* We include objects that force alignment of the data segment.
+ Unfortunately that sometimes causes a gap between .text and .data,
+ which is not detectable since .data does not have a start address
+ of itself in the a.out header. This should only matter for
+ testing; for production use, .data is at a "known" location.
+ We assume .data does not get an alignment larger than 32 bytes. */
+ ${CONSTRUCTING+. = ALIGN (32);}
+
+ ${CONSTRUCTING+ __Etext = .;}
+
+ /* Deprecated, use __Etext. */
+ ${CONSTRUCTING+ PROVIDE(_etext = .);}
+ }
+
+ /* Any dot-relative start-expression (such as "ALIGN(2)", also including
+ the "default" .data alignment expression) will use the initial, raw
+ size of .text and will be incorrect if the alignment used is less
+ than the alignment for .text (which might depend on input and obj
+ format). FIXME: Seems like a bug in ld. Seems hard to fix. Seems
+ unimportant. */
+ .data :
+ {
+ ${CONSTRUCTING+ __Sdata = .;}
+ *(.data);
+ ${RELOCATING+*(.data.*)}
+ ${RELOCATING+*(.gnu.linkonce.d*)}
+ ${RELOCATING+*(.eh_frame) /* FIXME: Make .text */}
+ ${RELOCATING+*(.gcc_except_table)}
+
+ /* See comment at ALIGN before __Etext. */
+ ${CONSTRUCTING+. = ALIGN (32);}
+
+ ${CONSTRUCTING+ __Edata = .;}
+
+ /* Deprecated, use __Edata. */
+ ${CONSTRUCTING+ PROVIDE(_edata = .);}
+ }
+
+ .bss :
+ {
+ /* Deprecated, use __Sbss. */
+ ${CONSTRUCTING+ PROVIDE(_bss_start = .);}
+
+ ${CONSTRUCTING+ __Sbss = .;}
+ *(.bss)
+ ${RELOCATING+*(.bss.*)}
+ *(COMMON)
+ ${CONSTRUCTING+ __Ebss = .;}
+
+ /* Deprecated, use __Ebss or __Eall as appropriate. */
+ ${CONSTRUCTING+ PROVIDE(_end = .);}
+ ${CONSTRUCTING+ PROVIDE(__end = .);}
+ }
+ ${CONSTRUCTING+ __Eall = .;}
+
+ /* Unfortunately, stabs are not mappable from ELF to a.out.
+ It can probably be fixed with some amount of work. */
+ /DISCARD/ :
+ { *(.stab) *(.stab*) *(.debug) *(.debug*) *(.comment) *(.gnu.warning.*) }
+
+ /* For the rsim and xsim simulators. */
+ ${CONSTRUCTING+ PROVIDE(__Endmem = 0x10000000);}
+
+ /* For elinux. */
+ ${CONSTRUCTING+ PROVIDE(__Stacksize = 0);}
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elf32avr.sc b/gnu/usr.bin/binutils/ld/scripttempl/elf32avr.sc
index 51b6512bf7f..0673945b854 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elf32avr.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elf32avr.sc
@@ -6,7 +6,7 @@ MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH
data (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH
- eeprom (rw!x) : ORIGIN = 0, LENGTH = $EEPROM_LENGTH
+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = $EEPROM_LENGTH
}
SECTIONS
@@ -88,6 +88,7 @@ SECTIONS
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{
+ ${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data)
*(.gnu.linkonce.d*)
${RELOCATING+. = ALIGN(2);}
@@ -95,7 +96,6 @@ SECTIONS
} ${RELOCATING+ > data}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
- ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.data))}
{
${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss)
@@ -105,6 +105,7 @@ SECTIONS
} ${RELOCATING+ > data}
.eeprom ${RELOCATING-0}:
+ ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.data))}
{
*(.eeprom*)
${RELOCATING+ __eeprom_end = . ; }
@@ -136,7 +137,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
@@ -144,6 +145,7 @@ SECTIONS
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
+ PROVIDE (__stack = ${STACK}) ;
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfd10v.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfd10v.sc
index 4a606c32766..4dca63c9b0b 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfd10v.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfd10v.sc
@@ -150,7 +150,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfd30v.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfd30v.sc
index f33f90ce14b..3b0a08a5ec2 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfd30v.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfd30v.sc
@@ -203,7 +203,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
@@ -214,3 +214,7 @@ SECTIONS
PROVIDE (__stack = ${STACK_START_ADDR});
}
EOF
+
+
+
+
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfi370.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfi370.sc
index e2f0e881874..05b1cf1d1bf 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfi370.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfi370.sc
@@ -198,7 +198,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc
new file mode 100644
index 00000000000..3cd25a2a367
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc
@@ -0,0 +1,361 @@
+#
+# Unusual variables checked by this code:
+# NOP - two byte opcode for no-op (defaults to 0)
+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
+# (e.g., .PARISC.global)
+# OTHER_SECTIONS - at the end
+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
+# executable (e.g., _DYNAMIC_LINK)
+# TEXT_START_SYMBOLS - symbols that appear at the start of the
+# .text section.
+# DATA_START_SYMBOLS - symbols that appear at the start of the
+# .data section.
+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+# .bss section besides __bss_start.
+# EMBEDDED - whether this is for an embedded system.
+#
+# When adding sections, do note that the names of some sections are used
+# when specifying the start address of the next.
+#
+test -z "$ENTRY" && ENTRY=_start
+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
+test "$LD_FLAG" = "N" && DATA_ADDR=.
+
+CTOR=".ctors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+ __CTOR_LIST__ = .; }
+ ${CONSTRUCTING+${CTOR_START}}
+ *(.ctors)
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last
+
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors)) */
+
+ ${CONSTRUCTING+${CTOR_END}}
+ ${CONSTRUCTING+ __CTOR_END__ = .; }
+ } ${RELOCATING+ > ${DATA_MEMORY}}"
+
+DTOR=" .dtors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+ __DTOR_LIST__ = .; }
+ *(.dtors)
+ /*
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors)) */
+ ${CONSTRUCTING+ __DTOR_END__ = .; }
+ } ${RELOCATING+ > ${DATA_MEMORY}}"
+
+
+VECTORS="
+ /* If the 'vectors_addr' symbol is defined, it indicates the start address
+ of interrupt vectors. This depends on the 68HC11 operating mode:
+
+ Addr
+ Single chip 0xffc0
+ Extended mode 0xffc0
+ Bootstrap 0x00c0
+ Test 0xbfc0
+
+ In general, the vectors address is 0xffc0. This can be overriden
+ with the '-defsym vectors_addr=0xbfc0' ld option.
+
+ Note: for the bootstrap mode, the interrupt vectors are at 0xbfc0 but
+ they are redirected to 0x00c0 by the internal PROM. Application's vectors
+ must also consist of jump instructions (see Motorola's manual). */
+
+ PROVIDE (_vectors_addr = DEFINED (vectors_addr) ? vectors_addr : 0xffc0);
+ .vectors DEFINED (vectors_addr) ? vectors_addr : 0xffc0 :
+ {
+ *(.vectors)
+ }"
+
+#
+# We provide two emulations: a fixed on that defines some memory banks
+# and a configurable one that includes a user provided memory definition.
+#
+case $GENERIC_BOARD in
+ yes|1|YES)
+ MEMORY_DEF="
+/* Get memory banks definition from some user configuration file.
+ This file must be located in some linker directory (search path
+ with -L<dir>). See fixed memory banks emulation script. */
+INCLUDE memory.x;
+"
+ ;;
+ *)
+MEMORY_DEF="
+/* Fixed definition of the available memory banks.
+ See generic emulation script for a user defined configuration. */
+MEMORY
+{
+ page0 (rwx) : ORIGIN = 0x0, LENGTH = 256
+ text (rx) : ORIGIN = ${ROM_START_ADDR}, LENGTH = ${ROM_SIZE}
+ data : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE}
+}
+
+/* Setup the stack on the top of the data memory bank. */
+PROVIDE (_stack = ${RAM_START_ADDR} + ${RAM_SIZE} - 1);
+"
+ ;;
+esac
+
+STARTUP_CODE="
+ /* Startup code. */
+ *(.install0) /* Section should setup the stack pointer. */
+ *(.install1) /* Place holder for applications. */
+ *(.install2) /* Optional installation of data sections in RAM. */
+ *(.install3) /* Place holder for applications. */
+ *(.install4) /* Section that calls the main. */
+"
+
+PRE_COMPUTE_DATA_SIZE="
+/* SCz: this does not work yet... This is supposed to force the loading
+ of _map_data.o (from libgcc.a) when the .data section is not empty.
+ By doing so, this should bring the code that copies the .data section
+ from ROM to RAM at init time.
+
+ ___pre_comp_data_size = SIZEOF(.data);
+ __install_data_sections = ___pre_comp_data_size > 0 ?
+ __map_data_sections : 0;
+*/
+"
+
+INSTALL_RELOC="
+ .install0 0 : { *(.install0) }
+ .install1 0 : { *(.install1) }
+ .install2 0 : { *(.install2) }
+ .install3 0 : { *(.install3) }
+ .install4 0 : { *(.install4) }
+"
+
+BSS_DATA_RELOC="
+ .data1 0 : { *(.data1) }
+
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 : { *(.sdata) }
+ .sbss 0 : { *(.sbss) }
+ .scommon 0 : { *(.scommon) }
+"
+
+cat <<EOF
+${RELOCATING+/* Linker script for 68HC11 executable (PROM). */}
+${RELOCATING-/* Linker script for 68HC11 object file (ld -r). */}
+
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+ "${LITTLE_OUTPUT_FORMAT}")
+OUTPUT_ARCH(${OUTPUT_ARCH})
+ENTRY(${ENTRY})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING+${MEMORY_DEF}}
+
+SECTIONS
+{
+ .hash ${RELOCATING-0} : { *(.hash) }
+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
+ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
+ .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
+ .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
+
+ .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rela.stext ${RELOCATING-0} : { *(.rela.stest) }
+ .rela.etext ${RELOCATING-0} : { *(.rela.etest) }
+ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
+ .rela.edata ${RELOCATING-0} : { *(.rela.edata) }
+ .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
+ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
+ .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
+ .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
+ .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
+ .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
+
+ .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
+ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
+ .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
+ .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
+ .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
+ .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
+ .rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
+ .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
+ .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
+ .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
+ .rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
+ .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+
+ /* Concatenate .page0 sections. Put them in the page0 memory bank
+ unless we are creating a relocatable file. */
+ .page0 :
+ {
+ *(.page0)
+ } ${RELOCATING+ > page0}
+
+ /* Start of text section. */
+ .stext ${RELOCATING-0} :
+ {
+ *(.stext)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .init ${RELOCATING-0} :
+ {
+ *(.init)
+ } ${RELOCATING+=${NOP-0}}
+
+ ${RELOCATING-${INSTALL_RELOC}}
+
+ .text ${RELOCATING-0}:
+ {
+ /* Put startup code at beginning so that _start keeps same address. */
+ ${RELOCATING+${STARTUP_CODE}}
+
+ ${RELOCATING+*(.init)}
+ *(.text)
+ *(.fini)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+
+ ${RELOCATING+_etext = .;}
+ ${RELOCATING+PROVIDE (etext = .);}
+
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .eh_frame ${RELOCATING-0} :
+ {
+ *(.eh_frame)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .rodata ${RELOCATING-0} :
+ {
+ *(.rodata)
+ *(.gnu.linkonce.r*)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .rodata1 ${RELOCATING-0} :
+ {
+ *(.rodata1)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ /* Start of the data section image in ROM. */
+ ${RELOCATING+__data_image = .;}
+ ${RELOCATING+PROVIDE (__data_image = .);}
+
+ /* All read-only sections that normally go in PROM must be above.
+ We construct the DATA image section in PROM at end of all these
+ read-only sections. The data image must be copied at init time.
+ Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */
+ .data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)}
+ {
+ ${RELOCATING+__data_section_start = .;}
+ ${RELOCATING+PROVIDE (__data_section_start = .);}
+
+ ${RELOCATING+${DATA_START_SYMBOLS}}
+ ${RELOCATING+*(.sdata)}
+ *(.data)
+ ${RELOCATING+*(.data1)}
+ *(.gnu.linkonce.d*)
+ ${CONSTRUCTING+CONSTRUCTORS}
+
+ ${RELOCATING+_edata = .;}
+ ${RELOCATING+PROVIDE (edata = .);}
+ } ${RELOCATING+ > ${DATA_MEMORY}}
+
+ ${RELOCATING+__data_section_size = SIZEOF(.data);}
+ ${RELOCATING+PROVIDE (__data_section_size = SIZEOF(.data));}
+ ${RELOCATING+__data_image_end = __data_image + __data_section_size;}
+
+ ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}}
+
+ /* .install ${RELOCATING-0}:
+ {
+ . = _data_image_end;
+ } ${RELOCATING+ > ${TEXT_MEMORY}} */
+
+ /* Relocation for some bss and data sections. */
+ ${RELOCATING-${BSS_DATA_RELOC}}
+
+ .bss ${RELOCATING-0} :
+ {
+ ${RELOCATING+__bss_start = .;}
+ ${RELOCATING+*(.sbss)}
+ ${RELOCATING+*(.scommon)}
+
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+PROVIDE (_end = .);}
+ } ${RELOCATING+ > ${DATA_MEMORY}}
+ ${RELOCATING+__bss_size = SIZEOF(.bss);}
+ ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));}
+
+ ${RELOCATING+${CTOR}}
+ ${RELOCATING+${DTOR}}
+
+ ${RELOCATING+${VECTORS}}
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+
+ .comment 0 : { *(.comment) }
+
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0.
+ Treatment of DWARF debug section must be at end of the linker
+ script to avoid problems when there are undefined symbols. It's necessary
+ to avoid that the DWARF section is relocated before such undefined
+ symbols are found. */
+
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc
new file mode 100644
index 00000000000..d3b648491b8
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc
@@ -0,0 +1,361 @@
+#
+# Unusual variables checked by this code:
+# NOP - two byte opcode for no-op (defaults to 0)
+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
+# (e.g., .PARISC.global)
+# OTHER_SECTIONS - at the end
+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
+# executable (e.g., _DYNAMIC_LINK)
+# TEXT_START_SYMBOLS - symbols that appear at the start of the
+# .text section.
+# DATA_START_SYMBOLS - symbols that appear at the start of the
+# .data section.
+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+# .bss section besides __bss_start.
+# EMBEDDED - whether this is for an embedded system.
+#
+# When adding sections, do note that the names of some sections are used
+# when specifying the start address of the next.
+#
+test -z "$ENTRY" && ENTRY=_start
+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
+test "$LD_FLAG" = "N" && DATA_ADDR=.
+
+CTOR=".ctors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+ __CTOR_LIST__ = .; }
+ ${CONSTRUCTING+${CTOR_START}}
+ *(.ctors)
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last
+
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors)) */
+
+ ${CONSTRUCTING+${CTOR_END}}
+ ${CONSTRUCTING+ __CTOR_END__ = .; }
+ } ${RELOCATING+ > ${DATA_MEMORY}}"
+
+DTOR=" .dtors ${CONSTRUCTING-0} :
+ {
+ ${CONSTRUCTING+ __DTOR_LIST__ = .; }
+ *(.dtors)
+ /*
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors)) */
+ ${CONSTRUCTING+ __DTOR_END__ = .; }
+ } ${RELOCATING+ > ${DATA_MEMORY}}"
+
+
+VECTORS="
+ /* If the 'vectors_addr' symbol is defined, it indicates the start address
+ of interrupt vectors. This depends on the 68HC11 operating mode:
+
+ Addr
+ Single chip 0xffc0
+ Extended mode 0xffc0
+ Bootstrap 0x00c0
+ Test 0xbfc0
+
+ In general, the vectors address is 0xffc0. This can be overriden
+ with the '-defsym vectors_addr=0xbfc0' ld option.
+
+ Note: for the bootstrap mode, the interrupt vectors are at 0xbfc0 but
+ they are redirected to 0x00c0 by the internal PROM. Application's vectors
+ must also consist of jump instructions (see Motorola's manual). */
+
+ PROVIDE (_vectors_addr = DEFINED (vectors_addr) ? vectors_addr : 0xffc0);
+ .vectors DEFINED (vectors_addr) ? vectors_addr : 0xffc0 :
+ {
+ *(.vectors)
+ }"
+
+#
+# We provide two emulations: a fixed on that defines some memory banks
+# and a configurable one that includes a user provided memory definition.
+#
+case $GENERIC_BOARD in
+ yes|1|YES)
+ MEMORY_DEF="
+/* Get memory banks definition from some user configuration file.
+ This file must be located in some linker directory (search path
+ with -L<dir>). See fixed memory banks emulation script. */
+INCLUDE memory.x;
+"
+ ;;
+ *)
+MEMORY_DEF="
+/* Fixed definition of the available memory banks.
+ See generic emulation script for a user defined configuration. */
+MEMORY
+{
+ page0 (rwx) : ORIGIN = 0x0, LENGTH = 256
+ text (rx) : ORIGIN = ${ROM_START_ADDR}, LENGTH = ${ROM_SIZE}
+ data : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE}
+}
+
+/* Setup the stack on the top of the data memory bank. */
+PROVIDE (_stack = ${RAM_START_ADDR} + ${RAM_SIZE} - 1);
+"
+ ;;
+esac
+
+STARTUP_CODE="
+ /* Startup code. */
+ *(.install0) /* Section should setup the stack pointer. */
+ *(.install1) /* Place holder for applications. */
+ *(.install2) /* Optional installation of data sections in RAM. */
+ *(.install3) /* Place holder for applications. */
+ *(.install4) /* Section that calls the main. */
+"
+
+PRE_COMPUTE_DATA_SIZE="
+/* SCz: this does not work yet... This is supposed to force the loading
+ of _map_data.o (from libgcc.a) when the .data section is not empty.
+ By doing so, this should bring the code that copies the .data section
+ from ROM to RAM at init time.
+
+ ___pre_comp_data_size = SIZEOF(.data);
+ __install_data_sections = ___pre_comp_data_size > 0 ?
+ __map_data_sections : 0;
+*/
+"
+
+INSTALL_RELOC="
+ .install0 0 : { *(.install0) }
+ .install1 0 : { *(.install1) }
+ .install2 0 : { *(.install2) }
+ .install3 0 : { *(.install3) }
+ .install4 0 : { *(.install4) }
+"
+
+BSS_DATA_RELOC="
+ .data1 0 : { *(.data1) }
+
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 : { *(.sdata) }
+ .sbss 0 : { *(.sbss) }
+ .scommon 0 : { *(.scommon) }
+"
+
+cat <<EOF
+${RELOCATING+/* Linker script for 68HC12 executable (PROM). */}
+${RELOCATING-/* Linker script for 68HC12 object file (ld -r). */}
+
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+ "${LITTLE_OUTPUT_FORMAT}")
+OUTPUT_ARCH(${OUTPUT_ARCH})
+ENTRY(${ENTRY})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING+${MEMORY_DEF}}
+
+SECTIONS
+{
+ .hash ${RELOCATING-0} : { *(.hash) }
+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
+ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
+ .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
+ .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
+
+ .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rela.stext ${RELOCATING-0} : { *(.rela.stest) }
+ .rela.etext ${RELOCATING-0} : { *(.rela.etest) }
+ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
+ .rela.edata ${RELOCATING-0} : { *(.rela.edata) }
+ .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
+ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
+ .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
+ .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
+ .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
+ .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
+
+ .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
+ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
+ .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
+ .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
+ .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
+ .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
+ .rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
+ .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
+ .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
+ .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
+ .rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
+ .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+
+ /* Concatenate .page0 sections. Put them in the page0 memory bank
+ unless we are creating a relocatable file. */
+ .page0 :
+ {
+ *(.page0)
+ } ${RELOCATING+ > page0}
+
+ /* Start of text section. */
+ .stext ${RELOCATING-0} :
+ {
+ *(.stext)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .init ${RELOCATING-0} :
+ {
+ *(.init)
+ } ${RELOCATING+=${NOP-0}}
+
+ ${RELOCATING-${INSTALL_RELOC}}
+
+ .text ${RELOCATING-0}:
+ {
+ /* Put startup code at beginning so that _start keeps same address. */
+ ${RELOCATING+${STARTUP_CODE}}
+
+ ${RELOCATING+*(.init)}
+ *(.text)
+ *(.fini)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+
+ ${RELOCATING+_etext = .;}
+ ${RELOCATING+PROVIDE (etext = .);}
+
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .eh_frame ${RELOCATING-0} :
+ {
+ *(.eh_frame)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .rodata ${RELOCATING-0} :
+ {
+ *(.rodata)
+ *(.gnu.linkonce.r*)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ .rodata1 ${RELOCATING-0} :
+ {
+ *(.rodata1)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
+ /* Start of the data section image in ROM. */
+ ${RELOCATING+__data_image = .;}
+ ${RELOCATING+PROVIDE (__data_image = .);}
+
+ /* All read-only sections that normally go in PROM must be above.
+ We construct the DATA image section in PROM at end of all these
+ read-only sections. The data image must be copied at init time.
+ Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */
+ .data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)}
+ {
+ ${RELOCATING+__data_section_start = .;}
+ ${RELOCATING+PROVIDE (__data_section_start = .);}
+
+ ${RELOCATING+${DATA_START_SYMBOLS}}
+ ${RELOCATING+*(.sdata)}
+ *(.data)
+ ${RELOCATING+*(.data1)}
+ *(.gnu.linkonce.d*)
+ ${CONSTRUCTING+CONSTRUCTORS}
+
+ ${RELOCATING+_edata = .;}
+ ${RELOCATING+PROVIDE (edata = .);}
+ } ${RELOCATING+ > ${DATA_MEMORY}}
+
+ ${RELOCATING+__data_section_size = SIZEOF(.data);}
+ ${RELOCATING+PROVIDE (__data_section_size = SIZEOF(.data));}
+ ${RELOCATING+__data_image_end = __data_image + __data_section_size;}
+
+ ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}}
+
+ /* .install ${RELOCATING-0}:
+ {
+ . = _data_image_end;
+ } ${RELOCATING+ > ${TEXT_MEMORY}} */
+
+ /* Relocation for some bss and data sections. */
+ ${RELOCATING-${BSS_DATA_RELOC}}
+
+ .bss ${RELOCATING-0} :
+ {
+ ${RELOCATING+__bss_start = .;}
+ ${RELOCATING+*(.sbss)}
+ ${RELOCATING+*(.scommon)}
+
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+PROVIDE (_end = .);}
+ } ${RELOCATING+ > ${DATA_MEMORY}}
+ ${RELOCATING+__bss_size = SIZEOF(.bss);}
+ ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));}
+
+ ${RELOCATING+${CTOR}}
+ ${RELOCATING+${DTOR}}
+
+ ${RELOCATING+${VECTORS}}
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+
+ .comment 0 : { *(.comment) }
+
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0.
+ Treatment of DWARF debug section must be at end of the linker
+ script to avoid problems when there are undefined symbols. It's necessary
+ to avoid that the DWARF section is relocated before such undefined
+ symbols are found. */
+
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/h8300s.sc b/gnu/usr.bin/binutils/ld/scripttempl/h8300s.sc
index 45474fc51ce..53c9dec11c2 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/h8300s.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/h8300s.sc
@@ -1,3 +1,13 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(h8300s)
@@ -8,10 +18,10 @@ ENTRY("_start")
MEMORY
{
- /* 0xc4 is a magic entry. We should have the linker just
- skip over it one day... */
- vectors : o = 0x0000, l = 0xc4
- magicvectors : o = 0xc4, l = 0x3c
+ /* 0xc4 is a magic entry. We should have the linker just
+ skip over it one day... */
+ vectors : o = 0x0000, l = 0xc4
+ magicvectors : o = 0xc4, l = 0x3c
/* We still only use 256k as the main ram size. */
ram : o = 0x0100, l = 0x3fefc
/* The stack starts at the top of main ram. */
@@ -22,55 +32,66 @@ MEMORY
eight : o = 0xffff00, l = 0x100
}
-SECTIONS
-{
-.vectors : {
- /* Use something like this to place a specific function's address
- into the vector table.
+SECTIONS
+{
+.vectors :
+ {
+ /* Use something like this to place a specific
+ function's address into the vector table.
- LONG(ABSOLUTE(_foobar)) */
+ LONG (ABSOLUTE (_foobar)). */
- *(.vectors)
+ *(.vectors)
} ${RELOCATING+ > vectors}
-.text : {
- *(.rodata)
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
- } ${RELOCATING+ > ram}
-.tors : {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.data : {
- *(.data)
- ${RELOCATING+ _edata = . ; }
+
+${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss : {
- ${RELOCATING+ _bss_start = . ;}
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack : {
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
} ${RELOCATING+ > topram}
-.tiny : {
- *(.tiny)
+
+.tiny :
+ {
+ *(.tiny)
} ${RELOCATING+ > tiny}
-.eight : {
- *(.eight)
+
+.eight :
+ {
+ *(.eight)
} ${RELOCATING+ > eight}
-.stab 0 ${RELOCATING+(NOLOAD)} : {
- [ .stab ]
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
}
-.stabstr 0 ${RELOCATING+(NOLOAD)} : {
- [ .stabstr ]
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
}
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/i386beos.sc b/gnu/usr.bin/binutils/ld/scripttempl/i386beos.sc
index 83ffde16407..21a01e56cdc 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/i386beos.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/i386beos.sc
@@ -177,7 +177,7 @@ SECTIONS
.debug_pubnames 0 ${RELOCATING+(NOLOAD)} : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 ${RELOCATING+(NOLOAD)} : { *(.debug_info) }
+ .debug_info 0 ${RELOCATING+(NOLOAD)} : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 ${RELOCATING+(NOLOAD)} : { *(.debug_abbrev) }
.debug_line 0 ${RELOCATING+(NOLOAD)} : { *(.debug_line) }
.debug_frame 0 ${RELOCATING+(NOLOAD)} : { *(.debug_frame) }
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/tic54xcoff.sc b/gnu/usr.bin/binutils/ld/scripttempl/tic54xcoff.sc
new file mode 100644
index 00000000000..8d8a81166b5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/tic54xcoff.sc
@@ -0,0 +1,52 @@
+# default linker script for c54x, TI COFF(1).
+# patterned after description in TI Assembler Tools PDF, SPRU102C, 7-53
+test -z "$ENTRY" && ENTRY=_c_int00
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH("${OUTPUT_ARCH}")
+
+MEMORY
+{
+ /*PAGE 0 : */ prog (RXI) : ORIGIN = 0x00000080, LENGTH = 0xFF00
+ /*PAGE 1 : */ data (W) : ORIGIN = 0x01000080, LENGTH = 0xFF80
+}
+
+ENTRY(${ENTRY})
+
+SECTIONS
+{
+ .text :
+ {
+ ___text__ = .;
+ *(.text)
+ etext = .;
+ ___etext__ = .;
+ } > prog
+ .data :
+ {
+ ___data__ = .;
+ __data = .;
+ *(.data)
+ __edata = .;
+ edata = .;
+ ___edata__ = .;
+ } > prog
+ /* all other initialized sections should be allocated here */
+ .cinit :
+ {
+ *(.cinit)
+ } > prog
+ .bss :
+ {
+ ___bss__ = .;
+ __bss = .;
+ *(.bss)
+ *(COMMON)
+ __ebss = .;
+ end = .;
+ ___end__ = .;
+ } > data
+ /* all other uninitialized sections should be allocated here */
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/v850.sc b/gnu/usr.bin/binutils/ld/scripttempl/v850.sc
index 0a20954d65c..90731de8749 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/v850.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/v850.sc
@@ -4,13 +4,13 @@ OUTPUT_FORMAT("elf32-v850", "elf32-v850",
OUTPUT_ARCH(v850)
ENTRY(_start)
SEARCH_DIR(.);
-/*/critters/slug/grossman/install/sun4/v850-elf/lib*/
SECTIONS
{
/* This saves a little space in the ELF file, since the zda starts
at a higher location that the ELF headers take up. */
- .zdata ${ZDATA_START_ADDR} : {
+ .zdata ${ZDATA_START_ADDR} :
+ {
*(.zdata)
*(.zbss)
*(reszdata)
@@ -23,13 +23,14 @@ SECTIONS
section. Specifically it prevents the zdata
section from being marked READONLY. */
- .rozdata ${ROZDATA_START_ADDR} : {
+ .rozdata ${ROZDATA_START_ADDR} :
+ {
*(.rozdata)
*(romzdata)
*(romzbss)
}
- /* Read-only sections, merged into text segment: */
+ /* Read-only sections, merged into text segment. */
. = ${TEXT_START_ADDR};
.interp : { *(.interp) }
.hash : { *(.hash) }
@@ -58,9 +59,11 @@ SECTIONS
.init : { KEEP (*(.init)) } =0
.plt : { *(.plt) }
- .text : {
+ .text :
+ {
*(.text)
${RELOCATING+*(.text.*)}
+
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
@@ -73,45 +76,51 @@ SECTIONS
It contains a small lookup table at the start followed by the
code pointed to by entries in the lookup table. */
- .call_table_data ${CALL_TABLE_START_ADDR} : {
+ .call_table_data ${CALL_TABLE_START_ADDR} :
+ {
${RELOCATING+PROVIDE(__ctbp = .);}
*(.call_table_data)
- } = 0xff /* fill gaps with 0xff */
- .call_table_text : {
+ } = 0xff /* Fill gaps with 0xff. */
+
+ .call_table_text :
+ {
*(.call_table_text)
}
- .fini : { KEEP (*(.fini)) } =0
+ .fini : { KEEP (*(.fini)) } =0
.rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
.rodata1 : { *(.rodata1) }
- .data : {
+ .data :
+ {
*(.data)
${RELOCATING+*(.data.*)}
*(.gnu.linkonce.d*)
CONSTRUCTORS
}
.data1 : { *(.data1) }
- .ctors : {
- ${RELOCATING+___ctors = .;}
+ .ctors :
+ {
+ ${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend(.ctors))
- ${RELOCATING+___ctors_end = .;}
+ ${CONSTRUCTING+___ctors_end = .;}
}
-
- .dtors : {
- ${RELOCATING+___dtors = .;}
+ .dtors :
+ {
+ ${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
- ${RELOCATING+___dtors_end = .;}
+ ${CONSTRUCTING+___dtors_end = .;}
}
.got : { *(.got.plt) *(.got) }
.dynamic : { *(.dynamic) }
- .tdata ${TDATA_START_ADDR} : {
+ .tdata ${TDATA_START_ADDR} :
+ {
${RELOCATING+PROVIDE (__ep = .);}
*(.tbyte)
*(.tcommon_byte)
@@ -123,21 +132,26 @@ SECTIONS
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
- .sdata ${SDATA_START_ADDR} : {
+
+ .sdata ${SDATA_START_ADDR} :
+ {
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
*(.sdata)
}
/* See comment about .rozdata. */
- .rosdata ${ROSDATA_START_ADDR} : {
+ .rosdata ${ROSDATA_START_ADDR} :
+ {
*(.rosdata)
}
/* We place the .sbss data section AFTER the .rosdata section, so that
it can directly preceed the .bss section. This allows runtime startup
code to initialise all the zero-data sections by simply taking the
- value of '_edata' and zeroing until it reaches '_end' */
- .sbss : {
+ value of '_edata' and zeroing until it reaches '_end'. */
+
+ .sbss :
+ {
${RELOCATING+__sbss_start = .;}
*(.sbss)
*(.scommon)
@@ -184,7 +198,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
@@ -192,17 +206,17 @@ SECTIONS
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
+ /* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
- /* User stack */
- .stack 0x200000 : {
+ /* User stack. */
+ .stack 0x200000 :
+ {
${RELOCATING+__stack = .;}
*(.stack)
}
- /* These must appear regardless of . */
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-selective/5.cc b/gnu/usr.bin/binutils/ld/testsuite/ld-selective/5.cc
new file mode 100644
index 00000000000..f5289f874a7
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-selective/5.cc
@@ -0,0 +1,32 @@
+struct A
+{
+ virtual void foo();
+ virtual void bar();
+};
+
+void A::foo() { } // lose
+void A::bar() { } // keep
+
+struct B : public A
+{
+ virtual void foo();
+};
+
+void B::foo() { } // lose
+
+void _start() __asm__("_start"); // keep
+
+A a; // keep
+B b;
+A *getme() { return &a; } // keep
+
+extern B* dropme2();
+void dropme1() { dropme2()->foo(); } // lose
+B *dropme2() { return &b; } // lose
+
+void _start()
+{
+ getme()->bar();
+}
+
+extern "C" void __main() { }
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-shared/symbolic.dat b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/symbolic.dat
new file mode 100644
index 00000000000..71464867db2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/symbolic.dat
@@ -0,0 +1,8 @@
+mainvar == 1
+overriddenvar == 2
+shlibvar1 == 3
+shlib_shlibvar1 () == 3
+shlib_shlibvar2 () == 4
+shlib_shlibcall () == 5
+main_called () == 6
+shlib_check () == 1
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.exp
new file mode 100644
index 00000000000..8de2949750c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.exp
@@ -0,0 +1,70 @@
+# Test handling of weak undefined symbols
+# Copyright 2001
+# Free Software Foundation, Inc.
+#
+# 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
+# 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.
+
+set testname "weak undefined symbols"
+
+# This test only works for ELF targets. It ought to work for some
+# a.out targets, but it doesn't.
+
+if { ![istarget *-*-sysv4*] \
+ && ![istarget *-*-unixware*] \
+ && ![istarget *-*-elf*] \
+ && ![istarget *-*-eabi*] \
+ && ![istarget *-*-linux*] \
+ && ![istarget *-*-irix5*] \
+ && ![istarget *-*-irix6*] \
+ && ![istarget *-*-solaris2*] } then {
+ return
+}
+
+if { [istarget *-*-linux*aout*] \
+ || [istarget *-*-linux*oldld*] } {
+ return
+}
+
+if {! [ld_assemble $as $srcdir/$subdir/weak-undef.s tmpdir/weak-undef.o]} then {
+ # It's OK if .weak doesn't work on this target.
+ unresolved $testname
+ return
+}
+
+# The linker should accept references to undefined weaks without error,
+# and resolve them to zero.
+
+set output_regexp \
+".*Contents of section .data:.*0000 00000000 11111111.*"
+
+if {! [ld_simple_link $ld tmpdir/weak-undef "$flags tmpdir/weak-undef.o -T $srcdir/$subdir/weak-undef.t"] } then {
+ fail $testname
+} else {
+ if {[which $objdump] == 0} then {
+ unresolved $testname
+ return
+ }
+
+ verbose -log "$objdump -s tmpdir/weak-undef"
+ catch "exec $objdump -s tmpdir/weak-undef" exec_output
+ set exec_output [prune_warnings $exec_output]
+ verbose -log $exec_output
+
+ if {[regexp $output_regexp $exec_output]} then {
+ pass $testname
+ } else {
+ fail $testname
+ }
+}
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.s b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.s
new file mode 100644
index 00000000000..386a311f2b7
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.s
@@ -0,0 +1,4 @@
+.data
+.weak foo
+.long foo
+.long 0x11111111
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.t b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.t
new file mode 100644
index 00000000000..a95bbcf1e3a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/weak-undef.t
@@ -0,0 +1,9 @@
+SECTIONS
+{
+ .data : {
+ tmpdir/weak-undef.o(.data)
+ }
+ /DISCARD/ : {
+ *(*)
+ }
+}