mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 11:30:56 +08:00
pru: Fix memory corruption on syscall return
In the initial code I missed one level of pointer indirection. Instead of storing errno in impure_data, _impure_ptr was corrupted. Only simulator is impacted. Real targets have no OS and no syscalls. This resolves a bunch of stdio cases from the GCC testsuite: FAIL->PASS: gcc.c-torture/execute/printf-2.c -O0 execution test Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
This commit is contained in:
parent
5266248285
commit
70cd4cbe65
@ -42,6 +42,7 @@ __SC_ret:
|
||||
/* Invert return code and store to errno (first int in _impure_ptr). */
|
||||
rsb r14, r14, 0
|
||||
ldi32 r1, _impure_ptr
|
||||
lbbo r1, r1, 0, 4
|
||||
sbbo r14, r1, 0, 4
|
||||
/* Return -1 (for both int32_t or int64_t). */
|
||||
fill r14, 8
|
||||
|
Loading…
x
Reference in New Issue
Block a user