2017-11-30 06:09:16 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: yaml2obj %s -o %t.o
|
2018-07-03 01:48:23 +08:00
|
|
|
# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
|
2017-11-30 06:09:16 +08:00
|
|
|
|
|
|
|
# The debug info has a broken relocation. Check that we don't crash
|
|
|
|
# and still report the undefined symbol.
|
|
|
|
|
2018-09-26 16:11:34 +08:00
|
|
|
# CHECK: error: {{.*}}.o: relocation R_X86_64_64 at 0x29 has unsupported target
|
2017-11-30 06:09:16 +08:00
|
|
|
# CHECK: error: undefined symbol: bar
|
|
|
|
|
|
|
|
--- !ELF
|
|
|
|
FileHeader:
|
|
|
|
Class: ELFCLASS64
|
|
|
|
Data: ELFDATA2LSB
|
|
|
|
Type: ET_REL
|
|
|
|
Machine: EM_X86_64
|
|
|
|
Sections:
|
|
|
|
- Name: .text
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
Content: '0000000000000000'
|
|
|
|
- Name: .rela.text
|
|
|
|
Type: SHT_RELA
|
2017-11-30 07:39:12 +08:00
|
|
|
AddressAlign: 8
|
2017-11-30 06:09:16 +08:00
|
|
|
Link: .symtab
|
|
|
|
Info: .text
|
|
|
|
Relocations:
|
|
|
|
- Offset: 0x0000000000000000
|
|
|
|
Symbol: bar
|
|
|
|
Type: R_X86_64_64
|
|
|
|
- Name: .debug_line
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Content: 3300000002001C0000000101FB0E0D000101010100000001000001006162632E7300000000000009020000000000000000140208000101
|
|
|
|
- Name: .rela.debug_line
|
2017-11-30 07:39:12 +08:00
|
|
|
AddressAlign: 8
|
2017-11-30 06:09:16 +08:00
|
|
|
Type: SHT_RELA
|
|
|
|
Link: .symtab
|
|
|
|
Info: .debug_line
|
|
|
|
Relocations:
|
|
|
|
- Offset: 0x0000000000000029
|
|
|
|
Symbol: bar
|
|
|
|
Type: R_X86_64_64
|
2018-03-23 01:14:41 +08:00
|
|
|
- Name: .debug_info
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
AddressAlign: 0x0000000000000001
|
|
|
|
Content: 0C000000040000000000080100000000
|
|
|
|
- Name: .rela.debug_info
|
|
|
|
Type: SHT_RELA
|
|
|
|
Link: .symtab
|
|
|
|
AddressAlign: 0x0000000000000008
|
|
|
|
Info: .debug_info
|
|
|
|
Relocations:
|
|
|
|
- Offset: 0x0000000000000006
|
|
|
|
Symbol: .debug_abbrev
|
|
|
|
Type: R_X86_64_32
|
|
|
|
- Offset: 0x000000000000000C
|
|
|
|
Symbol: .debug_line
|
|
|
|
Type: R_X86_64_32
|
|
|
|
- Name: .debug_abbrev
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
AddressAlign: 0x0000000000000001
|
|
|
|
Content: '0111001017000000'
|
|
|
|
|
2017-11-30 06:09:16 +08:00
|
|
|
Symbols:
|
|
|
|
Global:
|
|
|
|
- Name: _start
|
|
|
|
Section: .text
|
|
|
|
- Name: bar
|