# 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.
--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]
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_config_files="$ac_config_files Makefile ld-elf2flt"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
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
[ 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_SUBST(binutils_include_dir)
AC_SUBST(binutils_ldscript_dir)
AC_SUBST(got_check)
+AC_SUBST(emit_relocs)
AC_OUTPUT(Makefile ld-elf2flt)
LDSCRIPT="$NEWLDSCRIPT"
fi
- if [ "@got_check@" = "no" ]
+ if [ "@emit_relocs@" = "yes" ]
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
- $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
- $ELF2FLT $FLTFLAGS -o "$OFILE" -p "$OFILE.gdb" "$OFILE.elf" || exit $?
+ $ELF2FLT $FLTFLAGS -o "$OFILE" -p "$OFILE.gdb" "$RFILE" || exit $?
else
- $ELF2FLT $FLTFLAGS -o "$OFILE" -r "$OFILE.elf" || exit $?
+ $ELF2FLT $FLTFLAGS -o "$OFILE" -r "$RFILE" || exit $?
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