aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texinfo
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-06-07 11:35:46 +0000
committerAlan Modra <amodra@gmail.com>2008-06-07 11:35:46 +0000
commit967928e91621dc120ef477b7333471e5fb06957c (patch)
treef412b3396ae248b9dfba613ca45aafacea4e812e /ld/ld.texinfo
parent6efef468bed94a730bb0ae60a36ebead70c97f4e (diff)
downloadbinutils-967928e91621dc120ef477b7333471e5fb06957c.zip
binutils-967928e91621dc120ef477b7333471e5fb06957c.tar.gz
binutils-967928e91621dc120ef477b7333471e5fb06957c.tar.bz2
* NEWS: Mention archive:path patterns.
* ld.texinfo: Likewise. * ldlang.c: Formatting throughout. (archive_path): Only assume "[A-Za-z]:" is a dos drive. (input_statement_is_archive_path): New function, extracted from.. (walk_wild): ..here. (walk_wild_consider_section): Match archive:path here too. (init_map_userdata, sort_def_symbol): Convert to ISO C. * ldmain.c (main): Set link_info.path_separator. * emultempl/spuelf.em (choose_target): Don't set it here.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r--ld/ld.texinfo26
1 files changed, 25 insertions, 1 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index c8becd5..c90d953 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -3431,6 +3431,29 @@ needs to be at a particular location in memory. For example:
data.o(.data)
@end smallexample
+You can also specify files within archives by writing a pattern
+matching the archive, a colon, then the pattern matching the file,
+with no whitespace around the colon.
+
+@table @samp
+@item archive:file
+matches file within archive
+@item archive:
+matches the whole archive
+@item :file
+matches file but not one in an archive
+@end table
+
+Either one or both of @samp{archive} and @samp{file} can contain shell
+wildcards. On DOS based file systems, the linker will assume that a
+single letter followed by a colon is a drive specifier, so
+@samp{c:myfile.o} is a simple file specification, not @samp{myfile.o}
+within an archive called @samp{c}. @samp{archive:file} filespecs may
+also be used within an @code{EXCLUDE_FILE} list, but may not appear in
+other linker script contexts. For instance, you cannot extract a file
+from an archive by using @samp{archive:file} in an @code{INPUT}
+command.
+
If you use a file name without a list of sections, then all sections in
the input file will be included in the output section. This is not
commonly done, but it may by useful on occasion. For example:
@@ -3438,7 +3461,8 @@ commonly done, but it may by useful on occasion. For example:
data.o
@end smallexample
-When you use a file name which does not contain any wild card
+When you use a file name which is not an @samp{archive:file} specifier
+and does not contain any wild card
characters, the linker will first see if you also specified the file
name on the linker command line or in an @code{INPUT} command. If you
did not, the linker will attempt to open the file as an input file, as