ppc, ppc64: use common ALIAS/FUNC/END macros

arm_linker_fix
Daniel Kolesa 2021-01-08 04:52:46 +01:00
parent 6026980cac
commit cf05112306
8 changed files with 48 additions and 47 deletions

View File

@ -10,12 +10,12 @@
* from the use of this software.
*/
.global libucontext_getcontext
#include "common-defs.h"
ALIAS(getcontext, libucontext_getcontext)
.hidden __libucontext_swapcontext
.type libucontext_getcontext, @function
libucontext_getcontext:
FUNC(libucontext_getcontext)
li 4, 0
b __libucontext_swapcontext@local
.weak getcontext
getcontext = libucontext_getcontext
END(libucontext_getcontext)

View File

@ -10,13 +10,13 @@
* from the use of this software.
*/
.global libucontext_setcontext
#include "common-defs.h"
ALIAS(setcontext, libucontext_setcontext)
.hidden __libucontext_swapcontext
.type libucontext_setcontext, @function
libucontext_setcontext:
FUNC(libucontext_setcontext)
mr 4, 3
li 3, 0
b __libucontext_swapcontext@local
.weak setcontext
setcontext = libucontext_setcontext
END(libucontext_setcontext)

View File

@ -10,8 +10,10 @@
* from the use of this software.
*/
.globl libucontext_trampoline;
libucontext_trampoline:
#include "common-defs.h"
.hidden libucontext_trampoline
FUNC(libucontext_trampoline)
/* get the proper context into position and test for NULL */
mr. 3,31
@ -23,3 +25,4 @@ libucontext_trampoline:
no_linked_context:
b exit@GOT
END(libucontext_trampoline)

View File

@ -10,18 +10,16 @@
* from the use of this software.
*/
.global __libucontext_swapcontext
.type __libucontext_swapcontext, @function
__libucontext_swapcontext:
#include "common-defs.h"
ALIAS(swapcontext, __libucontext_swapcontext)
ALIAS(libucontext_swapcontext, __libucontext_swapcontext)
FUNC(__libucontext_swapcontext)
li 0, 249 # SYS_swapcontext
li 5, 1184 # sizeof(ucontext_t)
sc
.hidden __retfromsyscall
b __retfromsyscall@local
.weak swapcontext
swapcontext = libucontext_swapcontext
.weak libucontext_swapcontext
libucontext_swapcontext = __libucontext_swapcontext
END(__libucontext_swapcontext)

View File

@ -10,10 +10,12 @@
* from the use of this software.
*/
.global libucontext_getcontext
#include "common-defs.h"
ALIAS(getcontext, libucontext_getcontext)
.hidden __libucontext_swapcontext
.type libucontext_getcontext, @function
libucontext_getcontext:
FUNC(libucontext_getcontext)
addis 2, 12, .TOC.-libucontext_getcontext@ha
addi 2, 12, .TOC.-libucontext_getcontext@l
@ -21,6 +23,4 @@ libucontext_getcontext:
li 4, 0
b __libucontext_swapcontext
.weak getcontext
getcontext = libucontext_getcontext
END(libucontext_getcontext)

View File

@ -10,10 +10,12 @@
* from the use of this software.
*/
.global libucontext_setcontext
#include "common-defs.h"
ALIAS(setcontext, libucontext_setcontext)
.hidden __libucontext_swapcontext
.type libucontext_setcontext, @function
libucontext_setcontext:
FUNC(libucontext_setcontext)
addis 2, 12, .TOC.-libucontext_setcontext@ha
addi 2, 12, .TOC.-libucontext_setcontext@l
@ -22,6 +24,4 @@ libucontext_setcontext:
mr 4, 3
li 3, 0
b __libucontext_swapcontext
.weak setcontext
setcontext = libucontext_setcontext
END(libucontext_setcontext)

View File

@ -10,9 +10,10 @@
* from the use of this software.
*/
.globl libucontext_trampoline;
.hidden libucontext_trampoline;
libucontext_trampoline:
#include "common-defs.h"
.hidden libucontext_trampoline
FUNC(libucontext_trampoline)
cmpdi 31,0 /* test if ucontext link pointer is null */
beq no_linked_context /* if it is, exit */
@ -29,3 +30,4 @@ libucontext_trampoline:
no_linked_context:
b exit@GOT
nop
END(libucontext_trampoline)

View File

@ -10,9 +10,12 @@
* from the use of this software.
*/
.global __libucontext_swapcontext
.type __libucontext_swapcontext, @function
__libucontext_swapcontext:
#include "common-defs.h"
ALIAS(swapcontext, __libucontext_swapcontext)
ALIAS(libucontext_swapcontext, __libucontext_swapcontext)
FUNC(__libucontext_swapcontext)
addis 2, 12, .TOC.-__libucontext_swapcontext@ha
addi 2, 12, .TOC.-__libucontext_swapcontext@l
@ -24,9 +27,4 @@ __libucontext_swapcontext:
.hidden __retfromsyscall
b __retfromsyscall
.weak swapcontext
swapcontext = __libucontext_swapcontext
.weak libucontext_swapcontext
libucontext_swapcontext = __libucontext_swapcontext
END(__libucontext_swapcontext)