You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
791B

  1. /* mangle.h - This file has some CPP macros to deal with different symbol
  2. * mangling across binary formats.
  3. * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net>
  4. * File licensed under the GPL, see http://www.fsf.org/ for more info.
  5. */
  6. #ifndef __MANGLE_H
  7. #define __MANGLE_H
  8. /* Feel free to add more to the list, eg. a.out IMO */
  9. /* Use rip-relative addressing if compiling PIC code on x86-64. */
  10. #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
  11. (defined(__OpenBSD__) && !defined(__ELF__))
  12. #if defined(ARCH_X86_64) && defined(PIC)
  13. #define MANGLE(a) "_" #a"(%%rip)"
  14. #else
  15. #define MANGLE(a) "_" #a
  16. #endif
  17. #else
  18. #if defined(ARCH_X86_64) && defined(PIC)
  19. #define MANGLE(a) #a"(%%rip)"
  20. #else
  21. #define MANGLE(a) #a
  22. #endif
  23. #endif
  24. #endif /* !__MANGLE_H */