This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How does GCC access global variables on x86


I am wondering how gcc accesses global variables on x86. from the code
i have seen so far, it seems to use the %RIP as the base register. Is
it always like this?

  4006f9:       f0 80 0d bf 0b 20 00    lock orb $0x0,0x200bbf(%rip)
     # 6012c0 <t2lockor>
  400700:       00

t2lockor is a global variables.

Thanks

Xin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]