From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [ping] combine bfd_lookup_symbol in solib-*.c
Date: Sun, 28 Aug 2011 14:41:00 -0000 [thread overview]
Message-ID: <4E5A537E.30808@codesourcery.com> (raw)
In-Reply-To: <4E4D318E.704@codesourcery.com>
On 08/18/2011 11:36 PM, Yao Qi wrote:
>>>> +static CORE_ADDR
>>>> +bfd_lookup_symbol (bfd *abfd, char *symname)
>> I now notice that we already have copies of this
>> function in solib-svr4.c, solib-frv.c and solib-pa64.c
>> could could be combined. Given the precedent, it's okay
>> to leave that for a follow up.
>>
>
> During the tic6x patches review, Pedro pointed out the duplication of
> bfd_lookup_symbol cross solib-svr4.c, solib-frv.c and solib-pa64.c.
> This patch is to remove the duplication.
>
> Four instances of bfd_lookup_symbol is not exactly the same, and can be
> grouped into three 1) solib-svr4.c 2) solib-frv.c and solib-dsbt.c, 3)
> solib-pa64. In this patch, I split original version into two functions
> bfd_lookup_symbol_from_symtab and bfd_lookup_symbol_from_dyn_symtab, and
> move them to solib.c, so that they can be reused easily. A helper
> function, as a parameter, is introduced to hide the difference on
> comparing symbol name and checking section flag.
>
> There is still minor duplications in this new patch, which is helper
> function (cmp_name) defined in each solib-{frv,pa64,dsbt}.c
> respectively. Since I don't want helper_function be visible out of
> file, so this duplication is acceptable to me.
>
> Regression tested x86_64-pc-linux-gnu. OK for mainline?
>
Ping. http://sourceware.org/ml/gdb-patches/2011-08/msg00356.html
--
Yao (é½å°§)
next prev parent reply other threads:[~2011-08-28 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 15:37 Yao Qi
2011-08-28 14:41 ` Yao Qi [this message]
2011-08-29 11:41 ` Pedro Alves
2011-08-29 16:23 ` Yao Qi
2011-08-29 16:33 ` Pedro Alves
2011-08-30 2:51 ` [committed]: " 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=4E5A537E.30808@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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