summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorKarel Gardas <karel.gardas@centrum.cz>2015-11-01 22:10:15 +0100
committerKarel Gardas <karel.gardas@centrum.cz>2015-11-02 08:20:26 +0100
commitc00c5e5ba61935bbb04ccdb1c2c2899782d42937 (patch)
tree11aca9ff4e593a9a4a46db86c2bd07c70fe5935f /rts/Linker.c
parent1e2259b37af17c951d9f8266b240db0cdcc833e3 (diff)
downloadhaskell-c00c5e5ba61935bbb04ccdb1c2c2899782d42937.tar.gz
get rid of Elf32/Elf64_Section as this is a non-portable Linux-ism.
Summary: D1357 introduces usage of Elf32_Section/Elf64_Section in RTS linker code. Unfortunately this is a non-portable Linux-ism and such types are not defined anywhere except the Linux-land probably. I've checked Solaris 11.2, Solaris 11.3, FreeBSD 10.1, NetBSD 6.1.5 and OpenBSD current. The fix is easy to use `unsigned short' as this is also an underlying type of those Elf*_Section defines in Linux. Reviewers: olsner, austin, bgamari, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1419
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index cd94561c5e..2308275747 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -4030,7 +4030,6 @@ ocRunInit_PEi386 ( ObjectCode *oc )
#define Elf_Ehdr Elf64_Ehdr
#define Elf_Phdr Elf64_Phdr
#define Elf_Shdr Elf64_Shdr
-#define Elf_Section Elf64_Section
#define Elf_Sym Elf64_Sym
#define Elf_Rel Elf64_Rel
#define Elf_Rela Elf64_Rela
@@ -4055,7 +4054,6 @@ ocRunInit_PEi386 ( ObjectCode *oc )
#define Elf_Ehdr Elf32_Ehdr
#define Elf_Phdr Elf32_Phdr
#define Elf_Shdr Elf32_Shdr
-#define Elf_Section Elf32_Section
#define Elf_Sym Elf32_Sym
#define Elf_Rel Elf32_Rel
#define Elf_Rela Elf32_Rela
@@ -4629,7 +4627,7 @@ ocGetNames_ELF ( ObjectCode* oc )
HsBool isWeak = HS_BOOL_FALSE;
char* ad = NULL;
char* nm = strtab + stab[j].st_name;
- Elf_Section shndx = stab[j].st_shndx;
+ unsigned short shndx = stab[j].st_shndx;
Elf_Word secno;
/* See Note [Many ELF Sections] */