m4b / m4b/goblin

Unrecognised COFF object format when using cl.exe /GL

Open
#194 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.5k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

A bit of the history at https://github.com/gimli-rs/object/issues/154 and motivation at https://github.com/indygreg/PyOxidizer/pull/183

The default Python extension C flags on Windows with cl.exe includes /GL (Whole Program Optimization). The docs say

.obj files produced with /GL will not be available to such linker utilities as EDITBIN and DUMPBIN.

When that is used, the .obj format is very strange. Omit the option, and the usual .obj format is used and goblin and object process it wonderfully.

As I can hack the code involved, omitting that flag is possible, so this doesnt block us, but it would be nice to have the optimisations, and have one less hack. Anyways, I can proceed, so thanks very much for a workable library.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked gimli-rs/object issue and PyOxidizer pull request for prior context on /GL-generated COFF objects. Inspect goblin's COFF parsing path, then verify that .obj files produced with /GL are recognized while ordinary .obj files continue to parse correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.