xref: /illumos-gate/usr/src/cmd/sgs/libldstab/common/stab.c (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * The sharable object /usr/lib/libldstab.so.1 is a link-editor
29  * support library that was used to compress the stab table by
30  * eliminating duplicate include file entries. The link-editor would
31  * load it by default, unless the user explicitly supplied a support
32  * library via the ld -S option. We publically documented this in the
33  * Solaris Linkers and Libraries Manual (LLM), stating that users
34  * who supply their own support libraries should also explicitly
35  * add '-S libldstab.so.1' to their link commands in order to retain
36  * the functionality it supplied.
37  *
38  * The original libldstab.so worked by forking a child process running
39  * a program named sbfocus. sbfocus was delivered with the Sun
40  * compilers, and was expected to be found in the users PATH.
41  * As the compilers and the OSnet are delivered on disjoint schedules,
42  * this division never worked very well. Modern versions of the
43  * compilers supply their own support libraries directly as needed, and
44  * no longer deliver a program named sbfocus. The link-editor no longer
45  * loads libldstab.so.1 by default, and it is no longer documented in the LLM.
46  *
47  * The current version of /usr/lib/libldstab.so.1 is a stub that exists
48  * solely for backward compatibility. In the case where an existing
49  *  Makefile  still follows the old advice in the LLM and supplies
50  * '-S libldstab.so.1' to the link-editor command line, this object
51  * will be loaded. It specifies a support library version of
52  * LD_SUP_VNONE, which indicates to the link-editor that it is
53  * not needed and should be quietly unloaded. In this way, we
54  * preserve the old documented interface without undue overhead.
55  */
56 
57 
58 #include <stdio.h>
59 #include <link.h>
60 #include "libld.h"
61 
62 
63 /* ARGSUSED */
64 uint_t
65 #if	defined(_ELF64)
66 ld_version64(uint_t version)
67 #else
68 ld_version(uint_t version)
69 #endif
70 {
71 	/* LD_SUP_VNONE tells libld.so to ignore this support library */
72 	return (LD_SUP_VNONE);
73 }
74