mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 19:26:05 +00:00
[AMDGPU][MC] Generate relative relocations for allocatable (more particularly, eh_frame) sections
Reviewed By: scott.linder Differential Revision: https://reviews.llvm.org/D142453
This commit is contained in:
parent
f1837c7074
commit
c4a250ecea
@ -74,9 +74,9 @@ unsigned AMDGPUELFObjectWriter::getRelocType(MCContext &Ctx,
|
||||
return ELF::R_AMDGPU_REL32;
|
||||
case FK_Data_4:
|
||||
case FK_SecRel_4:
|
||||
return ELF::R_AMDGPU_ABS32;
|
||||
return IsPCRel ? ELF::R_AMDGPU_REL32 : ELF::R_AMDGPU_ABS32;
|
||||
case FK_Data_8:
|
||||
return ELF::R_AMDGPU_ABS64;
|
||||
return IsPCRel ? ELF::R_AMDGPU_REL64 : ELF::R_AMDGPU_ABS64;
|
||||
}
|
||||
|
||||
if (Fixup.getTargetKind() == AMDGPU::fixup_si_sopp_br) {
|
||||
|
16
llvm/test/MC/AMDGPU/cfi_reloc.s
Normal file
16
llvm/test/MC/AMDGPU/cfi_reloc.s
Normal file
@ -0,0 +1,16 @@
|
||||
// RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu=kaveri -show-encoding %s | llvm-readobj -r - | FileCheck %s
|
||||
|
||||
// CHECK: Relocations [
|
||||
// CHECK: .rel.eh_frame {
|
||||
// CHECK: R_AMDGPU_REL32 .text
|
||||
// CHECK: }
|
||||
// CHECK: .rel.debug_frame {
|
||||
// CHECK: R_AMDGPU_ABS64 .text
|
||||
// CHECK: }
|
||||
// CHECK: ]
|
||||
|
||||
kernel:
|
||||
.cfi_startproc
|
||||
.cfi_sections .debug_frame, .eh_frame
|
||||
s_endpgm
|
||||
.cfi_endproc
|
Loading…
x
Reference in New Issue
Block a user