Commit Graph
19 Commits
Author SHA1 Message Date
Daan De Meyer 0c15577abe basic + fundamental: Clean up includes
Split out of #37344.
2025-05-25 10:06:07 +02:00
Daan De Meyer 02b6ac3a50 static-destruct: Move static_destruct() logic to implementation file
This will allow us to remove the memory-util.h include from
static-destruct.h as part of #37344.
2025-05-14 16:56:41 +02:00
Daan De Meyer 3b7d332047 macro: Reduce transitive includes 2025-05-09 11:33:31 +02:00
Daan De Meyer decad4826d static-destruct: Reduce transitive includes 2025-05-07 22:04:46 +09:00
Yu Watanabe 9695b0c01b static-destruct: introduce STATIC_ARRAY_DESTRUCTOR_REGISTER() 2023-05-09 17:53:42 +09:00
Yu Watanabe 555ead8985 static-destruct: several cleanups
No functional changes, preparation for later commits.
2023-05-09 17:53:42 +09:00
Yu Watanabe 394129f88b tree-wide: use ALIGN_PTR() 2022-06-01 03:12:33 +09:00
Zbigniew Jędrzejewski-Szmek 90c8234e0c src/basic: adjust grammar in comments 2021-12-23 13:49:43 +01:00
Jan Janssen a3aff1c47f test,static-destruct: Use retain attribute to prevent linker garbage collection
Fixes: #21847
2021-12-22 12:14:08 +09:00
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