aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texinfo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-07-29 21:33:26 +0000
committerIan Lance Taylor <ian@airs.com>1996-07-29 21:33:26 +0000
commit86bc0974cb9bb02efc4fe0bf9c0466c2f02f1143 (patch)
tree1ff91efb81126755cd7ecf440debfe4ae68dab1d /ld/ld.texinfo
parentf2bf454e0f1bc17d01f9c2f22fe2010ee2442f3c (diff)
downloadgdb-86bc0974cb9bb02efc4fe0bf9c0466c2f02f1143.zip
gdb-86bc0974cb9bb02efc4fe0bf9c0466c2f02f1143.tar.gz
gdb-86bc0974cb9bb02efc4fe0bf9c0466c2f02f1143.tar.bz2
* fnmatch.h, fnmatch.c: New files.
* ldlex.l: Remove unused definition of FILENAME. Add definition of WILDCHAR. In SCRIPT mode, accept any sequence of WILDCHAR as a NAME. * ldgram.y (file_NAME_list): Accept '*' and '?' specially. (input_section_spec): Accept '?' specially. (statement): Change exp to mustbe_exp in length and FILL cases. (section): Call ldlex_script before section statements, and call ldlex_popstate after them. * ldlang.c: Include "fnmatch.h". (wildcardp): New static function. (wild_section): Permit the section name to be a wildcard. (wild_file): New static function, broken out of wild. (wild): Call wild_file. Permit the file name to be a wildcard. (open_input_bfds): Don't call lookup_name for a wildcard pattern. * Makefile.in: Rebuild dependencies. (CFILES): Add fnmatch.c. (HFILES): Add fnmatch.h. (OFILES): Add fnmatch.o. * ld.texinfo: Document that file and section names can now be wildcard patterns. * ldlang.c (lang_place_orphans): Correct condition: place a common section if not relocateable or if common definitions are forced.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r--ld/ld.texinfo52
1 files changed, 49 insertions, 3 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index bdb7644..73057c4 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -642,6 +642,19 @@ for a program linked against a shared library to override the definition
within the shared library. This option is only meaningful on ELF
platforms which support shared libraries.
+@cindex cross reference table
+@kindex --cref
+@item --cref
+Output a cross reference table. If a linker map file is being
+generated, the cross reference table is printed to the map file.
+Otherwise, it is printed on the standard output.
+
+The format of the table is intentionally simple, so that it may be
+easily processed by a script if necessary. The symbols are printed out,
+sorted by name. For each symbol, a list of file names is given. If the
+symbol is defined, the first file listed is the location of the
+definition. The remaining files contain references to the symbol.
+
@cindex symbols, from command line
@kindex --defsym @var{symbol}=@var{exp}
@item --defsym @var{symbol}=@var{expression}
@@ -1864,7 +1877,7 @@ beginning of the section.
The @var{contents} of a section definition may include any of the
following kinds of statement. You can include as many of these as you
like in a single section definition, separated from one another by
-whitespace.
+whitespace.
@table @code
@kindex @var{filename}
@@ -1949,8 +1962,23 @@ were in an input-file section named @code{COMMON}, regardless of the
input file's format.
@end table
-For example, the following command script arranges the output file into
-three consecutive sections, named @code{.text}, @code{.data}, and
+In any place where you may use a specific file or section name, you may
+also use a wildcard pattern. The wildcard handling is similar to that
+used by the Unix shell. A @samp{*} character matches any number of
+characters. A @samp{?} character matches any single character. The
+sequence @samp{[@var{chars}]} will match a single instance of any of the
+@var{chars}; the @samp{-} character may be used to specify a range of
+characters, as in @samp{[a-z]} to match any lower case letter. A
+@samp{\} character may be used to quote the following character.
+
+When using a wildcard to match a file name, the wildcard characters will
+not match a @samp{/} character (used to separate directory names on
+Unix). A pattern consisting of a single @samp{*} character is an
+exception; it will always match any file name. The wildcard characters
+will match a @samp{/} character in a section name.
+
+In the following example, the command script arranges the output file
+into three consecutive sections, named @code{.text}, @code{.data}, and
@code{.bss}, taking the input for each from the correspondingly named
sections of all the input files:
@@ -1995,6 +2023,24 @@ SECTIONS @{
@end group
@end smallexample
+This example shows how wildcard patterns might be used to partition
+files. All @code{.text} sections are placed in @code{.text}, and all
+@code{.bss} sections are placed in @code{.bss}. For all files beginning
+with an upper case character, the @code{.data} section is placed into
+@code{.DATA}; for all other files, the @code{.data} section is placed
+into @code{.data}.
+
+@smallexample
+@group
+SECTIONS @{
+ .text : @{ *(.text) @}
+ .DATA : @{ [A-Z]*(.data) @}
+ .data : @{ *(.data) @}
+ .bss : @{ *(.bss) @}
+@}
+@end group
+@end smallexample
+
@node Section Data Expressions
@subsection Section Data Expressions