llvm.org GIT mirror llvm / 785cf2e test / tools / llvm-readobj / elf-dynamic-tags-machine-specific.test
785cf2e

Tree @785cf2e (Download .tar.gz)

elf-dynamic-tags-machine-specific.test @785cf2eraw · history · blame

# Test that hexagon machine-specific tags can be dumped.
# RUN: yaml2obj --docnum=1 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.hex
# RUN: llvm-readobj --dynamic-table %t.hex | FileCheck %s --check-prefix=LLVM-HEXAGON
# RUN: llvm-readelf --dynamic-table %t.hex | FileCheck %s --check-prefix=GNU-HEXAGON

# LLVM-HEXAGON:      DynamicSection [ (6 entries)
# LLVM-HEXAGON-NEXT:   Tag                Type                 Name/Value
# LLVM-HEXAGON-NEXT:   0x0000000000000004 HASH                 0x1000
# LLVM-HEXAGON-NEXT:   0x0000000070000000 HEXAGON_SYMSZ        0x10
# LLVM-HEXAGON-NEXT:   0x0000000070000001 HEXAGON_VER          4096
# LLVM-HEXAGON-NEXT:   0x0000000070000002 HEXAGON_PLT          0x1000
# LLVM-HEXAGON-NEXT:   0x000000001234ABCD unknown              0x1
# LLVM-HEXAGON-NEXT:   0x0000000000000000 NULL                 0x0
# LLVM-HEXAGON-NEXT: ]

# GNU-HEXAGON:      Dynamic section at offset {{.*}} contains 6 entries:
# GNU-HEXAGON-NEXT:   Tag                Type                 Name/Value
# GNU-HEXAGON-NEXT:   0x0000000000000004 (HASH)               0x1000
# GNU-HEXAGON-NEXT:   0x0000000070000000 (HEXAGON_SYMSZ)      0x10
# GNU-HEXAGON-NEXT:   0x0000000070000001 (HEXAGON_VER)        4096
# GNU-HEXAGON-NEXT:   0x0000000070000002 (HEXAGON_PLT)        0x1000
# GNU-HEXAGON-NEXT:   0x000000001234abcd (unknown)            0x1
# GNU-HEXAGON-NEXT:   0x0000000000000000 (NULL)               0x0


# Test that MIPS machine-specific tags can be dumped.
# RUN: yaml2obj --docnum=2 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.mips
# RUN: llvm-readobj --dynamic-table %t.mips | FileCheck %s --check-prefix=LLVM-MIPS
# RUN: llvm-readelf --dynamic-table %t.mips | FileCheck %s --check-prefix=GNU-MIPS

