diff options
| author | Jordan Rupprecht <rupprecht@google.com> | 2018-08-17 22:34:48 +0000 |
|---|---|---|
| committer | Jordan Rupprecht <rupprecht@google.com> | 2018-08-17 22:34:48 +0000 |
| commit | be8ebccaed22135669fd3716ed4cd235085ef5fd (patch) | |
| tree | 3e49c58a2d41d305e9c27d1b54d9049ad6881131 /llvm/tools/llvm-objcopy/ObjcopyOpts.td | |
| parent | 04df67e268eaf4c63b7fd0712b0c54a6db89c1cf (diff) | |
| download | bcm5719-llvm-be8ebccaed22135669fd3716ed4cd235085ef5fd.tar.gz bcm5719-llvm-be8ebccaed22135669fd3716ed4cd235085ef5fd.zip | |
[llvm-objcopy] Implement -G/--keep-global-symbol(s).
Summary:
Port GNU Objcopy -G/--keep-global-symbol(s).
This is slightly different than the already-implemented --globalize-symbol, which marks a symbol as global when copying. When --keep-global-symbol (alias -G) is used, *only* those symbols marked will stay global, and all other globals are demoted to local. (Also note that it doesn't *promote* a symbol to global). Additionally, there is a pluralized version of the flag --keep-global-symbols, which effectively applies --keep-global-symbol for every non-comment in a file.
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50589
llvm-svn: 340105
Diffstat (limited to 'llvm/tools/llvm-objcopy/ObjcopyOpts.td')
| -rw-r--r-- | llvm/tools/llvm-objcopy/ObjcopyOpts.td | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td index 8cdef453b74..c34494736c3 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -81,6 +81,24 @@ def L : JoinedOrSeparate<["-"], "L">, defm globalize_symbol : Eq<"globalize-symbol">, MetaVarName<"symbol">, HelpText<"Mark <symbol> as global">; + +defm keep_global_symbol + : Eq<"keep-global-symbol">, + MetaVarName<"symbol">, + HelpText<"Convert all symbols except <symbol> to local. May be repeated " + "to convert all except a set of symbols to local.">; +def G : JoinedOrSeparate<[ "-" ], "G">, Alias<keep_global_symbol>; + +defm keep_global_symbols + : Eq<"keep-global-symbols">, + MetaVarName<"filename">, + HelpText< + "Reads a list of symbols from <filename> and runs as if " + "--keep-global-symbol=<symbol> is set for each one. <filename> " + "contains one symbol per line and may contain comments beginning " + "with '#'. Leading and trailing whitespace is stripped from each " + "line. May be repeated to read symbols from many files.">; + defm weaken_symbol : Eq<"weaken-symbol">, MetaVarName<"symbol">, HelpText<"Mark <symbol> as weak">; |

