summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-15 21:07:52 +0000
committerjdp <jdp@FreeBSD.org>1998-09-15 21:07:52 +0000
commit2d0810fe034500c49ae468d9262a2aaa668bab27 (patch)
treeec4f72e32419a02153281d8fd7b44e6ec9adfe4a /libexec
parenta2851f45e2fa16cfac0c5ad2189b546a1fab41bd (diff)
downloadFreeBSD-src-2d0810fe034500c49ae468d9262a2aaa668bab27.zip
FreeBSD-src-2d0810fe034500c49ae468d9262a2aaa668bab27.tar.gz
Make the pathname pointed to by the Obj_Entry structure for the
dynamic linker itself dynamically allocated. All of them are supposed to be dynamically allocated, but we cheated before. It made gdb unhappy under some circumstances.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 5cb35e0..4b1eb2f 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.7 1998/09/04 19:03:57 dfr Exp $
+ * $Id: rtld.c,v 1.8 1998/09/05 03:31:00 jdp Exp $
*/
/*
@@ -801,8 +801,13 @@ gethints(void)
static void
init_rtld(caddr_t mapbase)
{
- /* Conjure up an Obj_Entry structure for the dynamic linker. */
-
+ /*
+ * Conjure up an Obj_Entry structure for the dynamic linker.
+ *
+ * The "path" member is supposed to be dynamically-allocated, but we
+ * aren't yet initialized sufficiently to do that. Below we will
+ * replace the static version with a dynamically-allocated copy.
+ */
obj_rtld.path = "/usr/libexec/ld-elf.so.1";
obj_rtld.rtld = true;
obj_rtld.mapbase = mapbase;
@@ -835,6 +840,9 @@ obj_rtld.got = NULL;
obj_list = NULL;
obj_tail = &obj_list;
+ /* Replace the path with a dynamically allocated copy. */
+ obj_rtld.path = xstrdup(obj_rtld.path);
+
r_debug.r_brk = r_debug_state;
r_debug.r_state = RT_CONSISTENT;
}
OpenPOWER on IntegriCloud