[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:47 PST 2024
================
@@ -254,12 +310,20 @@ bool XCOFFWriter::initFileHeader(uint64_t CurrentOffset) {
// Calculate SymbolTableOffset for the file header.
if (InitFileHdr.NumberOfSymTableEntries) {
+ if (Obj.Header.SymbolTableOffset) {
+ if (CurrentOffset > Obj.Header.SymbolTableOffset) {
+ ErrOverwrite(CurrentOffset, Obj.Header.SymbolTableOffset,
+ "SymbolTableOffset");
+ return false;
+ }
+ CurrentOffset = Obj.Header.SymbolTableOffset;
+ }
InitFileHdr.SymbolTableOffset = CurrentOffset;
CurrentOffset +=
InitFileHdr.NumberOfSymTableEntries * XCOFF::SymbolTableEntrySize;
if (CurrentOffset > MaxRawDataSize) {
- ErrHandler("maximum object size of" + Twine(MaxRawDataSize) +
- "exceeded when writing symbols");
+ ErrHandler("maximum object size of " + Twine(MaxRawDataSize) +
----------------
jh7370 wrote:
Is this tested?
https://github.com/llvm/llvm-project/pull/77620
More information about the llvm-commits
mailing list