reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
## Show that llvm-sizes works correctly on a typical ELF input for sysv
## format. It also shows that the formatting is correct.

## FIXME: The rules demonstrated by this test are not quite what GNU size
## follows. See https://bugs.llvm.org/show_bug.cgi?id=42934.

# RUN: yaml2obj %s > %t.o
# RUN: llvm-size --format=sysv %t.o \
# RUN:   | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}}
# RUN: llvm-size -A %t.o \
# RUN:   | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}}

#      CHECK:[[FILE]]  :
# CHECK-NEXT:section               size      addr
# CHECK-NEXT:.progbits                1   2097152
# CHECK-NEXT:.symtab_shndx            4    524288
# CHECK-NEXT:.hash                   64     65536
# CHECK-NEXT:.dynamic               128     32768
# CHECK-NEXT:.note                  256     16384
# CHECK-NEXT:.nobits                512      8192
# CHECK-NEXT:.shlib                2048      2048
# CHECK-NEXT:.dynsym               4096      1024
# CHECK-NEXT:.init_array           8192       512
# CHECK-NEXT:.fini_array          16384       256
# CHECK-NEXT:.preinit_array       32768       128
# CHECK-NEXT:.group               65536        64
# CHECK-NEXT:.relr               131072        32
# CHECK-NEXT:.os_specific        262144        16
# CHECK-NEXT:.proc_specific      524288         8
# CHECK-NEXT:.user_specific     1048576         4
# CHECK-NEXT:Total              2096069

!ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_X86_64
Sections:
  - Name:    .progbits
    Type:    SHT_PROGBITS
    ShSize:  0x1
    Address: 0x200000
  - Name:    .strtab
    Type:    SHT_STRTAB
    ShSize:  0x2
    Address: 0x100000
  - Name:    .symtab_shndx
    Link:    .symtab
    Type:    SHT_SYMTAB_SHNDX
    ShSize:  0x4
    Address: 0x80000
    Entries:
  - Name:    .symtab
    Type:    SHT_SYMTAB
    ## .symtab's size has to be based on .symtab_shndx's size, hence the
    ## size not following the pattern of the other sections.
    ShSize:  0x18
    Address: 0x40000
  - Name:    .rela
    Type:    SHT_RELA
    ShSize:  0x20
    Address: 0x20000
  - Name:    .hash
    Type:    SHT_HASH
    Content: ''
    ShSize:  0x40
    Address: 0x10000
  - Name:    .dynamic
    Type:    SHT_DYNAMIC
    ShSize:  0x80
    Address: 0x8000
  - Name:    .note
    Type:    SHT_NOTE
    ShSize:  0x100
    Address: 0x4000
    Notes:   []
  - Name:    .nobits
    Type:    SHT_NOBITS
    ShSize:  0x200
    Address: 0x2000
  - Name:    .rel
    Type:    SHT_REL
    ShSize:  0x400
    Address: 0x1000
  - Name:    .shlib
    Type:    SHT_SHLIB
    ShSize:  0x800
    Address: 0x800
  - Name:    .dynsym
    Type:    SHT_DYNSYM
    ShSize:  0x1000
    Address: 0x400
  - Name:    .init_array
    Type:    SHT_INIT_ARRAY
    ShSize:  0x2000
    Address: 0x200
  - Name:    .fini_array
    Type:    SHT_FINI_ARRAY
    ShSize:  0x4000
    Address: 0x100
  - Name:    .preinit_array
    Type:    SHT_PREINIT_ARRAY
    ShSize:  0x8000
    Address: 0x80
  - Name:    .group
    Type:    SHT_GROUP
    ShSize:  0x10000
    Address: 0x40
    Info:    0
    Members:
  - Name:    .relr
    Type:    SHT_RELR
    ShSize:  0x20000
    Address: 0x20
  - Name:    .os_specific
    Type:    0x61234567
    ShSize:  0x40000
    Address: 0x10
  - Name:    .proc_specific
    Type:    0x71234567
    ShSize:  0x80000
    Address: 0x8
  - Name:    .user_specific
    Type:    0x81234567
    ShSize:  0x100000
    Address: 0x4
  - Name:    .null
    Type:    SHT_NULL
    ShSize:  0x200000
    Address: 0x2