]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/icf11.test
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / icf11.test
1 # RUN: yaml2obj %s -o %t.o
2 # RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s
3
4 # Checks that ICF does not merge 2 sections the type of
5 # the relocations of which differ.
6
7 # CHECK-NOT: selected
8
9 !ELF
10 FileHeader:
11   Class:           ELFCLASS64
12   Data:            ELFDATA2LSB
13   OSABI:           ELFOSABI_FREEBSD
14   Type:            ET_REL
15   Machine:         EM_X86_64
16 Sections:
17   - Type:            SHT_PROGBITS
18     Name:            .text
19     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
20     AddressAlign:    0x04
21     Content:         "0000000000000000"
22   - Name:            .text.foo
23     Type:            SHT_PROGBITS
24     Flags:           [ SHF_ALLOC, SHF_EXECINSTR]
25     Content:         "FFFFFFFFFFFFFFFF"
26   - Name:            .text.bar
27     Type:            SHT_PROGBITS
28     Flags:           [ SHF_ALLOC, SHF_EXECINSTR]
29     Content:         "FFFFFFFFFFFFFFFF"
30   - Name:            .rela.text.foo
31     Type:            SHT_RELA
32     Link:            .symtab
33     Info:            .text.foo
34     Relocations:
35       - Offset:          0x0000000000000000
36         Symbol:          ''
37         Type:            R_X86_64_NONE
38   - Name:            .rela.text.bar
39     Type:            SHT_RELA
40     Link:            .symtab
41     Info:            .text.bar
42     Relocations:
43       - Offset:          0
44         Symbol:          zed
45         Type:            R_X86_64_64
46 Symbols:
47   Global:
48     - Name:     zed
49       Type:     STT_FUNC
50       Section:  .text
51       Value:    0x0
52       Size:     8