Commit Graph

10 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 1f568ba13f basic/static-destruct: fix grammar in comment 2020-12-10 13:00:14 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Zbigniew Jędrzejewski-Szmek 4368277c74 tree-wide: use the usual SPDX header for our own files 2020-10-29 10:47:20 +01:00
Lennart Poettering dfaf16ebed static-destruct: add missing closing '(' in comment 2019-11-01 11:31:20 +01:00
Lennart Poettering 63e688cc3b
Merge pull request #11031 from poettering/gcc-attr-cleanup
various gcc attribute clean-ups
2018-12-03 21:59:00 +01:00
Lennart Poettering 7fdf40d247 static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER 2018-12-03 17:35:50 +01:00
Lennart Poettering a898603563 sd-bus,static-destruct: clean up how we do our ELF section magic
This cleans up a bit how we set up things for the ELF section magic:

1. Let's always use our gcc macros, instead of __attribute__ directly

2. Align our structures to sizeof(void*), i.e. the pointer size, rather
   than a fixed 8 or __BIGGEST_ALIGNMENT__. The former is unnecessarily
   high for 32bit systems, the latter too high for 64bit systems. gcc
   seems to use ptr alignment for static variables itself, hence this
   should be good enough for us too. Moreover, the Linux kernel also
   uses pointer alginment for all its ELF section registration magic,
   hence this should be good enough for us too.

3. Let's always prefix the sections we create ourself with SYSTEMD_,
   just to make clear where they come from.

4. Always align the pointer we start from when iterating through these
   lists. This should be unnecessary, but makes things nicely
   systematic, as we'll align all pointers we use to access these
   sections properly.
2018-12-03 13:28:26 +01:00
Lennart Poettering d34dae1817 tree-wide: use gcc attribute macros where appropriate
We have these macros already, hence use them.
2018-12-03 13:28:26 +01:00
Yu Watanabe e30f9c972b util: define free_func_t 2018-12-02 06:34:25 +01:00
Lennart Poettering 67e16c31e9 util: add set of macros for declaring _cleanup_-style destructors for static variables 2018-11-19 21:14:34 +01:00