summaryrefslogtreecommitdiff
path: root/rts/RtsSymbolInfo.h
blob: 4c9b24519ba78d24dbbd64725124e4dae3d71e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2000-2015
 *
 * RTS Symbol Info
 *
 * ---------------------------------------------------------------------------*/

#pragma once

#include "LinkerInternals.h"
#include <stdbool.h>

/* See Note [BFD import library].  */
typedef enum _SymbolKind {
    KIND_NORMAL = 0x01,
    KIND_WEAK   = 0x02,
    KIND_IMPORT = 0x04
} SymbolKind;

typedef struct _SymbolInfo {
    /* Determines what kind of symbol we are storing.  */
    SymbolKind kind;
} SymbolInfo;

bool isSymbolWeak(ObjectCode *owner, const void *label);
bool isSymbolImport(ObjectCode *owner, const void *label);
void setWeakSymbol(ObjectCode *owner, const void *label);
void setImportSymbol(ObjectCode *owner, const void *label);
void clearImportSymbol(ObjectCode *owner, const void *label);

typedef void (*symbolUpdater)(SymbolInfo*);
void setSymbolInfo(ObjectCode *owner, const void *label, symbolUpdater updater);