[lld] [lld] lld/ELF/Writer.cpp: write directly to outs when output is "-" (PR #72061)

Keith Winstein via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 23:21:29 PST 2023


keithw wrote:

Yes, unfortunately that writes to llvm::outs(), i.e. the `STDOUT_FILENO` file descriptor.

This PR makes it write to `lld::outs()`, the `stdoutOS` argument to `lld::elf::link()`. We're using this (and hopefully others might benefit) so we can use the LLD ELF driver as a library where the object gets written to an in-memory `raw_string_ostream`.

https://github.com/llvm/llvm-project/pull/72061


More information about the llvm-commits mailing list