Skip to content

Commit 2884b5f

Browse files
committed
add debug secno patch
1 parent 72d622c commit 2884b5f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ in {
300300
++ final.lib.optional (versionAtLeast "9.4" && final.stdenv.targetPlatform.isWindows) ./patches/ghc/ghc-9.6-fix-code-symbol-jumps.patch
301301
++ final.lib.optional (versionAtLeast "9.6.3" && versionLessThan "9.10" && final.stdenv.targetPlatform.isAndroid) ./patches/ghc/ghc-9.6-iog.patch
302302
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.12" && final.stdenv.targetPlatform.is32bit) ./patches/ghc/ghc-9.6-genapply-cross-arch.patch
303+
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.9" && final.stdenv.targetPlatform.isAndroid) ./patches/ghc/ghc-9.6-debug-secno.patch
303304
;
304305
in ({
305306
ghc865 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
2+
index 9f623a6..d5fc91c 100644
3+
--- a/rts/linker/Elf.c
4+
+++ b/rts/linker/Elf.c
5+
@@ -1056,6 +1056,11 @@ ocGetNames_ELF ( ObjectCode* oc )
6+
)
7+
) {
8+
/* Section 0 is the undefined section, hence > and not >=. */
9+
+ if (!(secno > 0 && secno < shnum)) {
10+
+ debugBelch("while processing %s\n", OC_INFORMATIVE_FILENAME(oc));
11+
+ debugBelch("while processing symbol %s (%d)\n", nm, j);
12+
+ barf("secno %d out of range (0, %d)\n", secno, shnum);
13+
+ }
14+
CHECK(secno > 0 && secno < shnum);
15+
/*
16+
if (shdr[secno].sh_type == SHT_NOBITS) {

0 commit comments

Comments
 (0)