[cxx-abi-dev] Mangling string constants

Richard Smith richardsmith at googlers.com
Fri Feb 20 21:22:32 UTC 2015


On 19 February 2015 at 23:44, Dennis Handly <dhandly at cup.hp.com> wrote:

> >From: David Majnemer <david.majnemer at gmail.com>
> >It seems that the ABI has no means to mangle the contents of string
> constants.
>
> Why is that needed?
>

See the linked message:
http://sourcerytools.com/pipermail/cxx-abi-dev/2012-January/000032.html

This is about string literals in signatures, where we need to mangle the
contents because the contents can be observed through evaluation of a
value-dependent constant expression.

The current scheme is to just number the constants in order.
> And that handles both strings and wide strings.
> And by the ODR rule the inlines must be the same.
>
> >the proposal doesn't specify how to mangle UTF-16/UTF-32 string literals.
> >Such a mangling would have to specify the endianness used to encode the
> code
> >points.
>
> Again why?  We just need mangling to make sure they match addresses.
> Do we really to check code enforcement?
> We don't do for narrow vs wide.
>
> >I am trying to figure out how we should mangle the string constant in:
> >struct X {
> >  static constexpr const char *p = "foo";
> >};
>
> I thought this was defined?


Apparently not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20150220/2b4ef711/attachment.html>


More information about the cxx-abi-dev mailing list