ELF_x86_64.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- ELF_x86_64.h - JIT link functions for ELF/x86-64 ---*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // jit-link functions for ELF/x86-64.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_EXECUTIONENGINE_JITLINK_ELF_X86_64_H
  18. #define LLVM_EXECUTIONENGINE_JITLINK_ELF_X86_64_H
  19. #include "llvm/ExecutionEngine/JITLink/JITLink.h"
  20. namespace llvm {
  21. namespace jitlink {
  22. namespace ELF_x86_64_Edges {
  23. enum ELFX86RelocationKind : Edge::Kind {
  24. Branch32 = Edge::FirstRelocation,
  25. Pointer32Signed,
  26. Pointer64,
  27. PCRel32,
  28. PCRel32GOTLoad,
  29. PCRel32GOTLoadRelaxable,
  30. PCRel32REXGOTLoadRelaxable,
  31. PCRel32TLV,
  32. PCRel64GOT,
  33. GOTOFF64,
  34. GOT64,
  35. Delta64,
  36. };
  37. } // end namespace ELF_x86_64_Edges
  38. /// Create a LinkGraph from an ELF/x86-64 relocatable object.
  39. ///
  40. /// Note: The graph does not take ownership of the underlying buffer, nor copy
  41. /// its contents. The caller is responsible for ensuring that the object buffer
  42. /// outlives the graph.
  43. Expected<std::unique_ptr<LinkGraph>>
  44. createLinkGraphFromELFObject_x86_64(MemoryBufferRef ObjectBuffer);
  45. /// jit-link the given object buffer, which must be a ELF x86-64 object file.
  46. void link_ELF_x86_64(std::unique_ptr<LinkGraph> G,
  47. std::unique_ptr<JITLinkContext> Ctx);
  48. /// Return the string name of the given ELF x86-64 edge kind.
  49. const char *getELFX86RelocationKindName(Edge::Kind R);
  50. } // end namespace jitlink
  51. } // end namespace llvm
  52. #endif // LLVM_EXECUTIONENGINE_JITLINK_ELF_X86_64_H
  53. #ifdef __GNUC__
  54. #pragma GCC diagnostic pop
  55. #endif