From: Kevin Buettner <kevinb@redhat.com>
To: Michael Snyder <msnyder@redhat.com>, Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] cvexpr.c: Don't let linker delete unused globals
Date: Thu, 18 Apr 2002 11:49:00 -0000 [thread overview]
Message-ID: <1020418184919.ZM8474@localhost.localdomain> (raw)
In-Reply-To: Michael Snyder <msnyder@redhat.com> "Re: [PATCH] cvexpr.c: Don't let linker delete unused globals" (Apr 18, 10:02am)
On Apr 18, 10:02am, Michael Snyder wrote:
> > On AIX, I was seeing lots of failures in gdb.base/code-expr.exp and
> > gdb.base/cvexpr.exp due to the fact that the linker deletes unused
> > symbols. The patch below fixes these failures.
> >
> > Committed as obvious.
>
> Wow, that's really sad, to have to add all that code
> for such a trivial reason. I'm sure there are other
> tests in gdb.base that also make use of symbols that
> don't get called.
Yeah. I ran across some of these in the past and added some similar
looking code. E.g, here's a ChangeLog entry for one of them:
2000-03-21 Kevin Buettner <kevinb@redhat.com>
* gdb.base/pointers.c (usevar): New function.
(main): Make sure that global variables v_int_pointer2, rptr,
and y are all referenced someplace in the program by calling
usevar() on them. [Some linkers delete symbols which are
never referenced. The space remains, but there's no way to
get a (symbolic) handle on the variable from the debugger.]
> Isn't there some option that you can
> give to the linker to tell it not to remove these?
Apparently there is, but in my opinion, it's easier to maintain
changes to C code than bits of configury involving the linker
which can change over time. Also, the testsuite will just work
without the need to specify any additional linker options for
other (future) linkers which choose to also garbage collect unused
symbols.
Kevin
prev parent reply other threads:[~2002-04-18 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-18 6:23 Kevin Buettner
2002-04-18 11:14 ` Michael Snyder
2002-04-18 11:49 ` Kevin Buettner [this message]
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=1020418184919.ZM8474@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@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