# LLVM-MIPS:      DynamicSection [ (48 entries)
# LLVM-MIPS-NEXT:   Tag                Type                 Name/Value
# LLVM-MIPS-NEXT:   0x0000000000000004 HASH                 0x1000
# LLVM-MIPS-NEXT:   0x0000000070000001 MIPS_RLD_VERSION     305419896
# LLVM-MIPS-NEXT:   0x0000000070000002 MIPS_TIME_STAMP      0x11223344
# LLVM-MIPS-NEXT:   0x0000000070000003 MIPS_ICHECKSUM       0x11112222
# LLVM-MIPS-NEXT:   0x0000000070000004 MIPS_IVERSION        0x1
# LLVM-MIPS-NEXT:   0x0000000070000005 MIPS_FLAGS           QUICKSTART SGI_ONLY PIXIE CORD
# LLVM-MIPS-NEXT:   0x0000000070000006 MIPS_BASE_ADDRESS    0x87654321
# LLVM-MIPS-NEXT:   0x0000000070000007 MIPS_MSYM            0x1000
# LLVM-MIPS-NEXT:   0x0000000070000008 MIPS_CONFLICT        0x1000
# LLVM-MIPS-NEXT:   0x0000000070000009 MIPS_LIBLIST         0x1000
# LLVM-MIPS-NEXT:   0x000000007000000A MIPS_LOCAL_GOTNO     1
# LLVM-MIPS-NEXT:   0x000000007000000B MIPS_CONFLICTNO      0x1
# LLVM-MIPS-NEXT:   0x0000000070000010 MIPS_LIBLISTNO       0x1
# LLVM-MIPS-NEXT:   0x0000000070000011 MIPS_SYMTABNO        1
# LLVM-MIPS-NEXT:   0x0000000070000012 MIPS_UNREFEXTNO      0
# LLVM-MIPS-NEXT:   0x0000000070000013 MIPS_GOTSYM          0x0
# LLVM-MIPS-NEXT:   0x0000000070000014 MIPS_HIPAGENO        0x88776655
# LLVM-MIPS-NEXT:   0x0000000070000016 MIPS_RLD_MAP         0x1000
# LLVM-MIPS-NEXT:   0x0000000070000017 MIPS_DELTA_CLASS     0x1000
# LLVM-MIPS-NEXT:   0x0000000070000018 MIPS_DELTA_CLASS_NO  0x1
# LLVM-MIPS-NEXT:   0x0000000070000019 MIPS_DELTA_INSTANCE  0x1000
# LLVM-MIPS-NEXT:   0x000000007000001A MIPS_DELTA_INSTANCE_NO0x1
# LLVM-MIPS-NEXT:   0x000000007000001B MIPS_DELTA_RELOC     0x1000
# LLVM-MIPS-NEXT:   0x000000007000001C MIPS_DELTA_RELOC_NO  0x1
# LLVM-MIPS-NEXT:   0x000000007000001D MIPS_DELTA_SYM       0x1000
# LLVM-MIPS-NEXT:   0x000000007000001E MIPS_DELTA_SYM_NO    0x1
# LLVM-MIPS-NEXT:   0x0000000070000020 MIPS_DELTA_CLASSSYM  0x1000
# LLVM-MIPS-NEXT:   0x0000000070000021 MIPS_DELTA_CLASSSYM_NO0x1
# LLVM-MIPS-NEXT:   0x0000000070000022 MIPS_CXX_FLAGS       0x88887777
# LLVM-MIPS-NEXT:   0x0000000070000023 MIPS_PIXIE_INIT      0x1000
# LLVM-MIPS-NEXT:   0x0000000070000025 MIPS_LOCALPAGE_GOTIDX0x1
# LLVM-MIPS-NEXT:   0x0000000070000026 MIPS_LOCAL_GOTIDX    0x1
# LLVM-MIPS-NEXT:   0x0000000070000027 MIPS_HIDDEN_GOTIDX   0x1
# LLVM-MIPS-NEXT:   0x0000000070000028 MIPS_PROTECTED_GOTIDX0x1
# LLVM-MIPS-NEXT:   0x0000000070000029 MIPS_OPTIONS         0x1000
# LLVM-MIPS-NEXT:   0x000000007000002A MIPS_INTERFACE       0x1000
# LLVM-MIPS-NEXT:   0x000000007000002B MIPS_DYNSTR_ALIGN    0x88888888
# LLVM-MIPS-NEXT:   0x000000007000002C MIPS_INTERFACE_SIZE  0x10
# LLVM-MIPS-NEXT:   0x000000007000002D MIPS_RLD_TEXT_RESOLVE_ADDR0x8
# LLVM-MIPS-NEXT:   0x000000007000002E MIPS_PERF_SUFFIX     0x0
# LLVM-MIPS-NEXT:   0x000000007000002F MIPS_COMPACT_SIZE    0x10
# LLVM-MIPS-NEXT:   0x0000000070000030 MIPS_GP_VALUE        0x1
# LLVM-MIPS-NEXT:   0x0000000070000031 MIPS_AUX_DYNAMIC     0x1000
# LLVM-MIPS-NEXT:   0x0000000070000032 MIPS_PLTGOT          0x1000
# LLVM-MIPS-NEXT:   0x0000000070000034 MIPS_RWPLT           0x1000
# LLVM-MIPS-NEXT:   0x0000000070000035 MIPS_RLD_MAP_REL     0x1000
# LLVM-MIPS-NEXT:   0x000000001234ABCD unknown              0x1
# LLVM-MIPS-NEXT:   0x0000000000000000 NULL                 0x0
# LLVM-MIPS-NEXT: ]

