)]}'
{
  "commit": "f550eba39c32b7aa7484869a82b4ba74b8515bf5",
  "tree": "da6840c6c5e04a48f7f7cf9d8d73e1037db02515",
  "parents": [
    "b83dd55eb6fe366b572c58e805a509bb8c5479fc"
  ],
  "author": {
    "name": "Rui Ueyama",
    "email": "ruiu@google.com",
    "time": "Thu Apr 24 20:12:01 2014 +0000"
  },
  "committer": {
    "name": "Rui Ueyama",
    "email": "ruiu@google.com",
    "time": "Thu Apr 24 20:12:01 2014 +0000"
  },
  "message": "[PECOFF] Define implicit symbols for exported ones.\n\nThis patch is to fix a compatibility issue with MSVC link.exe as to\nuse of dllexported symbols inside DLL.\n\nA DLL exports two symbols for a function. One is non-decorated one,\nand the other is with __imp_ prefix. The former is a function that\nyou can directly call, and the latter is a pointer to the function.\nThese dllexported symbols are created by linker for programs that\nlink against the DLL. So, I naturally believed that __imp_ symbols\nbecome available when you once create a DLL and link against it, but\nthey don\u0027t exist until then. And that\u0027s not true.\n\nMSVC link.exe is smart enough to allow users to use __imp_ symbols\nlocally. That is, if a symbol is specified with /export option, it\nimplicitly creates a new symbol with __imp_ prefix as a pointer to\nthe exported symbol. This feature allows the following program to\nbe linked and run, although _imp__hello is not defined in this code.\n\n  #include \u003cstdio.h\u003e\n\n  __declspec(dllexport)\n  void hello(void) { printf(\"Hello\\n\"); }\n\n  extern void (*_imp__hello)(void);\n\n  int main() {\n    _imp__hello();\n    return 0;\n  }\n\nMSVC link.exe prints out the following warning when linking it.\n\n  LNK4217: locally defined symbol _hello imported in function _main\n\nUsing __imp_ symbols locally is I think not a good coding style. One\nshould just take an address using \"\u0026\" operator rather than appending\n__imp_ prefix. However, there are programs in the wild that depends\non this link.exe\u0027s behavior, so we need this feature.\n\nllvm-svn: 207141\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "248aaabbef43fb28ee0d4dcefadeb2090bd8a7c7",
      "old_mode": 33188,
      "old_path": "lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h",
      "new_id": "5b9464ba64481f59ca4fe1c47b70793fcff829a1",
      "new_mode": 33188,
      "new_path": "lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h"
    }
  ]
}
