forked from SiSTR0/FTPS5
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlinker.x
63 lines (47 loc) · 774 Bytes
/
linker.x
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
OUTPUT_FORMAT("elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
PHDRS
{
/*
* PF_X = 0x1
* PF_W = 0x2
* PF_R = 0x4
*/
ph_text PT_LOAD FLAGS (0x1 | 0x4);
ph_data PT_LOAD FLAGS (0x2 | 0x4);
}
SECTIONS
{
__payload_base = .;
.text :
{
KEEP (*(.init))
KEEP (*(.fini))
*(.text .text.*)
. = ALIGN(4);
} : ph_text = 0x90909090
.rodata :
{
*(.rodata .rodata.*)
. = ALIGN(4);
}
. = ALIGN(0x4000);
.data :
{
*(.data .data.*)
. = ALIGN(0x10);
__imports_start = .;
KEEP(*(.imports .imports.*))
__imports_end = .;
__patches_start = .;
KEEP(*(.patches .patches.*))
QUAD(0); BYTE(0); BYTE(0);
__patches_end = .;
__bss_start = .;
*(.bss .bss.*) *(COMMON)
__bss_end = .;
. = . + 4;
. = ALIGN(4);
} : ph_data
}