[PATCH] D102592: [sanitizer] Caught global buffer underflow for first variable

Zhiwei Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 18 01:30:32 PDT 2021


condy added a comment.

In D102592#2764357 <https://reviews.llvm.org/D102592#2764357>, @eugenis wrote:

> You are adding a new global to every translation unit.
>
> - Private linkage would not allow them to be merged, this can have significant binary size and RAM overhead.

Do you suggest linkonce linkage?

> - There is no guarantee that any of these globals will end up to the left of any sanitized globals. With -fdata-sections, the linker is free to reorder.
> - It is also not referenced from anything, so -gc-sections is likely to kill it.
>
> It looks like this will only work in very limited circumstances.

Since it's limited, perhaps making it opt-in is a better choice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102592



More information about the cfe-commits mailing list