[PATCH] D21289: [ubsan] Version names of handlers

Filipe Cabecinhas via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 07:28:34 PDT 2016


filcab created this revision.
filcab added reviewers: kcc, samsonov, rsmith.
filcab added a subscriber: cfe-commits.

This patch introduces a simple way to bump of all the handlers in UBSan.
This way, we can easily break backwards compatibility without it being
confusing for users (a bit like the ASan
__asan_version_mismatch_check_vX symbol), since they'll get undefined
references when linking, instead of random checks providing invalid
information.

I chose to version all symbols at once (instead of just changing version
for one or two) since it avoids us needing to do lookups every time we
emit any check.

I haven't measured slowdown in a potential patch where we only rev the
checks we need, though.

This patch includes two commits: Adding an empty version string + bumping it to
_v2.

There's other alternatives of doing versions, but this one is simple,
efficient (enough), and will forcefully break with old object files (which is a
good thing). Bike-shed away anyway :-)

Before I land this diff, I want to redo D19667+D19668 on top of it. Then I can
commit them quickly so we're able to only rev up UBSan once, instead of having
an intermediary v2, and then bump to v3 immediately. If anyone would prefer a
more split up method I don't mind doing them separately, one at a time (they'll
always be different commits with both methods).

http://reviews.llvm.org/D21289

Files:
  lib/CodeGen/CGExpr.cpp
  test/CodeGen/catch-undef-behavior.c
  test/CodeGen/cfi-check-fail.c
  test/CodeGen/cfi-check-fail2.c
  test/CodeGen/compound-assign-overflow.c
  test/CodeGen/sanitize-recover.c
  test/CodeGen/sanitize-trap.c
  test/CodeGen/ubsan-strip-path-components.cpp
  test/CodeGen/ubsan-type-blacklist.cpp
  test/CodeGen/unsigned-overflow.c
  test/CodeGen/unsigned-promotion.c
  test/CodeGenCXX/bitsets.cpp
  test/CodeGenCXX/catch-undef-behavior.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21289.60520.patch
Type: text/x-patch
Size: 35105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160613/0450684e/attachment-0001.bin>


More information about the cfe-commits mailing list