Deleted Added
full compact
link.5 (13511) link.5 (13744)
1.\" Copyright (c) 1993 Paul Kranenburg
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.\"
1.\" Copyright (c) 1993 Paul Kranenburg
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.\"
29.\" $Id: link.5,v 1.2 1995/04/16 12:35:13 ats Exp $
29.\" $Id: link.5,v 1.3 1996/01/20 07:29:06 mpp Exp $
30.\"
31.Dd October 23, 1993
32.Dt LINK 5
33.Os
34.Sh NAME
35.Nm link
36.Nd dynamic loader and link editor interface
37.Sh SYNOPSIS

--- 9 unchanged lines hidden (view full) ---

47as it serves such similar functions as symbol definitions (including the
48accompanying string table) and relocation records needed to resolve
49references to external entities. It also records a number of data structures
50unique to the dynamic loading and linking process. These include references
51to other objects that are required to complete the link-editing process and
52indirection tables to facilitate
53.Em Position Independent Code
54(PIC for short) to improve sharing of code pages among different processes.
30.\"
31.Dd October 23, 1993
32.Dt LINK 5
33.Os
34.Sh NAME
35.Nm link
36.Nd dynamic loader and link editor interface
37.Sh SYNOPSIS

--- 9 unchanged lines hidden (view full) ---

47as it serves such similar functions as symbol definitions (including the
48accompanying string table) and relocation records needed to resolve
49references to external entities. It also records a number of data structures
50unique to the dynamic loading and linking process. These include references
51to other objects that are required to complete the link-editing process and
52indirection tables to facilitate
53.Em Position Independent Code
54(PIC for short) to improve sharing of code pages among different processes.
55The collection of data structures described here will be refered to as the
55The collection of data structures described here will be referred to as the
56.Em Run-time Relocation Section (RRS)
57and is embedded in the standard text and data segments of the dynamically
58linked program or shared object image as the existing
59.Xr a.out
60format offers no room for it elsewhere.
61.Pp
62Several utilities cooperate to ensure that the task of getting a program
63ready to run can complete successfully in a way that optimizes the use
64of system resources. The compiler emits PIC code from which shared libraries
65can be built by
66.Xr ld 1 .
67The compiler also includes size information of any initialized data items
68through the .size assembler directive. PIC code differs from conventional code
69in that it accesses data variables through an indirection table, the
56.Em Run-time Relocation Section (RRS)
57and is embedded in the standard text and data segments of the dynamically
58linked program or shared object image as the existing
59.Xr a.out
60format offers no room for it elsewhere.
61.Pp
62Several utilities cooperate to ensure that the task of getting a program
63ready to run can complete successfully in a way that optimizes the use
64of system resources. The compiler emits PIC code from which shared libraries
65can be built by
66.Xr ld 1 .
67The compiler also includes size information of any initialized data items
68through the .size assembler directive. PIC code differs from conventional code
69in that it accesses data variables through an indirection table, the
70Global Offset Table, by convention accessable by the reserved name
70Global Offset Table, by convention accessible by the reserved name
71.Em _GLOBAL_OFFSET_TABLE_.
72The exact mechanism used for this is machine dependent, usually a machine
73register is reserved for the purpose. The rational behind this construct
74is to generate code that is independent of the actual load address. Only
75the values contained in the Global Offset Table may need updating at run-time
76depending on the load addresses of the various shared objects in the address
77space.
78.Pp

--- 82 unchanged lines hidden (view full) ---

161.It Fa sdt_loaded
162A pointer to the first link map loaded (see below). This field is set by
163.Xr ld.so.
164.It Fa sdt_sods
165The start of a (linked) list of shared object descriptors needed by
166.Em this
167object.
168.It Fa sdt_filler1
71.Em _GLOBAL_OFFSET_TABLE_.
72The exact mechanism used for this is machine dependent, usually a machine
73register is reserved for the purpose. The rational behind this construct
74is to generate code that is independent of the actual load address. Only
75the values contained in the Global Offset Table may need updating at run-time
76depending on the load addresses of the various shared objects in the address
77space.
78.Pp

--- 82 unchanged lines hidden (view full) ---

161.It Fa sdt_loaded
162A pointer to the first link map loaded (see below). This field is set by
163.Xr ld.so.
164.It Fa sdt_sods
165The start of a (linked) list of shared object descriptors needed by
166.Em this
167object.
168.It Fa sdt_filler1
169Depricated (used by SunOS to specify library search rules).
169Deprecated (used by SunOS to specify library search rules).
170.It Fa sdt_got
171The location of the Global Offset Table within this image.
172.It Fa sdt_plt
173The location of the Procedure Linkage Table within this image.
174.It Fa sdt_rel
175The location of an array of
176.Fa relocation_info
177structures

--- 20 unchanged lines hidden (view full) ---

198.It Fa sdt_text_sz
199The size of the object's text segment.
200.It Fa sdt_plt_sz
201The size of the Procedure Linkage Table.
202.El
203.Pp
204A
205.Fa sod
170.It Fa sdt_got
171The location of the Global Offset Table within this image.
172.It Fa sdt_plt
173The location of the Procedure Linkage Table within this image.
174.It Fa sdt_rel
175The location of an array of
176.Fa relocation_info
177structures

--- 20 unchanged lines hidden (view full) ---

198.It Fa sdt_text_sz
199The size of the object's text segment.
200.It Fa sdt_plt_sz
201The size of the Procedure Linkage Table.
202.El
203.Pp
204A
205.Fa sod
206structure descibes a shared object that is needed
206structure describes a shared object that is needed
207to complete the link edit process of the object containing it.
208A list of such objects
209.Po
210chained through
211.Fa sod_next
212.Pc
213is pointed at
214by the

--- 347 unchanged lines hidden ---
207to complete the link edit process of the object containing it.
208A list of such objects
209.Po
210chained through
211.Fa sod_next
212.Pc
213is pointed at
214by the

--- 347 unchanged lines hidden ---