Re: .data initialization not working
Peter Bigot <[email protected]> Sat, 6 Dec 2014 18:15:21 -0600
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.user |
|---|---|
| Message-ID | <CAPOJ94O9ZSaKi4MTxe0n=x=gR=HrOsoEkAgUAo8qCV44yAt+=g@mail.gmail.com> |
This is a place to report these; other places would be the TI forums; see http://e2e.ti.com/support/development_tools/compiler/f/343/t/384148 It'd help if you provide a standalone program with the sort of initialization expressions that aren't working for you, along with the exact command line you're using. From my experience, global variables with initializers are constructed properly. (Note that if you use -minrt you are telling the compiler/linker to strip out the static initialization routines. Generally not a good idea.) Peter On Sat, Dec 6, 2014 at 5:03 PM, Olivier Girard <[email protected]> wrote: > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/mspgcc-users