summaryrefslogtreecommitdiff
path: root/includes/InfoTables.h
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-05-10 09:31:35 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-05-10 09:31:35 +0000
commit27b81b461fbc754779b2c941b9e1b9e49d54211b (patch)
treeeeeaa5f6fe2b2e5c97383f2e0e4bd37d49bc09fe /includes/InfoTables.h
parent4414ec29267052c5e5dfbc36d596797c7177f822 (diff)
downloadhaskell-27b81b461fbc754779b2c941b9e1b9e49d54211b.tar.gz
improve comments about x86-64 relative-offset hackery
Diffstat (limited to 'includes/InfoTables.h')
-rw-r--r--includes/InfoTables.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/InfoTables.h b/includes/InfoTables.h
index 67bd97bc8f..3e556efbc5 100644
--- a/includes/InfoTables.h
+++ b/includes/InfoTables.h
@@ -216,11 +216,21 @@ typedef struct StgLargeSRT_ {
relative to the info pointer, so that we can generate
position-independent code.
+ Note [x86-64-relative]
There is a complication on the x86_64 platform, where pointeres are
64 bits, but the tools don't support 64-bit relative relocations.
However, the default memory model (small) ensures that all symbols
have values in the lower 2Gb of the address space, so offsets all
fit in 32 bits. Hence we can use 32-bit offset fields.
+
+ When going via-C, the mangler arranges that we only generate
+ relative relocations between symbols in the same segment (the text
+ segment). The NCG, however, puts things in the right sections and
+ uses 32-bit relative offsets instead.
+
+ Somewhere between binutils-2.16.1 and binutils-2.16.91.0.6,
+ support for 64-bit PC-relative relocations was added, so maybe this
+ hackery can go away sometime.
------------------------------------------------------------------------- */
#if x86_64_TARGET_ARCH