[PATCH] D134462: [LLD][COFF] Fix absolute & synthetic symbols in COFF symbol table

Alvin Wong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 11:17:45 PDT 2022


alvinhochun created this revision.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Absolute symbol should contain its absolute value, but LLD had been
writing its RVA instead. Write its VA instead.

DefinedSynthetic were being skipped before with the reasoning "Relative
symbols are unrepresentable in a COFF symbol table", which is only true
if the RVA points to outside of a section. LLD does create synthetic
symbols which points to actual data chunks (typical for symbols embedded
into the load config directory). Write these symbols to the COFF symbol
table too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134462

Files:
  lld/COFF/Writer.cpp
  lld/test/COFF/symtab-DefinedSynthetic.s
  lld/test/COFF/symtab.test
  lld/test/COFF/wrap-i386.s
  lld/test/COFF/wrap.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134462.462246.patch
Type: text/x-patch
Size: 5213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220922/4e9a00d7/attachment.bin>


More information about the llvm-commits mailing list