[PATCH] D149611: [LLD][COFF] Allow overwriting directives exports with cmd-line exports

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 11:34:41 PDT 2023


aganea added a comment.

I'm not quite sure how the parenting works in Phabricator I might be doing things wrong.



================
Comment at: lld/COFF/DLL.cpp:558
 public:
-  ExportDirectoryChunk(int i, int j, Chunk *d, Chunk *a, Chunk *n, Chunk *o)
-      : maxOrdinal(i), nameTabSize(j), dllName(d), addressTab(a), nameTab(n),
-        ordinalTab(o) {}
+  ExportDirectoryChunk(int i, int j, int k, Chunk *d, Chunk *a, Chunk *n,
+                       Chunk *o)
----------------
alvinhochun wrote:
> Can we at least have a more descriptive name for the new argument for `baseOrdinal`?
Good point, I noticed that and forgot to change it.


================
Comment at: lld/COFF/DLL.cpp:846
+  }
+  assert(baseOrdinal >= 1);
 
----------------
alvinhochun wrote:
> Can you check whether MSVC link.exe allows using export ordinal 0?
It does not. This links suggests it must start at 1: https://learn.microsoft.com/en-us/cpp/build/reference/export-exports-a-function?view=msvc-170
```
> link.exe ... /EXPORT:foo, at 0
LINK : fatal error LNK1119: invalid ordinal number '0'
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149611/new/

https://reviews.llvm.org/D149611



More information about the llvm-commits mailing list