diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-11-02 15:01:27 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-02 15:42:00 -0400 |
commit | c3446c63d64bdc5c2fa627f345c59e893ba0c176 (patch) | |
tree | cadc2851520aa523db0d81c2105d12de6023c78e /rts/LinkerInternals.h | |
parent | 3f05126253a7d68b37a388c26b586d94e871614e (diff) | |
download | haskell-c3446c63d64bdc5c2fa627f345c59e893ba0c176.tar.gz |
Shuffle declarations into LinkerInternals.h
Summary: These will be needed across source files shortly.
Test Plan: Validate
Reviewers: erikd, austin, simonmar
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2647
Diffstat (limited to 'rts/LinkerInternals.h')
-rw-r--r-- | rts/LinkerInternals.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index 2fe9ff9d33..1d5288b310 100644 --- a/rts/LinkerInternals.h +++ b/rts/LinkerInternals.h @@ -14,6 +14,9 @@ #include "BeginPrivate.h" +typedef void SymbolAddr; +typedef char SymbolName; + /* See Linker.c Note [runtime-linker-phases] */ typedef enum { OBJECT_LOADED, @@ -182,12 +185,41 @@ extern Mutex linker_mutex; extern Mutex linker_unloaded_mutex; #endif +/* Type of the initializer */ +typedef void (*init_t) (int argc, char **argv, char **env); + +/* SymbolInfo tracks a symbol's address, the object code from which + it originated, and whether or not it's weak. + + RtsSymbolInfo is used to track the state of the symbols currently + loaded or to be loaded by the Linker. + + Where the information in the `ObjectCode` is used to track the + original status of the symbol inside the `ObjectCode`. + + A weak symbol that has been used will still be marked as weak + in the `ObjectCode` but in the `RtsSymbolInfo` it won't be. +*/ +typedef struct _RtsSymbolInfo { + SymbolAddr* value; + ObjectCode *owner; + HsBool weak; +} RtsSymbolInfo; + void exitLinker( void ); void freeObjectCode (ObjectCode *oc); void *mmapForLinker (size_t bytes, uint32_t flags, int fd, int offset); +void addProddableBlock ( ObjectCode* oc, void* start, int size ); +void checkProddableBlock (ObjectCode *oc, void *addr, size_t size ); +void freeProddableBlocks (ObjectCode *oc); + +void addSection (Section *s, SectionKind kind, SectionAlloc alloc, + void* start, StgWord size, StgWord mapped_offset, + void* mapped_start, StgWord mapped_size); + #if defined(mingw32_HOST_OS) typedef unsigned char UChar; |