2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * Prepare to jump to the target program we actually want to run. 2N/A * If this program is dynamically linked then we'll be jumping to 2N/A * another copy of the linker. If it's a statically linked program 2N/A * we'll be jumping directy to it's main entry point. In any case, 2N/A * we need to reset our current state stack and register state to 2N/A * something similar to the initial process state setup by the kernel 2N/A * and documented at: 2N/A * Of course this is the same stack format as when this executable 2N/A * was first started, so here we'll just roll back the stack and 2N/A * frame pointers to their values when this processes first started 2N/A * We also have to make sure to clear %edx since nornally ld.so.1 will 2N/A * set that to non-zero if there is an exit function that should be 2N/A * invoked when the process is terminating. This isn't actually 2N/A * necessary if the target program we're jumping to is a dynamically 2N/A * linked program since in that case we're actually jumping to another 2N/A * copy of ld.so.1 and it will just reset %edx, but if the target 2N/A * program we're jumping to is a statically linked binary that uses 2N/A * the standard sun compiler supplied crt1.o`_start(), it will check 2N/A * to see if %g1 is set. 2N/A * target will never return.