From cc0f9ff2f5b2af136014793156d47da6c33ee061 Mon Sep 17 00:00:00 2001 From: jdp Date: Sun, 5 Sep 1999 21:12:53 +0000 Subject: [PATCH] Make jdk-1.1.8 work again. It turns out that some code inside libjava peeks into the dynamic linker's private Obj_Entry structures. My recent changes introduced some new members near the front of the structures, causing libjava to get the wrong fields. This commit moves the new members toward the end of the structure so that the layout of the portion that is relevant to JDK remains the same as before. I will work with the JDK porting team to see if we can come up with a less fragile way for them to do what they need to do. I understand the current approach was necessary in order to work around some limitations of the dynamic linker. Maybe it's not necessary any more. --- libexec/rtld-elf/rtld.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 0cdbe4c44328..c63e7d08836b 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -70,6 +70,10 @@ typedef struct Struct_Needed_Entry { * * Items marked with "(%)" are dynamically allocated, and must be freed * when the structure is destroyed. + * + * CAUTION: It appears that the JDK port peeks into these structures. + * It looks at "next" and "mapbase" at least. Don't add new members + * near the front, until this can be straightened out. */ typedef struct Struct_Obj_Entry { /* @@ -80,12 +84,7 @@ typedef struct Struct_Obj_Entry { Elf_Word version; /* Version number of struct format */ struct Struct_Obj_Entry *next; - Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ - Objlist dagmembers; /* DAG has these members (%) */ char *path; /* Pathname of underlying file (%) */ - dev_t dev; /* Object's filesystem's device */ - ino_t ino; /* Object's inode number */ - unsigned long mark; /* Set to "curmark" to avoid repeat visits */ int refcount; int dl_refcount; /* Number of times loaded by dlopen */ @@ -133,6 +132,11 @@ typedef struct Struct_Obj_Entry { bool traced; /* Already printed in ldd trace output */ struct link_map linkmap; /* for GDB */ + Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ + Objlist dagmembers; /* DAG has these members (%) */ + dev_t dev; /* Object's filesystem's device */ + ino_t ino; /* Object's inode number */ + unsigned long mark; /* Set to "curmark" to avoid repeat visits */ } Obj_Entry; #define RTLD_MAGIC 0xd550b87a