This is an archive of the discontinued LLVM Phabricator instance.

[LLD][COFF] Ignore /kernel flag
ClosedPublic

Authored by pzheng on Jun 20 2022, 6:52 PM.

Details

Summary

There exists some description of the flag from Microsoft, but not sure if
there's more to it. We ignore the flag for now until we find out more about it.

https://docs.microsoft.com/en-us/cpp/build/reference/kernel-create-kernel-mode-binary?view=msvc-170

Diff Detail

Event Timeline

pzheng created this revision.Jun 20 2022, 6:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 6:52 PM
pzheng requested review of this revision.Jun 20 2022, 6:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 6:52 PM
pzheng updated this revision to Diff 438527.Jun 20 2022, 6:54 PM

minor change

hans added a comment.Jun 21 2022, 6:16 AM

Do you have a use case for this, or have you checked that it works?

I'm not familiar with this flag, but I suspect there could be more to it (for example, do any PE headers change).

If we're not sure that this is everything that's required, I think it's better to leave the flag as unsupported.

I was just also about to comment that it seems like it's just ignoring the incremental flag and that it has to be more to it?

Thanks for the comments, @hans and @thieta! I haven't done any verification of anything built with this flag yet. So, I am not very confident whether there's more to it than what's documented by Microsoft. I guess, for now, we'll just ignore the flag. At some point, I'll probably get a chance to do more testing on this and maybe we can revisit it then.

pzheng updated this revision to Diff 438768.Jun 21 2022, 11:11 AM

Ignore the flag

pzheng retitled this revision from [LLD][COFF] Support /kernel flag to [LLD][COFF] Ignore /kernel flag.Jun 21 2022, 11:12 AM
pzheng edited the summary of this revision. (Show Details)
thieta accepted this revision.Jun 21 2022, 11:20 AM

Lgtm. Wait with merge until Hans checks it as well.

This revision is now accepted and ready to land.Jun 21 2022, 11:20 AM

Thanks, @thieta! @hans, please let me know if there is anything I need to address.

hans accepted this revision.Jul 1 2022, 2:52 AM

lgtm

This revision was automatically updated to reflect the committed changes.