[Openmp-commits] [PATCH] D155886: [OpenMP][Plugin] Update the global address calculation

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jul 23 08:08:06 PDT 2023


tianshilei1992 updated this revision to Diff 543286.
tianshilei1992 added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155886/new/

https://reviews.llvm.org/D155886

Files:
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp


Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
===================================================================
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
@@ -53,8 +53,8 @@
 
   // The global's address is computed as the image begin + the ELF section
   // offset + the ELF symbol value.
-  ImageGlobal.setPtr(
-      advanceVoidPtr(Image.getStart(), Section.sh_offset + Symbol.st_value));
+  ImageGlobal.setPtr(advanceVoidPtr(
+      Image.getStart(), Section.sh_offset - Section.sh_addr + Symbol.st_value));
 
   // Set the global's size.
   ImageGlobal.setSize(Symbol.st_size);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155886.543286.patch
Type: text/x-patch
Size: 740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230723/6bf38522/attachment.bin>


More information about the Openmp-commits mailing list