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
name> 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.
Peter
On 8 May 2018 at 19:38, Sumonto Ghosh via llvm-dev
<llvm-dev at lists.llvm.org> wrote:> Hi,
> 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?
>
> Thanks
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>