[PATCH] D54421: [CodeView] RelocPtr points to little-endian data

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 13:32:49 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL347349: [CodeView] RelocPtr points to little endian data. (authored by zturner, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D54421?vs=173647&id=174830#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D54421

Files:
  lld/trunk/COFF/PDB.cpp
  llvm/trunk/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h


Index: lld/trunk/COFF/PDB.cpp
===================================================================
--- lld/trunk/COFF/PDB.cpp
+++ lld/trunk/COFF/PDB.cpp
@@ -1210,7 +1210,7 @@
   // Rewrite string table indices in the Fpo Data and symbol records to refer to
   // the global PDB string table instead of the object file string table.
   for (DebugFrameDataSubsectionRef &FDS : NewFpoFrames) {
-    const uint32_t *Reloc = FDS.getRelocPtr();
+    const ulittle32_t *Reloc = FDS.getRelocPtr();
     for (codeview::FrameData FD : FDS) {
       FD.RvaStart += *Reloc;
       FD.FrameFunc =
Index: llvm/trunk/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
===================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamReader.h"
+#include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
@@ -31,10 +32,10 @@
   FixedStreamArray<FrameData>::Iterator begin() const { return Frames.begin(); }
   FixedStreamArray<FrameData>::Iterator end() const { return Frames.end(); }
 
-  const uint32_t *getRelocPtr() const { return RelocPtr; }
+  const support::ulittle32_t *getRelocPtr() const { return RelocPtr; }
 
 private:
-  const uint32_t *RelocPtr = nullptr;
+  const support::ulittle32_t *RelocPtr = nullptr;
   FixedStreamArray<FrameData> Frames;
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54421.174830.patch
Type: text/x-patch
Size: 1589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181120/569cbeef/attachment.bin>


More information about the llvm-commits mailing list