Xen Test Framework
link.lds.h
Go to the documentation of this file.
1
7#ifdef LINKER_HEADER
8
9/* Don't clobber the ld directive */
10#undef i386
11
12#if defined(__x86_64__)
13
14OUTPUT_FORMAT("elf64-x86-64")
15OUTPUT_ARCH(i386:x86-64)
16
17#elif defined(__i386__)
18
19OUTPUT_FORMAT("elf32-i386")
20OUTPUT_ARCH(i386)
21
22#else
23# error Bad architecture to link with
24#endif
25
26ENTRY(_elf_start)
27
28#endif /* LINKER_HEADER */
29
30#ifdef LINKER_FOOTER
31
32ASSERT(IS_ALIGNED(hypercall_page, PAGE_SIZE), "hypercall_page misaligned");
33
34#ifdef CONFIG_HVM
35
36/* Check everything lives within l1_identmap[] for user and r/o mappings. */
37ASSERT(_end < (1 << (PT_ORDER + PAGE_SHIFT)), "Mappings exceed l1_identmap[]");
38
39ASSERT(IS_ALIGNED(pae_l1_identmap, PAGE_SIZE), "pae_l1_identmap misaligned");
40ASSERT(IS_ALIGNED(pae_l2_identmap, PAGE_SIZE), "pae_l2_identmap misaligned");
41ASSERT(IS_ALIGNED(pae_l3_identmap, PAGE_SIZE), "pae_l3_identmap misaligned");
42ASSERT(IS_ALIGNED(pae_l4_identmap, PAGE_SIZE), "pae_l4_identmap misaligned");
43
44ASSERT(IS_ALIGNED(pae32_l3_identmap, 32), "pae32_l3_ident misaligned");
45
46ASSERT(IS_ALIGNED(pse_l1_identmap, PAGE_SIZE), "pse_l1_identmap misaligned");
47ASSERT(IS_ALIGNED(pse_l2_identmap, PAGE_SIZE), "pse_l2_identmap misaligned");
48
49#else /* CONFIG_HVM */
50
51ASSERT(IS_ALIGNED(gdt, PAGE_SIZE), "gdt misaligned");
52
53#endif /* CONFIG_HVM */
54
55#endif /* LINKER_FOOTER */
56
57/*
58 * Local variables:
59 * mode: C
60 * c-file-style: "BSD"
61 * c-basic-offset: 4
62 * tab-width: 4
63 * indent-tabs-mode: nil
64 * End:
65 */
char _end[]
Definition: xtf.h:19
user_desc gdt[NR_GDT_ENTRIES]
uint8_t hypercall_page[PAGE_SIZE]
#define ASSERT(cond)
Definition: lib.h:14
#define IS_ALIGNED(val, align)
Return a boolean indicating whether val is aligned on align.
Definition: numbers.h:38
#define PAGE_SIZE
Definition: page.h:11
#define PAGE_SHIFT
Definition: page.h:10
#define PT_ORDER
Definition: page.h:64