diff options
| author | Simon Glass <[email protected]> | 2022-07-30 15:52:30 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-08-12 08:17:11 -0400 |
| commit | 569524741a01e1a96fc2b75dd7e5d12e41ce6c2b (patch) | |
| tree | 59e8dbf74bfe7c15d83a4d4d70205779c003efde /include | |
| parent | 2ff5490d7dee933eaf0b73d4d50d76660e5da6ff (diff) | |
event: Change EVENT_SPY to global
This creates static records at present, but it causes a problem with clang
and LTO: the linker list records are sometimes dropped from the image.
Fix this by making the records global.
Update to use __used while we are here.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/event.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/event.h b/include/event.h index c00c4fb68dc..fb0734ed4e1 100644 --- a/include/event.h +++ b/include/event.h @@ -123,10 +123,13 @@ static inline const char *event_spy_id(struct evspy_info *spy) * The only solution I can think of is to mark linker-list entries as 'used' * using an attribute. This should be safe, since we don't actually want to drop * any of these. However this does slightly limit LTO's optimisation choices. + * + * Another issue has come up, only with clang: using 'static' makes it throw + * away the linker-list entry sometimes, e.g. with the EVT_FT_FIXUP entry in + * vbe_simple.c - so for now, make it global. */ #define EVENT_SPY(_type, _func) \ - static __attribute__((used)) ll_entry_declare(struct evspy_info, \ - _type, evspy_info) = \ + __used ll_entry_declare(struct evspy_info, _type, evspy_info) = \ _ESPY_REC(_type, _func) /** |
