From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix up msymbol type of dll trampoline to mst_solib_trampoline
Date: Fri, 28 Jun 2013 15:58:00 -0000 [thread overview]
Message-ID: <87ehbmkzqr.fsf@fleche.redhat.com> (raw)
In-Reply-To: <51CD0054.9040401@codesourcery.com> (Yao Qi's message of "Fri, 28 Jun 2013 11:17:40 +0800")
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> + for (ix = 0;
Yao> + VEC_iterate (msymbolp, name_prefix_imp, ix, msym_dll);
Yao> + ix++)
Yao> + {
Yao> + const char *sname = SYMBOL_LINKAGE_NAME (msym_dll);
Yao> + const char *name = (sname[1] == '_' ? &sname[7] : &sname[6]);
Yao> + struct minimal_symbol *found
Yao> + = prim_find_minimal_symbol (name);
Yao> +
Yao> + /* If found, there are symbols named "_imp_foo" and "foo"
Yao> + respectively read in from the current objfile. Set the type
Yao> + of symbol "foo" as 'mst_solib_trampoline'. */
Yao> + if (found != NULL && MSYMBOL_TYPE (found) == mst_text)
Yao> + MSYMBOL_TYPE (found) = mst_solib_trampoline;
It seems to me that it would be more efficient to keep a hash table of
minsyms under construction, and then do this lookup when entering a new
minsym. This would avoid repeated loops over all minsyms being defined.
That is, if the new symbol is _imp_x, look up x. If the symbol is x,
look up _imp_x. Then modify a symbol if needed.
Tom
next prev parent reply other threads:[~2013-06-28 15:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 4:24 Yao Qi
2013-06-27 20:43 ` Tom Tromey
2013-06-28 7:37 ` Yao Qi
2013-06-28 15:58 ` Tom Tromey [this message]
2013-07-03 0:26 ` Yao Qi
2013-07-05 8:44 ` asmwarrior
2013-07-05 12:22 ` Yao Qi
2013-07-05 14:30 ` Eli Zaretskii
2013-07-06 7:21 ` Yao Qi
2013-07-06 7:41 ` Eli Zaretskii
2013-07-06 8:20 ` asmwarrior
2013-07-10 6:21 ` Yao Qi
2013-07-10 16:56 ` Tom Tromey
2013-07-18 2:09 ` Yao Qi
2013-07-18 3:26 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ehbmkzqr.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox