Ticket #9522: ELFv2-context-asm.patch
File ELFv2-context-asm.patch, 3.6 KB (added by , 9 years ago) |
---|
-
libs/context/src/asm/jump_ppc64_sysv_elf_gas.S
a b 80 80 * * 81 81 * *****************************************************************/ 82 82 83 .section ".text"84 .align 285 83 .globl jump_fcontext 86 .section ".opd","aw" 87 .align 3 84 #if _CALL_ELF == 2 85 .text 86 .align 2 88 87 jump_fcontext: 89 .quad .jump_fcontext,.TOC.@tocbase,0 90 .previous 91 .size jump_fcontext,24 92 .type .jump_fcontext,@function 93 .globl .jump_fcontext 88 addis %r2, %r12, .TOC.-jump_fcontext@ha 89 addi %r2, %r2, .TOC.-jump_fcontext@l 90 .localentry jump_fcontext, . - jump_fcontext 91 #else 92 .section ".opd","aw" 93 .align 3 94 jump_fcontext: 95 # ifdef _CALL_LINUX 96 .quad .L.jump_fcontext,.TOC.@tocbase,0 97 .type jump_fcontext,@function 98 .text 99 .align 2 100 .L.jump_fcontext: 101 # else 102 .hidden .jump_fcontext 103 .globl .jump_fcontext 104 .quad .jump_fcontext,.TOC.@tocbase,0 105 .size jump_fcontext,24 106 .type .jump_fcontext,@function 107 .text 108 .align 2 94 109 .jump_fcontext: 110 # endif 111 #endif 95 112 std %r13, 0(%r3) # save R13 96 113 std %r14, 8(%r3) # save R14 97 114 std %r15, 16(%r3) # save R15 … … 194 211 mr %r3, %r5 # use third arg as return value after jump 195 212 # and as first arg in context function 196 213 197 ld %r 0,176(%r4) # load PC198 mtctr %r 0# restore CTR214 ld %r12, 176(%r4) # load PC 215 mtctr %r12 # restore CTR 199 216 200 217 bctr # jump to context 201 .size .jump_fcontext, .-.jump_fcontext 218 #if _CALL_ELF == 2 219 .size jump_fcontext, .-jump_fcontext 220 #else 221 # ifdef _CALL_LINUX 222 .size .jump_fcontext, .-.L.jump_fcontext 223 # else 224 .size .jump_fcontext, .-.jump_fcontext 225 # endif 226 #endif 227 202 228 203 229 /* Mark that we don't need executable stack. */ 204 230 .section .note.GNU-stack,"",%progbits -
libs/context/src/asm/make_ppc64_sysv_elf_gas.S
a b 80 80 * * 81 81 * *****************************************************************/ 82 82 83 .section ".text"84 .align 285 83 .globl make_fcontext 86 .section ".opd","aw" 87 .align 3 84 #if _CALL_ELF == 2 85 .text 86 .align 2 88 87 make_fcontext: 89 .quad .make_fcontext,.TOC.@tocbase,0 90 .previous 91 .size make_fcontext,24 92 .type .make_fcontext,@function 93 .globl .make_fcontext 88 addis %r2, %r12, .TOC.-make_fcontext@ha 89 addi %r2, %r2, .TOC.-make_fcontext@l 90 .localentry make_fcontext, . - make_fcontext 91 #else 92 .section ".opd","aw" 93 .align 3 94 make_fcontext: 95 # ifdef _CALL_LINUX 96 .quad .L.make_fcontext,.TOC.@tocbase,0 97 .type make_fcontext,@function 98 .text 99 .align 2 100 .L.make_fcontext: 101 # else 102 .hidden .make_fcontext 103 .globl .make_fcontext 104 .quad .make_fcontext,.TOC.@tocbase,0 105 .size make_fcontext,24 106 .type .make_fcontext,@function 107 .text 108 .align 2 94 109 .make_fcontext: 110 # endif 111 #endif 95 112 mflr %r6 # save return address into R6 96 113 97 114 mr %r0, %r3 … … 130 147 li %r3, 0 # set return value to zero 131 148 bl _exit # exit application 132 149 nop 133 .size .make_fcontext, .-.make_fcontext 150 #if _CALL_ELF == 2 151 .size make_fcontext, .-make_fcontext 152 #else 153 # ifdef _CALL_LINUX 154 .size .make_fcontext, .-.L.make_fcontext 155 # else 156 .size .make_fcontext, .-.make_fcontext 157 # endif 158 #endif 134 159 135 160 /* Mark that we don't need executable stack. */ 136 161 .section .note.GNU-stack,"",%progbits