mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-12 15:37:38 +01:00
57e5696463
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.
26 lines
766 B
ArmAsm
26 lines
766 B
ArmAsm
#ifndef UNW_REMOTE_ONLY
|
|
|
|
/*
|
|
* Create a special unwind-table entry which makes it easy for an
|
|
* unwinder to locate the dynamic registration list. The special
|
|
* entry covers address range [0-0) and is therefore guaranteed to be
|
|
* the first in the unwind-table.
|
|
*/
|
|
.global _U_dyn_info_list
|
|
.hidden _U_dyn_info_list
|
|
|
|
.section .IA_64.unwind_info,"a","progbits"
|
|
.info: data8 (1<<48) | 1 /* v1, length==1 (8-byte word) */
|
|
data8 0 /* 8 empty .prologue directives (nops) */
|
|
data8 0 /* personality routine (ignored) */
|
|
string "dyn-list" /* lsda */
|
|
data8 @gprel(_U_dyn_info_list)
|
|
|
|
.section .IA_64.unwind, "a", "progbits"
|
|
data8 0, 0, @segrel(.info)
|
|
|
|
#endif
|
|
#ifdef __linux__
|
|
/* We do not need executable stack. */
|
|
.section .note.GNU-stack,"",@progbits
|
|
#endif
|