elfcomm.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*++
  2. Copyright (c) 2016 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. elfcomm.h
  5. Abstract:
  6. This header contains definitions for ELF functions that are agnostic to
  7. address size (32 vs 64 bit), but would otherwise be private to the ELF
  8. library.
  9. Author:
  10. Evan Green 8-Apr-2016
  11. --*/
  12. //
  13. // ------------------------------------------------------------------- Includes
  14. //
  15. //
  16. // ---------------------------------------------------------------- Definitions
  17. //
  18. //
  19. // ------------------------------------------------------ Data Type Definitions
  20. //
  21. //
  22. // -------------------------------------------------------------------- Globals
  23. //
  24. //
  25. // -------------------------------------------------------- Function Prototypes
  26. //
  27. KSTATUS
  28. ImpElfOpenWithPathList (
  29. PLOADED_IMAGE Parent,
  30. PSTR LibraryName,
  31. PSTR PathList,
  32. PIMAGE_FILE_INFORMATION File,
  33. PSTR *Path
  34. );
  35. /*++
  36. Routine Description:
  37. This routine attempts to load a needed library for an ELF image.
  38. Arguments:
  39. Parent - Supplies a pointer to the image that needs the library.
  40. LibraryName - Supplies the name of the library to load.
  41. PathList - Supplies a colon-separated list of paths to try.
  42. File - Supplies a pointer where the information for the file including its
  43. open handle will be returned.
  44. Path - Supplies a pointer where the real path to the opened file will be
  45. returned. The caller is responsible for freeing this memory.
  46. Return Value:
  47. Status code.
  48. --*/
  49. ULONG
  50. ImpElfOriginalHash (
  51. PSTR SymbolName
  52. );
  53. /*++
  54. Routine Description:
  55. This routine hashes a symbol name to get the index into the ELF hash table.
  56. Arguments:
  57. SymbolName - Supplies a pointer to the name to hash.
  58. Return Value:
  59. Returns the hash of the name.
  60. --*/
  61. ULONG
  62. ImpElfGnuHash (
  63. PSTR SymbolName
  64. );
  65. /*++
  66. Routine Description:
  67. This routine hashes a symbol name to get the index into the ELF hash table
  68. using the GNU style hash function.
  69. Arguments:
  70. SymbolName - Supplies a pointer to the name to hash.
  71. Return Value:
  72. Returns the hash of the name.
  73. --*/
  74. PSTR
  75. ImpElfGetEnvironmentVariable (
  76. PSTR Variable
  77. );
  78. /*++
  79. Routine Description:
  80. This routine gets an environment variable value for the image library.
  81. Arguments:
  82. Variable - Supplies a pointer to a null terminated string containing the
  83. name of the variable to get.
  84. Return Value:
  85. Returns a pointer to the value of the environment variable. The image
  86. library will not free or modify this value.
  87. NULL if the given environment variable is not set.
  88. --*/