longjmp.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright (C) 2014-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>.
  14. Versioned copy of setjmp/longjmp.c modified for versioning
  15. the reverted jmpbuf extension. */
  16. #include <shlib-compat.h>
  17. #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
  18. /* We don't want the weak alias to longjmp, _longjmp, siglongjmp here,
  19. because we create the default/versioned symbols later. */
  20. # define __libc_siglongjmp __libc_siglongjmp
  21. #endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
  22. #include <setjmp/longjmp.c>
  23. #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
  24. /* In glibc release 2.19 new versions of longjmp-functions were introduced,
  25. but were reverted before 2.20. Thus both versions are the same function. */
  26. strong_alias (__libc_siglongjmp, __libc_longjmp)
  27. weak_alias (__libc_siglongjmp, __v1_longjmp)
  28. weak_alias (__libc_siglongjmp, __v2_longjmp)
  29. versioned_symbol (libc, __v1_longjmp, _longjmp, GLIBC_2_0);
  30. compat_symbol (libc, __v2_longjmp, _longjmp, GLIBC_2_19);
  31. weak_alias (__libc_siglongjmp, __v1longjmp)
  32. weak_alias (__libc_siglongjmp, __v2longjmp)
  33. versioned_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0);
  34. compat_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19);
  35. weak_alias (__libc_siglongjmp, __v1siglongjmp)
  36. weak_alias (__libc_siglongjmp, __v2siglongjmp)
  37. versioned_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0);
  38. compat_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19);
  39. #endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */