Only skip one instance of each prefix character, if they are present.

This commit is contained in:
Nick Clifton 2003-12-16 11:10:42 +00:00
parent d35d0cd43c
commit 87cc7031ac
2 changed files with 39 additions and 3 deletions

View file

@ -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>

View file

@ -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 '@' */