Commit cba4ea9e by Pitchumani Sivanupandi Committed by Denis Chertykov

avr-arch.h (avr_mcu_t): Add text section start attribute.

	* config/avr/avr-arch.h (avr_mcu_t): Add text section start attribute.
	* config/avr/avr-devices.c (AVR_MCU): Same.
	(avr_mcu_types): add text start value to end of device list.
	* config/avr/avr-mcus.def: Add text section start for all devices.
	(ata5782): Add new avr5 device.
	(ata5831): Same.
	* config/avr/avr-tables.opt: Regenerate.
	* config/avr/avr.h: Add declaration for text section start handler.
	(EXTRA_SPEC_FUNCTIONS): Add text section start handler to SPEC function=
s.
	(LINK_SPEC): Include text section start handler to linker spec.
	* config/avr/driver-avr.c (avr_device_to_text_start): New function to
	pass -Ttext option to linker if the text section start for the device i=
s
	not zero.
	* config/avr/t-multilib: Regenerate.
	* doc/avr-mmcu.texi: Regenerate.

From-SVN: r212461
parent 8762d747
2014-07-11 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/avr/avr-arch.h (avr_mcu_t): Add text section start attribute.
* config/avr/avr-devices.c (AVR_MCU): Same.
(avr_mcu_types): add text start value to end of device list.
* config/avr/avr-mcus.def: Add text section start for all devices.
(ata5782): Add new avr5 device.
(ata5831): Same.
* config/avr/avr-tables.opt: Regenerate.
* config/avr/avr.h: Add declaration for text section start handler.
(EXTRA_SPEC_FUNCTIONS): Add text section start handler to SPEC function=
s.
(LINK_SPEC): Include text section start handler to linker spec.
* config/avr/driver-avr.c (avr_device_to_text_start): New function to
pass -Ttext option to linker if the text section start for the device i=
s
not zero.
* config/avr/t-multilib: Regenerate.
* doc/avr-mmcu.texi: Regenerate.
2014-07-11 David Edelsohn <dje.gcc@gmail.com> 2014-07-11 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/aix51.h (LINK_SPEC): Remove -bnodelcsect. * config/rs6000/aix51.h (LINK_SPEC): Remove -bnodelcsect.
......
...@@ -109,6 +109,9 @@ typedef struct ...@@ -109,6 +109,9 @@ typedef struct
/* Start of data section. */ /* Start of data section. */
int data_section_start; int data_section_start;
/* Start of text section. */
int text_section_start;
/* Number of 64k segments in the flash. */ /* Number of 64k segments in the flash. */
int n_flash; int n_flash;
......
...@@ -104,11 +104,11 @@ avr_texinfo[] = ...@@ -104,11 +104,11 @@ avr_texinfo[] =
const avr_mcu_t const avr_mcu_t
avr_mcu_types[] = avr_mcu_types[] =
{ {
#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, N_FLASH, LIBNAME)\ #define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, LIBNAME)\
{ NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, N_FLASH, LIBNAME }, { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, LIBNAME },
#include "avr-mcus.def" #include "avr-mcus.def"
#undef AVR_MCU #undef AVR_MCU
/* End of list. */ /* End of list. */
{ NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, NULL } { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0, NULL }
}; };
...@@ -491,6 +491,7 @@ typedef struct avr_args ...@@ -491,6 +491,7 @@ typedef struct avr_args
extern const char *avr_device_to_as (int argc, const char **argv); extern const char *avr_device_to_as (int argc, const char **argv);
extern const char *avr_device_to_ld (int argc, const char **argv); extern const char *avr_device_to_ld (int argc, const char **argv);
extern const char *avr_device_to_data_start (int argc, const char **argv); extern const char *avr_device_to_data_start (int argc, const char **argv);
extern const char *avr_device_to_text_start (int argc, const char **argv);
extern const char *avr_device_to_startfiles (int argc, const char **argv); extern const char *avr_device_to_startfiles (int argc, const char **argv);
extern const char *avr_device_to_devicelib (int argc, const char **argv); extern const char *avr_device_to_devicelib (int argc, const char **argv);
extern const char *avr_device_to_sp8 (int argc, const char **argv); extern const char *avr_device_to_sp8 (int argc, const char **argv);
...@@ -499,6 +500,7 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv); ...@@ -499,6 +500,7 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv);
{ "device_to_as", avr_device_to_as }, \ { "device_to_as", avr_device_to_as }, \
{ "device_to_ld", avr_device_to_ld }, \ { "device_to_ld", avr_device_to_ld }, \
{ "device_to_data_start", avr_device_to_data_start }, \ { "device_to_data_start", avr_device_to_data_start }, \
{ "device_to_text_start", avr_device_to_text_start }, \
{ "device_to_startfile", avr_device_to_startfiles }, \ { "device_to_startfile", avr_device_to_startfiles }, \
{ "device_to_devicelib", avr_device_to_devicelib }, \ { "device_to_devicelib", avr_device_to_devicelib }, \
{ "device_to_sp8", avr_device_to_sp8 }, { "device_to_sp8", avr_device_to_sp8 },
...@@ -525,6 +527,7 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv); ...@@ -525,6 +527,7 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv);
mmcu=at90usb64*:--pmem-wrap-around=64k}}}\ mmcu=at90usb64*:--pmem-wrap-around=64k}}}\
%:device_to_ld(%{mmcu=*:%*})\ %:device_to_ld(%{mmcu=*:%*})\
%:device_to_data_start(%{mmcu=*:%*})\ %:device_to_data_start(%{mmcu=*:%*})\
%:device_to_text_start(%{mmcu=*:%*}) \
%{shared:%eshared is not supported}" %{shared:%eshared is not supported}"
#define LIB_SPEC \ #define LIB_SPEC \
......
...@@ -101,6 +101,30 @@ avr_device_to_data_start (int argc, const char **argv) ...@@ -101,6 +101,30 @@ avr_device_to_data_start (int argc, const char **argv)
return concat ("-Tdata ", data_section_start_str, NULL); return concat ("-Tdata ", data_section_start_str, NULL);
} }
/* Returns command line parameters that describe start of text section. */
const char *
avr_device_to_text_start (int argc, const char **argv)
{
unsigned long text_section_start;
char text_section_start_str[16];
if (0 == argc)
return NULL;
avr_set_current_device (argv[0]);
if (avr_current_device->text_section_start == 0x0)
return NULL;
text_section_start = avr_current_device->text_section_start;
snprintf (text_section_start_str, sizeof(text_section_start_str) - 1,
"0x%lX", text_section_start);
return concat ("-Ttext ", text_section_start_str, NULL);
}
/* Returns command line parameters that describe the device startfile. */ /* Returns command line parameters that describe the device startfile. */
const char * const char *
......
...@@ -119,9 +119,11 @@ MULTILIB_MATCHES = \ ...@@ -119,9 +119,11 @@ MULTILIB_MATCHES = \
mmcu?avr4=mmcu?at90pwm3 \ mmcu?avr4=mmcu?at90pwm3 \
mmcu?avr4=mmcu?at90pwm3b \ mmcu?avr4=mmcu?at90pwm3b \
mmcu?avr4=mmcu?at90pwm81 \ mmcu?avr4=mmcu?at90pwm81 \
mmcu?avr5=mmcu?ata5782 \
mmcu?avr5=mmcu?ata5790 \ mmcu?avr5=mmcu?ata5790 \
mmcu?avr5=mmcu?ata5790n \ mmcu?avr5=mmcu?ata5790n \
mmcu?avr5=mmcu?ata5795 \ mmcu?avr5=mmcu?ata5795 \
mmcu?avr5=mmcu?ata5831 \
mmcu?avr5=mmcu?ata6613c \ mmcu?avr5=mmcu?ata6613c \
mmcu?avr5=mmcu?ata6614q \ mmcu?avr5=mmcu?ata6614q \
mmcu?avr5=mmcu?atmega16 \ mmcu?avr5=mmcu?atmega16 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment