On Fri, Apr 27, 2012 at 2:19 PM, Matthias Ringwald <matth...@ringwald.ch> wrote:
> Hi
>
> After updating from the 2011 LTS to the new LTS version, my code to place a 
> 10k array into . fartext section fails.
>
> The source file looks like this:
>
> __attribute__((section (".fartext")))
> const uint8_t cc256x_init_script[] = { 0x00, ... roughly 10k of data ... };
> const uint32_t cc256x_init_script_size = sizeof(cc256x_init_script);
>
> I get this error:
>
> msp430-gcc -mmcu=msp430f5438a -g -Os -Wall -I. -I../src -I../firmware -I../.. 
> -I../../chipset-cc256x -I../../src -I../../include   -c -o 
> ../../chipset-cc256x/bluetooth_init_cc2560A_1.7.o 
> ../../chipset-cc256x/bluetooth_init_cc2560A_1.7.c
>
> msp430-gcc ../../chipset-cc256x/bluetooth_init_cc2560A_1.7.o main.o 
> -mmcu=msp430f5438a -o led_counter.out
> ../../chipset-cc256x/bluetooth_init_cc2560A_1.7.o:(.debug_info+0x8e): 
> relocation truncated to fit: R_MSP430_16_BYTE against symbol 
> `cc256x_init_script' defined in .fartext section in 
> ../../chipset-cc256x/bluetooth_init_cc2560A_1.7.o
> collect2: ld returned 1 exit status
>
> Is there something I'm doing wrong, or, is this a regression and I should 
> file an item in the bug tracker?

The only thing "wrong" is that specifying the section is sufficient to
correctly place data in far memory, but not to allow you to access
that memory.  In the updates leading to 20120406, binutils now
validates the range for values placed into relocations, and addresses
in far memory simply don't fit in a 16-bit relocation, which is what
would be used if the array that's in far memory is referenced from any
other object file.

I'm not sure how it could have worked in 20110716; maybe other changes
cause a 16-bit relocation to be emitted where you used to use some
other mechanism to load the 20-bit address.

Peter

>
> (complete project is here: btstack.org in 
> /btstack/MSP-EXP430F5438-CC256x/example)
>
> Best
>  Matthias
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to