[llvm] [extract_symbols.py] Add DATA flag for non-function export symbols (PR #101951)

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 03:38:18 PST 2024


john-brawn-arm wrote:

Looking at the documentation in https://learn.microsoft.com/en-us/cpp/build/importing-and-exporting?view=msvc-170 it looks like DATA only has an effect when a .def file is used for importing a symbol, but the output of extract_symbols.py is only used to define which symbols to import, so I don't think this patch will have any effect.

I also tried building a simple test dll:
tmp.c:
```
int var = 10;
int fn() {
  return ++var;
}
```
tmp.def:
```
LIBRARY tmp
EXPORTS
 fn
 var DATA
```
Built with `cl tmp.c /LD /link /DEF:tmp.def`, the `dumpbin /exports tmp.dll` output is the same whether or not DATA is present on var, so it looks like it has no effect.

Do you have an example where this change would have an effect?

https://github.com/llvm/llvm-project/pull/101951


More information about the llvm-commits mailing list