Ticket #9522: ELFv2-context-asm.patch

File ELFv2-context-asm.patch, 3.6 KB (added by xnox@…, 9 years ago)
  • libs/context/src/asm/jump_ppc64_sysv_elf_gas.S

    a b  
    8080 *                                                                 *
    8181 * *****************************************************************/
    8282
    83 .section ".text"
    84 .align 2
    8583.globl jump_fcontext
    86 .section ".opd","aw"
    87 .align 3
     84#if _CALL_ELF == 2
     85        .text
     86        .align 2
    8887jump_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
     94jump_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
    94109.jump_fcontext:
     110# endif
     111#endif
    95112    std     %r13,  0(%r3)       # save R13
    96113    std     %r14,  8(%r3)       # save R14
    97114    std     %r15,  16(%r3)      # save R15
     
    194211    mr      %r3,   %r5          # use third arg as return value after jump
    195212                                # and as first arg in context function
    196213
    197     ld      %r0,   176(%r4)     # load PC
    198     mtctr   %r0                 # restore CTR
     214    ld      %r12,  176(%r4)     # load PC
     215    mtctr   %r12                # restore CTR
    199216
    200217    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
    202228
    203229/* Mark that we don't need executable stack.  */
    204230.section .note.GNU-stack,"",%progbits
  • libs/context/src/asm/make_ppc64_sysv_elf_gas.S

    a b  
    8080 *                                                                 *
    8181 * *****************************************************************/
    8282
    83 .section ".text"
    84 .align 2
    8583.globl make_fcontext
    86 .section ".opd","aw"
    87 .align 3
     84#if _CALL_ELF == 2
     85        .text
     86        .align 2
    8887make_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
     94make_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
    94109.make_fcontext:
     110# endif
     111#endif
    95112    mflr    %r6                 # save return address into R6
    96113
    97114    mr      %r0, %r3
     
    130147    li      %r3,  0             # set return value to zero
    131148    bl      _exit               # exit application
    132149    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
    134159
    135160/* Mark that we don't need executable stack.  */
    136161.section .note.GNU-stack,"",%progbits