1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/tools/llvm-readobj/XCOFF/symbols64.test
jasonliu c03aed5d1b [XCOFF][AIX] Enable tooling support for 64 bit symbol table parsing
Add in the ability of parsing symbol table for 64 bit object.

Reviewed By: jhenderson, DiggerLin

Differential Revision: https://reviews.llvm.org/D85774
2021-06-07 17:24:13 +00:00

388 lines
15 KiB
Plaintext

## This file tests the ability of llvm-readobj to display the symbol table for a
## 64-bit XCOFF object file.
## The object file used is generated by the following source file
## and command on AIX:
##
## > cat test8.c
##
## extern int i;
## extern int TestforXcoff;
## extern int fun(int i);
## static int static_i;
## char* p="abcd";
## int fun1(int j) {
## static_i++;
## j++;
## j=j+*p;
## return j;
## }
##
## int main() {
## i++;
## fun(i);
## return fun1(i);
## }
##
## > xlc -q64 -c test8.c -o symbol64.o
# RUN: llvm-readobj --symbols %p/Inputs/symbol64.o | \
# RUN: FileCheck --check-prefix=SYMBOL64 %s
# SYMBOL64: File: {{.*}}symbol64.o
# SYMBOL64-NEXT: Format: aix5coff64-rs6000
# SYMBOL64-NEXT: Arch: powerpc64
# SYMBOL64-NEXT: AddressSize: 64bit
# SYMBOL64-NEXT: Symbols [
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 0
# SYMBOL64-NEXT: Name: .file
# SYMBOL64-NEXT: Value (SymbolTableIndex): 0x0
# SYMBOL64-NEXT: Section: N_DEBUG
# SYMBOL64-NEXT: Source Language ID: TB_C (0x0)
# SYMBOL64-NEXT: CPU Version ID: TCPU_PPC64 (0x2)
# SYMBOL64-NEXT: StorageClass: C_FILE (0x67)
# SYMBOL64-NEXT: NumberOfAuxEntries: 3
# SYMBOL64-NEXT: File Auxiliary Entry {
# SYMBOL64-NEXT: Index: 1
# SYMBOL64-NEXT: Name: test64.c
# SYMBOL64-NEXT: Type: XFT_FN (0x0)
# SYMBOL64-NEXT: Auxiliary Type: AUX_FILE (0xFC)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: File Auxiliary Entry {
# SYMBOL64-NEXT: Index: 2
# SYMBOL64-NEXT: Name: Mon Aug 10 16:07:48 2020
# SYMBOL64-NEXT: Type: XFT_CT (0x1)
# SYMBOL64-NEXT: Auxiliary Type: AUX_FILE (0xFC)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: File Auxiliary Entry {
# SYMBOL64-NEXT: Index: 3
# SYMBOL64-NEXT: Name: IBM XL C for AIX, Version 16.1.0.6
# SYMBOL64-NEXT: Type: XFT_CV (0x2)
# SYMBOL64-NEXT: Auxiliary Type: AUX_FILE (0xFC)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 4
# SYMBOL64-NEXT: Name:
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x0
# SYMBOL64-NEXT: Section: .text
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 5
# SYMBOL64-NEXT: SectionLen: 256
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 7
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_PR (0x0)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 6
# SYMBOL64-NEXT: Name: .fun1
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x0
# SYMBOL64-NEXT: Section: .text
# SYMBOL64-NEXT: Type: 0x20
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 7
# SYMBOL64-NEXT: ContainingCsectSymbolIndex: 4
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 0
# SYMBOL64-NEXT: SymbolType: XTY_LD (0x2)
# SYMBOL64-NEXT: StorageMappingClass: XMC_PR (0x0)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 8
# SYMBOL64-NEXT: Name: .main
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x80
# SYMBOL64-NEXT: Section: .text
# SYMBOL64-NEXT: Type: 0x20
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 9
# SYMBOL64-NEXT: ContainingCsectSymbolIndex: 4
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 0
# SYMBOL64-NEXT: SymbolType: XTY_LD (0x2)
# SYMBOL64-NEXT: StorageMappingClass: XMC_PR (0x0)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 10
# SYMBOL64-NEXT: Name: TOC
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x100
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 11
# SYMBOL64-NEXT: SectionLen: 0
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 2
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC0 (0xF)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 12
# SYMBOL64-NEXT: Name:
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x128
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 13
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 14
# SYMBOL64-NEXT: Name:
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x168
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 15
# SYMBOL64-NEXT: SectionLen: 5
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_RO (0x1)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 16
# SYMBOL64-NEXT: Name: _$STATIC_BSS
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x170
# SYMBOL64-NEXT: Section: .bss
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 17
# SYMBOL64-NEXT: SectionLen: 4
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 2
# SYMBOL64-NEXT: SymbolType: XTY_CM (0x3)
# SYMBOL64-NEXT: StorageMappingClass: XMC_RW (0x5)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 18
# SYMBOL64-NEXT: Name: _$STATIC_BSS
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x108
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 19
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 20
# SYMBOL64-NEXT: Name: fun1
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x130
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 21
# SYMBOL64-NEXT: SectionLen: 24
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_DS (0xA)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 22
# SYMBOL64-NEXT: Name: fun1
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x100
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 23
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 24
# SYMBOL64-NEXT: Name: p
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x160
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 25
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_RW (0x5)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 26
# SYMBOL64-NEXT: Name: p
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x110
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 27
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 28
# SYMBOL64-NEXT: Name: main
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x148
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 29
# SYMBOL64-NEXT: SectionLen: 24
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_DS (0xA)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 30
# SYMBOL64-NEXT: Name: main
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x118
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 31
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 32
# SYMBOL64-NEXT: Name: i
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x0
# SYMBOL64-NEXT: Section: N_UNDEF
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 33
# SYMBOL64-NEXT: SectionLen: 0
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 0
# SYMBOL64-NEXT: SymbolType: XTY_ER (0x0)
# SYMBOL64-NEXT: StorageMappingClass: XMC_UA (0x4)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 34
# SYMBOL64-NEXT: Name: i
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x120
# SYMBOL64-NEXT: Section: .data
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_HIDEXT (0x6B)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 35
# SYMBOL64-NEXT: SectionLen: 8
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 3
# SYMBOL64-NEXT: SymbolType: XTY_SD (0x1)
# SYMBOL64-NEXT: StorageMappingClass: XMC_TC (0x3)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: Symbol {
# SYMBOL64-NEXT: Index: 36
# SYMBOL64-NEXT: Name: .fun
# SYMBOL64-NEXT: Value (RelocatableAddress): 0x0
# SYMBOL64-NEXT: Section: N_UNDEF
# SYMBOL64-NEXT: Type: 0x0
# SYMBOL64-NEXT: StorageClass: C_EXT (0x2)
# SYMBOL64-NEXT: NumberOfAuxEntries: 1
# SYMBOL64-NEXT: CSECT Auxiliary Entry {
# SYMBOL64-NEXT: Index: 37
# SYMBOL64-NEXT: SectionLen: 0
# SYMBOL64-NEXT: ParameterHashIndex: 0x0
# SYMBOL64-NEXT: TypeChkSectNum: 0x0
# SYMBOL64-NEXT: SymbolAlignmentLog2: 0
# SYMBOL64-NEXT: SymbolType: XTY_ER (0x0)
# SYMBOL64-NEXT: StorageMappingClass: XMC_PR (0x0)
# SYMBOL64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: }
# SYMBOL64-NEXT: ]