[PATCH] D33880: COFF: Introduce LD shim around LINK

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 12:56:24 PDT 2017


mstorsjo added inline comments.


================
Comment at: lld/lib/Shim/COFFLdShim.cpp:231
+  // handle __image_base__
+  LinkArgs.push_back("/alternatename:__image_base__=__ImageBase");
+  return coff::link(LinkArgs);
----------------
To get this working on i386, I had to do this modification:

```
  auto M = Args.getLastArg(OPT_m);
  if (M && StringRef(M->getValue()) == "i386pe")
    LinkArgs.push_back("/alternatename:__image_base__=___ImageBase");
  else
    LinkArgs.push_back("/alternatename:__image_base__=__ImageBase");
```


Repository:
  rL LLVM

https://reviews.llvm.org/D33880





More information about the llvm-commits mailing list