summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-10-24 11:56:16 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-10-25 14:13:05 +1100
commit3ed4b804bebcb5b1b5420679b5371363bafdfc9f (patch)
tree2a8c6d4a488634fef128f29f7a80fab809398987 /rts
parentabc214b77de400c3a7efbc812bebb6d1a81b6ab6 (diff)
downloadhaskell-3ed4b804bebcb5b1b5420679b5371363bafdfc9f.tar.gz
rts/Linker.c: Convert #if/#else to if/else
Test Plan: validate Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1366
Diffstat (limited to 'rts')
-rw-r--r--rts/Linker.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index a33b646a02..101e5494a3 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -5216,15 +5216,17 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
#else
StgInt64 off = value - P;
if (off >= 0x7fffffffL || off < -0x80000000L) {
-#if X86_64_ELF_NONPIC_HACK
- StgInt64 pltAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
+ if (X86_64_ELF_NONPIC_HACK) {
+ StgInt64 pltAddress =
+ (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
-> jumpIsland;
- off = pltAddress + A - P;
-#else
- errorBelch("R_X86_64_PC32 relocation out of range: %s = %p\nRecompile %s with -fPIC.",
- symbol, off, oc->fileName );
- return 0;
-#endif
+ off = pltAddress + A - P;
+ } else {
+ errorBelch("R_X86_64_PC32 relocation out of range: %s = %"
+ PRId64 "d\nRecompile %s with -fPIC.",
+ symbol, off, oc->fileName );
+ return 0;
+ }
}
*(Elf64_Word *)P = (Elf64_Word)off;
#endif
@@ -5243,15 +5245,17 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
barf("R_X86_64_32 relocation, but ALWAYS_PIC.");
#else
if (value >= 0x7fffffffL) {
-#if X86_64_ELF_NONPIC_HACK
- StgInt64 pltAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
+ if (X86_64_ELF_NONPIC_HACK) {
+ StgInt64 pltAddress =
+ (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
-> jumpIsland;
- value = pltAddress + A;
-#else
- errorBelch("R_X86_64_32 relocation out of range: %s = %p\nRecompile %s with -fPIC.",
+ value = pltAddress + A;
+ } else {
+ errorBelch("R_X86_64_32 relocation out of range: %s = %"
+ PRId64 "d\nRecompile %s with -fPIC.",
symbol, value, oc->fileName );
- return 0;
-#endif
+ return 0;
+ }
}
*(Elf64_Word *)P = (Elf64_Word)value;
#endif
@@ -5262,15 +5266,17 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
barf("R_X86_64_32S relocation, but ALWAYS_PIC.");
#else
if ((StgInt64)value > 0x7fffffffL || (StgInt64)value < -0x80000000L) {
-#if X86_64_ELF_NONPIC_HACK
- StgInt64 pltAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
+ if (X86_64_ELF_NONPIC_HACK) {
+ StgInt64 pltAddress =
+ (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
-> jumpIsland;
- value = pltAddress + A;
-#else
- errorBelch("R_X86_64_32S relocation out of range: %s = %p\nRecompile %s with -fPIC.",
+ value = pltAddress + A;
+ } else {
+ errorBelch("R_X86_64_32S relocation out of range: %s = %"
+ PRId64 "d\nRecompile %s with -fPIC.",
symbol, value, oc->fileName );
- return 0;
-#endif
+ return 0;
+ }
}
*(Elf64_Sword *)P = (Elf64_Sword)value;
#endif