1# REQUIRES: x86 2 3# RUN: yaml2obj %s -o %t.o 4# RUN: ld.lld %t.o -o /dev/null --entry 0 2>&1 | FileCheck %s 5# CHECK: warning: {{.*}}:(.debug_info+0x41f): has non-ABS relocation R_386_GOTPC against symbol '_GLOBAL_OFFSET_TABLE_' 6 7## This is for https://bugs.llvm.org//show_bug.cgi?id=34852. GCC 8.0 or 8## earlier have a bug which creates non-absolute R_386_GOTPC relocations 9## in non-allocated sections. It is illegal, but we want to make sure that 10## lld skips them instead of reporting errors. 11 12--- !ELF 13FileHeader: 14 Class: ELFCLASS32 15 Data: ELFDATA2LSB 16 Type: ET_REL 17 Machine: EM_386 18Sections: 19 - Name: .debug_info 20 Type: SHT_PROGBITS 21 AddressAlign: 0x0000000000000001 22 Content: 0000000000000000 23 - Name: .rel.debug_info 24 Type: SHT_REL 25 Link: .symtab 26 AddressAlign: 0x0000000000000004 27 Info: .debug_info 28 Relocations: 29 - Offset: 0x000000000000041F 30 Symbol: _GLOBAL_OFFSET_TABLE_ 31 Type: R_386_GOTPC 32Symbols: 33 - Name: _GLOBAL_OFFSET_TABLE_ 34 Binding: STB_GLOBAL 35