diff options
author | Fangrui Song <i@maskray.me> | 2019-10-30 10:50:23 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-10-30 10:50:23 +0000 |
commit | 197245e341aeb1b5da8ee5fbe5d6c49de650fb89 (patch) | |
tree | 046f13d6fd30949d79ec6c7eb88b1d39834c0824 /binutils/doc | |
parent | a961a1e1749443516d8fe6e0570cf808a09e8f89 (diff) | |
download | gdb-197245e341aeb1b5da8ee5fbe5d6c49de650fb89.zip gdb-197245e341aeb1b5da8ee5fbe5d6c49de650fb89.tar.gz gdb-197245e341aeb1b5da8ee5fbe5d6c49de650fb89.tar.bz2 |
Add a --output=<DIR> option to ar to allow the specifying of an output directory.
* ar.c (emum long option numbers): Declare. Use to provide
numerical values for long options.
(long_options): Add --output option.
(usage): Mention the --output option.
(open_output_file): New function. Create a filepath for an output
file and open it.
(extract_file): Use open_output_file().
(open_output_file):
* testsuite/binutils-all/ar.exp: Add a test of the new feature.
* doc/binutils.texi: Document the new feature.
* NEWS: Mention the new feature.
Diffstat (limited to 'binutils/doc')
-rw-r--r-- | binutils/doc/binutils.texi | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 2edd7e1..97abf98 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -169,7 +169,7 @@ in the section entitled ``GNU Free Documentation License''. @c man title ar create, modify, and extract from archives @smallexample -ar [-]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}] +ar [-]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@option{--output} @var{dirname}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}] ar -M [ <mri-script ] @end smallexample @@ -253,7 +253,7 @@ program. @smallexample @c man begin SYNOPSIS ar -ar [@option{-X32_64}] [@option{-}]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}] +ar [@option{-X32_64}] [@option{-}]@var{p}[@var{mod}] [@option{--plugin} @var{name}] [@option{--target} @var{bfdname}] [@option{--output} @var{dirname}] [@var{relpos}] [@var{count}] @var{archive} [@var{member}@dots{}] @c man end @end smallexample @@ -579,6 +579,21 @@ The optional command-line switch @option{--target @var{bfdname}} specifies that the archive members are in an object code format different from your system's default format. See @xref{Target Selection}, for more information. + +@item --output @var{dirname} +The @option{--output} option can be used to specify a path to a +directory into which archive members should be extracted. If this +option is not specified then the current directory will be used. + +Note - although the presence of this option does imply a @option{x} +extraction operation that option must still be included on the command +line. + +Note - using this option does not allow archive members to be +extracted to locations outside of the current directory, or one of its +sub-directories. This is a security feature to prevent archives +created with the @option{P} option from maliciously overwriting user +files. @end table @c man end |