[PATCH] D117933: [ELF] Don't consider directories of the same name as libraries

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 15:23:49 PST 2022


phosek created this revision.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: MaskRay.
phosek requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When processing linker scripts or dependent libraries, if there's a
directory of the same name as the library being searched for, either in
the current directory or earlier in the search order, LLD will try to
open it and report an error. This is because LLD currently uses file
existence check. While we could expand this check and verify that the
file type is not a directory, such a check could be susceptible to
races. Rather, we always try to open the file, but silently ignore the
error and continue with other cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117933

Files:
  lld/ELF/Driver.cpp
  lld/ELF/Driver.h
  lld/ELF/DriverUtils.cpp
  lld/ELF/InputFiles.cpp
  lld/ELF/InputFiles.h
  lld/ELF/ScriptParser.cpp
  lld/test/ELF/deplibs-dir.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117933.402122.patch
Type: text/x-patch
Size: 14824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220121/9621e4de/attachment.bin>


More information about the llvm-commits mailing list