This linker script parser and evaluator is powerful enough to read
Linux's libc.so, which is (despite its name) a linker script that
contains OUTPUT_FORMAT, GROUP and AS_NEEDED directives.
The parser implemented in this patch is a recursive-descendent one.
It does *not* construct an AST but consumes directives in place and
sets the results to the Config object, like Driver is doing. This
should be very fast since less objects are allocated, and this is
also more readable.
This opens a file, mmaps it, calls identify_magic and then drops everything and returns a bool :-(
Could this be reorganized into something like
addInptsForArg(StringRef Arg) {
}
That way we only open, mmap and identify each file once.