# GNU-MIPS:      Dynamic section at offset {{.*}} contains 48 entries:
# GNU-MIPS-NEXT:   Tag                Type                 Name/Value
# GNU-MIPS-NEXT:   0x0000000000000004 (HASH)               0x1000
# GNU-MIPS-NEXT:   0x0000000070000001 (MIPS_RLD_VERSION)   305419896
# GNU-MIPS-NEXT:   0x0000000070000002 (MIPS_TIME_STAMP)    0x11223344
# GNU-MIPS-NEXT:   0x0000000070000003 (MIPS_ICHECKSUM)     0x11112222
# GNU-MIPS-NEXT:   0x0000000070000004 (MIPS_IVERSION)      0x1
# GNU-MIPS-NEXT:   0x0000000070000005 (MIPS_FLAGS)         QUICKSTART SGI_ONLY PIXIE CORD
# GNU-MIPS-NEXT:   0x0000000070000006 (MIPS_BASE_ADDRESS)  0x87654321
# GNU-MIPS-NEXT:   0x0000000070000007 (MIPS_MSYM)          0x1000
# GNU-MIPS-NEXT:   0x0000000070000008 (MIPS_CONFLICT)      0x1000
# GNU-MIPS-NEXT:   0x0000000070000009 (MIPS_LIBLIST)       0x1000
# GNU-MIPS-NEXT:   0x000000007000000a (MIPS_LOCAL_GOTNO)   1
# GNU-MIPS-NEXT:   0x000000007000000b (MIPS_CONFLICTNO)    0x1
# GNU-MIPS-NEXT:   0x0000000070000010 (MIPS_LIBLISTNO)     0x1
# GNU-MIPS-NEXT:   0x0000000070000011 (MIPS_SYMTABNO)      1
# GNU-MIPS-NEXT:   0x0000000070000012 (MIPS_UNREFEXTNO)    0
# GNU-MIPS-NEXT:   0x0000000070000013 (MIPS_GOTSYM)        0x0
# GNU-MIPS-NEXT:   0x0000000070000014 (MIPS_HIPAGENO)      0x88776655
# GNU-MIPS-NEXT:   0x0000000070000016 (MIPS_RLD_MAP)       0x1000
# GNU-MIPS-NEXT:   0x0000000070000017 (MIPS_DELTA_CLASS)   0x1000
# GNU-MIPS-NEXT:   0x0000000070000018 (MIPS_DELTA_CLASS_NO) 0x1
# GNU-MIPS-NEXT:   0x0000000070000019 (MIPS_DELTA_INSTANCE) 0x1000
# GNU-MIPS-NEXT:   0x000000007000001a (MIPS_DELTA_INSTANCE_NO) 0x1
# GNU-MIPS-NEXT:   0x000000007000001b (MIPS_DELTA_RELOC)   0x1000
# GNU-MIPS-NEXT:   0x000000007000001c (MIPS_DELTA_RELOC_NO) 0x1
# GNU-MIPS-NEXT:   0x000000007000001d (MIPS_DELTA_SYM)     0x1000
# GNU-MIPS-NEXT:   0x000000007000001e (MIPS_DELTA_SYM_NO)  0x1
# GNU-MIPS-NEXT:   0x0000000070000020 (MIPS_DELTA_CLASSSYM) 0x1000
# GNU-MIPS-NEXT:   0x0000000070000021 (MIPS_DELTA_CLASSSYM_NO) 0x1
# GNU-MIPS-NEXT:   0x0000000070000022 (MIPS_CXX_FLAGS)     0x88887777
# GNU-MIPS-NEXT:   0x0000000070000023 (MIPS_PIXIE_INIT)    0x1000
# GNU-MIPS-NEXT:   0x0000000070000025 (MIPS_LOCALPAGE_GOTIDX) 0x1
# GNU-MIPS-NEXT:   0x0000000070000026 (MIPS_LOCAL_GOTIDX)  0x1
# GNU-MIPS-NEXT:   0x0000000070000027 (MIPS_HIDDEN_GOTIDX) 0x1
# GNU-MIPS-NEXT:   0x0000000070000028 (MIPS_PROTECTED_GOTIDX) 0x1
# GNU-MIPS-NEXT:   0x0000000070000029 (MIPS_OPTIONS)       0x1000
# GNU-MIPS-NEXT:   0x000000007000002a (MIPS_INTERFACE)     0x1000
# GNU-MIPS-NEXT:   0x000000007000002b (MIPS_DYNSTR_ALIGN)  0x88888888
# GNU-MIPS-NEXT:   0x000000007000002c (MIPS_INTERFACE_SIZE) 0x10
# GNU-MIPS-NEXT:   0x000000007000002d (MIPS_RLD_TEXT_RESOLVE_ADDR) 0x8
# GNU-MIPS-NEXT:   0x000000007000002e (MIPS_PERF_SUFFIX)   0x0
# GNU-MIPS-NEXT:   0x000000007000002f (MIPS_COMPACT_SIZE)  0x10
# GNU-MIPS-NEXT:   0x0000000070000030 (MIPS_GP_VALUE)      0x1
# GNU-MIPS-NEXT:   0x0000000070000031 (MIPS_AUX_DYNAMIC)   0x1000
# GNU-MIPS-NEXT:   0x0000000070000032 (MIPS_PLTGOT)        0x1000
# GNU-MIPS-NEXT:   0x0000000070000034 (MIPS_RWPLT)         0x1000
# GNU-MIPS-NEXT:   0x0000000070000035 (MIPS_RLD_MAP_REL)   0x1000
# GNU-MIPS-NEXT:   0x000000001234abcd (unknown)            0x1
# GNU-MIPS-NEXT:   0x0000000000000000 (NULL)               0x0


