rtos: Support looking up .lto_priv.0 appended to symbol name
authorTim Nordell <tnordell@airgain.com>
Wed, 7 Sep 2022 16:59:47 +0000 (11:59 -0500)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 17 Sep 2022 20:58:55 +0000 (20:58 +0000)
commitf9837d1807dae8042aac2e52af3f007ef3cca4d9
tree7dfe620a9e44ea8ac9f2e3fbdc3a1f957af1b0c7
parent68fe396b79a7732d1b0674bc60542bed3e0838b7
rtos: Support looking up .lto_priv.0 appended to symbol name

When FreeRTOS (at least) is compiled with -flto, this leaves certain
static symbols with .lto_priv.0 appended to their name.  Arguably this
could be considered to be a gdb or gcc bug, but one place to resolve it
for OpenOCD usage is here at symbol lookup time.

Note that the ".0" is for the first such instance of the variable as a
static; additional ones would end up as ".1", ".2", etc, and are not
considered here.

Signed-off-by: Tim Nordell <tnordell@airgain.com>
Change-Id: I03580b45e8ea364392ef4e05c96276416b390cb0
Reviewed-on: https://review.openocd.org/c/openocd/+/7179
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/rtos/rtos.c