forked from OSchip/llvm-project
157 lines
4.5 KiB
Plaintext
157 lines
4.5 KiB
Plaintext
# Tests that linker throws an error for an undefined symbol in the section
|
|
# group, which is the same as the signature in the next input file.
|
|
# comdat1.s
|
|
# ------------
|
|
# .section .foo,"axG",@progbits,g1,comdat
|
|
# .word g1
|
|
#comdat2.s
|
|
#-----------
|
|
# .global g1
|
|
# .section .bar,"axG",@progbits,g1,comdat
|
|
#g2:
|
|
# nop
|
|
# .section .car,"axG",@progbits,g1,comdat
|
|
#g3:
|
|
# nop
|
|
#
|
|
#RUN: yaml2obj -format=elf -docnum 1 %s -o %t.group1a.o
|
|
#RUN: yaml2obj -format=elf -docnum 2 %s -o %t.group1b.o
|
|
#RUN: lld -flavor old-gnu -target x86_64 %t.group1a.o %t.group1b.o \
|
|
#RUN: --noinhibit-exec -o %t2.out 2>&1 | FileCheck %s
|
|
#CHECK: Undefined symbol: {{.*}} g1
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
OSABI: ELFOSABI_GNU
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .group
|
|
Type: SHT_GROUP
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000004
|
|
Info: g1
|
|
Members:
|
|
- SectionOrType: GRP_COMDAT
|
|
- SectionOrType: .foo
|
|
- SectionOrType: .rela.foo
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x0000000000000004
|
|
Content: ''
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000004
|
|
Content: ''
|
|
- Name: .bss
|
|
Type: SHT_NOBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000004
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: '0000'
|
|
- Name: .rela.foo
|
|
Type: SHT_RELA
|
|
Flags: [ SHF_GROUP ]
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000008
|
|
Info: .foo
|
|
Relocations:
|
|
- Offset: 0x0000000000000000
|
|
Symbol: g1
|
|
Type: R_X86_64_16
|
|
Symbols:
|
|
Local:
|
|
- Name: .text
|
|
Type: STT_SECTION
|
|
Section: .text
|
|
- Name: .data
|
|
Type: STT_SECTION
|
|
Section: .data
|
|
- Name: .bss
|
|
Type: STT_SECTION
|
|
Section: .bss
|
|
- Name: .foo
|
|
Type: STT_SECTION
|
|
Section: .foo
|
|
- Name: .group
|
|
Type: STT_SECTION
|
|
Section: .group
|
|
Global:
|
|
- Name: g1
|
|
...
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
OSABI: ELFOSABI_GNU
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .group
|
|
Type: SHT_GROUP
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000004
|
|
Info: g1
|
|
Members:
|
|
- SectionOrType: GRP_COMDAT
|
|
- SectionOrType: .bar
|
|
- SectionOrType: .car
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x0000000000000004
|
|
Content: ''
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000004
|
|
Content: ''
|
|
- Name: .bss
|
|
Type: SHT_NOBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000004
|
|
- Name: .bar
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: '90'
|
|
- Name: .car
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: '90'
|
|
Symbols:
|
|
Local:
|
|
- Name: g2
|
|
Section: .bar
|
|
- Name: g3
|
|
Section: .car
|
|
- Name: .text
|
|
Type: STT_SECTION
|
|
Section: .text
|
|
- Name: .data
|
|
Type: STT_SECTION
|
|
Section: .data
|
|
- Name: .bss
|
|
Type: STT_SECTION
|
|
Section: .bss
|
|
- Name: .bar
|
|
Type: STT_SECTION
|
|
Section: .bar
|
|
- Name: .car
|
|
Type: STT_SECTION
|
|
Section: .car
|
|
- Name: .group
|
|
Type: STT_SECTION
|
|
Section: .group
|
|
Global:
|
|
- Name: g1
|
|
Section: .group
|
|
...
|