some other people have seen similar behavior.
http://lists.uclibc.org/pipermail/uclibc/2009-April/042363.html
http://thread.gmane.org/gmane.linux.hardware.blackfin.toolchain.devel/1121
Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-DTARGET_ALIAS=\"$(TARGET)\" \
-DNO_GOT_CHECK=@got_check@ \
-DUSE_EMIT_RELOCS=@emit_relocs@ \
- -DEMIT_CTOR_DTOR=@emit_ctor_dtor@
+ -DEMIT_CTOR_DTOR=@emit_ctor_dtor@ \
+ -DALWAYS_RELOC_TEXT=@always_reloc_text@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
ac_subst_vars='LTLIBOBJS
LIBOBJS
SYMBOL_PREFIX
+always_reloc_text
emit_ctor_dtor
emit_relocs
got_check
enable_got_check
enable_emit_relocs
enable_emit_ctor_dtor
+enable_always_reloc_text
'
ac_precious_vars='build_alias
host_alias
--disable-got-check - disable check for GOT (needed on H8)
--disable-emit-relocs - don't use the --emit-relocs (-q) linker option
--enable-emit-ctor-dtor manually create ctor/dtor list
+ --enable-always-reloc-text
+ always process text relocs ignoring pic/got (needed
+ on Blackfin)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
var_yn_to_10 emit_ctor_dtor
+# Check whether --enable-always-reloc-text was given.
+if test "${enable_always_reloc_text+set}" = set; then
+ enableval=$enable_always_reloc_text; always_reloc_text=$enableval
+else
+
+ case $target in
+ bfin*) always_reloc_text=yes;;
+ *) always_reloc_text=no;;
+ esac
+
+
+fi
+
+var_yn_to_10 always_reloc_text
+
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 ld-elf2flt.sh:ld-elf2flt.in Makefile elf2flt.ld"
cat >confcache <<\_ACEOF
)
var_yn_to_10 emit_ctor_dtor
+AC_ARG_ENABLE(always-reloc-text,
+ AS_HELP_STRING([--enable-always-reloc-text], [always process text relocs ignoring pic/got (needed on Blackfin)]),
+ [ always_reloc_text=$enableval ],
+ [
+ case $target in
+ bfin*) always_reloc_text=yes;;
+ *) always_reloc_text=no;;
+ esac
+ ]
+)
+var_yn_to_10 always_reloc_text
+
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_SUBST(got_check)
AC_SUBST(emit_relocs)
AC_SUBST(emit_ctor_dtor)
+AC_SUBST(always_reloc_text)
AC_SUBST(SYMBOL_PREFIX)
AC_OUTPUT(ld-elf2flt.sh:ld-elf2flt.in Makefile elf2flt.ld)
* Only relocate things in the data sections if we are PIC/GOT.
* otherwise do text as well
*/
- if (!pic_with_got && (a->flags & SEC_CODE))
+ if ((!pic_with_got || ALWAYS_RELOC_TEXT) && (a->flags & SEC_CODE))
sectionp = text + (a->vma - text_vma);
else if (a->flags & SEC_DATA)
sectionp = data + (a->vma - data_vma);