[COFF] Omit automatically imported symbols from the symbol table
authorMartin Storsjo <martin@martin.st>
Mon, 5 Aug 2019 11:57:00 +0000 (11:57 +0000)
committerMartin Storsjo <martin@martin.st>
Mon, 5 Aug 2019 11:57:00 +0000 (11:57 +0000)
commita0cbe16ed5197c2f882e44b0c758576ae409124b
treecdbf8e60266811a0360cc0abb04af71cb84bf34b
parent5a7e1e978f04f06a63c70107d6b2d42cc4f7b19d
[COFF] Omit automatically imported symbols from the symbol table

These symbols actually point to the symbol's IAT entry, which
obviously is different from the symbol itself (which is imported
from a different module and doesn't exist in the current one).

Omitting this symbol helps gdb inspect automatically imported
symbols, see https://sourceware.org/bugzilla/show_bug.cgi?id=24574
for discussion on the matter.

Surprisingly, those extra symbols don't seem to be an issue for
gdb when the sources have been built with clang, only with gcc.
The actual logic in gdb that this depends on still is unknown, but
omitting these symbols from the symbol table is the right thing to
do in any case.

Differential Revision: https://reviews.llvm.org/D65727

llvm-svn: 367836
lld/COFF/Writer.cpp
lld/test/COFF/autoimport-gnu-implib.s
lld/test/COFF/autoimport-x86.s