[PATCH] D134140: [LLD][COFF] Set OrdinalBase to 1 for export table

Alvin Wong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 18 11:09:18 PDT 2022


alvinhochun created this revision.
alvinhochun added reviewers: rnk, mstorsjo.
Herald added subscribers: ormris, steven_wu, hiraditya.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Before this, LLD sets OrdinalBase to 0, which deviates from usual
practices. This technically would allow LLD to export a symbol using
ordinal 0, however LLD never use export ordinal 0, which results in
binaries with export tables always having an empty export at ordinal 0.

This change makes LLD set OrdinalBase to 1 and not create the empty
export with ordinal 0, which makes its behaviour more in line with both
the MSVC linker and the GNU linker.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134140

Files:
  lld/COFF/DLL.cpp
  lld/test/COFF/directives.s
  lld/test/COFF/dll.test
  lld/test/COFF/exclude-symbols-embedded.s
  lld/test/COFF/exclude-symbols.s
  lld/test/COFF/export-all.s
  lld/test/COFF/export-arm64.yaml
  lld/test/COFF/export-armnt.yaml
  lld/test/COFF/export-exe.test
  lld/test/COFF/export.test
  lld/test/COFF/export32.test
  lld/test/COFF/icf-xdata.s
  lld/test/COFF/imports-gnu-autoexport.s
  lld/test/COFF/includeoptional-export.s
  lld/test/COFF/lto-icf.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134140.461084.patch
Type: text/x-patch
Size: 12254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220918/9e604122/attachment.bin>


More information about the llvm-commits mailing list