OSDN Git Service

[ELF] Support multiple SORT in an input section description
authorFangrui Song <i@maskray.me>
Thu, 12 Nov 2020 16:46:53 +0000 (08:46 -0800)
committerFangrui Song <i@maskray.me>
Thu, 12 Nov 2020 16:46:53 +0000 (08:46 -0800)
commit2a9aed0e8b538955f38f036bd34ea79adfce2ad7
treea419eaa7a8fbffe445f16e498ce14a497ed9cb48
parent170e45ae186b3eed16898db933c94a85ac623933
[ELF] Support multiple SORT in an input section description

The second `SORT` in `*(SORT(...) SORT(...))` is incorrectly parsed as a file pattern.
Fix the bug by stopping at `SORT*` in `readInputSectionsList`.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D91180
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/sort2.s
lld/test/ELF/linkerscript/wildcards.s