Files
clang-p2996/llvm/test/CodeGen/PowerPC/aix-aux-header.ll
esmeyi b1847ff068 [XCOFF] write the aux header when the visibility is specified in XCOFF32.
The n_type field in the symbol table entry has two interpretations in XCOFF32, and a single interpretation in XCOFF64.
The new interpretation is used in XCOFF32 if the value of the o_vstamp field in the auxiliary header is 2.
In XCOFF64 and the new XCOFF32 interpretation, the n_type field is used for the symbol type and visibility.
The patch writes the aux header with an o_vstamp field value of 2 when the visibility is specified in XCOFF32 to make the new XCOFF32 interpretation used.

Reviewed By: DiggerLin, jhenderson

Differential Revision: https://reviews.llvm.org/D128148
2022-07-20 07:09:34 -04:00

22 lines
624 B
LLVM

; RUN: llc -filetype=obj -mtriple=powerpc-ibm-aix-xcoff %s -o - | \
; RUN: llvm-readobj --auxiliary-header - | FileCheck %s
; CHECK: AuxiliaryHeader {
; CHECK-NEXT: Magic: 0x0
; CHECK-NEXT: Version: 0x2
; CHECK-NEXT: Size of .text section: 0x24
; CHECK-NEXT: Size of .data section: 0x14
; CHECK-NEXT: Size of .bss section: 0x0
; CHECK-NEXT: Entry point address: 0x0
; CHECK-NEXT: .text section start address: 0x0
; CHECK-NEXT: .data section start address: 0x24
; CHECK-NEXT: }
@var = hidden global i32 0, align 4
define hidden i32 @fun() {
entry:
%0 = load i32, i32* @var, align 4
ret i32 %0
}