[PATCH] D97610: [lld-macho] check minimum header length when opening linkable input files

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 27 13:39:06 PST 2021


int3 added inline comments.


================
Comment at: lld/test/MachO/rename.s:17
+# BAD1: lld: error: invalid name for segment or section: -o
+# BAD1: lld: error: file is too small to contain a linkable-file header: /dev/null
+
----------------
int3 wrote:
> gkm wrote:
> > int3 wrote:
> > > we shouldn't be emitting this message if `/dev/null` is an output file parameter
> > The `-o` was swallowed by `-rename_section` because of a missing sub arg. Therefore, it is interpreted as an input parameter.
> ah I see. IMO it's kind of weird to test this zero-size-file edge case in `rename.s`, since it's only tangentially related to renaming. I'd prefer we create a separate test file under `test/invalid` for it
(also, test seems to be failing on Windows since there isn't a real /dev/null there. Looks like they create a fake temporary file instead)



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97610/new/

https://reviews.llvm.org/D97610



More information about the llvm-commits mailing list