diff options
| author | John Polstra <jdp@FreeBSD.org> | 1998-09-15 21:07:52 +0000 |
|---|---|---|
| committer | John Polstra <jdp@FreeBSD.org> | 1998-09-15 21:07:52 +0000 |
| commit | 4e25d42aeec26af925d501d8a3840c4cb08af836 (patch) | |
| tree | c22f9c82631abbad8d786ec7e8c6d40d9ba8d674 | |
| parent | 79dadba22abe5f4ca318fadac5e2b44836b9a0f4 (diff) | |
Notes
| -rw-r--r-- | libexec/rtld-elf/rtld.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5cb35e087f31..4b1eb2ff1d42 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; } |
