mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-04 00:31:09 +00:00
(PSEUDO_RET): Correctly unstack lr.
(UNDOARGS_5): Fix ordering of pushes and pops. (SINGLE_THREAD_P_PIC): New. (SINGLE_THREAD_P_INT): Likewise. (SINGLE_THREAD_P): Implement in terms of above. Restore lr if it was stacked. (PSEUDO): Use SINGLE_THREAD_P_INT.
This commit is contained in:
parent
191cbebf58
commit
e62ed29b3b
@ -27,6 +27,7 @@
|
|||||||
# undef PSEUDO_RET
|
# undef PSEUDO_RET
|
||||||
# define PSEUDO_RET \
|
# define PSEUDO_RET \
|
||||||
ldrcc pc, [sp], $4; \
|
ldrcc pc, [sp], $4; \
|
||||||
|
ldr lr, [sp], $4; \
|
||||||
b PLTJMP(SYSCALL_ERROR)
|
b PLTJMP(SYSCALL_ERROR)
|
||||||
|
|
||||||
# undef PSEUDO
|
# undef PSEUDO
|
||||||
@ -34,7 +35,7 @@
|
|||||||
.section ".text"; \
|
.section ".text"; \
|
||||||
PSEUDO_PROLOGUE; \
|
PSEUDO_PROLOGUE; \
|
||||||
ENTRY (name) \
|
ENTRY (name) \
|
||||||
SINGLE_THREAD_P; \
|
SINGLE_THREAD_P_INT; \
|
||||||
bne .Lpseudo_cancel; \
|
bne .Lpseudo_cancel; \
|
||||||
DO_CALL (syscall_name, args); \
|
DO_CALL (syscall_name, args); \
|
||||||
cmn r0, $4096; \
|
cmn r0, $4096; \
|
||||||
@ -74,7 +75,7 @@
|
|||||||
# define UNDOC2ARGS_4
|
# define UNDOC2ARGS_4
|
||||||
|
|
||||||
# define DOCARGS_5 stmfd sp!, {r0-r3}
|
# define DOCARGS_5 stmfd sp!, {r0-r3}
|
||||||
# define UNDOCARGS_5 str r4, [sp, #-4]!; ldmfd sp, {r0-r4}
|
# define UNDOCARGS_5 ldmfd sp, {r0-r3}; str r4, [sp, #-4]!; ldr r4, [sp, #24]
|
||||||
# define UNDOC2ARGS_5 ldr r4, [sp], #20
|
# define UNDOC2ARGS_5 ldr r4, [sp], #20
|
||||||
|
|
||||||
# ifdef IS_IN_libpthread
|
# ifdef IS_IN_libpthread
|
||||||
@ -92,10 +93,11 @@ extern int __local_multiple_threads attribute_hidden;
|
|||||||
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
|
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
|
||||||
# else
|
# else
|
||||||
# if !defined PIC
|
# if !defined PIC
|
||||||
# define SINGLE_THREAD_P \
|
# define SINGLE_THREAD_P_INT \
|
||||||
ldr ip, =__local_multiple_threads; \
|
ldr ip, =__local_multiple_threads; \
|
||||||
ldr ip, [ip]; \
|
ldr ip, [ip]; \
|
||||||
teq ip, #0;
|
teq ip, #0;
|
||||||
|
# define SINGLE_THREAD_P SINGLE_THREAD_P_INT
|
||||||
# define MAYBE_SAVE_LR \
|
# define MAYBE_SAVE_LR \
|
||||||
str lr, [sp, $-4]!;
|
str lr, [sp, $-4]!;
|
||||||
# define PSEUDO_RET_MOV \
|
# define PSEUDO_RET_MOV \
|
||||||
@ -103,14 +105,19 @@ extern int __local_multiple_threads attribute_hidden;
|
|||||||
b PLTJMP(SYSCALL_ERROR)
|
b PLTJMP(SYSCALL_ERROR)
|
||||||
# define PSEUDO_PROLOGUE
|
# define PSEUDO_PROLOGUE
|
||||||
# else
|
# else
|
||||||
# define SINGLE_THREAD_P \
|
# define SINGLE_THREAD_P_PIC(reg) \
|
||||||
str lr, [sp, $-4]!; \
|
|
||||||
ldr ip, 1b; \
|
ldr ip, 1b; \
|
||||||
ldr lr, 2b; \
|
ldr reg, 2b; \
|
||||||
3: \
|
3: \
|
||||||
add ip, pc, ip; \
|
add ip, pc, ip; \
|
||||||
ldr ip, [ip, lr]; \
|
ldr ip, [ip, lr]; \
|
||||||
teq ip, #0;
|
teq ip, #0;
|
||||||
|
# define SINGLE_THREAD_P_INT \
|
||||||
|
str lr, [sp, $-4]!; \
|
||||||
|
SINGLE_THREAD_P_PIC(lr)
|
||||||
|
# define SINGLE_THREAD_P \
|
||||||
|
SINGLE_THREAD_P_INT; \
|
||||||
|
ldr lr, [sp], $4
|
||||||
# define PSEUDO_PROLOGUE \
|
# define PSEUDO_PROLOGUE \
|
||||||
1: .word _GLOBAL_OFFSET_TABLE_ - 3f - 8; \
|
1: .word _GLOBAL_OFFSET_TABLE_ - 3f - 8; \
|
||||||
2: .word __local_multiple_threads(GOTOFF);
|
2: .word __local_multiple_threads(GOTOFF);
|
||||||
|
Loading…
Reference in New Issue
Block a user