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