1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-18 00:52:07 +02:00
Files
u-boot-megous/lib
Harald Seiler ea3d28ec31 Revert "time: add weak annotation to timer_read_counter declaration"
This reverts commit 65ba7add0d.

A weak extern is a nasty sight to behold: If the symbol is never
defined, on ARM, the linker will replace the function call with a NOP.
This behavior isn't well documented but there are at least some hints
to it [1].

When timer_read_counter() is not defined, this obviously does the wrong
thing here and it does so silently.  The consequence is that a board
without timer_read_counter() will sleep for random amounts and generally
have erratic get_ticks() values.

Drop the __weak annotation of the extern so a linker error is raised
when timer_read_counter() is not defined.  This is okay, the original
reason for the reverted change - breaking the sandbox build - no longer
applies.

Final sidenote:  This was the only weak extern in the entire tree at
this time as far as I can tell.  I guess we should avoid introduction of
them again as they are obviously a very big footgun.

[1]: https://stackoverflow.com/questions/31203402/gcc-behavior-for-unresolved-weak-functions

Fixes: 65ba7add0d ("time: add weak annotation to timer_read_counter declaration")
Reported-by: Serge Bazanski <q3k@q3k.org>
Signed-off-by: Harald Seiler <hws@denx.de>
2023-01-12 14:06:16 -05:00
..
2022-01-18 08:31:02 -05:00
2022-07-11 14:58:57 -04:00
2022-01-19 18:11:34 +01:00
2022-07-26 02:30:56 -06:00
2020-05-18 21:19:18 -04:00
2022-01-19 18:11:34 +01:00
2023-01-04 13:17:42 +01:00
2022-08-12 08:14:23 -04:00
2020-10-30 10:56:11 -04:00
2021-09-04 12:26:01 -04:00
2022-12-21 13:09:01 -05:00
2023-01-06 22:27:30 +01:00
2022-03-15 16:19:29 -04:00
2022-12-08 15:15:22 +08:00
2020-05-18 21:19:18 -04:00
2021-07-14 16:57:35 -04:00
2020-05-18 21:19:18 -04:00
2020-08-24 14:11:31 -04:00
2022-10-27 09:10:08 -04:00
2021-07-15 18:42:05 -04:00
2022-01-19 18:11:34 +01:00
2022-09-03 09:35:48 +02:00