This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Patch to do reorder text and data sections according to a user specified sequence.
Taras Glek <tglek@mozilla.com> writes:
> Seems like matching symbols enmass should be a relatively common
> problem. Perhaps Ian can suggest the best way to do such an operation
> efficiently?
Perhaps someone can, but I can't. Linker scripts face a similar
issue. There I separate the patterns which contain wildcards from the
ones which do not, and create a hash table for the patterns which
don't have wildcards. For the others I just call fnmatch one at a
time.
It would be possible to convert a set of glob expressions into a
single regular expression. However, I can't see any reason why
matching that regular expression would be any faster than calling
fnmatch several times.
Ian