struct dlopen_args args;
args.file = file;
args.mode = mode;
- args.caller = __builtin_return_address (0);
+ args.caller = RETURN_ADDRESS (0);
return _dlerror_run (dlopen_doit, &args) ? NULL : args.new;
}
{
struct dlopen_args args;
args.file = file;
- args.caller = __builtin_return_address (0);
+ args.caller = RETURN_ADDRESS (0);
if ((mode & RTLD_BINDING_MASK) == 0)
/* By default assume RTLD_LAZY. */
/* Look up a symbol in a shared object loaded by `dlopen'.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
dlsym (void *handle, const char *name)
{
struct dlsym_args args;
- args.who = __builtin_return_address (0);
+ args.who = RETURN_ADDRESS (0);
args.handle = handle;
args.name = name;
/* Look up a versioned symbol in a shared object loaded by `dlopen'.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
args.handle = handle;
args.name = name;
- args.who = __builtin_return_address (0);
+ args.who = RETURN_ADDRESS (0);
args.version = version_str;
return (_dlerror_run (dlvsym_doit, &args) ? NULL : args.sym);
void
_dl_mcount_wrapper (void *selfpc)
{
- _dl_mcount ((ElfW(Addr)) __builtin_return_address (0),
- (ElfW(Addr)) selfpc);
+ _dl_mcount ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
}
_dl_mcount_wrapper_check (void *selfpc)
{
if (_dl_profile_map != NULL)
- _dl_mcount ((ElfW(Addr)) __builtin_return_address (0),
- (ElfW(Addr)) selfpc);
+ _dl_mcount ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
}
+2000-07-18 Kaz Kylheku <kaz@ashi.footprints.net>
+
+ * spinlock.c (__pthread_alt_lock, __pthread_alt_timedlock): Fixed
+ bug whereby thr field of waitnode structure would not be correctly
+ set unless a null self pointer is passed to the functions.
+ Eliminated redundant calls to thread_self().
+
2000-07-18 Jakub Jelinek <jakub@redhat.com>
* pthread.c (__pthread_initialize_manager): Lock
if (pp_node == pp_head) {
long oldvalue = (long) p_node;
long newvalue = (long) p_node->next;
-
+
if (__compare_and_swap((long *) pp_node, oldvalue, newvalue))
return;
wait_node.abandoned = 0;
wait_node.next = (struct wait_node *) lock->__status;
- wait_node.thr = self = thread_self();
+ wait_node.thr = self;
suspend_needed = 1;
}
newstatus = 1;
} else {
if (self == NULL)
- wait_node.thr = self = thread_self();
+ self = thread_self();
+ wait_node.thr = self;
newstatus = (long) &wait_node;
}
wait_node.abandoned = 0;
p_wait_node->abandoned = 0;
p_wait_node->next = (struct wait_node *) lock->__status;
- p_wait_node->thr = self = thread_self();
+ p_wait_node->thr = self;
}
WRITE_MEMORY_BARRIER();
newstatus = 1;
} else {
if (self == NULL)
- p_wait_node->thr = self = thread_self();
+ p_wait_node->thr = self;
newstatus = (long) p_wait_node;
}
p_wait_node->abandoned = 0;
Void_t* result;
#if defined __GNUC__ && __GNUC__ >= 2
- result = (*__malloc_hook)(bytes, __builtin_return_address (0));
+ result = (*__malloc_hook)(bytes, RETURN_ADDRESS (0));
#else
result = (*__malloc_hook)(bytes, NULL);
#endif
#if defined _LIBC || defined MALLOC_HOOKS
if (__free_hook != NULL) {
#if defined __GNUC__ && __GNUC__ >= 2
- (*__free_hook)(mem, __builtin_return_address (0));
+ (*__free_hook)(mem, RETURN_ADDRESS (0));
#else
(*__free_hook)(mem, NULL);
#endif
Void_t* result;
#if defined __GNUC__ && __GNUC__ >= 2
- result = (*__realloc_hook)(oldmem, bytes, __builtin_return_address (0));
+ result = (*__realloc_hook)(oldmem, bytes, RETURN_ADDRESS (0));
#else
result = (*__realloc_hook)(oldmem, bytes, NULL);
#endif
Void_t* result;
#if defined __GNUC__ && __GNUC__ >= 2
- result = (*__memalign_hook)(alignment, bytes,
- __builtin_return_address (0));
+ result = (*__memalign_hook)(alignment, bytes, RETURN_ADDRESS (0));
#else
result = (*__memalign_hook)(alignment, bytes, NULL);
#endif
if (__malloc_hook != NULL) {
sz = n * elem_size;
#if defined __GNUC__ && __GNUC__ >= 2
- mem = (*__malloc_hook)(sz, __builtin_return_address (0));
+ mem = (*__malloc_hook)(sz, RETURN_ADDRESS (0));
#else
mem = (*__malloc_hook)(sz, NULL);
#endif
/* Machine-dependent definitions for profiling support. Generic GCC 2 version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
void *__builtin_return_address (unsigned int N)
returns the return address of the frame N frames up. */
-/* Be warned that GCC cannot usefully compile __builtin_return_address(N)
+/* Be warned that GCC cannot usefully compile __builtin_return_address(N)
for N != 0 on all machines. In this case, you may have to write
your own version of _mcount(). */
#define MCOUNT \
void _mcount (void) \
{ \
- mcount_internal ((u_long) __builtin_return_address (1), \
- (u_long) __builtin_return_address (0)); \
+ mcount_internal ((u_long) RETURN_ADDRESS (1), (u_long) RETURN_ADDRESS (0)); \
}