OS_GetEnv result

Nick Burrett nick at dsvr.net
Mon Aug 5 01:54:44 PDT 2002


John Tytgat wrote:
> In message <2d8f49604b.ajw498 at alexwaugh.com>
>           Alex Waugh <alex at alexwaugh.com> wrote:
> 
> 

> I think the following would be easier:
> 
> 	;Gets the __riscosify_control value which can be defined by
> 	;the global variable __riscosify_control in the user program.
> 	;Returns 0 (= default value) when not defined.
> 	;
> 	;int __get_riscosify_control(void)
> 	IMPORT	|__riscosify_control|, WEAK
> 	EXPORT	|__get_riscosify_control|
> 	NAME	"__get_riscosify_control"
> |__get_riscosify_control|
> 	LDR	a1, =|__riscosify_control|
> 	TEQ	a1, #0
> 	LDRNE	a1, [a1, #0]
> 	return	AL, pc, lr
> 
> And somewhere.h:
> 
> int __get_riscosify_control(void);

AFAICT, the linker doesn't handle WEAK symbols very well.  Usually, even 
though something is marked WEAK, the linker drags in all associated 
functions anyway.  This is why I removed the original ___vfork and 
___stdiolib WEAK links.

If we can avoid WEAK symbols, then that would be preferable in my book.

Regards,


Nick.




More information about the gcc mailing list