1# Show that llvm-readelf properly prints the addend for relocations that do not 2# have an associated symbol but have a negative addend. 3 4# RUN: yaml2obj %s -o %t 5# RUN: llvm-readelf --relocations %t | FileCheck %s --check-prefix=REL 6# RUN: llvm-readelf --dyn-relocations %t | FileCheck %s --check-prefix=DYN 7 8# REL: Relocation section '.rela.text' at offset {{.*}} contains 1 entries: 9# REL-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend 10# REL-NEXT: 0000000000000000 0000000000000000 R_X86_64_NONE ffffffffffffffff 11# REL-EMPTY: 12# REL-NEXT: Relocation section '.rela.dyn' at offset {{.*}} contains 1 entries: 13# REL-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend 14# REL-NEXT: 0000000000000008 0000000000000000 R_X86_64_NONE ffffffffffffffff 15 16# DYN: 'RELA' relocation section at offset {{.*}} contains 24 bytes: 17# DYN-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend 18# DYN-NEXT: 0000000000000008 0000000000000000 R_X86_64_NONE ffffffffffffffff 19 20--- !ELF 21FileHeader: 22 Class: ELFCLASS64 23 Data: ELFDATA2LSB 24 Type: ET_EXEC 25 Machine: EM_X86_64 26Sections: 27 - Name: .text 28 Type: SHT_PROGBITS 29 Size: 0x10 30 - Name: .rela.text 31 Type: SHT_RELA 32 Info: .text 33 Relocations: 34 - Offset: 0 35 Type: R_X86_64_NONE 36 Addend: -1 37 - Name: .dynamic 38 Type: SHT_DYNAMIC 39 Flags: [SHF_ALLOC] 40 Address: 0x1000 41 AddressAlign: 0x1000 42 Entries: 43 - Tag: DT_RELA 44 Value: 0x1100 45 - Tag: DT_RELASZ 46 Value: 24 47 - Tag: DT_RELAENT 48 Value: 24 49 - Tag: DT_NULL 50 Value: 0 51 - Name: .rela.dyn 52 Type: SHT_RELA 53 Flags: [SHF_ALLOC] 54 Info: .text 55 Address: 0x1100 56 AddressAlign: 0x100 57 Relocations: 58 - Offset: 8 59 Type: R_X86_64_NONE 60 Addend: -1 61DynamicSymbols: 62 - Name: force_dynsym 63 Binding: STB_GLOBAL 64ProgramHeaders: 65 - Type: PT_LOAD 66 VAddr: 0x1000 67 FirstSec: .dynamic 68 LastSec: .rela.dyn 69 - Type: PT_DYNAMIC 70 VAddr: 0x1000 71 FirstSec: .dynamic 72 LastSec: .dynamic 73