[Haskell-cafe] ghci/i386/dragonfly: unhandled ELF relocation(Rel) type 15

G.Isenmann info at goetz-isenmann.de
Tue Apr 7 18:30:58 EDT 2009


Hi,
I am trying to get a useable ghc on i386 dragonfly2.2.0. My current
problem:

$ /var/tmp/ghc-6.10.2/bin/ghci
GHCi, version 6.10.2: http://www.haskell.org/ghc/  :? 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-4.1.0.0/HSbase-4.1.0.0.o:
unhandled ELF relocation(Rel) type 15

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

Looks like HSbase-4.1.0.0.o uses three different relocation types

$ objdump -r lib/ghc-6.10.2/base-4.1.0.0/HSbase-4.1.0.0.o \
  | awk '{print $2}' | sort -u | grep R_
R_386_32
R_386_PC32
R_386_TLS_IE

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-4.1.0.0/HSbase-4.1.0.0.o \
  | 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

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
0000000b R_386_TLS_LE      tls

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

--
Goetz


More information about the Haskell-Cafe mailing list