[PATCH] D138763: [dsymutil] fix accidental 32bit truncation in patchFrameInfoForObject
Alessandro Arzilli via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 10:31:43 PST 2022
aarzilli created this revision.
aarzilli added reviewers: avl, clayborg.
Herald added a subscriber: hiraditya.
Herald added a reviewer: JDevlieghere.
Herald added a project: All.
aarzilli requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
patchFrameInfoForObject accidentally truncates FDE addresses to the least significant 32bits, which causes the Go bug: https://github.com/golang/go/issues/25841.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138763
Files:
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/include/llvm/DWARFLinker/DWARFStreamer.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/lib/DWARFLinker/DWARFStreamer.cpp
Index: llvm/lib/DWARFLinker/DWARFStreamer.cpp
===================================================================
--- llvm/lib/DWARFLinker/DWARFStreamer.cpp
+++ llvm/lib/DWARFLinker/DWARFStreamer.cpp
@@ -796,7 +796,7 @@
/// contains the FDE data without the length, CIE offset and address
/// which will be replaced with the parameter values.
void DwarfStreamer::emitFDE(uint32_t CIEOffset, uint32_t AddrSize,
- uint32_t Address, StringRef FDEBytes) {
+ uint64_t Address, StringRef FDEBytes) {
MS->switchSection(MC->getObjectFileInfo()->getDwarfFrameSection());
MS->emitIntValue(FDEBytes.size() + 4 + AddrSize, 4);
Index: llvm/lib/DWARFLinker/DWARFLinker.cpp
===================================================================
--- llvm/lib/DWARFLinker/DWARFLinker.cpp
+++ llvm/lib/DWARFLinker/DWARFLinker.cpp
@@ -1912,7 +1912,7 @@
continue;
}
- uint32_t Loc = Data.getUnsigned(&InputOffset, AddrSize);
+ uint64_t Loc = Data.getUnsigned(&InputOffset, AddrSize);
// Some compilers seem to emit frame info that doesn't start at
// the function entry point, thus we can't just lookup the address
Index: llvm/include/llvm/DWARFLinker/DWARFStreamer.h
===================================================================
--- llvm/include/llvm/DWARFLinker/DWARFStreamer.h
+++ llvm/include/llvm/DWARFLinker/DWARFStreamer.h
@@ -137,7 +137,7 @@
void emitCIE(StringRef CIEBytes) override;
/// Emit an FDE with data \p Bytes.
- void emitFDE(uint32_t CIEOffset, uint32_t AddreSize, uint32_t Address,
+ void emitFDE(uint32_t CIEOffset, uint32_t AddreSize, uint64_t Address,
StringRef Bytes) override;
/// Emit DWARF debug names.
Index: llvm/include/llvm/DWARFLinker/DWARFLinker.h
===================================================================
--- llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -155,7 +155,7 @@
virtual void emitCIE(StringRef CIEBytes) = 0;
/// Emit an FDE with data \p Bytes.
- virtual void emitFDE(uint32_t CIEOffset, uint32_t AddreSize, uint32_t Address,
+ virtual void emitFDE(uint32_t CIEOffset, uint32_t AddreSize, uint64_t Address,
StringRef Bytes) = 0;
/// Emit the .debug_loc contribution for \p Unit by copying the entries from
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138763.478109.patch
Type: text/x-patch
Size: 2358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221127/b7fe76ab/attachment.bin>
More information about the llvm-commits
mailing list