2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 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 2004 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This crt1.o module is provided as the bare minimum required to build a 2N/A * 64-bit progile executable with gcc -pg. It is installed in /usr/lib/amd64 2N/A * where it will be picked up by gcc, along with crti.o and crtn.o 2N/A .
ident "%Z%%M% %I% %E% SMI" 2N/A/* global entities defined elsewhere but used here */ 2N/A * The SVR4/i386 ABI (pages 3-29) says that when the entry 2N/A * point runs registers' %rbp, %rsp, %rdx values are specified 2N/A * %rbp The content of this register is unspecified at 2N/A * process initialization time, but the user code should mark 2N/A * the deepest stack frame by setting the frame pointer to zero. 2N/A * No other frame's %ebp should have a zero value. 2N/A * %rsp Performing its usual job, the stack pointer holds the address 2N/A * of the bottom of the stack, which is guaranteed to be 2N/A * The stack contains the arguments and environment: 2N/A * envp[0] (16+(8*argc))(%rsp) 2N/A * NULL (8+(8*argc))(%rsp) 2N/A * %rdx In a conforming program, this register contains a function 2N/A * pointer that the application should register with atexit(BA_OS). 2N/A * This function is used for shared object termination code 2N/A * [see Dynamic Linking in Chapter 5 of the System V ABI]. 2N/A * Allocate a NULL return address and a NULL previous %rbp as if 2N/A * there was a genuine call to _start. 2N/A * envp[0] (32+(8*argc))(%rsp) - (A) 2N/A * NULL (24+(8*argc))(%rsp) 2N/A * argv[0] 24(%rbp) - (B) 2N/A * Check to see if there is an _mcleanup() function linked in, and if so, 2N/A * register it with atexit() as the last thing to be run by exit(). 2N/A/* start profiling */ 2N/A * Calculate the location of the envp array by adding the size of 2N/A * the argv array to the start of the argv array. 2N/A * Force stack alignment - below here there must have been an even 2N/A * number of un-popped pushq instructions whenever a call is reached