_GLOBAL_OFFSET_TABLE_

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

_GLOBAL_OFFSET_TABLE_

Post by mcheung63 »

Hi All
the linker said i am missing _GLOBAL_OFFSET_TABLE_, how to define it? what is it's struct{} look like?
thanks
from Peter ([email protected])
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

_GLOBAL_OFFSET_TABLE_ is a matter of the toolchain, i.e. it's not up to you to define it, it is defined by the compiler, if you use the right command line options.

Without knowing specifics, it's hard to tell what you should do different to get that table (or remove references to it).
Every good solution is obvious once you've found it.
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Post by mcheung63 »

the ld linker said i have a undefined reference : _GLOBAL_OFFSET_TABLE_
I think i need to define one in my code, but i don't know its type.
thanks
from Peter
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

Can you post the exact linker output (in code tags)? What flags are you using? What flags are you using for your compiler? Do you get any compiler warnings? What compiler are you using (presumably GCC/GPP)?

Cheers,
Adam
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

mcheung63 wrote:I think i need to define one in my code...
I don't think so. As I said, _GLOBAL_OFFSET_TABLE_ is something internal to compiler and linker.

It would help to know which files are compiled / linked with which command line options, and what versions of compiler / linker are used (as AJ said). Most likely some command options are used unwisely.
Every good solution is obvious once you've found it.
Post Reply