[FREELDR] Re-integrate the ASM files (and corresponding C code) in MSVC builds, that...
[reactos.git] / boot / freeldr / freeldr / freeldr_i386.msvc.lds
1 /*****************************************************************************\
2 *** MSVC Linker Script File -- Sections specifications & layout ***
3 \*****************************************************************************/
4
5 #ifndef _MSC_VER
6 #error This file must be used only with the MSVC compiler and linker.
7 #endif
8
9 #if defined(__LINKER__)
10 /*********************************\
11 ** Linker response file **
12 \*********************************/
13
14 // /LAST:.bss
15 /LAST:.data
16
17 #elif !defined(_USE_ML)
18 /*********************************\
19 ** C Linker #pragma directives **
20 \*********************************/
21
22 /*
23 * Notes about automatic LINK.EXE behaviour that cannot be changed:
24 *
25 * - If a .data section is present, the .bss section is appended to it in case
26 * both of these have either Initialized or Uninitialized data (which is the
27 * case, unless one has manually modified the attributes).
28 *
29 * - If the /DRIVER flag is NOT used, and if both the .rdata and the .edata
30 * sections (read-only data and exports, respectively) have the same
31 * attributes, the .edata section is appended to the .rdata section.
32 * Otherwise they are kept separated, unless an explicit /MERGE is used.
33 */
34
35 #pragma comment(linker, "/SECTION:.text,ERW /SECTION:.data,RW /MERGE:.MBDATA=.text /MERGE:INIT=.text /MERGE:.edata=.rdata")
36
37 #endif
38
39
40 #if defined(_USE_ML) // && !defined(__LINKER__)
41 /************************\
42 ** ASM definitions **
43 \************************/
44
45 #include <asm.inc>
46
47 /*
48 #pragma bss_seg(".bss")
49 // __declspec(allocate(".bss"))
50 void* __bss_start__;
51 #pragma bss_seg()
52 */
53 _BSS1 SEGMENT 'BSS' ALIAS('.bss')
54 PUBLIC __bss_start__
55 __bss_start__:
56 .long ?
57 _BSS1 ENDS
58
59 /*
60 #pragma bss_seg(".bss$ZZZ")
61 // __declspec(allocate(".bss$ZZZ"))
62 void* __bss_end__;
63 #pragma bss_seg()
64 */
65 _BSS2 SEGMENT 'BSS' ALIAS('.bss$ZZZ')
66 PUBLIC __bss_end__
67 __bss_end__:
68 .long ?
69 _BSS2 ENDS
70
71 END
72
73 #elif !defined(__LINKER__)
74 /************************\
75 ** C definitions **
76 \************************/
77
78 #endif