This is an archive of the discontinued LLVM Phabricator instance.

lld-link: Implement /swaprun: flag
ClosedPublic

Authored by thakis on Apr 24 2019, 7:16 AM.

Details

Summary

r191276 added this to old LLD, but it never made it to new LLD -- except that the flag was in Options.td, so it was silently ignored. I figured it should be easy to implement, so I did that instead of removing the flags from Options.td.

I then discovered that link.exe also supports comma-separated lists of 'cd' and 'net', which made the parsing code a bit annoying.

The Alias technique in Options.td is to get nice help output.

Diff Detail

Repository
rL LLVM

Event Timeline

thakis created this revision.Apr 24 2019, 7:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2019, 7:16 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
thakis updated this revision to Diff 196448.Apr 24 2019, 7:16 AM

attach the right diff file

ruiu accepted this revision.Apr 25 2019, 4:35 AM

LGTM

I guess that you are adding this for completeness, or are they still in use? I haven't used CD-ROMs for like 10 years now, but maybe /swaprun:net is still relevant.

This revision is now accepted and ready to land.Apr 25 2019, 4:35 AM

LGTM

I guess that you are adding this for completeness, or are they still in use? I haven't used CD-ROMs for like 10 years now, but maybe /swaprun:net is still relevant.

Yes, just for completeness.

It might actually be useful to have a swaprun:always because then we could overwrite .exe files that still run (since they run from a different location then), but that'd require loader support :)

This revision was automatically updated to reflect the committed changes.