This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
> Hello Everyone, > > We are trying to port an embedded system code from microtec > compiler to gnu > gcc. For testing purpose we are using a debugger and running > the code in > RAM. > > In that process We are facing problem in initializing the > global and static > vaiables. > > We have implemeneted the following steps for the same: > 1. We have included crt0.o file in our linker script. > 2. We have implemented start function which calls our main function. > 3. we have verified that GNU compiler inserts a call to > __main function in > the starting of our main function ( Using Assembely code). > 4. We have implemented the code to copy the .data section > (initialized data > section) to the ram. Removing this step (4) while debugging program in GDB may solve your problem. > 5. If we allow gnu to use the internal __main function it > gives an error at > run time in do_global_ctors function. To avoid this problem, we have > implemented an empty __main function, which is called from > our main(). But > now that, we have written our own __main function, the global > and static > variables are not being initialized as it is empty. > 6. Please note that the complete source is written in 'C and > we have defined > any specific data initialization routine. > > Hope to hear from anyone of you soon.. > Thanks and Regards, > Suman Jha > > > ------ > Want more information? See the CrossGCC FAQ, > http://www.objsw.com/CrossGCC/ > Want to unsubscribe? Send a note to > crossgcc-unsubscribe@sources.redhat.com > > ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |