mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-06-15 10:38:22 +08:00
74bf69110e
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2429 bbd45198-f89e-11dd-88c7-29a3b14d5316
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/**
|
|
* define start/end address of ro data.
|
|
* different compiler with different implementation.
|
|
*/
|
|
|
|
#ifndef __COMPILER_H__
|
|
#define __COMPILER_H__
|
|
|
|
#if defined(__CC_ARM) // armcc
|
|
|
|
#warning "Please check scatter file to ensure rodata is in ER_IROM1 region."
|
|
|
|
/* symbols reference to the scatter file */
|
|
extern char Image$$ER_IROM1$$Base;
|
|
extern char Image$$ER_IROM1$$Limit;
|
|
|
|
#define RODATA_START_ADDRESS (&Image$$ER_IROM1$$Base)
|
|
#define RODATA_END_ADDRESS (&Image$$ER_IROM1$$Limit)
|
|
|
|
#elif defined(__GNUC__) // gcc
|
|
|
|
#warning "Please check linker script to ensure rodata is between _stext and _etext."
|
|
|
|
/* symbols defined in linker script */
|
|
extern char _stext;
|
|
extern char _etext;
|
|
|
|
#define RODATA_START_ADDRESS (&_stext)
|
|
#define RODATA_END_ADDRESS (&_etext)
|
|
|
|
#else // other compilers
|
|
|
|
/* Firstly, modify rodata's start/end address. Then, comment the line below */
|
|
#error "Please modify RODATA_START_ADDRESS and RODATA_END_ADDRESS below */
|
|
|
|
/* Perhaps you can use start/end address of flash */
|
|
#define RODATA_START_ADDRESS ((char*)0x08000000)
|
|
#define RODATA_END_ADDRESS ((char*)0x08080000)
|
|
|
|
#endif
|
|
|
|
#endif // __COMPILER_H__
|
|
|