From 63fac2b9efb65061e07c03e4ddc516e051b673d0 Mon Sep 17 00:00:00 2001 From: John Polstra Date: Wed, 2 Sep 1998 02:51:12 +0000 Subject: [PATCH] Suppress duplicate entries in ldd output. --- libexec/rtld-elf/rtld.c | 21 ++++++++++----------- libexec/rtld-elf/rtld.h | 3 ++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1456ad90008c..9decc12c4a13 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.c,v 1.4 1998/09/02 01:09:34 jdp Exp $ + * $Id: rtld.c,v 1.5 1998/09/02 02:00:20 jdp Exp $ */ /* @@ -1388,17 +1388,16 @@ trace_loaded_objects(Obj_Entry *obj) bool is_lib; for (needed = obj->needed; needed; needed = needed->next) { - name = (char *)obj->strtab + needed->name; - if (!strncmp(name, "lib", 3)) { - is_lib = true; /* XXX bogus */ - } else { - is_lib = false; - } - - if (needed->obj == NULL) - path = "not found"; - else + if (needed->obj != NULL) { + if (needed->obj->traced) + continue; + needed->obj->traced = true; path = needed->obj->path; + } else + path = "not found"; + + name = (char *)obj->strtab + needed->name; + is_lib = strncmp(name, "lib", 3) == 0; /* XXX - bogus */ fmt = is_lib ? fmt1 : fmt2; while ((c = *fmt++) != '\0') { diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index a8490d1a37e3..679a676d4e4d 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.h,v 1.2 1998/04/30 07:48:02 dfr Exp $ + * $Id: rtld.h,v 1.3 1998/08/21 03:29:40 jb Exp $ */ #ifndef RTLD_H /* { */ @@ -109,6 +109,7 @@ typedef struct Struct_Obj_Entry { bool rtld; /* True if this is the dynamic linker */ bool textrel; /* True if there are relocations to text seg */ bool symbolic; /* True if generated with "-Bsymbolic" */ + bool traced; /* Already printed in ldd trace output */ struct link_map linkmap; /* for GDB */ } Obj_Entry;