* [PATCH] fix solib-svr4.c with 64-bit bfd
@ 2002-01-17 11:26 TAKAI Kousuke
2002-01-17 11:47 ` Kevin Buettner
0 siblings, 1 reply; 2+ messages in thread
From: TAKAI Kousuke @ 2002-01-17 11:26 UTC (permalink / raw)
To: gdb-patches; +Cc: takai
Hello,
I had encountered a bug in GDB 5.1 compiled for sparc-sun-solaris2.8,
that GDB cannot resolve symbols in shared libraries in 32-bit environment.
(I found this problem had been reported as PR gdb/266).
I found that this seems to be because LM_ADDR() in solib-svr4.c
sign-extends 32-bit address value into 64-bit CORE_ADDR type.
I have no access to SVR4 spec, but under SunOS 5.7 and 5.8,
<sys/link.h> says that `l_addr' is unsigned, and it seems that
l_addr should be zero-extended.
This is a patch to fix it.
2002-01-18 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
* solib-svr4.c (LM_ADDR): Use `extract_address' instead of
`extract_signed_integer'.
Fix PR gdb/266.
*** gdb-5.1.orig/gdb/solib-svr4.c Tue Jul 3 04:37:59 2001
--- gdb-5.1/gdb/solib-svr4.c Fri Jan 18 03:58:10 2002
*************** LM_ADDR (struct so_list *so)
*** 185,192 ****
{
struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
! return (CORE_ADDR) extract_signed_integer (so->lm_info->lm + lmo->l_addr_offset,
! lmo->l_addr_size);
}
static CORE_ADDR
--- 185,191 ----
{
struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
! return extract_address (so->lm_info->lm + lmo->l_addr_offset, lmo->l_addr_size);
}
static CORE_ADDR
[end of patch]
I am not subscribing gdb-patches, so I will appreciate it
if you would send Cc to me.
Sorry for my poor English.
--
TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
Dept. of Communications and Computer Engineering,
Graduate School of Infomatics, Kyoto University, Japan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix solib-svr4.c with 64-bit bfd
2002-01-17 11:26 [PATCH] fix solib-svr4.c with 64-bit bfd TAKAI Kousuke
@ 2002-01-17 11:47 ` Kevin Buettner
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Buettner @ 2002-01-17 11:47 UTC (permalink / raw)
To: TAKAI Kousuke, gdb-patches
On Jan 18, 4:26am, TAKAI Kousuke wrote:
> I had encountered a bug in GDB 5.1 compiled for sparc-sun-solaris2.8,
> that GDB cannot resolve symbols in shared libraries in 32-bit environment.
> (I found this problem had been reported as PR gdb/266).
>
> I found that this seems to be because LM_ADDR() in solib-svr4.c
> sign-extends 32-bit address value into 64-bit CORE_ADDR type.
> I have no access to SVR4 spec, but under SunOS 5.7 and 5.8,
> <sys/link.h> says that `l_addr' is unsigned, and it seems that
> l_addr should be zero-extended.
>
> This is a patch to fix it.
[...]
Thanks for your patch.
While your patch fixes the problems that you're seeing on Solaris, it
breaks GDB on certain other platforms. In fact, your patch simply
reverts a change that was made last year to "fix" GDB on one of these
other platforms. I discuss this matter more fully in
http://sources.redhat.com/ml/gdb/2001-10/msg00036.html
I'll be revisiting this matter in a couple of weeks and will fix it
properly then. (The changes are a bit involved.)
Thanks again,
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-01-17 19:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 11:26 [PATCH] fix solib-svr4.c with 64-bit bfd TAKAI Kousuke
2002-01-17 11:47 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox