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.
This commit is contained in:
John Polstra 1998-09-15 21:07:52 +00:00
parent 79dadba22a
commit 4e25d42aee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39306

View File

@ -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;
}