Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /* Definitions for Intel 386 ELF systems.
  2.    Copyright (C) 2015 Free Software Foundation, Inc.
  3.  
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8.  
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12. for more details.
  13.  
  14. Under Section 7 of GPL version 3, you are granted additional
  15. permissions described in the GCC Runtime Library Exception, version
  16. 3.1, as published by the Free Software Foundation.
  17.  
  18. You should have received a copy of the GNU General Public License and
  19. a copy of the GCC Runtime Library Exception along with this program;
  20. see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  21. <http://www.gnu.org/licenses/>.  */
  22.  
  23. #ifdef __i386__
  24. /* Used by crtstuff.c to initialize the base of data-relative relocations.
  25.    These are GOT relative on x86, so return the pic register.  */
  26. #define CRT_GET_RFIB_DATA(BASE)                                         \
  27.   __asm__ ("call\t.LPR%=\n"                                             \
  28.            ".LPR%=:\n\t"                                                \
  29.            "pop{l}\t%0\n\t"                                             \
  30.            /* Due to a GAS bug, this cannot use EAX.  That encodes      \
  31.               smaller than the traditional EBX, which results in the    \
  32.               offset being off by one.  */                              \
  33.            "add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"              \
  34.                    "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}"              \
  35.            : "=d"(BASE))
  36. #endif
  37.