_setup.c revision 9039eeaf76678a41be39feb97b4f724272ef7e18
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1988 AT&T
* All Rights Reserved
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* i386 specific setup routine - relocate ld.so's symbols, setup its
* environment, map in loadable sections of the executable.
*
* structure, address of process environment pointers, address of auxiliary
* vector and * argv[0] (process name).
* If errors occur, send process signal - otherwise
* return executable's entry point to the bootstrap routine.
*/
#include "_synonyms.h"
#include <signal.h>
#include <stdlib.h>
#include <link.h>
#include <dlfcn.h>
#include <debug.h>
#include "_rtld.h"
#include "_audit.h"
#include "msg.h"
extern int _end;
extern int _etext;
/*
* Stub routine to prevent atexit_init() being extracted from libc_pic.a on
* i386 and added to ld.so.1. We don't need it.
*/
void
{
}
/* VARARGS */
unsigned long
{
unsigned long relent = 0;
int auxflags = -1;
/*
* Scan the bootstrap structure to pick up the basics.
*/
case EB_LDSO_BASE:
break;
case EB_ARGV:
break;
case EB_ENVP:
break;
case EB_AUXV:
break;
case EB_DEVZERO:
break;
case EB_PAGESIZE:
break;
}
/*
* Search the aux. vector for the information passed by exec.
*/
case AT_EXECFD:
/* this is the old exec that passes a file descriptor */
break;
case AT_FLAGS:
/* processor flags (MAU available, etc) */
break;
case AT_PAGESZ:
/* system page size */
break;
case AT_PHDR:
/* address of the segment table */
break;
case AT_BASE:
/* interpreter base address */
if (ld_base == 0)
break;
case AT_SUN_UID:
/* effective user id for the executable */
break;
case AT_SUN_RUID:
/* real user id for the executable */
break;
case AT_SUN_GID:
/* effective group id for the executable */
break;
case AT_SUN_RGID:
/* real group id for the executable */
break;
#ifdef AT_SUN_PLATFORM /* Defined on SunOS 5.5 & greater. */
case AT_SUN_PLATFORM:
/* platform name */
break;
#endif
#ifdef AT_SUN_EXECNAME /* Defined on SunOS 5.6 & greater. */
case AT_SUN_EXECNAME:
/* full pathname of execed object */
break;
#endif
#ifdef AT_SUN_AUXFLAGS /* At the behest of PSARC 2002/188 */
case AT_SUN_AUXFLAGS:
break;
#endif
#ifdef AT_SUN_HWCAP /* Hardware capabilities */
case AT_SUN_HWCAP:
break;
#endif
#ifdef AT_SUN_EMULATOR /* Emulation library name */
case AT_SUN_EMULATOR:
/* name of emulation library, if any */
break;
#endif
}
}
/*
* Get needed info from ld.so's dynamic structure.
*/
/* LINTED */
case DT_REL:
break;
case DT_RELCOUNT:
break;
case DT_RELENT:
break;
case DT_STRTAB:
break;
case DT_SONAME:
break;
}
}
/*
* If we don't have a RELENT, just assume
* the size.
*/
if (relent == 0)
/*
* Relocate all symbols in ld.so.
*
* Because ld.so.1 is built with -Bsymbolic there should only be
* RELATIVE and JMPSLOT relocations, both of which get relative
* additions against them.
*/
}
/*
* If an emulation library is being used, use that as the linker's
* effective executable name. The real executable is not linked by this
* linker.
*/
}
/*
* Initialize the dyn_plt_ent_size field. It currently contains the
* size of the dyn_plt_template. It still needs to be aligned and have
* space for the 'dyn_data' area added.
*/
/*
* Continue with generic startup processing.
*/
}
return (LM_ENTRY_PT(lmp)());
}