This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: coffread.c relocation fixes
- From: "Raoul Gough" <RaoulGough at yahoo dot co dot uk>
- To: <gdb-patches at sources dot redhat dot com>
- Cc: "Elena Zannoni" <ezannoni at redhat dot com>
- Date: Mon, 7 Apr 2003 12:54:38 +0100
- Subject: Re: RFC: coffread.c relocation fixes
- References: <b3j1lm$vcn$1@main.gmane.org> <16012.44364.781796.157557@localhost.redhat.com>
"Elena Zannoni" <ezannoni at redhat dot com> wrote in message
news:16012 dot 44364 dot 781796 dot 157557 at localhost dot redhat dot com dot dot dot
> Raoul Gough writes:
> > When a shared object can't be loaded at its preferred image base,
it
> > gets relocated. There's a convoluted switch statement in
> > coff_symtab_read that handles relocation of the symbols, and I
believe
> > it handles a couple of cases incorrectly:
> >
> > o Static symbols (with c_sclass of C_STAT) never get relocated. I
> > think this is wrong, probably an oversight where the C_STAT cases
fall
> > through to the C_EXT case and then don't get handled.
> >
> > o Absolute symbols (with c_secnum of N_ABS) *do* get relocated,
so
> > things like __minor_os_version__ get adjusted by the relocation
> > offset. Curiously, there is a fixme comment in the code not to do
> > this.
> >
> > The attached exmple shows the problem in action and the attached
diffs
> > fix both problems. Do these changes seem sensible to others?
>
> I am not a coff expert, but the change seems sensible.
> See below for a typo.
> Did you run the gdb testsuite with your patch and w/o? Any
differences?
>
> elena
I'm still not geared up to run the test suites (I guess I just need to
install dejagnu). Will try to manage this by the end of the week, and
report back...
Will fix the typo as well - thanks!
--
Raoul Gough
see http://home.clara.net/raoulgough/ for my work availability