Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ld.elf_so convert to SIMPLEQ like the rest of the qu...
details: https://anonhg.NetBSD.org/src/rev/1cbcec53671e
branches: trunk
changeset: 786769:1cbcec53671e
user: christos <christos%NetBSD.org@localhost>
date: Thu May 09 15:38:14 2013 +0000
description:
convert to SIMPLEQ like the rest of the queues.
diffstat:
libexec/ld.elf_so/map_object.c | 12 ++++++------
libexec/ld.elf_so/rtld.c | 9 +++++----
libexec/ld.elf_so/rtld.h | 8 ++++----
libexec/ld.elf_so/symver.c | 8 ++++----
4 files changed, 19 insertions(+), 18 deletions(-)
diffs (149 lines):
diff -r ec562e2f428d -r 1cbcec53671e libexec/ld.elf_so/map_object.c
--- a/libexec/ld.elf_so/map_object.c Thu May 09 15:37:58 2013 +0000
+++ b/libexec/ld.elf_so/map_object.c Thu May 09 15:38:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: map_object.c,v 1.50 2013/05/08 15:25:01 christos Exp $ */
+/* $NetBSD: map_object.c,v 1.51 2013/05/09 15:38:14 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: map_object.c,v 1.50 2013/05/08 15:25:01 christos Exp $");
+__RCSID("$NetBSD: map_object.c,v 1.51 2013/05/09 15:38:14 christos Exp $");
#endif /* not lint */
#include <errno.h>
@@ -421,6 +421,7 @@
_rtld_obj_free(Obj_Entry *obj)
{
Objlist_Entry *elm;
+ Name_Entry *entry;
#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
if (obj->tls_done)
@@ -432,9 +433,8 @@
obj->needed = needed->next;
xfree(needed);
}
- while (!STAILQ_EMPTY(&obj->names)) {
- Name_Entry *entry = STAILQ_FIRST(&obj->names);
- STAILQ_REMOVE_HEAD(&obj->names, link);
+ while ((entry = SIMPLEQ_FIRST(&obj->names)) != NULL) {
+ SIMPLEQ_REMOVE_HEAD(&obj->names, link);
xfree(entry);
}
while ((elm = SIMPLEQ_FIRST(&obj->dldags)) != NULL) {
@@ -459,7 +459,7 @@
Obj_Entry *obj;
obj = CNEW(Obj_Entry);
- STAILQ_INIT(&obj->names);
+ SIMPLEQ_INIT(&obj->names);
SIMPLEQ_INIT(&obj->dldags);
SIMPLEQ_INIT(&obj->dagmembers);
return obj;
diff -r ec562e2f428d -r 1cbcec53671e libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c Thu May 09 15:37:58 2013 +0000
+++ b/libexec/ld.elf_so/rtld.c Thu May 09 15:38:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.c,v 1.166 2013/05/06 19:59:30 christos Exp $ */
+/* $NetBSD: rtld.c,v 1.167 2013/05/09 15:38:14 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.166 2013/05/06 19:59:30 christos Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.167 2013/05/09 15:38:14 christos Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -884,6 +884,7 @@
_rtld_linkmap_delete(obj);
*linkp = obj->next;
_rtld_objcount--;
+xprintf("%s, %d: %s\n", __FILE__, __LINE__, obj->path);
_rtld_obj_free(obj);
} else
linkp = &obj->next;
@@ -1373,8 +1374,8 @@
for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
phdr_info.dlpi_addr = (Elf_Addr)obj->relocbase;
/* XXX: wrong but not fixing it yet */
- phdr_info.dlpi_name = STAILQ_FIRST(&obj->names) ?
- STAILQ_FIRST(&obj->names)->name : obj->path;
+ phdr_info.dlpi_name = SIMPLEQ_FIRST(&obj->names) ?
+ SIMPLEQ_FIRST(&obj->names)->name : obj->path;
phdr_info.dlpi_phdr = obj->phdr;
phdr_info.dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]);
#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
diff -r ec562e2f428d -r 1cbcec53671e libexec/ld.elf_so/rtld.h
--- a/libexec/ld.elf_so/rtld.h Thu May 09 15:37:58 2013 +0000
+++ b/libexec/ld.elf_so/rtld.h Thu May 09 15:38:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.h,v 1.115 2013/05/06 19:59:30 christos Exp $ */
+/* $NetBSD: rtld.h,v 1.116 2013/05/09 15:38:14 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -92,7 +92,7 @@
typedef SIMPLEQ_HEAD(Struct_Objlist, Struct_Objlist_Entry) Objlist;
typedef struct Struct_Name_Entry {
- STAILQ_ENTRY(Struct_Name_Entry) link;
+ SIMPLEQ_ENTRY(Struct_Name_Entry) link;
char name[1];
} Name_Entry;
@@ -255,8 +255,8 @@
uint8_t nbuckets_s1;
uint8_t nbuckets_s2;
size_t pathlen; /* Pathname length */
- STAILQ_HEAD(, Struct_Name_Entry) names; /* List of names for this object we
- know about. */
+ SIMPLEQ_HEAD(, Struct_Name_Entry) names; /* List of names for this
+ * object we know about. */
#ifdef __powerpc__
Elf_Addr *gotptr; /* GOT table (secure-plt only) */
diff -r ec562e2f428d -r 1cbcec53671e libexec/ld.elf_so/symver.c
--- a/libexec/ld.elf_so/symver.c Thu May 09 15:37:58 2013 +0000
+++ b/libexec/ld.elf_so/symver.c Thu May 09 15:38:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: symver.c,v 1.3 2013/05/07 13:01:07 christos Exp $ */
+/* $NetBSD: symver.c,v 1.4 2013/05/09 15:38:14 christos Exp $ */
/*-
* Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: symver.c,v 1.3 2013/05/07 13:01:07 christos Exp $");
+__RCSID("$NetBSD: symver.c,v 1.4 2013/05/09 15:38:14 christos Exp $");
#include <sys/param.h>
#include <sys/exec_elf.h>
@@ -79,7 +79,7 @@
if (entry != NULL) {
strcpy(entry->name, name);
- STAILQ_INSERT_TAIL(&obj->names, entry, link);
+ SIMPLEQ_INSERT_TAIL(&obj->names, entry, link);
}
}
@@ -88,7 +88,7 @@
{
Name_Entry *entry;
- STAILQ_FOREACH(entry, &obj->names, link) {
+ SIMPLEQ_FOREACH(entry, &obj->names, link) {
dbg(("name: %s, entry->name: %s", name, entry->name));
if (strcmp(name, entry->name) == 0)
return 1;
Home |
Main Index |
Thread Index |
Old Index