This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: R_SPARC_RELATIVE vs R_SPARC_UA32 & unaligned unwind tables - again
- From: Ian Lance Taylor <ian at airs dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, binutils at sources dot redhat dot com
- Date: 18 Dec 2001 18:41:02 -0800
- Subject: Re: R_SPARC_RELATIVE vs R_SPARC_UA32 & unaligned unwind tables - again
- References: <200112190231.fBJ2VZK08687@greed.delorie.com>
DJ Delorie <dj@redhat.com> writes:
> Ok, I seem to have bumped into a "this just isn't possible" scenario.
>
> We create unaligned 32-bit pointers in unwind tables (specifically,
> in the augmentation fields for context->lsda in gcc/unwind-dw2.c).
>
> If these pointers are in a shared library, the dynamic linker needs to
> adjust them according to where the shared library is loaded.
>
> However, the only reloc available for that is R_SPARC_RELATIVE, and it
> requires aligned data. If you try to use it with unaligned data,
> ld.so aborts. If you don't use it, unwinding causes aborts because
> the pointer points to the wrong place.
>
> Could we make that pointer fde-relative or something, so that ld.so
> doesn't need to adjust it? Or make it aligned? I can't think of any
> other fix, unless there's some other R_SPARC_* reloc that does what's
> needed here.
R_SPARC_RELATIVE is an optimization which skips the symbol lookup. It
seems to me that you can always use an R_SPARC_UA32 reloc against an
offset from a section, or at the very least you could do that against
a symbol.
Ian