elf.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _ELF_H
  2. #include <elf/elf.h>
  3. #ifndef _ISOMAC
  4. # include <libc-pointer-arith.h>
  5. /* Compute the offset of the note descriptor from size of note entry's
  6. owner string and note alignment. */
  7. # define ELF_NOTE_DESC_OFFSET(namesz, align) \
  8. ALIGN_UP (sizeof (ElfW(Nhdr)) + (namesz), (align))
  9. /* Compute the offset of the next note entry from size of note entry's
  10. owner string, size of the note descriptor and note alignment. */
  11. # define ELF_NOTE_NEXT_OFFSET(namesz, descsz, align) \
  12. ALIGN_UP (ELF_NOTE_DESC_OFFSET ((namesz), (align)) + (descsz), (align))
  13. # ifdef HIDDEN_VAR_NEEDS_DYNAMIC_RELOC
  14. # define DL_ADDRESS_WITHOUT_RELOC(expr) (expr)
  15. # else
  16. /* Evaluate EXPR without run-time relocation for it. EXPR should be an
  17. array, an address of an object, or a string literal. */
  18. # define DL_ADDRESS_WITHOUT_RELOC(expr) \
  19. ({ \
  20. __auto_type _result = (expr); \
  21. asm ("" : "+r" (_result)); \
  22. _result; \
  23. })
  24. # endif
  25. /* Some information which is not meant for the public and therefore not
  26. in <elf.h>. */
  27. # include <dl-dtprocnum.h>
  28. # ifdef DT_1_SUPPORTED_MASK
  29. # error DT_1_SUPPORTED_MASK is defined!
  30. # endif
  31. # define DT_1_SUPPORTED_MASK \
  32. (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
  33. | DF_1_ORIGIN | DF_1_NODEFLIB | DF_1_PIE)
  34. #endif /* !_ISOMAC */
  35. #endif /* elf.h */