Do different sections of libc
(such as .text
, .plt
, .got
, .bss
, .rodata
, and others) get loaded at the same offset relative to the libc
base address every time?
I know the loader loads libc
at a random location every time I run my program.
Thank you in advance.
I guess I found the answer to my own question. I wrote a pin-tool using Intel PIN that on every
libc
section get loaded outputs the section offset relative to the address oflibc
. Here are the sections having get loaded at same offsets with their corresponding offsets (the thing before-
is the library name which islibc
with its version and what comes after that is the section name):And there are indeed sections that get loaded at different offsets every time. You may see them in below. However, as I do not recognize them and to me not important, I would like to conclude that yes the sections we most concern about get loaded at the same offset each time the program runs.