This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: What about check the bfd_arch_info before load the solib?
- From: Hui Zhu <teawater at gmail dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 1 Jul 2009 14:55:20 +0800
- Subject: Re: What about check the bfd_arch_info before load the solib?
- References: <daef60380906300607g2ab2c140g855cdeae69a08f6e@mail.gmail.com> <4A4AE147.5060800@vmware.com>
On Wed, Jul 1, 2009 at 12:08, Michael Snyder<msnyder@vmware.com> wrote:
> Hui Zhu wrote:
>>
>> Hi guys,
>>
>> In cross-compile remote debug environment, the gdb will load the solib
>> of local host if user doesn't set sysroot or something.
>> Load the wrong lib will make gdb get error.
>>
>> I think maybe we can add some check code to check if the bfd_arch_info
>> of this solib is same with the current_gdbarch before load this solib
>> in.
>> If not same, output a warning to let user set gdb to load right lib.
>>
>> What do you think about it?
>
> It would certainly be reasonable to reject an object file (eg. shlib)
> if it has the wrong architecture type. ?I'm surprised that we don't
> already do it.
Me too. I will try to make a patch for it.
Thanks,
Hui