Skip to content
Commit 1ebc8ed7 authored by Rui Ueyama's avatar Rui Ueyama
Browse files

ELF: Add wildcard pattern matching to SECTIONS linker script command.

Each rule in SECTIONS commands is something like ".foo *(.baz.*)",
which instructs the linker to collect all sections whose name matches
".baz.*" from all files and put them into .foo section.

Previously, we didn't recognize the wildcard character. This patch
adds that feature.

Performance impact is a bit concerning because a linker script can
contain hundreds of SECTIONS rules, and doing pattern matching against
each rule would be too expensive. We could merge all patterns into
single DFA so that it takes O(n) to the input size. However, it is
probably too much at this moment -- we don't know whether the
performance of pattern matching matters or not. So I chose to
implement the simplest algorithm in this patch. I hope this simple
pattern matcher is sufficient.

llvm-svn: 260745
parent 595c1377
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment