support.c revision 5c02782f732993cfb08de519f9a7de10c942c041
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CDDL HEADER START
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * The contents of this file are subject to the terms of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Common Development and Distribution License (the "License").
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * You may not use this file except in compliance with the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * See the License for the specific language governing permissions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * and limitations under the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * When distributing Covered Code, include this CDDL HEADER in each
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * If applicable, add the following below this CDDL HEADER, with the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * fields enclosed by brackets "[]" replaced with your own identifying
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CDDL HEADER END
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Use is subject to license terms.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Table which defines the default functions to be called by the library
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * SUPPORT (-S <libname>). These functions can be redefined by the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * ld_support_loadso() routine.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_VERSION), { 0, 0 }}, /* LDS_VERSION */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_INPUT_DONE), { 0, 0 }}, /* LDS_INPUT_DONE */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_START_64), { 0, 0 }}, /* LDS_START */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_ATEXIT_64), { 0, 0 }}, /* LDS_ATEXIT */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_OPEN_64), { 0, 0 }}, /* LDS_OPEN */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_FILE_64), { 0, 0 }}, /* LDS_FILE */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_INSEC_64), { 0, 0 }}, /* LDS_INSEC */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#else /* Elf32 */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_START), { 0, 0 }}, /* LDS_START */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_ATEXIT), { 0, 0 }}, /* LDS_ATEXIT */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync {MSG_ORIG(MSG_SUP_INSEC), { 0, 0 }}, /* LDS_INSEC */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Loads in a support shared object specified using the SGS_SUPPORT environment
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * variable or the -S ld option, and determines which interface functions are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * provided by that object.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Load the required support library. If we are unable to load it fail
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * with a fatal error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((handle = dlopen(obj, (RTLD_LAZY | RTLD_FIRST))) == NULL) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_SUP_NOLOAD),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync for (interface = 0; interface < LDS_NUM; interface++) {
obj));
return (S_ERROR);
return (S_ERROR);
return (S_ERROR);
int _flags = 0;
ekind);
if (npath)
if (nfile)
int _flags = 0;
return (S_ERROR);
* libCCexcept.so), then diagnose the section header difference and