Search code examples
shared-librariesreverse-engineering.so

How to understand the different segments, e.g. the .plt, .text, inside an .so file?


Anyone can help explain the different segments inside an .so file? e.g. the

  • .plt,
  • .text,
  • .rodata,
  • .eh_frame,
  • .eh_frame_hdr,
  • .fini_array,
  • .got,
  • .bss,
  • .prgend,
  • extern,
  • abs,

And also, what is PHT Entry ?

Appreciate if someone can provide a detailed explanation or some useful reference links.


Solution

  • man elf has most of the answers you seek: http://man7.org/linux/man-pages/man5/elf.5.html. It's rather lengthy so I'm not going to paste it here, but start reading at "Various sections hold program and control information".

    Ian Lance Taylor's blog (the creator of the gold linker) is also super helpful, especially for the eh_frame and eh_frame_hdr sections: https://www.airs.com/blog/

    The OSDev wiki also has some of this info: https://wiki.osdev.org/ELF.