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 | 87cc7031acb7cc7a3b69dcfd79c3d71aa57fe477 (patch) | |
tree | 63a27a6255c5257e9d0830b61f203e71be035d51 /bfd | |
parent | d35d0cd43c20f6f014da29ddf38f345aac490a2b (diff) | |
download | gdb-87cc7031acb7cc7a3b69dcfd79c3d71aa57fe477.zip gdb-87cc7031acb7cc7a3b69dcfd79c3d71aa57fe477.tar.gz gdb-87cc7031acb7cc7a3b69dcfd79c3d71aa57fe477.tar.bz2 |
Only skip one instance of each prefix character, if they are present.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/peicode.h | 38 |
2 files changed, 40 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bb4c9ce..4b354be 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2003-12-16 Eric Youngdale <eric@mkssoftware.com> + Nick Clifton <nickc@redhat.com> + + * peicode.h (pe_ILF_build_a_bfd): Only skip one instance of each + prefix character, if they are present. + 2003-12-15 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru> Nick Clifton <nickc@redhat.com> diff --git a/bfd/peicode.h b/bfd/peicode.h index 41fcbbc..41445e5 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 '@' */ |