Skip to content

Commit 0222c6c

Browse files
authored
fix hidden symbols 9.6 take 2 (#2166)
* Fixing up hidding symbols
1 parent 1436a1a commit 0222c6c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ in {
278278
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "8.11") ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols.patch
279279
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "8.11") ./patches/ghc/ghc-8.10-0006-Adds-support-for-Hidden-symbols-2.patch
280280
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.8" && (final.stdenv.targetPlatform.isWindows || final.stdenv.targetPlatform.isMusl)) ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols.patch
281+
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.8" && (final.stdenv.targetPlatform.isWindows || final.stdenv.targetPlatform.isMusl)) ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols-2.patch
281282
;
282283
in ({
283284
ghc865 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
2+
index 8701e76..150ec73 100644
3+
--- a/rts/linker/PEi386.c
4+
+++ b/rts/linker/PEi386.c
5+
@@ -1916,6 +1916,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
6+
&& (!section || (section && section->kind != SECTIONKIND_IMPORT))) {
7+
/* debugBelch("addSymbol %p `%s' Weak:%lld \n", addr, sname, isWeak); */
8+
sname = strdup (sname);
9+
+ if(secNumber == IMAGE_SYM_UNDEFINED)
10+
+ type |= SYM_TYPE_HIDDEN;
11+
IF_DEBUG(linker_verbose, debugBelch("addSymbol %p `%s'\n", addr, sname));
12+
ASSERT(i < (uint32_t)oc->n_symbols);
13+
oc->symbols[i].name = sname;
14+
@@ -1924,8 +1926,6 @@ ocGetNames_PEi386 ( ObjectCode* oc )
15+
if (isWeak) {
16+
setWeakSymbol(oc, sname);
17+
}
18+
- if(secNumber == IMAGE_SYM_UNDEFINED)
19+
- type |= SYM_TYPE_HIDDEN;
20+
21+
if (! ghciInsertSymbolTable(oc->fileName, symhash, sname, addr,
22+
isWeak, type, oc))

0 commit comments

Comments
 (0)