summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-10-16 17:00:43 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-10-16 19:46:14 +1100
commit4d6844a54f1fc72b3ba31f1b6e09991add816875 (patch)
treec07b5544a0f0393857364e9ba3eaa2b0b3203515 /rts
parent78c9deaf228b9ed40d9ca9632a181f18a112936f (diff)
downloadhaskell-4d6844a54f1fc72b3ba31f1b6e09991add816875.tar.gz
rts/Linker.c : Fix armhf build (#10977)
Test Plan: Validate on x86_64, PowerPC and Arm Reviewers: simonmar, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1330 GHC Trac Issues: #10977
Diffstat (limited to 'rts')
-rw-r--r--rts/Linker.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index af07fdaa39..173b90d6a3 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -6192,18 +6192,15 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
int nent = shdr[shnum].sh_size / sizeof(Elf_Rela);
int symtab_shndx = shdr[shnum].sh_link;
int strtab_shndx = shdr[symtab_shndx].sh_link;
+ int target_shndx = shdr[shnum].sh_info;
#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
/* This #ifdef only serves to avoid unused-var warnings. */
- Elf_Addr targ;
- int target_shndx = shdr[shnum].sh_info;
+ Elf_Addr targ = (Elf_Addr) oc->sections[target_shndx].start;
#endif
stab = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset);
strtab= (char*) (ehdrC + shdr[ strtab_shndx ].sh_offset);
-#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
- /* This #ifdef only serves to avoid set-but-not-used warnings */
- targ = (Elf_Addr) oc->sections[target_shndx].start;
-#endif
+
IF_DEBUG(linker,debugBelch( "relocations for section %d using symtab %d\n",
target_shndx, symtab_shndx ));