title: Get the start and end address of text section in an executable
body: <p>I need to get the start and end address of an executable's text section. How can I get it?</p>
  
  <p>I can get the starting address from the <code>_init</code> symbol or the <code>_start</code> symbol, but what about the ending address? Shall I consider the ending address of the <code>text</code> section to be the last address before starting of the <code>.rodata</code> section?</p>
  
  <p>Or shall I edit the default ld script and add my own symbols to indicate the start and end of the text section, and pass it to GCC when compiling? In this case, where shall I place the new symbols, shall I consider the init and fini section?</p>
  
  <p>What is a good way to get the start and end address of the text section?</p>