summaryrefslogtreecommitdiff
path: root/rts/linker/macho/plt.h
blob: ae1ff143908cabca30f3008a40d9a15b1f8530e2 (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
34
35
#pragma once

#include <LinkerInternals.h>

#include "plt_aarch64.h"

#if defined(aarch64_HOST_ARCH)

#if defined(OBJFORMAT_MACHO)

#if defined(__x86_64__)
#define __suffix__ X86_64
#elif defined(__aarch64__) || defined(__arm64__)
#define __suffix__ Aarch64
#else
#error "unknown architecture"
#endif

#define PASTE(x,y) x ## y
#define EVAL(x,y) PASTE(x,y)
#define ADD_SUFFIX(x) EVAL(PASTE(x,),__suffix__)

unsigned numberOfStubsForSection( ObjectCode *oc, unsigned sectionIndex);

#define STUB_SIZE          ADD_SUFFIX(stubSize)

bool findStub(Section * section, void* * addr, uint8_t flags);
bool makeStub(Section * section, void* * addr, uint8_t flags);

void freeStubs(Section * section);

#endif // OBJECTFORMAT_MACHO

#endif // aarch64_HOST_ARCH