https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122472
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Yong <[email protected]>: https://gcc.gnu.org/g:f401c2b735c106d7b5b3f2e69358e520c780ad4c commit r16-5052-gf401c2b735c106d7b5b3f2e69358e520c780ad4c Author: Peter Damianov <[email protected]> Date: Thu Nov 6 00:14:44 2025 +0000 libiberty: Add BigObj COFF support for LTO on Windows targets [PR122472] This patch adds support for the BigObj COFF object file format to libiberty's simple-object-coff.c. BigObj extends regular COFF to support a 32-bit section count. BigObj differs from COFF in a few ways: * A different header structure * 32-bit section counts instead of 16-bit * 32-bit symbol section numbers instead of 16-bit * 20-byte symbols instead of 18-byte symbols (due to the extended section numbers) For a more detailed summary, read my blog post on this subject: https://peter0x44.github.io/posts/bigobj_format_explained/ libiberty/ChangeLog: PR target/122472 * simple-object-coff.c (struct external_filehdr_bigobj): New structure for BigObj file header. (bigobj_magic): New constant for BigObj magic bytes. (struct external_syment_bigobj): New structure for BigObj 20-byte symbol table entries. (union external_auxent_bigobj): New union for BigObj 20-byte auxiliary symbol entries. (struct simple_object_coff_read): Add is_bigobj flag and make nscns 32-bit to support both formats. (struct simple_object_coff_attributes): Add is_bigobj flag. (simple_object_coff_match): Add BigObj format detection. (simple_object_coff_read_strtab): Use format-specific symbol size when calculating string table offset. (simple_object_coff_attributes_merge): Check is_bigobj flag. (simple_object_coff_write_filehdr_bigobj): New function. (simple_object_coff_write_to_file): Add logic for writing BigObj vs regular COFF format with appropriate symbol and auxiliary entry structures. Signed-off-by: Peter Damianov <[email protected]> Signed-off-by: Jonathan Yong <[email protected]>
