===================================================================
@@ -10001,7 +10001,9 @@ avr_asm_init_sections (void)
resp. `avr_need_copy_data_p'. If flash is not mapped to RAM then
we have also to track .rodata because it is located in RAM then. */
+#if defined HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH
if (0 == avr_arch->flash_pm_offset)
+#endif
readonly_data_section->unnamed.callback = avr_output_data_section_asm_op;
data_section->unnamed.callback = avr_output_data_section_asm_op;
bss_section->unnamed.callback = avr_output_bss_section_asm_op;
@@ -10037,7 +10039,10 @@ avr_asm_named_section (const char *name,
|| STR_PREFIX_P (name, ".gnu.linkonce.d"));
if (!avr_need_copy_data_p
- && 0 == avr_arch->flash_pm_offset)
+#if defined HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH
+ && 0 == avr_arch->flash_pm_offset
+#endif
+ )
avr_need_copy_data_p = (STR_PREFIX_P (name, ".rodata")
|| STR_PREFIX_P (name, ".gnu.linkonce.r"));
===================================================================
@@ -1460,6 +1460,13 @@ that are supported for each access macro
#endif
+/* Define if your default avr linker script for avrxmega3 leaves .rodata in
+ flash. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH
+#endif
+
+
/* Define if your linker supports -z bndplt */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_BNDPLT_SUPPORT
===================================================================
@@ -24851,29 +24851,32 @@ EOF
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
- if test -f conftest.nm
+ if test -s conftest.nm
then
if grep ' R xxvaryy' conftest.nm > /dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- rm -f conftest.s conftest.o conftest.elf conftest.nm
+
+$as_echo "#define HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH 1" >>confdefs.h
+
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no: avrxmega3 .rodata located in RAM" >&5
$as_echo "no: avrxmega3 .rodata located in RAM" >&6; }
echo "$as_me: nm output was" >&5
cat conftest.nm >&5
- rm -f conftest.s conftest.o conftest.elf conftest.nm
avr_ld_ver="`$gcc_cv_ld -v | sed -e 's:^.* ::'`"
- as_fn_error "support for avrxmega3 needs Binutils 2.29 or higher (have $avr_ld_ver)" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for avrxmega3 .rodata in flash needs Binutils 2.29 or higher (have $avr_ld_ver)" >&5
+$as_echo "$as_me: WARNING: support for avrxmega3 .rodata in flash needs Binutils 2.29 or higher (have $avr_ld_ver)" >&2;}
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: test failed" >&5
$as_echo "test failed" >&6; }
echo "$as_me: failed program was" >&5
cat conftest.s >&5
- rm -f conftest.s conftest.o conftest.elf
- as_fn_error "see \`config.log' for details" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: see \`config.log' for details" >&5
+$as_echo "$as_me: WARNING: see \`config.log' for details" >&2;}
fi
+ rm -f conftest.s conftest.o conftest.elf conftest.nm
;;
cris-*-*)
===================================================================
@@ -3832,26 +3832,26 @@ EOF
AC_TRY_COMMAND([$gcc_cv_as -mmcu=avrxmega3 conftest.s -o conftest.o])
AC_TRY_COMMAND([$gcc_cv_ld -mavrxmega3 conftest.o -o conftest.elf])
AC_TRY_COMMAND([$gcc_cv_nm conftest.elf > conftest.nm])
- if test -f conftest.nm
+ if test -s conftest.nm
then
if grep ' R xxvaryy' conftest.nm > /dev/null; then
AC_MSG_RESULT(yes)
- rm -f conftest.s conftest.o conftest.elf conftest.nm
+ AC_DEFINE(HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH, 1,
+ [Define if your default avr linker script for avrxmega3 leaves .rodata in flash.])
else
AC_MSG_RESULT(no: avrxmega3 .rodata located in RAM)
echo "$as_me: nm output was" >&AS_MESSAGE_LOG_FD
cat conftest.nm >&AS_MESSAGE_LOG_FD
- rm -f conftest.s conftest.o conftest.elf conftest.nm
avr_ld_ver="`$gcc_cv_ld -v | sed -e 's:^.* ::'`"
- AC_MSG_ERROR([[support for avrxmega3 needs Binutils 2.29 or higher (have $avr_ld_ver)]])
+ AC_MSG_WARN([[support for avrxmega3 .rodata in flash needs Binutils 2.29 or higher (have $avr_ld_ver)]])
fi
else
AC_MSG_RESULT(test failed)
echo "$as_me: failed program was" >&AS_MESSAGE_LOG_FD
cat conftest.s >&AS_MESSAGE_LOG_FD
- rm -f conftest.s conftest.o conftest.elf
- AC_MSG_ERROR([[see `config.log' for details]])
+ AC_MSG_WARN([[see `config.log' for details]])
fi
+ rm -f conftest.s conftest.o conftest.elf conftest.nm
;;
cris-*-*)