Thu Dec 29 22:41:36 2022 UTC ()
link.5: fix some spelling and grammar


(gutteridge)
diff -r1.24 -r1.25 src/share/man/man5/link.5

cvs diff -r1.24 -r1.25 src/share/man/man5/link.5 (expand / switch to unified diff)

--- src/share/man/man5/link.5 2017/07/03 21:30:59 1.24
+++ src/share/man/man5/link.5 2022/12/29 22:41:36 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: link.5,v 1.24 2017/07/03 21:30:59 wiz Exp $ 1.\" $NetBSD: link.5,v 1.25 2022/12/29 22:41:36 gutteridge Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Paul Kranenburg. 7.\" by Paul Kranenburg.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -66,50 +66,50 @@ Several utilities cooperate to ensure th @@ -66,50 +66,50 @@ Several utilities cooperate to ensure th
66ready to run can complete successfully in a way that optimizes the use 66ready to run can complete successfully in a way that optimizes the use
67of system resources. 67of system resources.
68The compiler emits PIC code from which shared libraries can be built by 68The compiler emits PIC code from which shared libraries can be built by
69.Xr ld 1 . 69.Xr ld 1 .
70The compiler also includes size information of any initialized data items 70The compiler also includes size information of any initialized data items
71through the .size assembler directive. 71through the .size assembler directive.
72.Pp 72.Pp
73PIC code differs from conventional code in that it accesses data 73PIC code differs from conventional code in that it accesses data
74variables through an indirection table, the Global Offset Table, 74variables through an indirection table, the Global Offset Table,
75by convention accessible by the reserved name 75by convention accessible by the reserved name
76.Em _GLOBAL_OFFSET_TABLE_ . 76.Em _GLOBAL_OFFSET_TABLE_ .
77The exact mechanism used for this is machine dependent, usually a machine 77The exact mechanism used for this is machine dependent, usually a machine
78register is reserved for the purpose. 78register is reserved for the purpose.
79The rational behind this construct is to generate code that is 79The rationale behind this construct is to generate code that is
80independent of the actual load address. 80independent of the actual load address.
81Only the values contained in the Global Offset Table may need 81Only the values contained in the Global Offset Table may need
82updating at run-time depending on the load addresses of the various 82updating at run-time depending on the load addresses of the various
83shared objects in the address space. 83shared objects in the address space.
84.Pp 84.Pp
85Likewise, procedure calls to globally defined functions are redirected 85Likewise, procedure calls to globally defined functions are redirected
86through the Procedure Linkage Table (PLT) residing in the data 86through the Procedure Linkage Table (PLT) residing in the data
87segment of the core image. 87segment of the core image.
88Again, this is done to avoid run-time modifications to the text segment. 88Again, this is done to avoid run-time modifications to the text segment.
89.Pp 89.Pp
90The linker-editor allocates the Global Offset Table and Procedure 90The linker-editor allocates the Global Offset Table and Procedure
91Linkage Table when combining PIC object files into an image suitable 91Linkage Table when combining PIC object files into an image suitable
92for mapping into the process address space. 92for mapping into the process address space.
93It also collects all symbols that may be needed by the run-time 93It also collects all symbols that may be needed by the run-time
94link-editor and stores these along with the image's text and data bits. 94link-editor and stores these along with the image's text and data bits.
95Another reserved symbol, 95Another reserved symbol,
96.Em _DYNAMIC 96.Em _DYNAMIC
97is used to indicate the presence of the run-time linker structures. 97is used to indicate the presence of the run-time linker structures.
98Whenever 98Whenever
99.Em _DYNAMIC 99.Em _DYNAMIC
100is relocated to 0, there is no need to invoke the run-time link-editor. 100is relocated to 0, there is no need to invoke the run-time link-editor.
101If this symbol is non-zero, it points at a data structure from 101If this symbol is non-zero, it points at a data structure from
102which the location of the necessary relocation- and symbol information 102which the location of the necessary relocation and symbol information
103can be derived. 103can be derived.
104This is most notably used by the start-up module, 104This is most notably used by the start-up module,
105.Em crt0 . 105.Em crt0 .
106The _DYNAMIC structure is conventionally located at the start of the data 106The _DYNAMIC structure is conventionally located at the start of the data
107segment of the image to which it pertains. 107segment of the image to which it pertains.
108.Sh DATA STRUCTURES 108.Sh DATA STRUCTURES
109The data structures supporting dynamic linking and run-time relocation 109The data structures supporting dynamic linking and run-time relocation
110reside both in the text and data segments of the image they apply to. 110reside both in the text and data segments of the image they apply to.
111The text segments contain read-only data such as symbols descriptions and 111The text segments contain read-only data such as symbols descriptions and
112names, while the data segments contain the tables that need to be modified by 112names, while the data segments contain the tables that need to be modified by
113during the relocation process. 113during the relocation process.
114.Pp 114.Pp
115The _DYNAMIC symbol references a 115The _DYNAMIC symbol references a
@@ -370,27 +370,27 @@ struct rrs_hash { @@ -370,27 +370,27 @@ struct rrs_hash {
370.It Fa rh_symbolnum 370.It Fa rh_symbolnum
371The index of the symbol in the shared object's symbol table (as given by the 371The index of the symbol in the shared object's symbol table (as given by the
372.Fa ld_symbols 372.Fa ld_symbols
373field). 373field).
374.It Fa rh_next 374.It Fa rh_next
375In case of collisions, this field is the offset of the next entry in this 375In case of collisions, this field is the offset of the next entry in this
376hash table bucket. 376hash table bucket.
377It is zero for the last bucket element. 377It is zero for the last bucket element.
378.El 378.El
379The 379The
380.Fa rt_symbol 380.Fa rt_symbol
381structure is used to keep track of run-time allocated commons 381structure is used to keep track of run-time allocated commons
382and data items copied from shared objects. 382and data items copied from shared objects.
383These items are kept on linked list and is exported through the 383These items are kept in a linked list which is exported through the
384.Fa dd_cc 384.Fa dd_cc
385field in the 385field in the
386.Fa so_debug 386.Fa so_debug
387structure (see below) for use by debuggers. 387structure (see below) for use by debuggers.
388.Bd -literal -offset indent 388.Bd -literal -offset indent
389struct rt_symbol { 389struct rt_symbol {
390 struct nzlist *rt_sp; 390 struct nzlist *rt_sp;
391 struct rt_symbol *rt_next; 391 struct rt_symbol *rt_next;
392 struct rt_symbol *rt_link; 392 struct rt_symbol *rt_link;
393 void *rt_srcaddr; 393 void *rt_srcaddr;
394 struct so_map *rt_smp; 394 struct so_map *rt_smp;
395}; 395};
396.Ed 396.Ed