FR-V FDPIC ABI: new EH frame BFD hooks

Alexandre Oliva aoliva@redhat.com
Tue Feb 10 06:06:00 GMT 2004


Some time ago, when I posted the bulk of the FR-V FDPIC ABI supporting
code, I alluded to the need for additional work to get EH to work
properly, because of the impossibility to use PC-relative relocations
to reference symbols in other segments (remember they may be relocated
by different amounts).

Back then, I'd written an uglier version of this patch that I intended
to rewrite into something nicer, that would let the back-end decide
whether/how to re-encode addresses that might be suitable for
re-encoding.  Unfortunately, since the encoding has to be the same for
all FDEs in a CIE and I couldn't think of any nice way to enable the
back-end to be communicated of such semi-global needs, I gave up and
retained the new hooks that decide whether we can decay encodings
within FDEs to PC-relative, instead of using the other hook added to
enable the back-end to decide the encoding to be given to reference
.eh_frame from .eh_frame_hdr.

Ideally, we'd like to use GOTOFF32 or PC32 relocs for symbols in the
data segment, GPREL32 for those in the text segment (although it would
be quite tricky to find _gp for a given module within
dl_iterate_phdr), and absolute encodings for symbols whose locations
are not known, that ideally decay to either of them in the linker.
Unfortunately, we don't have GOTOFF32 or PC32 relocs available in
FR-V, so the compiler has to use absolute encodings all over, and the
linker can't decay them to PC-relative.  ==> Lots of dynamic
relocations ;-(

Suggestions on how to improve the code to make encodings relative to
_G_O_T_ or PC would be definitely welcome.

Anyway, this patch at least gets things to work.  Tested on
i686-pc-linux-gnu x frv-uclinux.  Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-frv-no-pcrel-eh-frame.patch
Type: text/x-patch
Size: 10281 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20040210/02d6a233/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Happy GNU Year!                     oliva@{lsd.ic.unicamp.br, gnu.org}
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Binutils mailing list