From da28970c3e164d4166cb8a3e0fe59c804299ed32 Mon Sep 17 00:00:00 2001 From: Marc Singer Date: Fri, 9 Jan 2015 17:53:18 -0800 Subject: [PATCH] Fix to move stubs into rodata. o Stubs were declared as globals which means they will be initialized data. No need for this. Now, stubs are static const and are only present in the program image. --- src/lmi.c | 2 +- src/nrf51.c | 2 +- src/stm32f1.c | 2 +- src/stm32f4.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lmi.c b/src/lmi.c index a08819e..a251242 100644 --- a/src/lmi.c +++ b/src/lmi.c @@ -63,7 +63,7 @@ static const char tm4c123gh6pm_xml_memory_map[] = "" ""; -uint16_t lmi_flash_write_stub[] = { +static const uint16_t lmi_flash_write_stub[] = { // _start: 0x4809, // ldr r0, [pc, #36] // _flashbase 0x490b, // ldr r1, [pc, #44] // _addr diff --git a/src/nrf51.c b/src/nrf51.c index 52c9749..7305d29 100644 --- a/src/nrf51.c +++ b/src/nrf51.c @@ -98,7 +98,7 @@ static const char nrf51_xml_memory_map[] = "" #define NRF51_PAGE_SIZE 1024 -uint16_t nrf51_flash_write_stub[] = { +static const uint16_t nrf51_flash_write_stub[] = { // _start: 0x4808, // ldr r0, [pc, #32] ; (24 <_ready>) 0x4909, // ldr r1, [pc, #36] ; (28 <_addr>) diff --git a/src/stm32f1.c b/src/stm32f1.c index d02a26d..bce00d3 100644 --- a/src/stm32f1.c +++ b/src/stm32f1.c @@ -122,7 +122,7 @@ static const char stm32hd_xml_memory_map[] = "" #define DBGMCU_IDCODE 0xE0042000 #define DBGMCU_IDCODE_F0 0x40015800 -uint16_t stm32f1_flash_write_stub[] = { +static const uint16_t stm32f1_flash_write_stub[] = { // _start: 0x4809, // ldr r0, [pc, #36] // _flashbase 0x490a, // ldr r1, [pc, #40] // _addr diff --git a/src/stm32f4.c b/src/stm32f4.c index 4f27859..148c31b 100644 --- a/src/stm32f4.c +++ b/src/stm32f4.c @@ -122,7 +122,7 @@ static const char stm32f4_xml_memory_map[] = "" #define DBGMCU_IDCODE 0xE0042000 /* This routine is uses word access. Only usable on target voltage >2.7V */ -uint16_t stm32f4_flash_write_stub[] = { +static const uint16_t stm32f4_flash_write_stub[] = { // _start: 0x480a, // ldr r0, [pc, #40] // _flashbase 0x490b, // ldr r1, [pc, #44] // _addr