131 lines · plain
1## Test that note values are interpreted correctly for FreeBSD executables.2# RUN: yaml2obj %s -o %t.o3# RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefixes=GNU --strict-whitespace4# RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM --strict-whitespace5 6--- !ELF7FileHeader:8 Class: ELFCLASS649 Data: ELFDATA2LSB10 Type: ET_EXEC11 Machine: EM_RISCV12Sections:13 - Name: .note.tag14 Type: SHT_NOTE15 AddressAlign: 0x000000000000000416 Notes:17 - Name: FreeBSD18 Desc: '6CD61300'19 Type: NT_FREEBSD_ABI_TAG20 - Name: FreeBSD21 Desc: '6C' # Invalid data (should be 4 bytes)22 Type: NT_FREEBSD_ABI_TAG23 - Name: FreeBSD24 Desc: '61617263683634'25 Type: NT_FREEBSD_ARCH_TAG26 - Name: FreeBSD27 Desc: 'FFFFFFFF'28 Type: NT_FREEBSD_FEATURE_CTL29 - Name: FreeBSD30 Desc: '00' # Invalid data (should be 4 bytes)31 Type: NT_FREEBSD_FEATURE_CTL32 - Name: FreeBSD33 Desc: '00000000'34 Type: NT_FREEBSD_NOINIT_TAG35 - Name: FreeBSD36 Desc: '616263646566'37 Type: 0xabcdef38 - Name: FreeBSD39 Desc: '616263646566'40 Type: NT_FREEBSD_PROCSTAT_RLIMIT # Only valid for coredumps.41 42# GNU: Displaying notes found in: .note.tag43# GNU-NEXT: Owner Data size Description44# GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_ABI_TAG (ABI version tag)45# GNU-NEXT: ABI tag: 130007646# GNU-NEXT: FreeBSD 0x00000001 NT_FREEBSD_ABI_TAG (ABI version tag)47# GNU-NEXT: description data: 6c48# GNU-NEXT: FreeBSD 0x00000007 NT_FREEBSD_ARCH_TAG (architecture tag)49# GNU-NEXT: Arch tag: aarch6450# GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)51# GNU-NEXT: Feature flags: ASLR_DISABLE PROTMAX_DISABLE STKGAP_DISABLE WXNEEDED LA48 ASG_DISABLE (0xffffffff)52# GNU-NEXT: FreeBSD 0x00000001 NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)53# GNU-NEXT: description data: 0054# GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_NOINIT_TAG (no .init tag)55# GNU-NEXT: description data: 00 00 00 0056# GNU-NEXT: FreeBSD 0x00000006 Unknown note type: (0x00abcdef)57# GNU-NEXT: description data: 61 62 63 64 65 6658## NT_FREEBSD_PROCSTAT_RLIMIT is only a valid type for coredumps and should therefore not be decoded.59## Note: Binutils prints NT_PROCSTAT_RLIMIT, but this seems incorrect60# GNU-NEXT: FreeBSD 0x00000006 Unknown note type: (0x0000000d)61# GNU-NEXT: description data: 61 62 63 64 65 6662# GNU-EMPTY:63 64# LLVM: NoteSections [65# LLVM-NEXT: NoteSection {66# LLVM-NEXT: Name: .note.tag67# LLVM-NEXT: Offset: 0x4068# LLVM-NEXT: Size: 0xCC69# LLVM-NEXT: Notes [70# LLVM-NEXT: {71# LLVM-NEXT: Owner: FreeBSD72# LLVM-NEXT: Data size: 0x473# LLVM-NEXT: Type: NT_FREEBSD_ABI_TAG (ABI version tag)74# LLVM-NEXT: ABI tag: 130007675# LLVM-NEXT: }76# LLVM-NEXT: {77# LLVM-NEXT: Owner: FreeBSD78# LLVM-NEXT: Data size: 0x179# LLVM-NEXT: Type: NT_FREEBSD_ABI_TAG (ABI version tag)80# LLVM-NEXT: Description data (81# LLVM-NEXT: 0000: 6C |l|82# LLVM-NEXT: )83# LLVM-NEXT: }84# LLVM-NEXT: {85# LLVM-NEXT: Owner: FreeBSD86# LLVM-NEXT: Data size: 0x787# LLVM-NEXT: Type: NT_FREEBSD_ARCH_TAG (architecture tag)88# LLVM-NEXT: Arch tag: aarch6489# LLVM-NEXT: }90# LLVM-NEXT: {91# LLVM-NEXT: Owner: FreeBSD92# LLVM-NEXT: Data size: 0x493# LLVM-NEXT: Type: NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)94# LLVM-NEXT: Feature flags: ASLR_DISABLE PROTMAX_DISABLE STKGAP_DISABLE WXNEEDED LA48 ASG_DISABLE (0xffffffff)95# LLVM-NEXT: }96# LLVM-NEXT: {97# LLVM-NEXT: Owner: FreeBSD98# LLVM-NEXT: Data size: 0x199# LLVM-NEXT: Type: NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)100# LLVM-NEXT: Description data (101# LLVM-NEXT: 0000: 00 |.|102# LLVM-NEXT: )103# LLVM-NEXT: }104# LLVM-NEXT: {105# LLVM-NEXT: Owner: FreeBSD106# LLVM-NEXT: Data size: 0x4107# LLVM-NEXT: Type: NT_FREEBSD_NOINIT_TAG (no .init tag)108# LLVM-NEXT: Description data (109# LLVM-NEXT: 0000: 00000000 |....|110# LLVM-NEXT: )111# LLVM-NEXT: }112# LLVM-NEXT: {113# LLVM-NEXT: Owner: FreeBSD114# LLVM-NEXT: Data size: 0x6115# LLVM-NEXT: Type: Unknown (0x00abcdef)116# LLVM-NEXT: Description data (117# LLVM-NEXT: 0000: 61626364 6566 |abcdef|118# LLVM-NEXT: )119# LLVM-NEXT: }120# LLVM-NEXT: {121# LLVM-NEXT: Owner: FreeBSD122# LLVM-NEXT: Data size: 0x6123# LLVM-NEXT: Type: Unknown (0x0000000d)124# LLVM-NEXT: Description data (125# LLVM-NEXT: 0000: 61626364 6566 |abcdef|126# LLVM-NEXT: )127# LLVM-NEXT: }128# LLVM-NEXT: ]129# LLVM-NEXT: }130# LLVM-NEXT:]131