This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH, COMMIT]: Allow ^ and ! inside linker scripts regexps
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 31 Aug 2010 17:07:49 +0100
- Subject: [PATCH, COMMIT]: Allow ^ and ! inside linker scripts regexps
Hi Guys,
I am applying the patch below to allow the caret (^) and exclamation
point (!) characters to be used inside linker script regular
expressions. The code in fnmatch() (in libiberty) supports them, but
the linker's parser was not accepting them. Thus expressions like:
.text: { *(.text.[^.]* )
would not work.
ld/ChangeLog
2010-08-31 Nick Clifton <nickc@redhat.com>
* ldlex.l (WILDCHAR): Add the caret and exclamation point
characters, so that they can be used inside regexps.
Index: ld/ldlex.l
===================================================================
RCS file: /cvs/src/src/ld/ldlex.l,v
retrieving revision 1.46
diff -c -3 -p -r1.46 ldlex.l
*** ld/ldlex.l 10 Feb 2010 19:48:16 -0000 1.46
--- ld/ldlex.l 31 Aug 2010 15:58:07 -0000
*************** CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$
*** 99,105 ****
FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
! WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
WHITE [ \t\n\r]+
NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
--- 99,105 ----
FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
! WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*\^\!]
WHITE [ \t\n\r]+
NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]