+2017-07-05 Georg-Johann Lay <avr@gjlay.de>
+
+ Graceful degrade if Binutils PR21472 is not available.
+
+ PR target/81072
+ * configure.ac [target=avr]: WARN instead of ERROR if avrxmega3
+ .rodata in flash test fails.
+ (HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH): Define it if test passes.
+ * confgure: Regenerate.
+ * config.in: Regenerate.
+ * config/avr/avr.c (avr_asm_named_section)
+ [HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH]: Only trigger
+ __do_copy_data for stuff in .rodata if flash_pm_offset = 0.
+ (avr_asm_init_sections): Same.
+
2017-07-05 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/arm/neon.md (fma<VCVTF:mode>4): Remove %?.
#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
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;
|| 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"));
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-*-*)
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-*-*)