[PATCH] D55951: [LLD][COFF] Fix file/line retrieval when a undefined symbol is to be printed

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 12:55:25 PST 2018


aganea created this revision.
aganea added reviewers: pcc, rnk.

Previously, if a symbol `function` was undefined, LLD was trying to print its referenced locations, and was failing with two different errors:

1. `Stream Error: The specified offset is invalid for the current stream`
2. `CodeView Error: There are no records`

Nothing else was printed.

The fix covers these two cases: one is a `Lines` subsection without anything in it; the other is when the provided `Addr` param is <= Line.Offset.

The original OBJ was compiled with Clang. The provided test is simply a reduction of our case.
The source of these two bugs seems to lie in how Clang emits `Lines` subsections; however I wanted to ensure LLD handles these correctly first.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D55951

Files:
  COFF/PDB.cpp
  test/COFF/line-error.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55951.179131.patch
Type: text/x-patch
Size: 7345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181220/f0c580f0/attachment.bin>


More information about the llvm-commits mailing list