Start/end of .text section

Is there a way to retrieve the start/end of .text section (at runtime) without having to add additional PROVIDE() variables to the linker script?


Hello Sumonto,

As far as I know, the only way to retrieve the start/end of the .text
section is via the linker script. LLD will define __start_<section

and __stop_<section name> symbols if <section name> is a valid C

identifier, which unfortunately doesn't cover sections starting with a
'.' like .text. I think Gold and ld.bfd behave this way as well but I
haven't checked the finer details.