Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Problems with constructor of static member class

2005-06-28 by soren_t_hansen

--- In lpc2000@yahoogroups.com, "Jaromir" <jaromir.kajdaniak@z...> wrote:
> Hi
> 
> First :
> instead static member , better is use singleton that call function
with static object of your class.
> Second:
> standard startup.s file ( example from freertos or ... ) is only for 
> C, so you nedd add extra code to call all constructors for global 
> (static) obiects. Check WinARM site for example.


I have found and added the following code: 

		LDR 	r0, =__ctors_start__
		LDR 	r1, =__ctors_end__
ctor_loop:
		CMP 	r0, r1
		BEQ 	ctor_end
		LDR 	r2, [r0], #4
		STMFD 	sp!, {r0-r1}
		MOV 	lr, pc
		MOV 	pc, r2
		LDMFD 	sp!, {r0-r1}
		B 		ctor_loop
ctor_end:

But it doesn't do the trick yet. Is there something else I'm missing
out? I'm using the startup.s file from Keil, which is intended to be
used in C.

/Søren

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.