Page MenuHomePhabricator

[ubsan] Only use indirect RTTI in prologues on Darwin

Authored by vsk on Oct 13 2017, 2:50 PM.



Using a layer of indirection to point to RTTI through function prologues
is not supported on some setups. One reported error message is:

error: Cannot represent a difference across sections

This is a regression. This patch limits the indirect RTTI behavior to
Darwin, where we know it works. We can add more configurations to the
whitelist once we know it won't be a regression.

For context, see the mailing list discussion re:
r313096 - [ubsan] Function Sanitizer: Don't require writable text segments

Testing: check-clang, check-ubsan

Diff Detail

Event Timeline

vsk created this revision.Oct 13 2017, 2:50 PM
echristo edited edge metadata.Oct 13 2017, 2:53 PM

Given you were the last one in this code it seems reasonable to let you go for it :)

That said, I didn't notice anything in particular that stuck out at me.

vsk added a comment.Oct 13 2017, 2:59 PM

Sounds good. This doesn't seem too controversial, since it just takes us back to the old behavior on all platforms except Darwin. I'll wait an hour or so before committing in case there are any more comments.

vsk added a comment.Oct 13 2017, 6:02 PM

@pcc made an alternate suggestion which led to D38913. We're still discussing whether the new patch is a sufficient fix.

vsk abandoned this revision.Oct 13 2017, 6:38 PM

D38913 should make this unnecessary.