+1998-08-31 Ulrich Drepper <drepper@cygnus.com>
+
+ * elf/dl-close.c (_dl_close): Update _dl_loaded if the first
+ object on the list is removed. Don't use this code for PIC.
+ Reported by HJ Lu [PR libc/770].
+
1998-08-31 15:56 Ulrich Drepper <drepper@cygnus.com>
* db2/db_int.h: Use <db.h> instead of "db.h" to find header in include.
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <assert.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
__munmap ((caddr_t) (imap->l_addr + mapstart), mapend - mapstart);
/* Finally, unlink the data structure and free it. */
- if (imap->l_prev)
+#ifdef PIC
+ /* We will unlink the first object only if this is a statically
+ linked program. */
+ assert (imap->l_prev != NULL);
+#else
+ if (imap->l_prev != NULL)
imap->l_prev->l_next = imap->l_next;
+ else
+ _dl_loaded = imap->l_next;
+#endif
if (imap->l_next)
imap->l_next->l_prev = imap->l_prev;
if (imap->l_searchlist && imap->l_searchlist != list)
1998-08-31 Ulrich Drepper <drepper@cygnus.com>
- * sysdeps/i386/pt-machine.h (testandset): Add memory clobber.
+ * sysdeps/i386/i686/pt-machine.h (testandset): Add memory clobber.
+ * sysdeps/i386/pt-machine.h: Likewise
Suggested by Roland McGrath.
1998-08-28 13:58 Ulrich Drepper <drepper@cygnus.com>
{
int ret;
- __asm__ __volatile__("xchgl %0, %1"
+ __asm__ __volatile__ (
+ "xchgl %0, %1"
: "=r"(ret), "=m"(*spinlock)
- : "0"(1), "m"(*spinlock));
+ : "0"(1), "m"(*spinlock)
+ : "memory");
return ret;
}
{
int ret;
- __asm__ __volatile__("xchgl %0, %1"
- : "=r"(ret), "=m"(*spinlock)
- : "0"(1), "m"(*spinlock));
+ __asm__ __volatile__(
+ "xchgl %0, %1"
+ : "=r"(ret), "=m"(*spinlock)
+ : "0"(1), "m"(*spinlock)
+ : "memory");
return ret;
}