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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 3 23:41:02 PDT 2022


MaskRay added a comment.

> This matches gcc's behavior of keeping an objects st_size as it was before the redzone is added. Keeping the smaller size is beneficial for reducing the amount copied in copy relocations.

This is insufficient justification to me. With compilation for executables moving from -fno-pic to -fpie, we cannot see copy relocations.
Copy relocations really only happen with uncommon configurations now and decreasing st_size doesn't save many bytes any way. (Copy relocations can also be avoided with -fno-direct-access-external-data.)
The enlarged st_size value gives users a quick way to know whether the area has been enlarged.
I do not see why we need to match GCC's behavior here.


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

https://reviews.llvm.org/D123010



More information about the llvm-commits mailing list