I'm trying to figure out the difference between these two sections, this may appear to be a duplicate of this question, but the answer given there didn't explain a lot, so I'd like a more detailed and concise explanation.
The split is due to security reasons. By default (used to be only under -Wl,-z,relro
in the past) .got
section is remapped as read-only once dynamic loader resolved all data relocations at startup (i.e. before entering main
function) to prevent some types of exploits. .got.plt
can not be remapped because of lazy symbol binding (unless LD_BIND_NOW
or -Wl,-z,now
were used in which case lazy binding is turned off and .got.plt
is remapped as well).