Escape names used in symbol whitelisting regex.

There is the theoretical possibility that symbols may contain special
regex characters like '.' and '$'. This patch ensures all such
characters in symbol names are escaped before they are added to the
whitelisting regex.

	* include/regex.h (escape): New string reference holder
	class. (operator<<): Declaration of std::ostream,
	regex::escape overload.
	* include/regex.cc (operator<<): New std::ostream,
	regex::escape overload that outputs regex-escaped strings.
	* src/abg-tools-utils.cc
	(gen_suppr_spec_from_kernel_abi_whitelists): Make sure any
	special regex characters in symbol names are escaped.

Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
2 files changed