blob: 396f33d6fbf4b139da4237e0869a431a6eea6410 [file] [log] [blame]
# Tests two special cases for the ELF format:
# - If the section count in the ELF headers is 0, then, the true value
# is read out of section 0.
# - If the section string index in the ELF headers is SHN_XINDEX, the
# true value is read out of section 0.
#
# These special cases are documented here:
# https://docs.oracle.com/cd/E19683-01/817-3677/chapter6-94076/index.html
# RUN: %yaml2obj %s -o %t.obj
# RUN: %bloaty --raw-map %t.obj | %FileCheck %s
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
EShNum: 0
EShStrNdx: 0xffff ## SHN_XINDEX
Sections:
- Type: SHT_NULL
Link: .shstrtab
Size: 0x3
...
# CHECK: FILE MAP:
# CHECK: 000-040 64 [ELF Headers]
# CHECK: 040-041 1 .strtab
# CHECK: 041-058 23 .shstrtab
# CHECK: 058-098 64 [ELF Headers]
# CHECK: 098-0d8 64 .strtab
# CHECK: 0d8-118 64 .shstrtab
# CHECK: VM MAP: