summaryrefslogtreecommitdiff
path: root/rts/LinkerInternals.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/LinkerInternals.h')
-rw-r--r--rts/LinkerInternals.h45
1 files changed, 10 insertions, 35 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index 05fa7701d5..04d873ca99 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -20,19 +20,10 @@
typedef void SymbolAddr;
typedef char SymbolName;
-/* See Linker.c Note [runtime-linker-phases] */
-typedef enum {
- OBJECT_LOADED,
- OBJECT_NEEDED,
- OBJECT_RESOLVED,
- OBJECT_UNLOADED,
- OBJECT_DONT_RESOLVE
-} OStatus;
-
/* Indication of section kinds for loaded objects. Needed by
the GC for deciding whether or not a pointer on the stack
is a code pointer.
- See Note [BFD import libraries].
+ See Note [BFD import library].
*/
typedef
enum { /* Section is code or readonly. e.g. .text or .r(o)data. */
@@ -41,8 +32,12 @@ typedef
SECTIONKIND_RWDATA,
/* Static initializer section. e.g. .ctors. */
SECTIONKIND_INIT_ARRAY,
+ /* Static finalizer section. e.g. .dtors. */
+ SECTIONKIND_FINIT_ARRAY,
/* We don't know what the section is and don't care. */
SECTIONKIND_OTHER,
+ /* Section contains debug information. e.g. .debug$. */
+ SECTIONKIND_DEBUG,
/* Section belongs to an import section group. e.g. .idata$. */
SECTIONKIND_IMPORT,
/* Section defines an import library entry, e.g. idata$7. */
@@ -55,7 +50,7 @@ typedef
enum { SECTION_NOMEM,
SECTION_M32,
SECTION_MMAP,
- SECTION_MALLOC,
+ SECTION_MALLOC
}
SectionAlloc;
@@ -273,6 +268,9 @@ SymbolAddr* lookupSymbol_ (SymbolName* lbl);
extern /*Str*/HashTable *symhash;
+pathchar*
+resolveSymbolAddr (pathchar* buffer, int size,
+ SymbolAddr* symbol, uintptr_t* top);
/*************************************************
* Various bits of configuration
@@ -302,28 +300,6 @@ ObjectCode* mkOc( pathchar *path, char *image, int imageSize,
int misalignment
);
-#if defined(mingw32_HOST_OS)
-/* We use myindex to calculate array addresses, rather than
- simply doing the normal subscript thing. That's because
- some of the above structs have sizes which are not
- a whole number of words. GCC rounds their sizes up to a
- whole number of words, which means that the address calcs
- arising from using normal C indexing or pointer arithmetic
- are just plain wrong. Sigh.
-*/
-INLINE_HEADER unsigned char *
-myindex ( int scale, void* base, int index )
-{
- return
- ((unsigned char*)base) + scale * index;
-}
-
-// Defined in linker/PEi386.c
-char *cstring_from_section_name(
- unsigned char* name,
- unsigned char* strtab);
-#endif /* mingw32_HOST_OS */
-
/* MAP_ANONYMOUS is MAP_ANON on some systems,
e.g. OS X (before Sierra), OpenBSD etc */
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
@@ -340,8 +316,7 @@ char *cstring_from_section_name(
# include "linker/ElfTypes.h"
#elif defined (mingw32_HOST_OS)
# define OBJFORMAT_PEi386
-struct SectionFormatInfo { void* placeholder; };
-struct ObjectCodeFormatInfo { void* placeholder; };
+# include "linker/PEi386Types.h"
#elif defined(darwin_HOST_OS) || defined(ios_HOST_OS)
# define OBJFORMAT_MACHO
# include "linker/MachOTypes.h"