Skip to content

Commit 7d5c33c

Browse files
author
Solid Snake
committed
should be alignment that matches psylink now
1 parent 57486c4 commit 7d5c33c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/psyq-obj-parser/psyq-obj-parser.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,11 @@ std::unique_ptr<PsyqLnkFile> PsyqLnkFile::parse(PCSX::File* file, bool verbose)
416416

417417
// Each entry is aligned to the size of the type after testing the output of mixed .bss and sbss with psyq GCC 2.7.2
418418
// this works the same way as modern GCC.
419-
auto align = symbol->size - 1;
419+
auto sizeToUse = symbol->size;
420+
if (sizeToUse > section->alignment) {
421+
sizeToUse = section->alignment;
422+
}
423+
auto align = sizeToUse - 1;
420424
section->uninitializedOffset += align;
421425
section->uninitializedOffset &= ~align;
422426
symbol->offset = section->uninitializedOffset;

0 commit comments

Comments
 (0)