forked from OSchip/llvm-project
143 lines
4.0 KiB
Plaintext
143 lines
4.0 KiB
Plaintext
# Tests that linker throws an error for an undefined symbol in the section
|
|
# group.
|
|
#
|
|
#comdata.s
|
|
#------------
|
|
# .section .foo,"axG",@progbits,g1,comdat
|
|
# .word g1
|
|
#
|
|
#comdatb.s
|
|
#------------
|
|
# .global g1
|
|
# .section .foo,"axG",@progbits,g1,comdat
|
|
#g1:
|
|
# 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 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: .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: '90'
|
|
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
|
|
Section: .foo
|
|
...
|