image-vars.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2020 Western Digital Corporation or its affiliates.
  4. * Linker script variables to be set after section resolution, as
  5. * ld.lld does not like variables assigned before SECTIONS is processed.
  6. * Based on arch/arm64/kerne/image-vars.h
  7. */
  8. #ifndef __RISCV_KERNEL_IMAGE_VARS_H
  9. #define __RISCV_KERNEL_IMAGE_VARS_H
  10. #ifndef LINKER_SCRIPT
  11. #error This file should only be included in vmlinux.lds.S
  12. #endif
  13. #ifdef CONFIG_EFI
  14. /*
  15. * The EFI stub has its own symbol namespace prefixed by __efistub_, to
  16. * isolate it from the kernel proper. The following symbols are legally
  17. * accessed by the stub, so provide some aliases to make them accessible.
  18. * Only include data symbols here, or text symbols of functions that are
  19. * guaranteed to be safe when executed at another offset than they were
  20. * linked at. The routines below are all implemented in assembler in a
  21. * position independent manner
  22. */
  23. __efistub_memcmp = memcmp;
  24. __efistub_memchr = memchr;
  25. __efistub_memcpy = memcpy;
  26. __efistub_memmove = memmove;
  27. __efistub_memset = memset;
  28. __efistub_strlen = strlen;
  29. __efistub_strnlen = strnlen;
  30. __efistub_strcmp = strcmp;
  31. __efistub_strncmp = strncmp;
  32. __efistub_strrchr = strrchr;
  33. #ifdef CONFIG_KASAN
  34. __efistub___memcpy = memcpy;
  35. __efistub___memmove = memmove;
  36. __efistub___memset = memset;
  37. #endif
  38. __efistub__start = _start;
  39. __efistub__start_kernel = _start_kernel;
  40. __efistub__end = _end;
  41. __efistub__edata = _edata;
  42. __efistub_screen_info = screen_info;
  43. #endif
  44. #endif /* __RISCV_KERNEL_IMAGE_VARS_H */