On Fri, 2018-08-31 at 20:35 +0800, Henry C wrote: > As you mentioned, it is not guaranteed, I wonder under what situation > Elf64_Shdr::sh_addr won't represent the virtual address of the > beginning of .rodata section.
Try creating a shared library or compile your application with -pie to make an ELF executable that isn't mapped at a fixed address. Also not all ELF files will have a section table, some might only have program headers. In that case you cannot even locate the .rodata section since it will just be part of some segment.