在 2025-10-31 19:53, Richard Biener 写道:
On Fri, Oct 31, 2025 at 12:34 PM Peter0x44 <[email protected]> wrote:

On 2025-10-31 08:40, Richard Biener wrote:
On Fri, Oct 31, 2025 at 2:25 AM Peter Damianov <[email protected]>
wrote:

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/

Thanks for working on this!  Can you state how you tested this?  In
particular,
does LTO now work with BigObj objects (and regular COFF objects still
work
with LTO)?

Thanks,
Richard.

I tested this by linking some programs with LTO using both -Wa,-mbig-obj
and without it.
They all worked.

I'm also building a w64devkit with this patch:
https://github.com/Peter0x44/w64devkit/commit/42452901a1eb31768d3c27d824e8a741125f4c04

w64devkit patches binutils to always emit bigobj, so this should
exercise it well.
Afterwards, I can test if it functions on the windows host too.

The patch is OK.  Please leave the maintainers you CCed the chance
to chime in before pushing though (until early next week).


I have bootstrapped GCC on {i686,x86_64}-w64-mingw32 with `-Wa,-mbig-obj` in {C,CXX}FLAGS, and tried building some C and C++ test programs with `-flto -Wa,-mbig-obj` (which failed without this patch), and seen no issue so far.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to