2003-02-26 09:33:57 +01:00
|
|
|
.globl func_add1, func_add1_end
|
|
|
|
.proc func_add1
|
|
|
|
func_add1:
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; add r8 = 1, r32
|
2003-02-26 09:33:57 +01:00
|
|
|
nop.i 0
|
|
|
|
br.ret.sptk.many rp
|
|
|
|
}
|
|
|
|
func_add1_end:
|
|
|
|
.endp func_add1
|
|
|
|
|
|
|
|
.globl func_add3, func_add3_end
|
|
|
|
.proc func_add3
|
|
|
|
func_add3:
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; alloc loc0 = ar.pfs, 2, 1, 2, 0
|
2003-02-27 10:58:57 +01:00
|
|
|
mov r2 = sp
|
|
|
|
add sp = -16, sp
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mii; ld8 r8 = [in1], 8 // load the function pointer
|
2003-02-27 10:58:57 +01:00
|
|
|
mov r3 = rp
|
|
|
|
mov rp = loc0 // trash rp
|
2003-02-26 09:33:57 +01:00
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; ld8 r9 = [r8], 8 // load the entry-point
|
2003-02-27 10:58:57 +01:00
|
|
|
st8 [r2] = r3
|
2003-02-26 09:33:57 +01:00
|
|
|
mov out0 = in0
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mii; ld8 gp = [r8] // load the gp
|
2003-02-26 09:33:57 +01:00
|
|
|
mov b6 = r9
|
2003-02-27 10:58:57 +01:00
|
|
|
mov out1 = in1
|
|
|
|
}
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; nop 0
|
2003-02-27 10:58:57 +01:00
|
|
|
nop 0
|
2003-02-26 09:33:57 +01:00
|
|
|
br.call.sptk rp = b6
|
|
|
|
}
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; add r2 = 16, sp
|
2003-02-27 10:58:57 +01:00
|
|
|
;;
|
|
|
|
ld8 r3 = [r2] // r3 = saved rp
|
|
|
|
mov ar.pfs = loc0
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mii; nop 0
|
2003-02-27 10:58:57 +01:00
|
|
|
mov rp = r3
|
|
|
|
adds sp = 16, sp
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; st8 [sp] = in0 // trash rp save location
|
2003-02-27 10:58:57 +01:00
|
|
|
add r8 = 2, r8
|
2003-02-26 09:33:57 +01:00
|
|
|
br.ret.sptk.many rp
|
|
|
|
}
|
|
|
|
func_add3_end:
|
|
|
|
.endp func_add3
|
2003-02-27 10:58:57 +01:00
|
|
|
|
|
|
|
.globl func_vframe, func_vframe_end
|
|
|
|
.proc func_vframe
|
|
|
|
func_vframe:
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mii; alloc r16 = ar.pfs, 1, 2, 0, 0 // 0
|
2003-02-27 10:58:57 +01:00
|
|
|
mov loc0 = rp
|
|
|
|
mov loc1 = sp
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; sub sp = sp, in0
|
2003-02-27 10:58:57 +01:00
|
|
|
st8 [loc1] = r16
|
|
|
|
mov r2 = -99 // 0
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mii; nop 0
|
2003-02-27 10:58:57 +01:00
|
|
|
mov rp = r2
|
|
|
|
mov ar.pfs = r0
|
|
|
|
}
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; mov r16 = r2
|
2003-02-27 10:58:57 +01:00
|
|
|
tbit.nz p6, p0 = in0, 4
|
2003-03-27 05:29:07 +01:00
|
|
|
(p6) br.cond.sptk.many .exit
|
2003-02-27 10:58:57 +01:00
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; ld8 r16 = [loc1]
|
2003-02-27 10:58:57 +01:00
|
|
|
;;
|
|
|
|
mov r3 = loc0 // 8 move saved rp to r3
|
|
|
|
mov ar.pfs = r16
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; mov sp = loc1 // 10
|
2003-02-27 10:58:57 +01:00
|
|
|
st8 [loc1] = r0 // trash saved pfs
|
|
|
|
mov loc0 = r2
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; mov r8 = 10
|
2003-02-27 10:58:57 +01:00
|
|
|
mov rp = r3
|
|
|
|
br.ret.sptk.many rp
|
|
|
|
}
|
2003-03-27 05:29:07 +01:00
|
|
|
.exit:
|
|
|
|
{.mmi; ld8 r16 = [loc1]
|
2003-02-27 10:58:57 +01:00
|
|
|
;;
|
|
|
|
sub sp = 32, sp
|
|
|
|
mov ar.pfs = r16
|
|
|
|
} ;;
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mmi; mov sp = loc1
|
2003-02-27 10:58:57 +01:00
|
|
|
st8 [loc1] = r0 // trash saved pfs
|
|
|
|
mov rp = loc0
|
|
|
|
}
|
2003-03-27 05:29:07 +01:00
|
|
|
{.mib; nop 0
|
2003-02-27 10:58:57 +01:00
|
|
|
mov r8 = 4
|
|
|
|
br.ret.sptk.many rp
|
|
|
|
}
|
|
|
|
func_vframe_end:
|
|
|
|
.endp func_vframe
|
Mark Wielaard <mwielaard@redhat.com> writes:
On some systems executable stacks are denied. Since libunwind and the
tests don't actually need executable stacks this patch marks all
assembly files as not needing it.
The original patch comes from frysk:
2007-04-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* src/hppa/getcontext.S, src/hppa/setcontext.S, src/hppa/siglongjmp.S,
src/ia64/Ginstall_cursor.S, src/ia64/Linstall_cursor.S,
src/ia64/dyn_info_list.S, src/ia64/getcontext.S, src/ia64/longjmp.S,
src/ia64/setjmp.S, src/ia64/siglongjmp.S, src/ia64/sigsetjmp.S,
src/ppc64/longjmp.S, src/ppc64/siglongjmp.S, src/x86/longjmp.S,
src/x86/siglongjmp.S, src/x86_64/longjmp.S, src/x86_64/setcontext.S,
src/x86_64/siglongjmp.S: Stack should be non-executable, for SELinux.
I added a couple more markers for new files in current libunwind.
Before this patch you would get the following on selinux enabled
systems without allow_exec_stack: error while loading shared
libraries:
libunwind.so.7: cannot enable executable stack as shared object
requires: Permission denied
After the patch that error disappears and all test results are similar
to the results on systems without executable stack protection.
2007-10-01 16:35:01 +02:00
|
|
|
|
|
|
|
#ifdef __linux__
|
|
|
|
/* We do not need executable stack. */
|
|
|
|
.section .note.GNU-stack,"",@progbits
|
|
|
|
#endif
|