xref: /titanic_50/usr/src/cmd/sgs/libldstab/common/stab.c (revision d2d5cf7c5d909b74a88d499283e24750a9a52c5d)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57257d1b4Sraf  * Common Development and Distribution License (the "License").
67257d1b4Sraf  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217257d1b4Sraf 
227c478bd9Sstevel@tonic-gate /*
237257d1b4Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267257d1b4Sraf 
277c478bd9Sstevel@tonic-gate /*
28*d2d5cf7cSAli Bahrami  * The sharable object /usr/lib/libldstab.so.1 is a link-editor
29*d2d5cf7cSAli Bahrami  * support library that was used to compress the stab table by
30*d2d5cf7cSAli Bahrami  * eliminating duplicate include file entries. The link-editor would
31*d2d5cf7cSAli Bahrami  * load it by default, unless the user explicitly supplied a support
32*d2d5cf7cSAli Bahrami  * library via the ld -S option. We publically documented this in the
33*d2d5cf7cSAli Bahrami  * Solaris Linkers and Libraries Manual (LLM), stating that users
34*d2d5cf7cSAli Bahrami  * who supply their own support libraries should also explicitly
35*d2d5cf7cSAli Bahrami  * add '-S libldstab.so.1' to their link commands in order to retain
36*d2d5cf7cSAli Bahrami  * the functionality it supplied.
37*d2d5cf7cSAli Bahrami  *
38*d2d5cf7cSAli Bahrami  * The original libldstab.so worked by forking a child process running
39*d2d5cf7cSAli Bahrami  * a program named sbfocus. sbfocus was delivered with the Sun
40*d2d5cf7cSAli Bahrami  * compilers, and was expected to be found in the users PATH.
41*d2d5cf7cSAli Bahrami  * As the compilers and the OSnet are delivered on disjoint schedules,
42*d2d5cf7cSAli Bahrami  * this division never worked very well. Modern versions of the
43*d2d5cf7cSAli Bahrami  * compilers supply their own support libraries directly as needed, and
44*d2d5cf7cSAli Bahrami  * no longer deliver a program named sbfocus. The link-editor no longer
45*d2d5cf7cSAli Bahrami  * loads libldstab.so.1 by default, and it is no longer documented in the LLM.
46*d2d5cf7cSAli Bahrami  *
47*d2d5cf7cSAli Bahrami  * The current version of /usr/lib/libldstab.so.1 is a stub that exists
48*d2d5cf7cSAli Bahrami  * solely for backward compatibility. In the case where an existing
49*d2d5cf7cSAli Bahrami  *  Makefile  still follows the old advice in the LLM and supplies
50*d2d5cf7cSAli Bahrami  * '-S libldstab.so.1' to the link-editor command line, this object
51*d2d5cf7cSAli Bahrami  * will be loaded. It specifies a support library version of
52*d2d5cf7cSAli Bahrami  * LD_SUP_VNONE, which indicates to the link-editor that it is
53*d2d5cf7cSAli Bahrami  * not needed and should be quietly unloaded. In this way, we
54*d2d5cf7cSAli Bahrami  * preserve the old documented interface without undue overhead.
557c478bd9Sstevel@tonic-gate  */
56*d2d5cf7cSAli Bahrami 
57*d2d5cf7cSAli Bahrami 
587c478bd9Sstevel@tonic-gate #include <stdio.h>
59*d2d5cf7cSAli Bahrami #include <link.h>
607c478bd9Sstevel@tonic-gate #include "libld.h"
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /* ARGSUSED */
64*d2d5cf7cSAli Bahrami uint_t
657c478bd9Sstevel@tonic-gate #if	defined(_ELF64)
ld_version64(uint_t version)66*d2d5cf7cSAli Bahrami ld_version64(uint_t version)
677c478bd9Sstevel@tonic-gate #else
68*d2d5cf7cSAli Bahrami ld_version(uint_t version)
697c478bd9Sstevel@tonic-gate #endif
707c478bd9Sstevel@tonic-gate {
71*d2d5cf7cSAli Bahrami 	/* LD_SUP_VNONE tells libld.so to ignore this support library */
72*d2d5cf7cSAli Bahrami 	return (LD_SUP_VNONE);
737c478bd9Sstevel@tonic-gate }
74