OSDN Git Service

Use the emit-relocs options by default unless the user has configured
authorDavid McCullough <davidm@snapgear.com>
Mon, 10 Jul 2006 22:23:46 +0000 (22:23 +0000)
committerDavid McCullough <davidm@snapgear.com>
Mon, 10 Jul 2006 22:23:46 +0000 (22:23 +0000)
it to do otherwise.

Signed-off-by: Richard Sandiford <richard@codesourcery.com>
configure
configure.in
ld-elf2flt.in

index c0f861b..8b816be 100755 (executable)
--- a/configure
+++ b/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP bfd_include_dir binutils_include_dir binutils_ldscript_dir got_check LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP bfd_include_dir binutils_include_dir binutils_ldscript_dir got_check emit_relocs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -846,6 +846,7 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-got-check - disable check for GOT (needed on H8)
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-got-check - disable check for GOT (needed on H8)
+ --disable-emit-relocs - don't use the --emit-relocs (-q) linker option
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1363,6 +1364,15 @@ else
 
 fi;
 
 
 fi;
 
+# Check whether --enable-emit_relocs or --disable-emit_relocs was given.
+if test "${enable_emit_relocs+set}" = set; then
+  enableval="$enable_emit_relocs"
+   emit_relocs=$enableval
+else
+   emit_relocs=yes
+
+fi;
+
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -3747,6 +3757,7 @@ done
 
 
 
 
 
 
+
                     ac_config_files="$ac_config_files Makefile ld-elf2flt"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
                     ac_config_files="$ac_config_files Makefile ld-elf2flt"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4412,6 +4423,7 @@ s,@bfd_include_dir@,$bfd_include_dir,;t t
 s,@binutils_include_dir@,$binutils_include_dir,;t t
 s,@binutils_ldscript_dir@,$binutils_ldscript_dir,;t t
 s,@got_check@,$got_check,;t t
 s,@binutils_include_dir@,$binutils_include_dir,;t t
 s,@binutils_ldscript_dir@,$binutils_ldscript_dir,;t t
 s,@got_check@,$got_check,;t t
+s,@emit_relocs@,$emit_relocs,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
index ae5dd27..2e2eb7a 100644 (file)
@@ -37,6 +37,12 @@ AC_ARG_ENABLE(got-check,
        [ got_check=yes ]
 )
 
        [ got_check=yes ]
 )
 
+AC_ARG_ENABLE(emit_relocs,
+       [ --disable-emit-relocs - don't use the --emit-relocs (-q) linker option ],
+       [ emit_relocs=$enableval ],
+       [ emit_relocs=yes ]
+)
+
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
@@ -122,6 +128,7 @@ AC_SUBST(bfd_include_dir)
 AC_SUBST(binutils_include_dir)
 AC_SUBST(binutils_ldscript_dir)
 AC_SUBST(got_check)
 AC_SUBST(binutils_include_dir)
 AC_SUBST(binutils_ldscript_dir)
 AC_SUBST(got_check)
+AC_SUBST(emit_relocs)
 
 AC_OUTPUT(Makefile ld-elf2flt)
 
 
 AC_OUTPUT(Makefile ld-elf2flt)
 
index 778ea0d..134ea45 100644 (file)
@@ -144,23 +144,31 @@ then
                        LDSCRIPT="$NEWLDSCRIPT"
                fi
 
                        LDSCRIPT="$NEWLDSCRIPT"
                fi
 
-               if [ "@got_check@" = "no" ]
+               if [ "@emit_relocs@" = "yes" ]
                then
                then
-                $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -d -o "$OFILE.elf" $ARG1         ||exit $?
-                $LINKER $EMUL $SDIRS -T $LDSCRIPT -o "$OFILE.gdb" $ARG1                ||exit $?
+                $LINKER $EMUL $SDIRS -T $LDSCRIPT -q -o "$OFILE.gdb" $ARG1             ||exit $?
+                RFILE="$OFILE.gdb"
+                FLTFLAGS="$FLTFLAGS -a"
                else
                else
-                $LINKER $EMUL -r -d -o "$OFILE.elf2flt" $ARG1                          ||exit $?
-                $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -o "$OFILE.elf" "$OFILE.elf2flt" ||exit $?
-                $LINKER $EMUL $SDIRS -T $LDSCRIPT -o "$OFILE.gdb" "$OFILE.elf2flt"     ||exit $?
-                rm -f "$OFILE.elf2flt"
+                if [ "@got_check@" = "no" ]
+                then
+                 $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -d -o "$OFILE.elf" $ARG1         ||exit $?
+                 $LINKER $EMUL $SDIRS -T $LDSCRIPT -o "$OFILE.gdb" $ARG1                ||exit $?
+                else
+                 $LINKER $EMUL -r -d -o "$OFILE.elf2flt" $ARG1                          ||exit $?
+                 $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -o "$OFILE.elf" "$OFILE.elf2flt" ||exit $?
+                 $LINKER $EMUL $SDIRS -T $LDSCRIPT -o "$OFILE.gdb" "$OFILE.elf2flt"     ||exit $?
+                 rm -f "$OFILE.elf2flt"
+                fi
+                RFILE="$OFILE.elf"
                fi
                if $NM "$OFILE.gdb" | grep _GLOBAL_OFFSET_TABLE_ > /dev/null 
                then
                fi
                if $NM "$OFILE.gdb" | grep _GLOBAL_OFFSET_TABLE_ > /dev/null 
                then
-                       $ELF2FLT $FLTFLAGS -o "$OFILE" -p "$OFILE.gdb" "$OFILE.elf" || exit $?
+                       $ELF2FLT $FLTFLAGS -o "$OFILE" -p "$OFILE.gdb" "$RFILE" || exit $?
                else
                else
-                       $ELF2FLT $FLTFLAGS -o "$OFILE" -r "$OFILE.elf" || exit $?
+                       $ELF2FLT $FLTFLAGS -o "$OFILE" -r "$RFILE" || exit $?
                fi
                fi
-               rm -f "$OFILE.elf"  # not needed for any reason
+               [ "$RFILE" = "$OFILE.gdb" ] || rm -f "$RFILE"  # not needed for any reason
                rm -f "$NEWLDSCRIPT"
                exit 0
        fi
                rm -f "$NEWLDSCRIPT"
                exit 0
        fi