Fix #16525: ObjectCode freed wrongly because of lack of info header check

`checkUnload` currently doesn't check the info header of static objects.
Thus, it may free an `ObjectCode` struct wrongly even if there's still a
live static object whose info header lies in a mapped section of that
`ObjectCode`. This fixes the issue by adding an appropriate check.
20 jobs for !827 with wip-16525 in 581 minutes and 58 seconds (queued for 1 second)
latest detached
Status Job ID Name Coverage
  Lint
passed #99480
lint
ghc-linters

00:00:19

passed #99481
lint
lint-submods-mr

00:00:19

 
  Build
passed #99483
x86_64-linux
hadrian-ghc-in-ghci

00:27:34

failed #99485
x86_64-linux allowed to fail
release-x86_64-linux-deb9-dwarf

01:47:19

passed #99484
x86_64-linux
validate-x86_64-linux-deb9-debug

01:28:07

failed #99482
x86_64-linux allowed to fail
validate-x86_64-linux-deb9-hadrian

02:21:48

 
  Full Build
failed #99487
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

01:15:29

passed #99488
x86_64-linux
validate-i386-linux-deb9

01:24:18

passed #99486
x86_64-darwin
validate-x86_64-darwin

01:00:31

passed #99489
x86_64-linux
validate-x86_64-linux-deb9

01:45:17

passed #99491
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:20:03

passed #99490
x86_64-linux
validate-x86_64-linux-deb9-llvm

02:38:12

passed #100708
x86_64-linux
validate-x86_64-linux-deb9-unreg

03:32:44

passed #99493
x86_64-linux
validate-x86_64-linux-fedora27

01:40:18

failed #99495
x86_64-windows allowed to fail
validate-x86_64-windows

02:18:00

passed #99494
x86_64-windows
validate-x86_64-windows-hadrian

01:27:11

failed #99492
x86_64-linux
validate-x86_64-linux-deb9-unreg

02:14:02

 
  Cleanup
passed #99496
x86_64-darwin
cleanup-darwin

00:00:04

 
  Packaging
passed #99497
x86_64-linux
doc-tarball

00:04:02

 
  Hackage
manual #99498
x86_64-linux allowed to fail manual
hackage
 
Name Stage Failure
failed
validate-x86_64-linux-deb9-hadrian Build
Exit code: 1
Stderr:
)


Uploading artifacts...
junit.xml: found 1 matching files
Uploading artifacts to coordinator... ok
id=99482 responseStatus=201 Created token=x_8zRVwk
ERROR: Job failed: exit code 1
failed
release-x86_64-linux-deb9-dwarf Build
$ cp -Rf $HOME/.cabal cabal-cache
Uploading artifacts...
ghc-*.tar.xz: found 1 matching files
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=99485 responseStatus=201 Created token=s97cvxXz
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=99485 responseStatus=201 Created token=s97cvxXz
ERROR: Job failed: exit code 1
failed
validate-aarch64-linux-deb9 Full Build
$ cp -Rf $HOME/.cabal cabal-cache
Uploading artifacts...
WARNING: ghc-*.tar.xz: no matching files
WARNING: junit.xml: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows Full Build
junit.xml: found 1 matching files                  
WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=99495 responseStatus=201 Created token=GNpM67Pu
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=612 revision=1f513601 version=11.10.1
junit.xml: found 1 matching files

WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=99495 responseStatus=201 Created token=GNpM67Pu
ERROR: Job failed: exit status 2