[PATCH] D38760: [LLD] [COFF] Add support for automatically exporting all symbols

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 12:41:13 PDT 2017


ruiu added inline comments.


================
Comment at: COFF/Driver.cpp:552
+// when exporting all global symbols for MinGW.
+static StringSet<> getExportExcludeSymbols() {
+  std::vector<std::string> V = {
----------------
Since what this function constructs is a set containing predetermined elements, it is probably better to construct it directly, as it is more obvious what we are doing.

  static StringSet<> getExportExcludeSymbols() {
    if (Config->Machine == I386)
      return {"__NULL_IMPORT_DESCRIPTOR",
              "__pei386_runtime_relocator",
              "_do_pseudo_reloc",
              "_impure_ptr",
              "__impure_ptr",
              "__fmode",
              "_environ",
              "___dso_handle",
              // These are the MinGW names that differ from the standard
              // ones (lacking an extra underscore).
              "_DllMain at 12",
              "_DllEntryPoint at 12",
              "_DllMainCRTStartup at 12"};
  
    return {"_NULL_IMPORT_DESCRIPTOR",
            "_pei386_runtime_relocator",
            "do_pseudo_reloc",
            "impure_ptr",
            "_impure_ptr",
            "_fmode",
            "environ",
            "__dso_handle",
            "DllMain",
            "DllEntryPoint",
            "DllMainCRTStartup"};
  }



https://reviews.llvm.org/D38760





More information about the llvm-commits mailing list