_setup.c revision ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1988 AT&T
* All Rights Reserved
*/
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
* 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 <signal.h>
#include <stdlib.h>
#include <link.h>
#include <dlfcn.h>
#include "_rtld.h"
#include "_audit.h"
#include "msg.h"
/* VARARGS */
unsigned long
{
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_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;
case AT_SUN_PLATFORM:
/* platform name */
break;
case AT_SUN_EXECNAME:
/* full pathname of execed object */
break;
case AT_SUN_AUXFLAGS:
/* auxiliary flags */
break;
case AT_SUN_HWCAP:
/* hardware capabilities */
break;
case AT_SUN_HWCAP2:
/* hardware capabilities */
break;
case AT_SUN_EMULATOR:
/* name of emulation library, if any */
break;
}
}
/*
* 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)
/*
* As all global symbol references within ld.so.1 are protected
* (symbolic), only RELATIVE and JMPSLOT relocations should be left
* to process at runtime. Process all relative relocations now.
*/
}
/*
* 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)());
}