+2016-11-30 Pitchumani Sivanupandi <pitchumani.sivanupandi@microchip.com>
+
+ Commit files forgotten in r242966.
+
+ * config/avr/avr-arch.h (avr_mcu_t) [flash_size]: New member.
+ * config/avr/avr-devices.c (avr_mcu_types): Add flash size info.
+ * config/avr/gen-avr-mmcu-specs.c (print_mcu): Remove hard-coded
+ prefix check to find wrap-around value, instead use MCU flash size.
+ For 8k flash devices, update link_pmem_wrap spec string to
+ add --pmem-wrap-around=8k.
+ * config/avr/specs.h (LINK_RELAX_SPEC): Move link_pmem_wrap from
+ here...
+ (LINK_SPEC): ...to here.
+
2016-11-30 David Malcolm <dmalcolm@redhat.com>
PR c/78498
2016-11-29 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
- * config/avr/avr-arch.h (avr_mcu_t): Add flash_size member.
- * config/avr/avr-devices.c(avr_mcu_types): Add flash size info.
- * config/avr/avr-mcu.def: Likewise.
- * config/avr/gen-avr-mmcu-specs.c (print_mcu): Remove hard-coded prefix
- check to find wrap-around value, instead use MCU flash size. For 8k
- flash devices, update link_pmem_wrap spec string to add
- --pmem-wrap-around=8k.
- * config/avr/specs.h: Remove link_pmem_wrap from LINK_RELAX_SPEC and
- add to linker specs (LINK_SPEC) directly.
+ * config/avr/avr-mcu.def: (avr_mcu_types): Add flash size info.
2016-11-29 David Malcolm <dmalcolm@redhat.com>
/* Number of 64k segments in the flash. */
int n_flash;
+
+ /* Flash size in bytes. */
+ int flash_size;
} avr_mcu_t;
/* AVR device specific features.
const avr_mcu_t
avr_mcu_types[] =
{
-#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH)\
- { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH },
+#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, FLASH_SIZE)\
+ { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, FLASH_SIZE },
#include "avr-mcus.def"
#undef AVR_MCU
/* End of list. */
- { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0 }
+ { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0, 0 }
};
// avr-specific specs for linking / the linker.
int wrap_k =
- str_prefix_p (mcu->name, "at90usb8") ? 8
- : str_prefix_p (mcu->name, "atmega16") ? 16
- : (str_prefix_p (mcu->name, "atmega32")
- || str_prefix_p (mcu->name, "at90can32")) ? 32
- : (str_prefix_p (mcu->name, "atmega64")
- || str_prefix_p (mcu->name, "at90can64")
- || str_prefix_p (mcu->name, "at90usb64")) ? 64
+ mcu->flash_size == 0x2000 ? 8
+ : mcu->flash_size == 0x4000 ? 16
+ : mcu->flash_size == 0x8000 ? 32
+ : mcu->flash_size == 0x10000 ? 64
: 0;
fprintf (f, "*link_pmem_wrap:\n");
- if (wrap_k)
+ if (wrap_k == 8)
+ fprintf (f, "\t%%{!mno-pmem-wrap-around: --pmem-wrap-around=8k}");
+ else if (wrap_k > 8)
fprintf (f, "\t%%{mpmem-wrap-around: --pmem-wrap-around=%dk}", wrap_k);
fprintf (f, "\n\n");
"%{mmcu=*:-m%*} "
#define LINK_RELAX_SPEC \
- "%{mrelax:--relax %(link_pmem_wrap)} "
+ "%{mrelax:--relax} "
#undef LINK_SPEC
#define LINK_SPEC \
"%(link_data_start) " \
"%(link_text_start) " \
"%(link_relax) " \
+ "%(link_pmem_wrap) " \
"%{shared:%eshared is not supported} "
#undef LIB_SPEC