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
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to