as "weak". Since the elf-support is in the library anyhow, this serves
no purpose and in fact causes problem because the weak reference alone
is not enough to pull in the ELF-code from an archive file, causing to
spurious failures of get_proc_name.
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.
routine and add address-space argument. This is needed because on
PPC64, a the function-name symbol refers to a function descriptor
(unlike, for example, on ia64, where the @fptr() operator is needed to
refer to a function descriptor). Thus, in order to look up the name
of a function, we need to dereference the function descriptor. To
make matters more "interesting", the function descriptors are normally
resolved by the dynamic linker, so we can't get their values from the
ELF file. Instead, we have to read them from the running image, hence
the need for the address-space argument.
* tests/ia64-test-setjmp.c (doit): New forward declaration.
(doit_pointer): New function pointer variable initialized to DOIT.
(doit): Self-call made by an unoptimizable volatile indirect call.
* tests/test-ptrace.c (target_pid_kill): New function.
(target_pid, main): TARGET_PID made static, for target_pid_kill ().
(main): Register target_pid_kill () for atexit(3).
2007-04-04 Jan Kratochvil <jan.kratochvil@redhat.com>
* tests/Gtest-dyn1.c, tests/test-async-sig.c, tests/test-ptrace.c:
Fixed lockups on broken libunwind (as ppc64 is).
2007-03-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* tests/test-async-sig.c (do_backtrace): Limit maximum backtrace depth
to 100 iterations; it workarounds FC6 DWARF-broken glibc.
2006-12-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* tests/test-ptrace.c (main): Check for too many unexpected child
signals, such as the common `SIGSEGV'.
This is so that the source file gets distributed and _ucontext_i.h is
generated properly on the target machine.
Signed-off-by: Arun Sharma <arun.sharma@google.com>
When libunwind is linked with a C++ program that throws exceptions,
the exception that's thrown is passed in %rax. However, libc's
setcontext clears %rax, causing problems.
This patch implements a setcontext that doesn't clobber rax.
TBD: Add dwarf CFI annotations
Signed-off-by: Arun Sharma <arun.sharma@google.com>
include/dwarf.h: Declare dwarf_reg_state_pool and dwarf_cie_info_pool.
include/dwarf_i.h: Include libunwind_i.h instead of tdep.h.
Make dwarf_to_unw_regnum() a macro so it doesn't get compiled
into an object file merely because it include dwarf_i.h (important
when optimization is turned off).
(dwarf_read_encoded_pointer_inlined): New function.
include/tdep-x86/libunwind_i.h: Add include of "mempool.h".
include/tdep-x86_64/libunwind_i.h: Add include of "mempool.h".
Yes, it casts to signed, but then converts right back to
unsigned via the return type. Fixed thus.
Signed-off-by: Richard Henderson <rth@redhat.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>