aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPitchumani Sivanupandi <pitchumani.sivanupandi@microchip.com>2016-11-30 15:07:37 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2016-11-30 15:07:37 +0000
commitbdc5f9370cf1ee5b83cacc29fc737e458d173f70 (patch)
treec34e502d697bb73c2a4ea76c52e0ff1ee11fb863 /gcc/config
parent82c7aae6edb583e85bb944080e66fea784f2d105 (diff)
downloadgcc-bdc5f9370cf1ee5b83cacc29fc737e458d173f70.zip
gcc-bdc5f9370cf1ee5b83cacc29fc737e458d173f70.tar.gz
gcc-bdc5f9370cf1ee5b83cacc29fc737e458d173f70.tar.bz2
Commit files forgotten in r242966.
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. From-SVN: r243033
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/avr/avr-arch.h3
-rw-r--r--gcc/config/avr/avr-devices.c6
-rw-r--r--gcc/config/avr/gen-avr-mmcu-specs.c15
-rw-r--r--gcc/config/avr/specs.h3
4 files changed, 15 insertions, 12 deletions
diff --git a/gcc/config/avr/avr-arch.h b/gcc/config/avr/avr-arch.h
index a740a15..e6a2d75 100644
--- a/gcc/config/avr/avr-arch.h
+++ b/gcc/config/avr/avr-arch.h
@@ -122,6 +122,9 @@ typedef struct
/* Number of 64k segments in the flash. */
int n_flash;
+
+ /* Flash size in bytes. */
+ int flash_size;
} avr_mcu_t;
/* AVR device specific features.
diff --git a/gcc/config/avr/avr-devices.c b/gcc/config/avr/avr-devices.c
index 7d13ba4..cef3b9a 100644
--- a/gcc/config/avr/avr-devices.c
+++ b/gcc/config/avr/avr-devices.c
@@ -111,12 +111,12 @@ avr_texinfo[] =
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 }
};
diff --git a/gcc/config/avr/gen-avr-mmcu-specs.c b/gcc/config/avr/gen-avr-mmcu-specs.c
index 9ea987f..ee75b1e 100644
--- a/gcc/config/avr/gen-avr-mmcu-specs.c
+++ b/gcc/config/avr/gen-avr-mmcu-specs.c
@@ -215,17 +215,16 @@ print_mcu (const avr_mcu_t *mcu)
// 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");
diff --git a/gcc/config/avr/specs.h b/gcc/config/avr/specs.h
index 222ad5b..b5fef33 100644
--- a/gcc/config/avr/specs.h
+++ b/gcc/config/avr/specs.h
@@ -58,7 +58,7 @@ along with GCC; see the file COPYING3. If not see
"%{mmcu=*:-m%*} "
#define LINK_RELAX_SPEC \
- "%{mrelax:--relax %(link_pmem_wrap)} "
+ "%{mrelax:--relax} "
#undef LINK_SPEC
#define LINK_SPEC \
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see
"%(link_data_start) " \
"%(link_text_start) " \
"%(link_relax) " \
+ "%(link_pmem_wrap) " \
"%{shared:%eshared is not supported} "
#undef LIB_SPEC