Skip to content

Commit 1a768f3

Browse files
impiaaagithub-cygwin
authored andcommitted
libgloss: mips: Support Lite Exit in crt0
Based on the equivalent code in ARM
1 parent c0c26fd commit 1a768f3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

libgloss/mips/hal/crt0.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,21 @@ init:
225225
beq t9,zero,1f
226226
jalr t9
227227
1:
228+
#ifdef _LITE_EXIT
229+
# Make reference to atexit weak to avoid unconditionally pulling in
230+
# support code. Refer to comments in __atexit.c for more details.
231+
.weak atexit
232+
LA t9, atexit
233+
beq t9,zero,.Lweak_atexit
234+
.weak _fini
235+
#endif
228236
/* Register exit handlers */
229237
LA a0, _fini
230238
jal atexit
231239

240+
#ifdef _LITE_EXIT
241+
.Lweak_atexit:
242+
#endif
232243
/* run global constructors */
233244
jal _init
234245

0 commit comments

Comments
 (0)