diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2015-07-31 13:48:22 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2015-08-07 11:41:40 +0200 |
commit | 0b45135ec1364f9d0c850a52ce05cf4ffb038021 (patch) | |
tree | c7cfc0420170c3ebd8b7b753b0cafcdc6280e1f1 /gdb/language.h | |
parent | da8c46d2967b6325dcd2cc72eca26d807964c93c (diff) | |
download | gdb-0b45135ec1364f9d0c850a52ce05cf4ffb038021.zip gdb-0b45135ec1364f9d0c850a52ce05cf4ffb038021.tar.gz gdb-0b45135ec1364f9d0c850a52ce05cf4ffb038021.tar.bz2 |
objcopy: Improve wildcard matching for symbols with '!' prefix.
When using options such as --localize-symbol, --globalize-symbol, etc,
along with the --wildcard option, prefixing a symbol name with '!'
should provide non-matching behaviour, as example the following example
is given in the manual:
--wildcard --weaken-symbol !foo --weaken-symbol fo*
which should weaken all symbols matching the pattern 'fo*', but not the
symbol 'foo'.
However, this currently does not work, the current logic will waken all
symbols matching the pattern 'fo*' AND all symbols that are not 'foo'.
The symbol 'foo' is covered by the first condition, and so is weakened,
while, other symbols, for example 'bar' will match the second condition,
and so be weakened.
This patch adjusts the logic so that a pattern prefixed with '!'
specifically DOES NOT apply the relevant change to any matching symbols,
instead of applying the change to all non-matching symbols. So this:
--weaken-symbol !foo
will ensure that the symbol 'foo' is not weakened, but says nothing
about symbols that are not 'foo'. As a result, a pattern prefixed with
'!' now only makes sense when used alongside a more wide ranging
wildcard pattern.
This change should make the wildcard matching feature more useful, with
no overall loss of functionality. The example given in the manual,
weaken all symbols matching 'fo*' except 'foo' can now be achieved, but
so too can more complex examples, such as weaken all symbols matching
'fo*' except 'foo', 'foa', and 'fob', like this:
--wildcard --weaken-symbol !foo \
--weaken-symbol !foa \
--weaken-symbol !fob \
--weaken-symbol fo*
Under the previous scheme, something as symbols as, weaken all symbols
except 'foo' could have been achieved with this:
--weaken-symbol !foo
however, this will no longer work. To achieve the same result under the
new scheme this is now required:
--weaken-symbol !foo --weaken-symbol *
binutils/ChangeLog:
* objcopy.c (is_specified_symbol_predicate): Don't stop at first
match. Non-match rules set found to FALSE.
binutils/testsuite/ChangeLog:
* binutils-all/objcopy.exp: Run new symbol tests.
(objcopy_test_symbol_manipulation): New function.
* binutils-all/symbols-1.d: New file.
* binutils-all/symbols-2.d: New file.
* binutils-all/symbols-3.d: New file.
* binutils-all/symbols-4.d: New file.
* binutils-all/symbols.s: New file.
Diffstat (limited to 'gdb/language.h')
0 files changed, 0 insertions, 0 deletions