Back to index

glibc  2.9
Functions | Variables
unwind-forcedunwind.c File Reference
#include <dlfcn.h>
#include <stdio.h>
#include <unwind.h>
#include <pthreadP.h>

Go to the source code of this file.

Functions

void __attribute_noinline__ pthread_cancel_init (void)
 asm (" .globl _Unwind_Resume\n"" .type _Unwind_Resume, %function\n""_Unwind_Resume:\n"" stmfd sp!, {r4, r5, r6, lr}\n"" ldr r4, 1f\n"" ldr r5, 2f\n""3: add r4, pc, r4\n"" ldr r3, [r4, r5]\n"" mov r6, r0\n"" cmp r3, #0\n"" beq 4f\n""5: mov r0, r6\n"" ldmfd sp!, {r4, r5, r6, lr}\n"" bx r3\n""4: bl pthread_cancel_init\n"" ldr r3, [r4, r5]\n"" b 5b\n""1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n""2: .word libgcc_s_resume(GOTOFF)\n"" .size _Unwind_Resume, .-_Unwind_Resume\n")
_Unwind_Reason_Code __gcc_personality_v0 (_Unwind_State state, struct _Unwind_Exception *ue_header, struct _Unwind_Context *context)
_Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, void *stop_argument)
_Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context)

Variables

static void(* libgcc_s_resume )(struct _Unwind_Exception *exc)
static _Unwind_Reason_Code(* libgcc_s_personality )(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *)
static _Unwind_Reason_Code(* libgcc_s_forcedunwind )(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *)
static _Unwind_Word(* libgcc_s_getcfa )(struct _Unwind_Context *)

Function Documentation

_Unwind_Reason_Code __gcc_personality_v0 ( _Unwind_State  state,
struct _Unwind_Exception ue_header,
struct _Unwind_Context context 
)

Definition at line 98 of file unwind-forcedunwind.c.

{
  if (__builtin_expect (libgcc_s_personality == NULL, 0))
    pthread_cancel_init ();

  return libgcc_s_personality (state, ue_header, context);
}

Here is the call graph for this function:

_Unwind_Reason_Code _Unwind_ForcedUnwind ( struct _Unwind_Exception exc,
_Unwind_Stop_Fn  stop,
void *  stop_argument 
)

Definition at line 109 of file unwind-forcedunwind.c.

{
  if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
    pthread_cancel_init ();

  return libgcc_s_forcedunwind (exc, stop, stop_argument);
}

Here is the call graph for this function:

_Unwind_Word _Unwind_GetCFA ( struct _Unwind_Context context)

Definition at line 119 of file unwind-forcedunwind.c.

Here is the call graph for this function:

asm ( " .globl _Unwind_Resume\n"" .type  _Unwind_Resume,
%function\n""_Unwind_Resume:\n""stmfd sp!   
)

Definition at line 34 of file unwind-forcedunwind.c.

{
  void *resume, *personality, *forcedunwind, *getcfa;
  void *handle;

  if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
    {
      /* Force gcc to reload all values.  */
      asm volatile ("" ::: "memory");
      return;
    }

  handle = __libc_dlopen ("libgcc_s.so.1");

  if (handle == NULL
      || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
      || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL
      || (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind"))
        == NULL
      || (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL
#ifdef ARCH_CANCEL_INIT
      || ARCH_CANCEL_INIT (handle)
#endif
      )
    __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");

  libgcc_s_resume = resume;
  libgcc_s_personality = personality;
  libgcc_s_forcedunwind = forcedunwind;
  /* Make sure libgcc_s_getcfa is written last.  Otherwise,
     pthread_cancel_init might return early even when the pointer the
     caller is interested in is not initialized yet.  */
  atomic_write_barrier ();
  libgcc_s_getcfa = getcfa;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 29 of file unwind-forcedunwind.c.

_Unwind_Word(* libgcc_s_getcfa)(struct _Unwind_Context *) [static]

Definition at line 30 of file unwind-forcedunwind.c.

Definition at line 27 of file unwind-forcedunwind.c.

void(* libgcc_s_resume)(struct _Unwind_Exception *exc) [static]

Definition at line 25 of file unwind-forcedunwind.c.