VirtualBox

Changeset 335 in vbox for trunk


Ignore:
Timestamp:
Jan 25, 2007 11:17:44 PM (18 years ago)
Author:
vboxsync
Message:

64-bit: g_SUPGlobalInfoPage is out of bounds for GCC generated code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r1 r335  
    162162extern DECLEXPORT(PCSUPGLOBALINFOPAGE)  g_pSUPGlobalInfoPage;
    163163#elif defined(IN_RING0)
    164 # define g_pSUPGlobalInfoPage         (&g_SUPGlobalInfoPage)
    165164extern DECLIMPORT(const SUPGLOBALINFOPAGE) g_SUPGlobalInfoPage;
     165# if defined(__GNUC__) && !defined(__DARWIN__) && defined(__AMD64__)
     166/** Workaround for ELF+GCC problem on 64-bit hosts.
     167 * (GCC emits a mov with a R_X86_64_32 reloc, we need R_X86_64_64.) */
     168DECLINLINE(PCSUPGLOBALINFOPAGE) SUPGetGIP(void)
     169{
     170    PCSUPGLOBALINFOPAGE pGIP;
     171    __asm__ __volatile__ ("movabs g_SUPGlobalInfoPage,%0\n\t"
     172                          : "=a" (pGIP));
     173    return pGIP;
     174}
     175#  define g_pSUPGlobalInfoPage         (SUPGetGIP())
     176# else
     177#  define g_pSUPGlobalInfoPage         (&g_SUPGlobalInfoPage)
     178#endif
    166179#else
    167180extern DECLIMPORT(PCSUPGLOBALINFOPAGE)  g_pSUPGlobalInfoPage;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette