Use LinkerInternals.h for exitLinker.

Part of remove HEAP_ALLOCED patch set (#8199)

Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: https://phabricator.haskell.org/D262

GHC Trac Issues: #8199
Place static closures in their own section.

Summary:
The primary reason for doing this is assisting debuggability:
if static closures are all in the same section, they are
guaranteed to be adjacent to one another.  This will help
later when we add some code that takes section start/end and
uses this to sanity-check the sections.

Part of remove HEAP_ALLOCED patch set (#8199)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: https://phabricator.haskell.org/D263

GHC Trac Issues: #8199
BC-breaking changes to C-- CLOSURE syntax.

Summary:
Previously, there were two variants of CLOSURE in C--:

    - Top-level CLOSURE(foo_closure, foo, lits...), which defines a new
      static closure and gives it a name, and

    - Array CLOSURE(foo, lits...), which was used for the static char
      and integer arrays.

They used the same name, were confusing, and didn't even generate
the correct internal label representation!  So now, we have two
new forms:

    - Top-level CLOSURE(foo, lits...) which automatically generates
      foo_closure (along with foo_info, which we were doing already)

    - Array ANONYMOUS_CLOSURE(foo, lits...) which doesn't generate
      a foo_closure identifier.

Part of remove HEAP_ALLOCED patch set (#8199)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: https://phabricator.haskell.org/D264

GHC Trac Issues: #8199
Properly generate info tables for static closures in C--.

Summary:
Previously, we assumed all objects declared in C-- were not-static, even
ones which were CONSTR_NOCAF_STATIC.  This used to be harmless, but now
we need this information to be correct.

Part of remove HEAP_ALLOCED patch set (#8199)

Depends on D264

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: https://phabricator.haskell.org/D265

GHC Trac Issues: #8199
Rename _closure to _static_closure, apply naming consistently.

Summary:
In preparation for indirecting all references to closures,
we rename _closure to _static_closure to ensure any old code
will get an undefined symbol error.  In order to reference
a closure foobar_closure (which is now undefined), you should instead
use STATIC_CLOSURE(foobar).  For convenience, a number of these
old identifiers are macro'd.

Across C-- and C (Windows and otherwise), there were differing
conventions on whether or not foobar_closure or &foobar_closure
was the address of the closure.  Now, all foobar_closure references
are addresses, and no & is necessary.

CHARLIKE/INTLIKE were not changed, simply alpha-renamed.

Part of remove HEAP_ALLOCED patch set (#8199)

Depends on D265

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Test Plan: validate

Reviewers: simonmar, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision: https://phabricator.haskell.org/D267

GHC Trac Issues: #8199