summaryrefslogtreecommitdiff
path: root/libubacktrace/sysdeps
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2011-05-04 08:31:16 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2011-05-04 08:31:16 +0200
commit3004ce0c9619f89bf8e64931edd696bf4df8d2e1 (patch)
treef03f898fa5c2506c4e30f5f89ce097acf01bc016 /libubacktrace/sysdeps
parent3b3285b1b7c02d36c74a6ae265fdb02ca991c96b (diff)
parent4916fd889ec1c60710faa528a3ccdb50973198e2 (diff)
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (32 commits) libubacktrace: fix backtrace support on arm-eabi, which needs libgcc_eh linked too getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r getaddrinfo.c: improve code readability. No functional changes string: remove unused variable x86_64: silence warning if !TLS buildsys: prettify ssp.c handling madvise is LINUX_SPECIFIC test_nptl: fix expected result for tst-cputimer[123] test_nptl: fix expected result for tst-clock2 test buildsys: make $(LOCAL_INSTALL_PATH) phony ether_aton: reject invalid input tests: disable ether tests if !HAS_SOCKET inet: add ether_aton testcase sysconf: clock_getres depends on HAS_REALTIME __rt_sigwaitinfo: depends on HAS_REALTIME buildsys: minor fixes in Makefile.arch for C6X buildsys: minor fixes in Makefile.arch for microblaze libubacktrace: enabled for all archs indeed. sparc: don't access fp registers when configured for no fpu libubacktrace: generic implementation based dwarf ... Conflicts: ldso/ldso/dl-elf.c ldso/ldso/mips/elfinterp.c ldso/ldso/x86_64/elfinterp.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libubacktrace/sysdeps')
-rw-r--r--libubacktrace/sysdeps/sh/Makefile.arch12
-rw-r--r--libubacktrace/sysdeps/sh/backtrace.c84
2 files changed, 0 insertions, 96 deletions
diff --git a/libubacktrace/sysdeps/sh/Makefile.arch b/libubacktrace/sysdeps/sh/Makefile.arch
deleted file mode 100644
index 9b0de385b..000000000
--- a/libubacktrace/sysdeps/sh/Makefile.arch
+++ /dev/null
@@ -1,12 +0,0 @@
-# Makefile for uClibc (sh/libubacktrace)
-#
-# Copyright (C) 2010 STMicroelectronics Ltd
-# Author: Carmelo Amoroso <carmelo.amoroso@st.com>
-
-# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-
-libubacktrace_ARCH_SRC-y := backtrace.c
-
-# -fexections is required for backtrace to work using dwarf2
-CFLAGS-backtrace.c := -fexceptions
diff --git a/libubacktrace/sysdeps/sh/backtrace.c b/libubacktrace/sysdeps/sh/backtrace.c
deleted file mode 100644
index 18b91b1bb..000000000
--- a/libubacktrace/sysdeps/sh/backtrace.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Perform stack unwinding by using the _Unwind_Backtrace.
- *
- * User application that wants to use backtrace needs to be
- * compiled with -fexceptions option and -rdynamic to get full
- * symbols printed.
- *
- * Copyright (C) 2009, 2010 STMicroelectronics Ltd.
- *
- * Author(s): Giuseppe Cavallaro <peppe.cavallaro@st.com>
- * - Initial implementation for glibc
- *
- * Author(s): Carmelo Amoroso <carmelo.amoroso@st.com>
- * - Reworked for uClibc
- * - use dlsym/dlopen from libdl
- * - rewrite initialisation to not use libc_once
- * - make it available in static link too
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- *
- */
-
-#include <execinfo.h>
-#include <dlfcn.h>
-#include <stdlib.h>
-#include <unwind.h>
-#include <assert.h>
-#include <stdio.h>
-
-struct trace_arg
-{
- void **array;
- int cnt, size;
-};
-
-static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
-static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
-
-static void backtrace_init (void)
-{
- void *handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
-
- if (handle == NULL
- || ((unwind_backtrace = dlsym (handle, "_Unwind_Backtrace")) == NULL)
- || ((unwind_getip = dlsym (handle, "_Unwind_GetIP")) == NULL)) {
- printf("libgcc_s.so.1 must be installed for backtrace to work\n");
- abort();
- }
-}
-
-static _Unwind_Reason_Code
-backtrace_helper (struct _Unwind_Context *ctx, void *a)
-{
- struct trace_arg *arg = a;
-
- assert (unwind_getip != NULL);
-
- /* We are first called with address in the __backtrace function. Skip it. */
- if (arg->cnt != -1)
- arg->array[arg->cnt] = (void *) unwind_getip (ctx);
- if (++arg->cnt == arg->size)
- return _URC_END_OF_STACK;
- return _URC_NO_REASON;
-}
-
-/*
- * Perform stack unwinding by using the _Unwind_Backtrace.
- *
- * User application that wants to use backtrace needs to be
- * compiled with -fexceptions option and -rdynamic to get full
- * symbols printed.
- */
-int backtrace (void **array, int size)
-{
- struct trace_arg arg = { .array = array, .size = size, .cnt = -1 };
-
- if (unwind_backtrace == NULL)
- backtrace_init();
-
- if (size >= 1)
- unwind_backtrace (backtrace_helper, &arg);
-
- return arg.cnt != -1 ? arg.cnt : 0;
-}