Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: src/IceAssembler.cpp

Issue 1241313002: Fix --filetype=iasm non-pc-rel fixup offsets (double counted). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceELFSection.h » ('j') | src/IceELFSection.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssembler.cpp
diff --git a/src/IceAssembler.cpp b/src/IceAssembler.cpp
index 48db0363916ca2e9b874d9ab78a7c20a97fcb419..5c1760b46313aa6c9b26af6e6406ec0948f7ee81 100644
--- a/src/IceAssembler.cpp
+++ b/src/IceAssembler.cpp
@@ -132,6 +132,10 @@ void Assembler::emitIASBytes(GlobalContext *Ctx) const {
Str << "\n";
}
Str << "\t.long ";
+ // For PCRel fixups, we write the pc-offset from a symbol into the Buffer
+ // (e.g., -4), but we don't represent that in the fixup's offset.
+ // Otherwise the fixup holds the true offset, and so does the Buffer.
+ // Just load the offset from the buffer.
NextFixup->emit(Ctx, Buffer.load<RelocOffsetT>(NextFixupLoc));
if (fixupIsPCRel(NextFixup->kind()))
Str << " - .";
« no previous file with comments | « no previous file | src/IceELFSection.h » ('j') | src/IceELFSection.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698