summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-02 02:51:12 +0000
committerjdp <jdp@FreeBSD.org>1998-09-02 02:51:12 +0000
commit45eff87b424b4d6ff07fd066d0ca7d82acc54b10 (patch)
tree951ee983470f8f3fcb33e40ea64c6501963c0e65 /libexec
parent6bd2d046080d19e9b93daec5325c4480fcde0b55 (diff)
downloadFreeBSD-src-45eff87b424b4d6ff07fd066d0ca7d82acc54b10.zip
FreeBSD-src-45eff87b424b4d6ff07fd066d0ca7d82acc54b10.tar.gz
Suppress duplicate entries in ldd output.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c21
-rw-r--r--libexec/rtld-elf/rtld.h3
2 files changed, 12 insertions, 12 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 1456ad9..9decc12 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 a8490d1..679a676 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;
OpenPOWER on IntegriCloud