132 lines · plain
1## Show that llvm-sizes works correctly on a typical ELF input for sysv2## format. It also shows that the formatting is correct.3 4## FIXME: The rules demonstrated by this test are not quite what GNU size5## follows. See https://bugs.llvm.org/show_bug.cgi?id=42934.6 7# RUN: yaml2obj %s -o %t.o8# RUN: llvm-size --format=sysv %t.o \9# RUN: | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}}10# RUN: llvm-size -A %t.o \11# RUN: | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}}12 13# CHECK:[[FILE]] :14# CHECK-NEXT:section size addr15# CHECK-NEXT:.progbits 1 209715216# CHECK-NEXT:.symtab_shndx 4 52428817# CHECK-NEXT:.hash 64 6553618# CHECK-NEXT:.dynamic 128 3276819# CHECK-NEXT:.note 256 1638420# CHECK-NEXT:.nobits 512 819221# CHECK-NEXT:.shlib 2048 204822# CHECK-NEXT:.dynsym 4096 102423# CHECK-NEXT:.init_array 8192 51224# CHECK-NEXT:.fini_array 16384 25625# CHECK-NEXT:.preinit_array 32768 12826# CHECK-NEXT:.group 65536 6427# CHECK-NEXT:.relr 131072 3228# CHECK-NEXT:.os_specific 262144 1629# CHECK-NEXT:.proc_specific 524288 830# CHECK-NEXT:.user_specific 1048576 431# CHECK-NEXT:Total 209606932 33!ELF34FileHeader:35 Class: ELFCLASS6436 Data: ELFDATA2LSB37 Type: ET_REL38 Machine: EM_X86_6439Sections:40 - Name: .progbits41 Type: SHT_PROGBITS42 ShSize: 0x143 Address: 0x20000044 - Name: .strtab45 Type: SHT_STRTAB46 ShSize: 0x247 Address: 0x10000048 - Name: .symtab_shndx49 Link: .symtab50 Type: SHT_SYMTAB_SHNDX51 ShSize: 0x452 Address: 0x8000053 Entries:54 - Name: .symtab55 Type: SHT_SYMTAB56 ## .symtab's size has to be based on .symtab_shndx's size, hence the57 ## size not following the pattern of the other sections.58 ShSize: 0x1859 Address: 0x4000060 - Name: .rela61 Type: SHT_RELA62 ShSize: 0x2063 Address: 0x2000064 - Name: .hash65 Type: SHT_HASH66 Content: ''67 ShSize: 0x4068 Address: 0x1000069 - Name: .dynamic70 Type: SHT_DYNAMIC71 ShSize: 0x8072 Address: 0x800073 - Name: .note74 Type: SHT_NOTE75 ShSize: 0x10076 Address: 0x400077 Notes: []78 - Name: .nobits79 Type: SHT_NOBITS80 ShSize: 0x20081 Address: 0x200082 - Name: .rel83 Type: SHT_REL84 ShSize: 0x40085 Address: 0x100086 - Name: .shlib87 Type: SHT_SHLIB88 ShSize: 0x80089 Address: 0x80090 - Name: .dynsym91 Type: SHT_DYNSYM92 ShSize: 0x100093 Address: 0x40094 - Name: .init_array95 Type: SHT_INIT_ARRAY96 ShSize: 0x200097 Address: 0x20098 - Name: .fini_array99 Type: SHT_FINI_ARRAY100 ShSize: 0x4000101 Address: 0x100102 - Name: .preinit_array103 Type: SHT_PREINIT_ARRAY104 ShSize: 0x8000105 Address: 0x80106 - Name: .group107 Type: SHT_GROUP108 ShSize: 0x10000109 Address: 0x40110 Info: 0111 Members:112 - Name: .relr113 Type: SHT_RELR114 ShSize: 0x20000115 Address: 0x20116 - Name: .os_specific117 Type: 0x61234567118 ShSize: 0x40000119 Address: 0x10120 - Name: .proc_specific121 Type: 0x71234567122 ShSize: 0x80000123 Address: 0x8124 - Name: .user_specific125 Type: 0x81234567126 ShSize: 0x100000127 Address: 0x4128 - Name: .null129 Type: SHT_NULL130 ShSize: 0x200000131 Address: 0x2132