This is an archive of the discontinued LLVM Phabricator instance.

[ms] [llvm-ml] Create the @feat.00 symbol, and populate it appropriately
ClosedPublic

Authored by epastor on Sep 28 2020, 2:22 PM.

Details

Summary

@feat.00 is a bitfield read by Microsoft-style linkers, and is required to signal (e.g.) /safeseh support on 32-bit systems.

Diff Detail

Event Timeline

epastor created this revision.Sep 28 2020, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2020, 2:22 PM
epastor requested review of this revision.Sep 28 2020, 2:22 PM
rnk added inline comments.Sep 28 2020, 4:40 PM
llvm/tools/llvm-ml/llvm-ml.cpp
372

This looks like the first instance of C++14 binary literals in LLVM non-test C++ source code. In theory, C++14 support is required, but if I were you I'd prefer not to be the guinea pig.

380–381

Can getOrCreateSymbol ever return null? The implementation suggests that it can't. Is this branch meant to avoid redefining @feat.00 if it is already set?

epastor updated this revision to Diff 295069.Sep 29 2020, 11:35 AM

Address feedback: remove an unnecessary branch, and avoid using a C++14 binary literal just in case.

epastor marked 2 inline comments as done.Sep 29 2020, 11:36 AM
epastor added inline comments.
llvm/tools/llvm-ml/llvm-ml.cpp
372

Switched, thanks.

380–381

I think I was assuming it could be null when I wrote this. Removed the unnecessary branch.

rnk accepted this revision.Sep 29 2020, 11:49 AM

lgtm

This revision is now accepted and ready to land.Sep 29 2020, 11:49 AM
epastor updated this revision to Diff 295101.Sep 29 2020, 1:16 PM
epastor marked 2 inline comments as done.

Rebase on parent