[PATCH] D109400: [LLD] Add archive Name to relocaiton overflow printout
Alexander Yermolovich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 7 16:50:05 PDT 2021
ayermolo added a comment.
In D109400#2988243 <https://reviews.llvm.org/D109400#2988243>, @MaskRay wrote:
> Oh, yes. This occasionally tripped over me as well. Perhaps the `getDILineInfo` code path needs the object/archive filename as well.
>
> // First check if we can get desired values from debugging information.
> if (Optional<DILineInfo> info = getFile<ELFT>()->getDILineInfo(this, offset))
> return info->FileName + ":" + std::to_string(info->Line) + ":(" +
> secAndOffset + ")";
>
> - // File->sourceFile contains STT_FILE symbol that contains a
> - // source file name. If it's missing, we use an object file name.
> - std::string srcFile = std::string(getFile<ELFT>()->sourceFile);
> - if (srcFile.empty())
> - srcFile = toString(file);
> + std::string srcFile = toString(file);
>
> I understand that source filename+line number is handy for hand-written assembly, but the `.o` filename is usually needed so that `llvm-readelf -r` on the file can do something useful.
>
> However, with just object filename, the `(function xxx)` part seems less useful.
>
> The code was from D25826 <https://reviews.llvm.org/D25826> by @evgeny777
Ah thanks for providing context. @evgeny777 thoughts?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109400/new/
https://reviews.llvm.org/D109400
More information about the llvm-commits
mailing list