# Test that PPC machine-specific tags can be dumped.
# RUN: yaml2obj --docnum=3 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.ppc
# RUN: llvm-readobj --dynamic-table %t.ppc | FileCheck %s --check-prefix=LLVM-PPC
# RUN: llvm-readelf --dynamic-table %t.ppc | FileCheck %s --check-prefix=GNU-PPC

# LLVM-PPC:      DynamicSection [ (4 entries)
# LLVM-PPC-NEXT:   Tag        Type                 Name/Value
# LLVM-PPC-NEXT:   0x70000000 PPC_GOT              0x200C0
# LLVM-PPC-NEXT:   0x70000001 PPC_OPT              0x1
# LLVM-PPC-NEXT:   0x1234ABCD unknown              0x1
# LLVM-PPC-NEXT:   0x00000000 NULL                 0x0
# LLVM-PPC-NEXT: ]

# GNU-PPC:      Dynamic section at offset {{.*}} contains 4 entries:
# GNU-PPC-NEXT:   Tag        Type                 Name/Value
# GNU-PPC-NEXT:   0x70000000 (PPC_GOT)            0x200c0
# GNU-PPC-NEXT:   0x70000001 (PPC_OPT)            0x1
# GNU-PPC-NEXT:   0x1234abcd (unknown)            0x1
# GNU-PPC-NEXT:   0x00000000 (NULL)               0x0


# Test that PPC64 machine-specific tags can be dumped.
# RUN: yaml2obj --docnum=4 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.ppc64
# RUN: llvm-readobj --dynamic-table %t.ppc64 | FileCheck %s --check-prefix=LLVM-PPC64
# RUN: llvm-readelf --dynamic-table %t.ppc64 | FileCheck %s --check-prefix=GNU-PPC64

# LLVM-PPC64:      DynamicSection [ (4 entries)
# LLVM-PPC64-NEXT:   Tag                Type                 Name/Value
# LLVM-PPC64-NEXT:   0x0000000000000004 HASH                 0x1000
# LLVM-PPC64-NEXT:   0x0000000070000000 PPC64_GLINK          0x1000
# LLVM-PPC64-NEXT:   0x000000001234ABCD unknown              0x1
# LLVM-PPC64-NEXT:   0x0000000000000000 NULL                 0x0
# LLVM-PPC64-NEXT: ]

# GNU-PPC64:      Dynamic section at offset {{.*}} contains 4 entries:
# GNU-PPC64-NEXT:   Tag                Type                 Name/Value
# GNU-PPC64-NEXT:   0x0000000000000004 (HASH)               0x1000
# GNU-PPC64-NEXT:   0x0000000070000000 (PPC64_GLINK)        0x1000
# GNU-PPC64-NEXT:   0x000000001234abcd (unknown)            0x1
# GNU-PPC64-NEXT:   0x0000000000000000 (NULL)               0x0

# Test that AARCH64 machine-specific tags can be dumped.
# RUN: yaml2obj --docnum=5 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.aarch64
# RUN: llvm-readobj --dynamic-table %t.aarch64 | FileCheck %s --check-prefix=LLVM-AARCH64
# RUN: llvm-readelf --dynamic-table %t.aarch64 | FileCheck %s --check-prefix=GNU-AARCH64

# LLVM-AARCH64:     DynamicSection [ (5 entries)
# LLVM-AARCH64-NEXT:  Tag                Type                 Name/Value
# LLVM-AARCH64-NEXT:  0x0000000000000004 HASH                 0x1000
# LLVM-AARCH64-NEXT:  0x0000000070000001 AARCH64_BTI_PLT      0
# LLVM-AARCH64-NEXT:  0x0000000070000003 AARCH64_PAC_PLT      0
# LLVM-AARCH64-NEXT:  0x000000001234ABCD unknown              0x1
# LLVM-AARCH64-NEXT:  0x0000000000000000 NULL                 0x0
# LLVM-AARCH64-NEXT:]

# GNU-AARCH64:      Dynamic section at offset {{.*}} contains 5 entries:
# GNU-AARCH64-NEXT:  Tag                Type                 Name/Value
# GNU-AARCH64-NEXT:  0x0000000000000004 (HASH)               0x1000
# GNU-AARCH64-NEXT:  0x0000000070000001 (AARCH64_BTI_PLT)    0
# GNU-AARCH64-NEXT:  0x0000000070000003 (AARCH64_PAC_PLT)    0
# GNU-AARCH64-NEXT:  0x000000001234abcd (unknown)            0x1
# GNU-AARCH64-NEXT:  0x0000000000000000 (NULL)               0x0