diff options
author | Nick Clifton <nickc@redhat.com> | 2003-12-16 11:10:42 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-12-16 11:10:42 +0000 |
commit | 5ce996598ad4c533a873987939daa3a762dff564 (patch) | |
tree | 5d8fa90426dc8e97a4aad4d4e64a4f3429f3c631 /bfd/peicode.h | |
parent | c15c486a0f626e31c7cf537d1b4f076baa809d89 (diff) | |
download | binutils-redhat-5ce996598ad4c533a873987939daa3a762dff564.tar.gz |
Only skip one instance of each prefix character, if they are present.
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r-- | bfd/peicode.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index 41fcbbcb65..41445e592c 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -902,10 +902,40 @@ pe_ILF_build_a_bfd (bfd * abfd, symbol = symbol_name; if (import_name_type != IMPORT_NAME) - /* Skip any prefix in symbol_name. */ - while (*symbol == '@' || * symbol == '?' || * symbol == '_') - ++ symbol; - + { + bfd_boolean skipped_leading_underscore = FALSE; + bfd_boolean skipped_leading_at = FALSE; + bfd_boolean skipped_leading_question_mark = FALSE; + bfd_boolean check_again; + + /* Skip any prefix in symbol_name. */ + -- symbol; + do + { + check_again = FALSE; + ++ symbol; + + switch (*symbol) + { + case '@': + if (! skipped_leading_at) + check_again = skipped_leading_at = TRUE; + break; + case '?': + if (! skipped_leading_question_mark) + check_again = skipped_leading_question_mark = TRUE; + break; + case '_': + if (! skipped_leading_underscore) + check_again = skipped_leading_underscore = TRUE; + break; + default: + break; + } + } + while (check_again); + } + if (import_name_type == IMPORT_NAME_UNDECORATE) { /* Truncate at the first '@' */ |