2013-07-02 Joey Ye <joey.ye@arm.com>
* arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini
        when lite exit is enabled.
			
			
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2013-07-02  Joey Ye  <joey.ye@arm.com> | ||||||
|  |  | ||||||
|  | 	* arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini | ||||||
|  | 	when lite exit is enabled. | ||||||
|  |  | ||||||
| 2013-06-28  Yufeng Zhang  <Yufeng.Zhang@arm.com> | 2013-06-28  Yufeng Zhang  <Yufeng.Zhang@arm.com> | ||||||
|  |  | ||||||
| 	* aarch64/syscalls.c (POINTER_TO_PARAM_BLOCK_T): New macro. | 	* aarch64/syscalls.c (POINTER_TO_PARAM_BLOCK_T): New macro. | ||||||
|   | |||||||
| @@ -390,8 +390,17 @@ __change_mode: | |||||||
| 	   for _fini to be called at program exit.  */ | 	   for _fini to be called at program exit.  */ | ||||||
| 	movs	r4, r0 | 	movs	r4, r0 | ||||||
| 	movs	r5, r1 | 	movs	r5, r1 | ||||||
|  | #ifdef _LITE_EXIT | ||||||
|  | 	/* Make reference to atexit weak to avoid unconditionally pulling in | ||||||
|  | 	   support code.  Refer to comments in __atexit.c for more details.  */ | ||||||
|  | 	.weak	FUNCTION(atexit) | ||||||
|  | 	ldr	r0, .Latexit | ||||||
|  | 	cmp	r0, #0 | ||||||
|  | 	beq	.Lweak_atexit | ||||||
|  | #endif | ||||||
| 	ldr	r0, .Lfini | 	ldr	r0, .Lfini | ||||||
| 	bl	FUNCTION (atexit) | 	bl	FUNCTION (atexit) | ||||||
|  | .Lweak_atexit: | ||||||
| 	bl	FUNCTION (_init) | 	bl	FUNCTION (_init) | ||||||
| 	movs	r0, r4 | 	movs	r0, r4 | ||||||
| 	movs	r1, r5 | 	movs	r1, r5 | ||||||
| @@ -465,6 +474,13 @@ change_back: | |||||||
| .LC2: | .LC2: | ||||||
| 	.word	__bss_end__ | 	.word	__bss_end__ | ||||||
| #ifdef __USES_INITFINI__ | #ifdef __USES_INITFINI__ | ||||||
|  | #ifdef _LITE_EXIT | ||||||
|  | .Latexit: | ||||||
|  | 	.word	FUNCTION(atexit) | ||||||
|  |  | ||||||
|  | 	/* Weak reference _fini in case of lite exit.  */ | ||||||
|  | 	.weak	FUNCTION(_fini) | ||||||
|  | #endif | ||||||
| .Lfini: | .Lfini: | ||||||
| 	.word	FUNCTION(_fini) | 	.word	FUNCTION(_fini) | ||||||
| #endif | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user