ghci/i386/dragonfly: unhandled ELF relocation(Rel) type 15

G.Isenmann info at
Tue Apr 7 15:39:53 PDT 2009

I am trying to get a useable ghc on i386 dragonfly2.2.0. My current

$ /var/tmp/ghc-6.10.2/bin/ghci
GHCi, version 6.10.2:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
ghc: /var/tmp/ghc-6.10.2/lib/ghc-6.10.2/base-
unhandled ELF relocation(Rel) type 15

Loading package base ... linking ... ghc: unable to load package `base'

Looks like HSbase- uses three different relocation types

$ objdump -r lib/ghc-6.10.2/base- \
  | awk '{print $2}' | sort -u | grep R_

but the ghc rts/Linker.c only supports two

$ grep R_386_ rts/Linker.c
#  define R_386_32    RELOC_32
#  define R_386_PC32  RELOC_PC32
         case R_386_32:   *pP = value;     break;
         case R_386_PC32: *pP = value - P; break;

The third seems to be the access to thread local errno

$ objdump -r lib/ghc-6.10.2/base- \
  | grep R_386_TLS_IE
001c2682 R_386_TLS_IE      errno
001c2b5b R_386_TLS_IE      errno
001c2f36 R_386_TLS_IE      errno

The difference to linux and freebsd seems to be that the access to the
errno location is not hidden inside dragonflys libc but is visible for
the caller similar to

$ cat t.c
static __thread int tls;
int *get() { return &tls; }
$ gcc -c t.c
$ objdump -r t.o

t.o:     file format elf32-i386

OFFSET   TYPE              VALUE 
0000000b R_386_TLS_LE      tls

What would be the best or easiest way to deal with this situation?


More information about the Users mailing list