* config/tc-ia64.c (generate_unwind_image): Align the fragment
[deliverable/binutils-gdb.git] / ld / ldint.texinfo
CommitLineData
252b5132
RH
1\input texinfo
2@setfilename ldint.info
a2b64bed
NC
3@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4@c Free Software Foundation, Inc.
252b5132
RH
5
6@ifinfo
7@format
8START-INFO-DIR-ENTRY
9* Ld-Internals: (ldint). The GNU linker internals.
10END-INFO-DIR-ENTRY
11@end format
12@end ifinfo
13
14@ifinfo
15This file documents the internals of the GNU linker ld.
16
a2b64bed
NC
17Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
18Free Software Foundation, Inc.
252b5132
RH
19Contributed by Cygnus Support.
20
704c465c
NC
21 Permission is granted to copy, distribute and/or modify this document
22 under the terms of the GNU Free Documentation License, Version 1.1
23 or any later version published by the Free Software Foundation;
24 with no Invariant Sections, with no Front-Cover Texts, and with no
25 Back-Cover Texts. A copy of the license is included in the
26 section entitled "GNU Free Documentation License".
252b5132
RH
27
28@ignore
29Permission is granted to process this file through Tex and print the
30results, provided the printed document carries copying permission
31notice identical to this one except for the removal of this paragraph
32(this paragraph not being relevant to the printed manual).
33
34@end ignore
252b5132
RH
35@end ifinfo
36
37@iftex
38@finalout
39@setchapternewpage off
40@settitle GNU Linker Internals
41@titlepage
42@title{A guide to the internals of the GNU linker}
43@author Per Bothner, Steve Chamberlain, Ian Lance Taylor, DJ Delorie
44@author Cygnus Support
45@page
46
47@tex
48\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
5b343f5a 49\xdef\manvers{2.10.91} % For use in headers, footers too
252b5132
RH
50{\parskip=0pt
51\hfill Cygnus Support\par
52\hfill \manvers\par
53\hfill \TeX{}info \texinfoversion\par
54}
55@end tex
56
57@vskip 0pt plus 1filll
704c465c 58Copyright @copyright{} 1992, 93, 94, 95, 96, 97, 1998, 2000
252b5132
RH
59Free Software Foundation, Inc.
60
704c465c
NC
61 Permission is granted to copy, distribute and/or modify this document
62 under the terms of the GNU Free Documentation License, Version 1.1
63 or any later version published by the Free Software Foundation;
64 with no Invariant Sections, with no Front-Cover Texts, and with no
65 Back-Cover Texts. A copy of the license is included in the
66 section entitled "GNU Free Documentation License".
252b5132
RH
67
68@end titlepage
69@end iftex
70
71@node Top
72@top
73
74This file documents the internals of the GNU linker @code{ld}. It is a
75collection of miscellaneous information with little form at this point.
76Mostly, it is a repository into which you can put information about
77GNU @code{ld} as you discover it (or as you design changes to @code{ld}).
78
cf055d54
NC
79This document is distributed under the terms of the GNU Free
80Documentation License. A copy of the license is included in the
81section entitled "GNU Free Documentation License".
82
252b5132
RH
83@menu
84* README:: The README File
85* Emulations:: How linker emulations are generated
86* Emulation Walkthrough:: A Walkthrough of a Typical Emulation
704c465c 87* GNU Free Documentation License:: GNU Free Documentation License
252b5132
RH
88@end menu
89
90@node README
91@chapter The @file{README} File
92
93Check the @file{README} file; it often has useful information that does not
94appear anywhere else in the directory.
95
96@node Emulations
97@chapter How linker emulations are generated
98
99Each linker target has an @dfn{emulation}. The emulation includes the
100default linker script, and certain emulations also modify certain types
101of linker behaviour.
102
103Emulations are created during the build process by the shell script
104@file{genscripts.sh}.
105
106The @file{genscripts.sh} script starts by reading a file in the
107@file{emulparams} directory. This is a shell script which sets various
108shell variables used by @file{genscripts.sh} and the other shell scripts
109it invokes.
110
111The @file{genscripts.sh} script will invoke a shell script in the
112@file{scripttempl} directory in order to create default linker scripts
113written in the linker command language. The @file{scripttempl} script
114will be invoked 5 (or, in some cases, 6) times, with different
115assignments to shell variables, to create different default scripts.
116The choice of script is made based on the command line options.
117
118After creating the scripts, @file{genscripts.sh} will invoke yet another
119shell script, this time in the @file{emultempl} directory. That shell
120script will create the emulation source file, which contains C code.
121This C code permits the linker emulation to override various linker
122behaviours. Most targets use the generic emulation code, which is in
123@file{emultempl/generic.em}.
124
125To summarize, @file{genscripts.sh} reads three shell scripts: an
126emulation parameters script in the @file{emulparams} directory, a linker
127script generation script in the @file{scripttempl} directory, and an
128emulation source file generation script in the @file{emultempl}
129directory.
130
131For example, the Sun 4 linker sets up variables in
132@file{emulparams/sun4.sh}, creates linker scripts using
133@file{scripttempl/aout.sc}, and creates the emulation code using
134@file{emultempl/sunos.em}.
135
136Note that the linker can support several emulations simultaneously,
137depending upon how it is configured. An emulation can be selected with
138the @code{-m} option. The @code{-V} option will list all supported
139emulations.
140
141@menu
142* emulation parameters:: @file{emulparams} scripts
143* linker scripts:: @file{scripttempl} scripts
144* linker emulations:: @file{emultempl} scripts
145@end menu
146
147@node emulation parameters
148@section @file{emulparams} scripts
149
150Each target selects a particular file in the @file{emulparams} directory
151by setting the shell variable @code{targ_emul} in @file{configure.tgt}.
152This shell variable is used by the @file{configure} script to control
153building an emulation source file.
154
155Certain conventions are enforced. Suppose the @code{targ_emul} variable
156is set to @var{emul} in @file{configure.tgt}. The name of the emulation
157shell script will be @file{emulparams/@var{emul}.sh}. The
158@file{Makefile} must have a target named @file{e@var{emul}.c}; this
159target must depend upon @file{emulparams/@var{emul}.sh}, as well as the
160appropriate scripts in the @file{scripttempl} and @file{emultempl}
161directories. The @file{Makefile} target must invoke @code{GENSCRIPTS}
162with two arguments: @var{emul}, and the value of the make variable
163@code{tdir_@var{emul}}. The value of the latter variable will be set by
164the @file{configure} script, and is used to set the default target
165directory to search.
166
167By convention, the @file{emulparams/@var{emul}.sh} shell script should
168only set shell variables. It may set shell variables which are to be
169interpreted by the @file{scripttempl} and the @file{emultempl} scripts.
170Certain shell variables are interpreted directly by the
171@file{genscripts.sh} script.
172
173Here is a list of shell variables interpreted by @file{genscripts.sh},
174as well as some conventional shell variables interpreted by the
175@file{scripttempl} and @file{emultempl} scripts.
176
177@table @code
178@item SCRIPT_NAME
179This is the name of the @file{scripttempl} script to use. If
180@code{SCRIPT_NAME} is set to @var{script}, @file{genscripts.sh} will use
181the script @file{scriptteml/@var{script}.sc}.
182
183@item TEMPLATE_NAME
184This is the name of the @file{emultemlp} script to use. If
185@code{TEMPLATE_NAME} is set to @var{template}, @file{genscripts.sh} will
186use the script @file{emultempl/@var{template}.em}. If this variable is
187not set, the default value is @samp{generic}.
188
189@item GENERATE_SHLIB_SCRIPT
190If this is set to a nonempty string, @file{genscripts.sh} will invoke
191the @file{scripttempl} script an extra time to create a shared library
192script. @ref{linker scripts}.
193
194@item OUTPUT_FORMAT
195This is normally set to indicate the BFD output format use (e.g.,
196@samp{"a.out-sunos-big"}. The @file{scripttempl} script will normally
197use it in an @code{OUTPUT_FORMAT} expression in the linker script.
198
199@item ARCH
200This is normally set to indicate the architecture to use (e.g.,
201@samp{sparc}). The @file{scripttempl} script will normally use it in an
202@code{OUTPUT_ARCH} expression in the linker script.
203
204@item ENTRY
205Some @file{scripttempl} scripts use this to set the entry address, in an
206@code{ENTRY} expression in the linker script.
207
208@item TEXT_START_ADDR
209Some @file{scripttempl} scripts use this to set the start address of the
210@samp{.text} section.
211
212@item NONPAGED_TEXT_START_ADDR
213If this is defined, the @file{genscripts.sh} script sets
214@code{TEXT_START_ADDR} to its value before running the
215@file{scripttempl} script for the @code{-n} and @code{-N} options
216(@pxref{linker scripts}).
217
218@item SEGMENT_SIZE
219The @file{genscripts.sh} script uses this to set the default value of
220@code{DATA_ALIGNMENT} when running the @file{scripttempl} script.
221
222@item TARGET_PAGE_SIZE
223If @code{SEGMENT_SIZE} is not defined, the @file{genscripts.sh} script
224uses this to define it.
225
226@item ALIGNMENT
227Some @file{scripttempl} scripts set this to a number to pass to
228@code{ALIGN} to set the required alignment for the @code{end} symbol.
229@end table
230
231@node linker scripts
232@section @file{scripttempl} scripts
233
234Each linker target uses a @file{scripttempl} script to generate the
235default linker scripts. The name of the @file{scripttempl} script is
236set by the @code{SCRIPT_NAME} variable in the @file{emulparams} script.
237If @code{SCRIPT_NAME} is set to @var{script}, @code{genscripts.sh} will
238invoke @file{scripttempl/@var{script}.sc}.
239
240The @file{genscripts.sh} script will invoke the @file{scripttempl}
241script 5 or 6 times. Each time it will set the shell variable
242@code{LD_FLAG} to a different value. When the linker is run, the
243options used will direct it to select a particular script. (Script
244selection is controlled by the @code{get_script} emulation entry point;
245this describes the conventional behaviour).
246
247The @file{scripttempl} script should just write a linker script, written
248in the linker command language, to standard output. If the emulation
249name--the name of the @file{emulparams} file without the @file{.sc}
250extension--is @var{emul}, then the output will be directed to
251@file{ldscripts/@var{emul}.@var{extension}} in the build directory,
252where @var{extension} changes each time the @file{scripttempl} script is
253invoked.
254
255Here is the list of values assigned to @code{LD_FLAG}.
256
257@table @code
258@item (empty)
259The script generated is used by default (when none of the following
260cases apply). The output has an extension of @file{.x}.
261@item n
262The script generated is used when the linker is invoked with the
263@code{-n} option. The output has an extension of @file{.xn}.
264@item N
265The script generated is used when the linker is invoked with the
266@code{-N} option. The output has an extension of @file{.xbn}.
267@item r
268The script generated is used when the linker is invoked with the
269@code{-r} option. The output has an extension of @file{.xr}.
270@item u
271The script generated is used when the linker is invoked with the
272@code{-Ur} option. The output has an extension of @file{.xu}.
273@item shared
274The @file{scripttempl} script is only invoked with @code{LD_FLAG} set to
275this value if @code{GENERATE_SHLIB_SCRIPT} is defined in the
276@file{emulparams} file. The @file{emultempl} script must arrange to use
277this script at the appropriate time, normally when the linker is invoked
278with the @code{-shared} option. The output has an extension of
279@file{.xs}.
280@end table
281
282Besides the shell variables set by the @file{emulparams} script, and the
283@code{LD_FLAG} variable, the @file{genscripts.sh} script will set
284certain variables for each run of the @file{scripttempl} script.
285
286@table @code
287@item RELOCATING
288This will be set to a non-empty string when the linker is doing a final
289relocation (e.g., all scripts other than @code{-r} and @code{-Ur}).
290
291@item CONSTRUCTING
292This will be set to a non-empty string when the linker is building
293global constructor and destructor tables (e.g., all scripts other than
294@code{-r}).
295
296@item DATA_ALIGNMENT
297This will be set to an @code{ALIGN} expression when the output should be
298page aligned, or to @samp{.} when generating the @code{-N} script.
299
300@item CREATE_SHLIB
301This will be set to a non-empty string when generating a @code{-shared}
302script.
303@end table
304
305The conventional way to write a @file{scripttempl} script is to first
306set a few shell variables, and then write out a linker script using
307@code{cat} with a here document. The linker script will use variable
308substitutions, based on the above variables and those set in the
309@file{emulparams} script, to control its behaviour.
310
311When there are parts of the @file{scripttempl} script which should only
312be run when doing a final relocation, they should be enclosed within a
313variable substitution based on @code{RELOCATING}. For example, on many
314targets special symbols such as @code{_end} should be defined when doing
315a final link. Naturally, those symbols should not be defined when doing
316a relocateable link using @code{-r}. The @file{scripttempl} script
317could use a construct like this to define those symbols:
318@smallexample
319 $@{RELOCATING+ _end = .;@}
320@end smallexample
321This will do the symbol assignment only if the @code{RELOCATING}
322variable is defined.
323
324The basic job of the linker script is to put the sections in the correct
325order, and at the correct memory addresses. For some targets, the
326linker script may have to do some other operations.
327
328For example, on most MIPS platforms, the linker is responsible for
329defining the special symbol @code{_gp}, used to initialize the
330@code{$gp} register. It must be set to the start of the small data
331section plus @code{0x8000}. Naturally, it should only be defined when
332doing a final relocation. This will typically be done like this:
333@smallexample
334 $@{RELOCATING+ _gp = ALIGN(16) + 0x8000;@}
335@end smallexample
336This line would appear just before the sections which compose the small
337data section (@samp{.sdata}, @samp{.sbss}). All those sections would be
338contiguous in memory.
339
340Many COFF systems build constructor tables in the linker script. The
341compiler will arrange to output the address of each global constructor
342in a @samp{.ctor} section, and the address of each global destructor in
343a @samp{.dtor} section (this is done by defining
344@code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} in the
345@code{gcc} configuration files). The @code{gcc} runtime support
346routines expect the constructor table to be named @code{__CTOR_LIST__}.
347They expect it to be a list of words, with the first word being the
348count of the number of entries. There should be a trailing zero word.
349(Actually, the count may be -1 if the trailing word is present, and the
350trailing word may be omitted if the count is correct, but, as the
351@code{gcc} behaviour has changed slightly over the years, it is safest
352to provide both). Here is a typical way that might be handled in a
353@file{scripttempl} file.
354@smallexample
355 $@{CONSTRUCTING+ __CTOR_LIST__ = .;@}
356 $@{CONSTRUCTING+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)@}
357 $@{CONSTRUCTING+ *(.ctors)@}
358 $@{CONSTRUCTING+ LONG(0)@}
359 $@{CONSTRUCTING+ __CTOR_END__ = .;@}
360 $@{CONSTRUCTING+ __DTOR_LIST__ = .;@}
361 $@{CONSTRUCTING+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)@}
362 $@{CONSTRUCTING+ *(.dtors)@}
363 $@{CONSTRUCTING+ LONG(0)@}
364 $@{CONSTRUCTING+ __DTOR_END__ = .;@}
365@end smallexample
366The use of @code{CONSTRUCTING} ensures that these linker script commands
367will only appear when the linker is supposed to be building the
368constructor and destructor tables. This example is written for a target
369which uses 4 byte pointers.
370
371Embedded systems often need to set a stack address. This is normally
372best done by using the @code{PROVIDE} construct with a default stack
373address. This permits the user to easily override the stack address
374using the @code{--defsym} option. Here is an example:
375@smallexample
376 $@{RELOCATING+ PROVIDE (__stack = 0x80000000);@}
377@end smallexample
378The value of the symbol @code{__stack} would then be used in the startup
379code to initialize the stack pointer.
380
381@node linker emulations
382@section @file{emultempl} scripts
383
384Each linker target uses an @file{emultempl} script to generate the
385emulation code. The name of the @file{emultempl} script is set by the
386@code{TEMPLATE_NAME} variable in the @file{emulparams} script. If the
387@code{TEMPLATE_NAME} variable is not set, the default is
388@samp{generic}. If the value of @code{TEMPLATE_NAME} is @var{template},
389@file{genscripts.sh} will use @file{emultempl/@var{template}.em}.
390
391Most targets use the generic @file{emultempl} script,
392@file{emultempl/generic.em}. A different @file{emultempl} script is
393only needed if the linker must support unusual actions, such as linking
394against shared libraries.
395
396The @file{emultempl} script is normally written as a simple invocation
397of @code{cat} with a here document. The document will use a few
398variable substitutions. Typically each function names uses a
399substitution involving @code{EMULATION_NAME}, for ease of debugging when
400the linker supports multiple emulations.
401
402Every function and variable in the emitted file should be static. The
403only globally visible object must be named
404@code{ld_@var{EMULATION_NAME}_emulation}, where @var{EMULATION_NAME} is
405the name of the emulation set in @file{configure.tgt} (this is also the
406name of the @file{emulparams} file without the @file{.sh} extension).
407The @file{genscripts.sh} script will set the shell variable
408@code{EMULATION_NAME} before invoking the @file{emultempl} script.
409
410The @code{ld_@var{EMULATION_NAME}_emulation} variable must be a
411@code{struct ld_emulation_xfer_struct}, as defined in @file{ldemul.h}.
412It defines a set of function pointers which are invoked by the linker,
413as well as strings for the emulation name (normally set from the shell
414variable @code{EMULATION_NAME} and the default BFD target name (normally
415set from the shell variable @code{OUTPUT_FORMAT} which is normally set
416by the @file{emulparams} file).
417
418The @file{genscripts.sh} script will set the shell variable
419@code{COMPILE_IN} when it invokes the @file{emultempl} script for the
420default emulation. In this case, the @file{emultempl} script should
421include the linker scripts directly, and return them from the
422@code{get_scripts} entry point. When the emulation is not the default,
423the @code{get_scripts} entry point should just return a file name. See
424@file{emultempl/generic.em} for an example of how this is done.
425
426At some point, the linker emulation entry points should be documented.
427
428@node Emulation Walkthrough
429@chapter A Walkthrough of a Typical Emulation
430
431This chapter is to help people who are new to the way emulations
432interact with the linker, or who are suddenly thrust into the position
433of having to work with existing emulations. It will discuss the files
434you need to be aware of. It will tell you when the given "hooks" in
435the emulation will be called. It will, hopefully, give you enough
436information about when and how things happen that you'll be able to
437get by. As always, the source is the definitive reference to this.
438
439The starting point for the linker is in @file{ldmain.c} where
440@code{main} is defined. The bulk of the code that's emulation
441specific will initially be in @code{emultempl/@var{emulation}.em} but
442will end up in @code{e@var{emulation}.c} when the build is done.
443Most of the work to select and interface with emulations is in
444@code{ldemul.h} and @code{ldemul.c}. Specifically, @code{ldemul.h}
445defines the @code{ld_emulation_xfer_struct} structure your emulation
446exports.
447
448Your emulation file exports a symbol
449@code{ld_@var{EMULATION_NAME}_emulation}. If your emulation is
450selected (it usually is, since usually there's only one),
451@code{ldemul.c} sets the variable @var{ld_emulation} to point to it.
452@code{ldemul.c} also defines a number of API functions that interface
453to your emulation, like @code{ldemul_after_parse} which simply calls
454your @code{ld_@var{EMULATION}_emulation.after_parse} function. For
455the rest of this section, the functions will be mentioned, but you
456should assume the indirect reference to your emulation also.
457
458We will also skip or gloss over parts of the link process that don't
459relate to emulations, like setting up internationalization.
460
461After initialization, @code{main} selects an emulation by pre-scanning
462the command line arguments. It calls @code{ldemul_choose_target} to
463choose a target. If you set @code{choose_target} to
464@code{ldemul_default_target}, it picks your @code{target_name} by
465default.
466
467@code{main} calls @code{ldemul_before_parse}, then @code{parse_args}.
468@code{parse_args} calls @code{ldemul_parse_args} for each arg, which
469must update the @code{getopt} globals if it recognizes the argument.
470If the emulation doesn't recognize it, then parse_args checks to see
471if it recognizes it.
472
473Now that the emulation has had access to all its command-line options,
474@code{main} calls @code{ldemul_set_symbols}. This can be used for any
475initialization that may be affected by options. It is also supposed
476to set up any variables needed by the emulation script.
477
478@code{main} now calls @code{ldemul_get_script} to get the emulation
479script to use (based on arguments, no doubt, @pxref{Emulations}) and
480runs it. While parsing, @code{ldgram.y} may call @code{ldemul_hll} or
481@code{ldemul_syslib} to handle the @code{HLL} or @code{SYSLIB}
482commands. It may call @code{ldemul_unrecognized_file} if you asked
483the linker to link a file it doesn't recognize. It will call
484@code{ldemul_recognized_file} for each file it does recognize, in case
485the emulation wants to handle some files specially. All the while,
486it's loading the files (possibly calling
487@code{ldemul_open_dynamic_archive}) and symbols and stuff. After it's
488done reading the script, @code{main} calls @code{ldemul_after_parse}.
489Use the after-parse hook to set up anything that depends on stuff the
490script might have set up, like the entry point.
491
492@code{main} next calls @code{lang_process} in @code{ldlang.c}. This
493appears to be the main core of the linking itself, as far as emulation
494hooks are concerned(*). It first opens the output file's BFD, calling
495@code{ldemul_set_output_arch}, and calls
496@code{ldemul_create_output_section_statements} in case you need to use
497other means to find or create object files (i.e. shared libraries
498found on a path, or fake stub objects). Despite the name, nobody
499creates output sections here.
500
501(*) In most cases, the BFD library does the bulk of the actual
502linking, handling symbol tables, symbol resolution, relocations, and
503building the final output file. See the BFD reference for all the
504details. Your emulation is usually concerned more with managing
505things at the file and section level, like "put this here, add this
506section", etc.
507
508Next, the objects to be linked are opened and BFDs created for them,
509and @code{ldemul_after_open} is called. At this point, you have all
510the objects and symbols loaded, but none of the data has been placed
511yet.
512
513Next comes the Big Linking Thingy (except for the parts BFD does).
514All input sections are mapped to output sections according to the
515script. If a section doesn't get mapped by default,
516@code{ldemul_place_orphan} will get called to figure out where it goes.
517Next it figures out the offsets for each section, calling
518@code{ldemul_before_allocation} before and
519@code{ldemul_after_allocation} after deciding where each input section
520ends up in the output sections.
521
522The last part of @code{lang_process} is to figure out all the symbols'
523values. After assigning final values to the symbols,
524@code{ldemul_finish} is called, and after that, any undefined symbols
525are turned into fatal errors.
526
527OK, back to @code{main}, which calls @code{ldwrite} in
528@file{ldwrite.c}. @code{ldwrite} calls BFD's final_link, which does
529all the relocation fixups and writes the output bfd to disk, and we're
530done.
531
532In summary,
533
534@itemize @bullet
535
536@item @code{main()} in @file{ldmain.c}
537@item @file{emultempl/@var{EMULATION}.em} has your code
538@item @code{ldemul_choose_target} (defaults to your @code{target_name})
539@item @code{ldemul_before_parse}
540@item Parse argv, calls @code{ldemul_parse_args} for each
541@item @code{ldemul_set_symbols}
542@item @code{ldemul_get_script}
543@item parse script
544
545@itemize @bullet
546@item may call @code{ldemul_hll} or @code{ldemul_syslib}
547@item may call @code{ldemul_open_dynamic_archive}
548@end itemize
549
550@item @code{ldemul_after_parse}
551@item @code{lang_process()} in @file{ldlang.c}
552
553@itemize @bullet
554@item create @code{output_bfd}
555@item @code{ldemul_set_output_arch}
556@item @code{ldemul_create_output_section_statements}
557@item read objects, create input bfds - all symbols exist, but have no values
558@item may call @code{ldemul_unrecognized_file}
559@item will call @code{ldemul_recognized_file}
560@item @code{ldemul_after_open}
561@item map input sections to output sections
562@item may call @code{ldemul_place_orphan} for remaining sections
563@item @code{ldemul_before_allocation}
564@item gives input sections offsets into output sections, places output sections
565@item @code{ldemul_after_allocation} - section addresses valid
566@item assigns values to symbols
567@item @code{ldemul_finish} - symbol values valid
568@end itemize
569
570@item output bfd is written to disk
571
572@end itemize
573
704c465c
NC
574@node GNU Free Documentation License
575@chapter GNU Free Documentation License
576
577 GNU Free Documentation License
578
579 Version 1.1, March 2000
580
581 Copyright (C) 2000 Free Software Foundation, Inc.
582 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
583
584 Everyone is permitted to copy and distribute verbatim copies
585 of this license document, but changing it is not allowed.
586
587
5880. PREAMBLE
589
590The purpose of this License is to make a manual, textbook, or other
591written document "free" in the sense of freedom: to assure everyone
592the effective freedom to copy and redistribute it, with or without
593modifying it, either commercially or noncommercially. Secondarily,
594this License preserves for the author and publisher a way to get
595credit for their work, while not being considered responsible for
596modifications made by others.
597
598This License is a kind of "copyleft", which means that derivative
599works of the document must themselves be free in the same sense. It
600complements the GNU General Public License, which is a copyleft
601license designed for free software.
602
603We have designed this License in order to use it for manuals for free
604software, because free software needs free documentation: a free
605program should come with manuals providing the same freedoms that the
606software does. But this License is not limited to software manuals;
607it can be used for any textual work, regardless of subject matter or
608whether it is published as a printed book. We recommend this License
609principally for works whose purpose is instruction or reference.
610
611
6121. APPLICABILITY AND DEFINITIONS
613
614This License applies to any manual or other work that contains a
615notice placed by the copyright holder saying it can be distributed
616under the terms of this License. The "Document", below, refers to any
617such manual or work. Any member of the public is a licensee, and is
618addressed as "you".
619
620A "Modified Version" of the Document means any work containing the
621Document or a portion of it, either copied verbatim, or with
622modifications and/or translated into another language.
623
624A "Secondary Section" is a named appendix or a front-matter section of
625the Document that deals exclusively with the relationship of the
626publishers or authors of the Document to the Document's overall subject
627(or to related matters) and contains nothing that could fall directly
628within that overall subject. (For example, if the Document is in part a
629textbook of mathematics, a Secondary Section may not explain any
630mathematics.) The relationship could be a matter of historical
631connection with the subject or with related matters, or of legal,
632commercial, philosophical, ethical or political position regarding
633them.
634
635The "Invariant Sections" are certain Secondary Sections whose titles
636are designated, as being those of Invariant Sections, in the notice
637that says that the Document is released under this License.
638
639The "Cover Texts" are certain short passages of text that are listed,
640as Front-Cover Texts or Back-Cover Texts, in the notice that says that
641the Document is released under this License.
642
643A "Transparent" copy of the Document means a machine-readable copy,
644represented in a format whose specification is available to the
645general public, whose contents can be viewed and edited directly and
646straightforwardly with generic text editors or (for images composed of
647pixels) generic paint programs or (for drawings) some widely available
648drawing editor, and that is suitable for input to text formatters or
649for automatic translation to a variety of formats suitable for input
650to text formatters. A copy made in an otherwise Transparent file
651format whose markup has been designed to thwart or discourage
652subsequent modification by readers is not Transparent. A copy that is
653not "Transparent" is called "Opaque".
654
655Examples of suitable formats for Transparent copies include plain
656ASCII without markup, Texinfo input format, LaTeX input format, SGML
657or XML using a publicly available DTD, and standard-conforming simple
658HTML designed for human modification. Opaque formats include
659PostScript, PDF, proprietary formats that can be read and edited only
660by proprietary word processors, SGML or XML for which the DTD and/or
661processing tools are not generally available, and the
662machine-generated HTML produced by some word processors for output
663purposes only.
664
665The "Title Page" means, for a printed book, the title page itself,
666plus such following pages as are needed to hold, legibly, the material
667this License requires to appear in the title page. For works in
668formats which do not have any title page as such, "Title Page" means
669the text near the most prominent appearance of the work's title,
670preceding the beginning of the body of the text.
671
672
6732. VERBATIM COPYING
674
675You may copy and distribute the Document in any medium, either
676commercially or noncommercially, provided that this License, the
677copyright notices, and the license notice saying this License applies
678to the Document are reproduced in all copies, and that you add no other
679conditions whatsoever to those of this License. You may not use
680technical measures to obstruct or control the reading or further
681copying of the copies you make or distribute. However, you may accept
682compensation in exchange for copies. If you distribute a large enough
683number of copies you must also follow the conditions in section 3.
684
685You may also lend copies, under the same conditions stated above, and
686you may publicly display copies.
687
688
6893. COPYING IN QUANTITY
690
691If you publish printed copies of the Document numbering more than 100,
692and the Document's license notice requires Cover Texts, you must enclose
693the copies in covers that carry, clearly and legibly, all these Cover
694Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
695the back cover. Both covers must also clearly and legibly identify
696you as the publisher of these copies. The front cover must present
697the full title with all words of the title equally prominent and
698visible. You may add other material on the covers in addition.
699Copying with changes limited to the covers, as long as they preserve
700the title of the Document and satisfy these conditions, can be treated
701as verbatim copying in other respects.
702
703If the required texts for either cover are too voluminous to fit
704legibly, you should put the first ones listed (as many as fit
705reasonably) on the actual cover, and continue the rest onto adjacent
706pages.
707
708If you publish or distribute Opaque copies of the Document numbering
709more than 100, you must either include a machine-readable Transparent
710copy along with each Opaque copy, or state in or with each Opaque copy
711a publicly-accessible computer-network location containing a complete
712Transparent copy of the Document, free of added material, which the
713general network-using public has access to download anonymously at no
714charge using public-standard network protocols. If you use the latter
715option, you must take reasonably prudent steps, when you begin
716distribution of Opaque copies in quantity, to ensure that this
717Transparent copy will remain thus accessible at the stated location
718until at least one year after the last time you distribute an Opaque
719copy (directly or through your agents or retailers) of that edition to
720the public.
721
722It is requested, but not required, that you contact the authors of the
723Document well before redistributing any large number of copies, to give
724them a chance to provide you with an updated version of the Document.
725
726
7274. MODIFICATIONS
728
729You may copy and distribute a Modified Version of the Document under
730the conditions of sections 2 and 3 above, provided that you release
731the Modified Version under precisely this License, with the Modified
732Version filling the role of the Document, thus licensing distribution
733and modification of the Modified Version to whoever possesses a copy
734of it. In addition, you must do these things in the Modified Version:
735
736A. Use in the Title Page (and on the covers, if any) a title distinct
737 from that of the Document, and from those of previous versions
738 (which should, if there were any, be listed in the History section
739 of the Document). You may use the same title as a previous version
740 if the original publisher of that version gives permission.
741B. List on the Title Page, as authors, one or more persons or entities
742 responsible for authorship of the modifications in the Modified
743 Version, together with at least five of the principal authors of the
744 Document (all of its principal authors, if it has less than five).
745C. State on the Title page the name of the publisher of the
746 Modified Version, as the publisher.
747D. Preserve all the copyright notices of the Document.
748E. Add an appropriate copyright notice for your modifications
749 adjacent to the other copyright notices.
750F. Include, immediately after the copyright notices, a license notice
751 giving the public permission to use the Modified Version under the
752 terms of this License, in the form shown in the Addendum below.
753G. Preserve in that license notice the full lists of Invariant Sections
754 and required Cover Texts given in the Document's license notice.
755H. Include an unaltered copy of this License.
756I. Preserve the section entitled "History", and its title, and add to
757 it an item stating at least the title, year, new authors, and
758 publisher of the Modified Version as given on the Title Page. If
759 there is no section entitled "History" in the Document, create one
760 stating the title, year, authors, and publisher of the Document as
761 given on its Title Page, then add an item describing the Modified
762 Version as stated in the previous sentence.
763J. Preserve the network location, if any, given in the Document for
764 public access to a Transparent copy of the Document, and likewise
765 the network locations given in the Document for previous versions
766 it was based on. These may be placed in the "History" section.
767 You may omit a network location for a work that was published at
768 least four years before the Document itself, or if the original
769 publisher of the version it refers to gives permission.
770K. In any section entitled "Acknowledgements" or "Dedications",
771 preserve the section's title, and preserve in the section all the
772 substance and tone of each of the contributor acknowledgements
773 and/or dedications given therein.
774L. Preserve all the Invariant Sections of the Document,
775 unaltered in their text and in their titles. Section numbers
776 or the equivalent are not considered part of the section titles.
777M. Delete any section entitled "Endorsements". Such a section
778 may not be included in the Modified Version.
779N. Do not retitle any existing section as "Endorsements"
780 or to conflict in title with any Invariant Section.
781
782If the Modified Version includes new front-matter sections or
783appendices that qualify as Secondary Sections and contain no material
784copied from the Document, you may at your option designate some or all
785of these sections as invariant. To do this, add their titles to the
786list of Invariant Sections in the Modified Version's license notice.
787These titles must be distinct from any other section titles.
788
789You may add a section entitled "Endorsements", provided it contains
790nothing but endorsements of your Modified Version by various
791parties--for example, statements of peer review or that the text has
792been approved by an organization as the authoritative definition of a
793standard.
794
795You may add a passage of up to five words as a Front-Cover Text, and a
796passage of up to 25 words as a Back-Cover Text, to the end of the list
797of Cover Texts in the Modified Version. Only one passage of
798Front-Cover Text and one of Back-Cover Text may be added by (or
799through arrangements made by) any one entity. If the Document already
800includes a cover text for the same cover, previously added by you or
801by arrangement made by the same entity you are acting on behalf of,
802you may not add another; but you may replace the old one, on explicit
803permission from the previous publisher that added the old one.
804
805The author(s) and publisher(s) of the Document do not by this License
806give permission to use their names for publicity for or to assert or
807imply endorsement of any Modified Version.
808
809
8105. COMBINING DOCUMENTS
811
812You may combine the Document with other documents released under this
813License, under the terms defined in section 4 above for modified
814versions, provided that you include in the combination all of the
815Invariant Sections of all of the original documents, unmodified, and
816list them all as Invariant Sections of your combined work in its
817license notice.
818
819The combined work need only contain one copy of this License, and
820multiple identical Invariant Sections may be replaced with a single
821copy. If there are multiple Invariant Sections with the same name but
822different contents, make the title of each such section unique by
823adding at the end of it, in parentheses, the name of the original
824author or publisher of that section if known, or else a unique number.
825Make the same adjustment to the section titles in the list of
826Invariant Sections in the license notice of the combined work.
827
828In the combination, you must combine any sections entitled "History"
829in the various original documents, forming one section entitled
830"History"; likewise combine any sections entitled "Acknowledgements",
831and any sections entitled "Dedications". You must delete all sections
832entitled "Endorsements."
833
834
8356. COLLECTIONS OF DOCUMENTS
836
837You may make a collection consisting of the Document and other documents
838released under this License, and replace the individual copies of this
839License in the various documents with a single copy that is included in
840the collection, provided that you follow the rules of this License for
841verbatim copying of each of the documents in all other respects.
842
843You may extract a single document from such a collection, and distribute
844it individually under this License, provided you insert a copy of this
845License into the extracted document, and follow this License in all
846other respects regarding verbatim copying of that document.
847
848
8497. AGGREGATION WITH INDEPENDENT WORKS
850
851A compilation of the Document or its derivatives with other separate
852and independent documents or works, in or on a volume of a storage or
853distribution medium, does not as a whole count as a Modified Version
854of the Document, provided no compilation copyright is claimed for the
855compilation. Such a compilation is called an "aggregate", and this
856License does not apply to the other self-contained works thus compiled
857with the Document, on account of their being thus compiled, if they
858are not themselves derivative works of the Document.
859
860If the Cover Text requirement of section 3 is applicable to these
861copies of the Document, then if the Document is less than one quarter
862of the entire aggregate, the Document's Cover Texts may be placed on
863covers that surround only the Document within the aggregate.
864Otherwise they must appear on covers around the whole aggregate.
865
866
8678. TRANSLATION
868
869Translation is considered a kind of modification, so you may
870distribute translations of the Document under the terms of section 4.
871Replacing Invariant Sections with translations requires special
872permission from their copyright holders, but you may include
873translations of some or all Invariant Sections in addition to the
874original versions of these Invariant Sections. You may include a
875translation of this License provided that you also include the
876original English version of this License. In case of a disagreement
877between the translation and the original English version of this
878License, the original English version will prevail.
879
880
8819. TERMINATION
882
883You may not copy, modify, sublicense, or distribute the Document except
884as expressly provided for under this License. Any other attempt to
885copy, modify, sublicense or distribute the Document is void, and will
886automatically terminate your rights under this License. However,
887parties who have received copies, or rights, from you under this
888License will not have their licenses terminated so long as such
889parties remain in full compliance.
890
891
89210. FUTURE REVISIONS OF THIS LICENSE
893
894The Free Software Foundation may publish new, revised versions
895of the GNU Free Documentation License from time to time. Such new
896versions will be similar in spirit to the present version, but may
897differ in detail to address new problems or concerns. See
898http://www.gnu.org/copyleft/.
899
900Each version of the License is given a distinguishing version number.
901If the Document specifies that a particular numbered version of this
902License "or any later version" applies to it, you have the option of
903following the terms and conditions either of that specified version or
904of any later version that has been published (not as a draft) by the
905Free Software Foundation. If the Document does not specify a version
906number of this License, you may choose any version ever published (not
907as a draft) by the Free Software Foundation.
908
909
910ADDENDUM: How to use this License for your documents
911
912To use this License in a document you have written, include a copy of
913the License in the document and put the following copyright and
914license notices just after the title page:
915
916@smallexample
917 Copyright (c) YEAR YOUR NAME.
918 Permission is granted to copy, distribute and/or modify this document
919 under the terms of the GNU Free Documentation License, Version 1.1
920 or any later version published by the Free Software Foundation;
921 with the Invariant Sections being LIST THEIR TITLES, with the
922 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
923 A copy of the license is included in the section entitled "GNU
924 Free Documentation License".
925@end smallexample
926
927If you have no Invariant Sections, write "with no Invariant Sections"
928instead of saying which ones are invariant. If you have no
929Front-Cover Texts, write "no Front-Cover Texts" instead of
930"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
931
932If your document contains nontrivial examples of program code, we
933recommend releasing these examples in parallel under your choice of
934free software license, such as the GNU General Public License,
935to permit their use in free software.
936
252b5132
RH
937@contents
938@bye
This page took 0.102147 seconds and 4 git commands to generate.