From: TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
To: gdb-patches@sources.redhat.com
Cc: takai@vlsi.kuee.kyoto-u.ac.jp
Subject: [PATCH] fix solib-svr4.c with 64-bit bfd
Date: Thu, 17 Jan 2002 11:26:00 -0000 [thread overview]
Message-ID: <rj1ygohj92.fsf@vlsi.kuee.kyoto-u.ac.jp> (raw)
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
next reply other threads:[~2002-01-17 19:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-17 11:26 TAKAI Kousuke [this message]
2002-01-17 11:47 ` Kevin Buettner
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=rj1ygohj92.fsf@vlsi.kuee.kyoto-u.ac.jp \
--to=takai@vlsi.kuee.kyoto-u.ac.jp \
--cc=gdb-patches@sources.redhat.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