[PATCH] D125523: [ELF] Disallow input section description without a filename
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 10:56:29 PDT 2022
MaskRay added a comment.
In D125523#3510971 <https://reviews.llvm.org/D125523#3510971>, @peter.smith wrote:
> LGTM. GNU ld documentation for InputSection https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html states that An input section description consists of a file name optionally followed by a list of section names in parentheses. I couldn't find anything about which characters in filenames were not permitted. It looks like both lld and gnu ld can handle these when quoted. For example for a file "file(o)" we can write `{ "file(o)"(.text) }` I do hope parentheses in filenames are not common though. Maybe worth a test case if we've not got one already.
Most printable characters are accepted in the filename pattern, with exception to `()#%`. Seems that disallowing `( and `)` is sufficient for us to disambiguate the grammar.
Parentheses in filenames are accepted if quoted. Let me check whether there is an existing test...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125523/new/
https://reviews.llvm.org/D125523
More information about the llvm-commits
mailing list