aboutsummaryrefslogtreecommitdiff
path: root/libgloss/arc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-13 13:44:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-18 07:45:09 +0200
commit2faeaf50fd3e83a8573d6008f3e927c1d40c3b4a (patch)
treee86a3f2d6f349d74c111aac37dbfafeacf723dfe /libgloss/arc
parent9035e406cbda2dcab02dde1c6bd7db0a6f6f1563 (diff)
downloadnewlib-2faeaf50fd3e83a8573d6008f3e927c1d40c3b4a.zip
newlib-2faeaf50fd3e83a8573d6008f3e927c1d40c3b4a.tar.gz
newlib-2faeaf50fd3e83a8573d6008f3e927c1d40c3b4a.tar.bz2
Use global atexit data for all configurations
For the exit processing only members of _GLOBAL_REENT were used by default. If the _REENT_GLOBAL_ATEXIT option was enabled, then the data structures were provided through dedicated global objects. Make this option the default. Remove the option. Rename struct _reent members _atexit and _atexit0 to _reserved_6 and _reserved_7, respectively. Provide them only if _REENT_BACKWARD_BINARY_COMPAT is defined.
Diffstat (limited to 'libgloss/arc')
-rw-r--r--libgloss/arc/crt0.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
index 46c9efd..8d9adaa 100644
--- a/libgloss/arc/crt0.S
+++ b/libgloss/arc/crt0.S
@@ -187,12 +187,13 @@ __start:
; calling atexit drags in malloc, so instead poke the function
; address directly into the reent structure
ld r1, [gp, @_impure_ptr@sda]
- mov_s r0, @_fini
- add r1, r1, 0x14c ; &_GLOBAL_REENT->atexit0
- st r1, [r1, -4] ; _GLOBAL_REENT->atexit
- st_s r0, [r1, 8] ; _GLOBAL_REENT->atexit0._fns[0]
+ mov_s r1, @__atexit0
+ mov_s r2, @__atexit
+ st_s r1, [r2, 0] ; __atexit = &__atexit0
mov_s r0, 1
- st_s r0, [r1, 4] ; _GLOBAL_REENT->atexit0._ind
+ st_s r0, [r1, 4] ; __atexit0._ind = 1
+ mov_s r0, @_fini
+ st_s r0, [r1, 8] ; __atexit0._fns[0] = _fini
; branch to _init
#if defined (__ARCEM__) || defined (__ARCHS__)
jl @_init