[PATCH] D123010: [asan] Emit .size directive for global object size before redzone

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 12:55:36 PDT 2022


efriedma added a comment.

This seems really obscure, but makes sense.



================
Comment at: llvm/docs/LangRef.rst:7098
+
+The ``explicit_size`` metadata is used to emit a size directive with a different
+size than the objects total size. This can be useful when an object contains
----------------
MaskRay wrote:
> Suggest: The ``explicit_size`` metadata  may be attached to a global variable definition with a size different from the object's total size. This can be useful when an instrumentation enlarges the object while the symbol size should reflect the accessible or meaningful part of the object.
> 
> 
> I think this is not meaningful to functions, ifuncs, comdats, etc, and likely not meaningful to scalar types, but it may not be necessary to catch the error in the IR verifier.
Probably makes sense to diagnose on anything that isn't a definition of a variable.  Probably not worth trying to catch other dubious cases.

Maybe explicitly note that this doesn't make sense for all object formats?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123010/new/

https://reviews.llvm.org/D123010



More information about the llvm-commits mailing list