elf-lib.h 1.5 KB

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