config.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifdef DEBUG
  2. # define LDSO_IMAGE "../ld-so/ld.so"
  3. # define LDSO_CONF "../util/ld.so.conf"
  4. # define LDSO_CACHE "../util/ld.so.cache"
  5. # define LDSO_PRELOAD "../util/ld.so.preload"
  6. # define LDDSTUB "../util/lddstub"
  7. #elif UCLIBC_DEVEL
  8. # define LDSO_IMAGE UCLIBC_INSTALL_DIR"/lib/ld.so"
  9. # define LDSO_CONF UCLIBC_INSTALL_DIR"/etc/ld.so.conf"
  10. # define LDSO_CACHE UCLIBC_INSTALL_DIR"/etc/ld.so.cache"
  11. # define LDSO_PRELOAD UCLIBC_INSTALL_DIR"/etc/ld.so.preload"
  12. # define LDDSTUB UCLIBC_INSTALL_DIR"/lib/lddstub"
  13. #else
  14. # define LDSO_IMAGE "/lib/ld.so"
  15. # define LDSO_CONF "/etc/ld.so.conf"
  16. # define LDSO_CACHE "/etc/ld.so.cache"
  17. # define LDSO_PRELOAD "/etc/ld.so.preload"
  18. # define LDDSTUB "/usr/lib/lddstub"
  19. #endif
  20. #define LDD_ARGV0 "__LDD_ARGV0"
  21. #define DIR_SEP ":, \t\n"
  22. #define MAX_DIRS 32
  23. typedef void (*loadptr)(int func, ...);
  24. typedef void (*callbackptr)(int ver, int nlibs, char **libs,
  25. int nmods, char **mods);
  26. #define CALLBACK_VER 1
  27. #define LIB_ANY -1
  28. #define LIB_DLL 0
  29. #define LIB_ELF 1
  30. #define LIB_ELF_LIBC5 2
  31. #define LIB_ELF_LIBC6 3
  32. #define LIB_ELF64 0x80
  33. #define FUNC_VERS 0
  34. #define FUNC_LDD 1
  35. #define FUNC_LINK 2
  36. #define FUNC_LINK_AND_CALLBACK 3
  37. #define LDSO_CACHE_MAGIC "ld.so-"
  38. #define LDSO_CACHE_MAGIC_LEN (sizeof LDSO_CACHE_MAGIC -1)
  39. #define LDSO_CACHE_VER "1.7.0"
  40. #define LDSO_CACHE_VER_LEN (sizeof LDSO_CACHE_VER -1)
  41. typedef struct {
  42. char magic [LDSO_CACHE_MAGIC_LEN];
  43. char version [LDSO_CACHE_VER_LEN];
  44. int nlibs;
  45. } header_t;
  46. typedef struct {
  47. int flags;
  48. int sooffset;
  49. int liboffset;
  50. } libentry_t;