Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is _GLOBAL_OFFSET_TABLE?

Tags:

c

linux

gcc

x86-64

Using the nm command in Linux to see the symbols in my program, I see a symbol by the name _GLOBAL_OFFSET_TABLE_ as shown below. Can somebody elaborate what is _GLOBAL_OFFSET_TABLE_ used for?

0000000000614018 d _GLOBAL_OFFSET_TABLE_
like image 704
MetallicPriest Avatar asked Mar 13 '12 14:03

MetallicPriest


People also ask

What is_ global_ Offset_ Table_?

_GLOBAL_OFFSET_TABLE_ is used to locate the real addresses of globals (functions, variables etc) for PIC (Position-Independent Code), its commonly referred to as the GOT, you can read up on it here and a more in-depth one here.

Where is Global Offset Table?

The Global Offset Table (or GOT) is a section inside of programs that holds addresses of functions that are dynamically linked. As mentioned in the page on calling conventions, most programs don't include every function they use to reduce binary size.


1 Answers

_GLOBAL_OFFSET_TABLE_ is used to locate the real addresses of globals (functions, variables etc) for PIC (Position-Independent Code), its commonly referred to as the GOT, you can read up on it here and a more indepth one here.

like image 52
Necrolis Avatar answered Sep 17 '22 04:09

Necrolis