Foundationপ্রথম নীতি থেকে
LEVEL 5 · Compilers

Global Offset Table

গ্লোবাল অফসেট টেবিল

Data symbol-এর absolute address-এর table — position-independent code ঠিকানা hardcode না করে GOT entry-র মাধ্যমে indirect access করে।

also: GOT

PIC-এ text segment read-only shared — address বসানো নিষেধ। সমাধান: address গুলো data segment-এর একটা table-এ, code শুধু index জানে:

mov  rax, [rip + global_var@GOTPCREL]   ; GOT entry-র ঠিকানা
mov  rax, [rax]                          ; সেখান থেকে আসল value
  • Loader GOT fill করে (load-time relocation) বা lazy (PLT-র সাথে)
  • x86-64 RIP-relative addressing-এ local access GOT bypass করে (@GOTPCREL শুধু interposable symbol-এ)
  • Full RELRO: GOT read-only করে দেওয়া — GOT overwrite attack বন্ধ