Hi all,

I just want to start a new thread regarding another issue I mentioned in an
earlier mail.

When porting some programs to the latest MSPGCC version from RedHat/TI, I
noticed that ALL initialized global variables in my C code are not
initialized by the crt0 code.

After looking around in the crt* sources, I noticed there is a procedure
meant to do that in the "msp430-elf/tools/libgloss/msp430/crt_movedata.S"
file.
When compiling my program using the standard linker scripts provided with
the toolchain, I can't see this procedure anywhere in the linked executable.

I was not able to see if the problem lays in the linker script itself or in
the compiled crt0 procedures.
However, I can restore the proper functionality by re-writing the
crt_movedata procedure directly in my C code and calling it first thing
when entering the main():

"...
extern const unsigned char * __datastart;
extern const unsigned char * __romdatastart;
extern const unsigned int    __romdatacopysize;

void my_crt_movedata(void) {
  __asm__ __volatile__(
"mov #__datastart,       R12 \n\t"
"mov #__romdatastart,    R13 \n\t"
"mov #__romdatacopysize, R14 \n\t"
"call #memmove"
  );
}

int main(void) {

    my_crt_movedata();

    WDTCTL = WDTPW | WDTHOLD;          // Disable watchdog timer
..."

As this solution is definitely not acceptable, does someone has an idea
about what currently goes wrong in the current toolchain release (crt ?
linker script ? ...).

Is this mailing list also the right place to report this kind of issues ?

Thanks a lot,
Olivier

PS: currently running:
msp430-elf-gcc (GCC) 4.9.1 20140707 (prerelease (msp430-14r1-98)) (GNUPro
14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1)
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to