[project @ 2005-03-08 11:04:11 by simonmar]
authorsimonmar <unknown>
Tue, 8 Mar 2005 11:04:11 +0000 (11:04 +0000)
committersimonmar <unknown>
Tue, 8 Mar 2005 11:04:11 +0000 (11:04 +0000)
x86_64: the assembler doesn't like generating 8-byte relative
relocations between text and rodata symbols.  Hack around this by
putting SRTs in the text segment for now.

ghc/driver/mangler/ghc-asm.lprl

index 3934416..f801846 100644 (file)
@@ -227,6 +227,14 @@ sub init_TARGET_STUFF {
     $T_HDR_misc     = "\.text\n\t\.align 8\n";
     $T_HDR_data     = "\.data\n\t\.align 8\n";
     $T_HDR_rodata   = "\.section\t\.rodata\n\t\.align 8\n";
+
+       # the assembler on x86_64/Linux refuses to generate code for
+       #   .quad  x - y
+       # where x is in the text section and y in the rodata section.
+       # It works if y is in the text section, though.  This is probably
+       # going to cause difficulties for PIC, I imagine.
+    $T_HDR_relrodata= "\.text\n\t\.align 8\n";
+
     $T_HDR_closure  = "\.data\n\t\.align 8\n";
     $T_HDR_info     = "\.text\n\t\.align 8\n";
     $T_HDR_entry    = "\.text\n\t\.align 8\n";