Hi,

I have a USB driver for the msp430 5xx series which allocates the USB
buffers at the proper addresses in the USB RAM using asm("0xaddr")
statements.

With the 20120911 compiler, when using "-fdata-sections" the code no
longer compiles. For example, with the following code:

#include <msp430.h>
#include <stdint.h>
#include <string.h>

#define EP0_MAX_PACKET_SIZE 0x08

static uint8_t iep0_buf[EP0_MAX_PACKET_SIZE] asm("0x2378");

int main()
{
        memset(&iep0_buf[0], 0, sizeof(iep0_buf));
        return 0;
}


ionut@heimdall:~$ msp430-gcc -mmcu=msp430f5528 -fdata-sections -c main.c
-o main.o
/tmp/ccaEQtpB.s: Assembler messages:
/tmp/ccaEQtpB.s:8: Error: Missing symbol name in directive
/tmp/ccaEQtpB.s:8: Error: junk at end of line, first unrecognized
character is `x'
/tmp/ccaEQtpB.s:9: Error: expected comma after name `' in .size
directive
/tmp/ccaEQtpB.s:10: Error: junk at end of line, first unrecognized
character is `0'


If I remove the "-fdata-sections" option, the code compiles just fine.

In my project, since it's being used for multiple devices, there are a
lot of things (code and data) that need to be stripped if they're not
used. That's why I need to use "-fdata-sections -ffunction-sections
-Wl,--gc-sections" to eliminate data and code that isn't used.

Trying the same code with the x86 gcc shows the same problem, so I guess
this is not mspgcc specific, but rather something that changed in newer
versions of gcc.

Does anyone have a suggestion on how to solve this? I thought about
declaring sections for each variable in a custom linker file and then
using __attribute__((section(".section_name"))) when declaring the
variables, but I think it's an ugly solution.

Thanks,
Ionut.


------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to