aboutsummaryrefslogtreecommitdiff
path: root/libgloss/epiphany
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/epiphany
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/epiphany')
-rw-r--r--libgloss/epiphany/crt0.S26
1 files changed, 11 insertions, 15 deletions
diff --git a/libgloss/epiphany/crt0.S b/libgloss/epiphany/crt0.S
index d684e1e..b0d9ecb 100644
--- a/libgloss/epiphany/crt0.S
+++ b/libgloss/epiphany/crt0.S
@@ -113,23 +113,19 @@ _external_start:
#else
; calling atexit drags in malloc, so instead poke the function
; address directly into the reent structure
- mov r2,%low(__impure_ptr)
- movt r2,%high(__impure_ptr)
- ldr r2,[r2]
- mov r1,%low(fini)
- movt r1,%high(fini)
+ mov r1,%low(__atexit0)
+ movt r1,%high(__atexit0)
+ mov r2,%low(__atexit)
+ movt r2,%high(__atexit)
#ifdef __STRUCT_ALIGN_64__
-#error
- add r2,r2,need_to_find_out; &_GLOBAL_REENT->atexit0
- str r2, [r2,-1];??or -2?; _GLOBAL_REENT->atexit
- mov r0, 1
- str r0, [r2,1] ; _GLOBAL_REENT->atexit0._ind
- str r1, [r2,2] ; _GLOBAL_REENT->atexit0._fns[0]
+#error "not implemented"
#else /* !__STRUCT_ALIGN_64__ */
- add r0,r2,0x14c ; &_GLOBAL_REENT->atexit0
- str r0, [r0,-1] ; _GLOBAL_REENT->atexit
- mov r0, 1
- strd r0, [r2,0x2a] ; _GLOBAL_REENT->atexit0._ind
+ str r1, [r2, 0] ; __atexit = &__atexit0
+ movr r0, 1
+ str r0, [r1, 4] ; __atexit0._ind = 1
+ mov r0,%low(fini)
+ movt r0,%high(fini)
+ str r0, [r1, 8] ; __atexit0._fns[0] = fini
#endif /* !__STRUCT_ALIGN_64__ */
#endif /* !0 */
;; Call global and static constructors