[commit: ghc] master: get rid of Elf32/Elf64_Section as this is a non-portable Linux-ism. (c00c5e5)

git at git.haskell.org git at git.haskell.org
Mon Nov 2 07:20:57 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c00c5e5ba61935bbb04ccdb1c2c2899782d42937/ghc

>---------------------------------------------------------------

commit c00c5e5ba61935bbb04ccdb1c2c2899782d42937
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Sun Nov 1 22:10:15 2015 +0100

    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


>---------------------------------------------------------------

c00c5e5ba61935bbb04ccdb1c2c2899782d42937
 rts/Linker.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index cd94561..2308275 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] */



More information about the ghc-commits mailing list