RFC: coffread.c relocation fixes

Raoul Gough RaoulGough@yahoo.co.uk
Mon Apr 7 11:54:00 GMT 2003


"Elena Zannoni" <ezannoni@redhat.com> wrote in message
news:16012.44364.781796.157557@localhost.redhat.com...
> 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



More information about the Gdb-patches mailing list