]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/X86_64/imagebase.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / X86_64 / imagebase.test
1 # Checks that segments start at the image address specified.
2
3 # Build executable
4 # RUN: yaml2obj -format=elf -docnum 1 %s -o %t.o
5 # RUN: lld -flavor gnu -target x86_64 %t.o -o %t.exe -static \
6 # RUN: --no-align-segments --noinhibit-exec --image-base 0x600000
7 # RUN: llvm-readobj -program-headers %t.exe | FileCheck %s
8 #
9 #CHECK:    VirtualAddress: 0x600000
10 #CHECK:    PhysicalAddress: 0x600000
11 #CHECK:    VirtualAddress: 0x600178
12 #CHECK:    PhysicalAddress: 0x600178
13
14 # object
15 ---
16 FileHeader:
17   Class:           ELFCLASS64
18   Data:            ELFDATA2LSB
19   OSABI:           ELFOSABI_GNU
20   Type:            ET_REL
21   Machine:         EM_X86_64
22 Sections:
23   - Name:            .text
24     Type:            SHT_PROGBITS
25     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
26     AddressAlign:    0x0000000000000010
27     Content:         554889E5B864000000C745FC000000005DC366666666662E0F1F840000000000554889E531C05DC3
28   - Name:            .data
29     Type:            SHT_PROGBITS
30     Flags:           [ SHF_WRITE, SHF_ALLOC ]
31     AddressAlign:    0x0000000000000004
32     Content:         ''
33   - Name:            .bss
34     Type:            SHT_NOBITS
35     Flags:           [ SHF_WRITE, SHF_ALLOC ]
36     AddressAlign:    0x0000000000000004
37     Content:         '64000000'
38   - Name:            .rodata
39     Type:            SHT_PROGBITS
40     Flags:           [ SHF_ALLOC ]
41     AddressAlign:    0x0000000000000004
42     Content:         '64000000'
43   - Name:            .eh_frame
44     Type:            SHT_PROGBITS
45     Flags:           [ SHF_ALLOC ]
46     AddressAlign:    0x0000000000000008
47     Content:         1400000000000000037A5200017810011B0C070890010000180000001C000000000000001200000000410E108602430D060000001800000038000000000000000800000000410E108602430D06000000
48   - Name:            .rela.eh_frame
49     Type:            SHT_RELA
50     Link:            .symtab
51     AddressAlign:    0x0000000000000008
52     Info:            .eh_frame
53     Relocations:
54       - Offset:          0x0000000000000020
55         Symbol:          .text
56         Type:            R_X86_64_PC32
57         Addend:          0
58       - Offset:          0x000000000000003C
59         Symbol:          .text
60         Type:            R_X86_64_PC32
61         Addend:          32
62 Symbols:
63   Local:
64     - Name:            .text
65       Type:            STT_SECTION
66       Section:         .text
67     - Name:            .data
68       Type:            STT_SECTION
69       Section:         .data
70     - Name:            .bss
71       Type:            STT_SECTION
72       Section:         .bss
73     - Name:            .eh_frame
74       Type:            STT_SECTION
75       Section:         .eh_frame
76   Global:
77     - Name:            foo
78       Type:            STT_FUNC
79       Section:         .text
80       Value:           0x0000000000000020
81       Size:            0x0000000000000008
82     - Name:            main
83       Type:            STT_FUNC
84       Section:         .text
85       Size:            0x0000000000000012
86     - Name:            myval
87       Type:            STT_OBJECT
88       Section:         .bss
89       Size:            0x0000000000000004
90     - Name:            val
91       Type:            STT_OBJECT
92       Section:         .rodata
93       Size:            0x0000000000000004
94 ...