changeset 16631:0e34c7fbd288

[SPARC] Add relocation info for constant reference to constant section
author Stefan Anzinger <stefan.anzinger@gmail.com>
date Thu, 17 Jul 2014 17:16:39 -0700
parents 29ac953be681
children d89cafcc398b
files src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp	Wed Jul 16 08:50:11 2014 -0700
+++ b/src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp	Thu Jul 17 17:16:39 2014 -0700
@@ -61,9 +61,11 @@
   address pc = _instructions->start() + pc_offset;
   address const_start = _constants->start();
   jint offset = DataSectionReference::offset(data);
+  address dest = _constants->start() + offset;
 
-  NativeMovRegMem* load = nativeMovRegMem_at(pc);
-  load->add_offset_in_bytes((long)const_start+offset);
+  _instructions->relocate(pc + NativeMovConstReg::sethi_offset, internal_word_Relocation::spec((address) dest));
+  _instructions->relocate(pc + NativeMovConstReg::add_offset, internal_word_Relocation::spec((address) dest));
+  TRACE_graal_3("relocating at %p with destination at %p (%d)", pc, dest, offset);
 }
 
 void CodeInstaller::pd_relocate_CodeBlob(CodeBlob* cb, NativeInstruction* inst) {