How to access far.rodata when memory model is medium

Howard0Su <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <[email protected]>
I am building btstack with msp430-gcc 4.7. I got the following error when
access a data in far.rodata region.
btstack/chipset-cc256x/bt_control_cc256x.c:194:(.any.text.bt_control_cc256x_next_cmd+0x16):
relocation truncated to fit: R_MSP430_16_BYTE against symbol
`cc256x_init_script' defined in .far.rodata.cc256x_init_script section in
objs/btstack/chipset-cc256x/bt_control_cc256x.o

the code looks like this:
#if defined(__GNUC__) && (__MSP430X__ > 0)
#define __data20 __attribute__((__far__))
#endif
const uint8_t cc256x_init_script[] __data20 = {............};

the access code is:
    for(int i = 0; i < 3; i++)
      hci_cmd_buffer[i]= cc256x_init_script[init_script_offset + i]; 

How can I work around this? This is a big project I don't want to switch to
huge memory model.

-Howard



--
View this message in context: http://msp430-gcc-users.1086195.n5.nabble.com/How-to-access-far-rodata-when-memory-model-is-medium-tp6697.html
Sent from the MSP430 gcc - Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.