[llvm] [yaml2obj][XOFF] Update yaml2obj for XCOFF to create valid XCOFF files in more cases. (PR #77620)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 00:47:46 PST 2024
================
@@ -486,10 +543,10 @@ bool XCOFFWriter::writeSectionData() {
XCOFFYAML::Section YamlSec = Obj.Sections[I];
if (YamlSec.SectionData.binary_size()) {
// Fill the padding size with zeros.
- int64_t PaddingSize =
- InitSections[I].FileOffsetToData - (W.OS.tell() - StartOffset);
+ int64_t PaddingSize = (uint64_t)InitSections[I].FileOffsetToData -
+ (W.OS.tell() - StartOffset);
if (PaddingSize < 0) {
- ErrHandler("redundant data was written before section data");
+ ErrHandler("unexpected data was written before section data");
----------------
jh7370 wrote:
Test case?
https://github.com/llvm/llvm-project/pull/77620
More information about the llvm-commits
mailing list