[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:37:50 PST 2021


int3 accepted this revision.
int3 added inline comments.
This revision is now accepted and ready to land.


================
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
+
----------------
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


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