summaryrefslogtreecommitdiff
path: root/src/basic/static-destruct.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-12-03 17:33:28 +0100
committerLennart Poettering <lennart@poettering.net>2018-12-03 17:35:50 +0100
commit7fdf40d247361a510661915fbbddddb97b9aa8ff (patch)
treed7d6f70e49458ba067dcfa9daef6ae309916f9cf /src/basic/static-destruct.h
parent026c2677fc9ad6baf32dadc640c58a11dfc09bf1 (diff)
downloadsystemd-7fdf40d247361a510661915fbbddddb97b9aa8ff.tar.gz
static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER
Diffstat (limited to 'src/basic/static-destruct.h')
-rw-r--r--src/basic/static-destruct.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/static-destruct.h b/src/basic/static-destruct.h
index 5c0bea31a6..9f7392121d 100644
--- a/src/basic/static-destruct.h
+++ b/src/basic/static-destruct.h
@@ -21,10 +21,14 @@ typedef struct StaticDestructor {
typeof(variable) *q = p; \
func(q); \
} \
- /* The actual destructor structure */ \
+ /* The actual destructor structure we place in a special section to find it */ \
_section_("SYSTEMD_STATIC_DESTRUCT") \
+ /* We pick pointer alignment, since that is apparently what gcc does for static variables */ \
_alignptr_ \
+ /* Make sure this is not dropped from the image because not explicitly referenced */ \
_used_ \
+ /* Make sure that AddressSanitizer doesn't pad this variable: we want everything in this section packed next to each other so that we can enumerate it. */ \
+ _variable_no_sanitize_address_ \
static const StaticDestructor UNIQ_T(static_destructor_entry, uq) = { \
.data = &(variable), \
.destroy = UNIQ_T(static_destructor_wrapper, uq), \