11 <chapter id="dfunc">
22 <title id="dfunc-title">Linking Dynamically-Loaded Functions</title>
33
4+ <para>
5+
46<!--
57.SH "Compiling Dynamically-Loaded C Functions"
68.PP
@@ -100,19 +102,23 @@ You should look at the Postgres User's Manual for an explanation of this
100102procedure.
101103-->
102104
103- <para>
104105 After you have created and registered a user-defined
105- function, your work is essentially done. <productname>Postgres</productname>,
106- however, must load the object code (e.g., a <filename>.o</filename> file, or
106+ function, your work is essentially done.
107+ <productname>Postgres</productname>,
108+ however, must load the object code
109+ (e.g., a <literal>.o</literal> file, or
107110 a shared library) that implements your function. As
108- previously mentioned, <productname>Postgres</productname> loads your code at
111+ previously mentioned, <productname>Postgres</productname>
112+ loads your code at
109113 runtime, as required. In order to allow your code to be
110114 dynamically loaded, you may have to compile and
111115 link-edit it in a special way. This section briefly
112116 describes how to perform the compilation and
113117 link-editing required before you can load your user-defined
114- functions into a running <productname>Postgres</productname> server. Note that
118+ functions into a running <productname>Postgres</productname> server.
119+ Note that
115120 this process has changed as of Version 4.2.
121+ </para>
116122
117123<!--
118124 <tip>
@@ -123,15 +129,17 @@ procedure.
123129 and alignment of executable instructions within memory, etc.
124130 on the part of the person writing the dynamic loader. Such
125131 loaders tended to be slow and buggy. As of Version 4.2, the
126- <productname>Postgres</productname> dynamic loading mechanism has been rewritten to use
132+ <productname>Postgres</productname> dynamic loading mechanism
133+ has been rewritten to use
127134 the dynamic loading mechanism provided by the operating
128135 system. This approach is generally faster, more reliable and
129136 more portable than our previous dynamic loading mechanism.
130137 The reason for this is that nearly all modern versions of
131138 Unix use a dynamic loading mechanism to implement shared
132139 libraries and must therefore provide a fast and reliable
133140 mechanism. On the other hand, the object file must be
134- postprocessed a bit before it can be loaded into <productname>Postgres</productname>. We
141+ postprocessed a bit before it can be loaded into
142+ <productname>Postgres</productname>. We
135143 hope that the large increase in speed and reliability will
136144 make up for the slight decrease in convenience.
137145 </para>