[AMDGPU] Corrected directive to use for ELF weak refs

WeakRefDirective should specify a directive to declare "a global as being a weak undefined symbol".
The directive used by AMDGPU was incorrect - ".weakref" was intended for other purposes.
The correct directive is ".weak" and it is already defined as default for ELF.
So the redefinition was removed.

Reviewers: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D87762
This commit is contained in:
Dmitry Preobrazhensky 2020-09-16 18:51:26 +03:00
parent f0546173fa
commit 06d058afec
2 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT,
HasAggressiveSymbolFolding = true;
COMMDirectiveAlignmentIsInBytes = false;
HasNoDeadStrip = true;
WeakRefDirective = ".weakref\t";
//===--- Dwarf Emission Directives -----------------------------------===//
SupportsDebugInformation = true;
DwarfRegNumForCFI = true;

View File

@ -13,6 +13,8 @@ define amdgpu_kernel void @test() {
ret void
}
@weak_global = extern_weak addrspace(1) global i32
; ASM: .type linkonce_odr_global_program,@object
; ASM: .section .bss,#alloc,#write
; ASM: .weak linkonce_odr_global_program
@ -48,3 +50,5 @@ define amdgpu_kernel void @test() {
; ASM: external_readonly:
; ASM: .long 0
; ASM: .size external_readonly, 4
; ASM: .weak weak_global