vsyscall-note.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text.
  3. * Here we can supply some information useful to userland.
  4. */
  5. #include <linux/version.h>
  6. #include <linux/elfnote.h>
  7. /* Ideally this would use UTS_NAME, but using a quoted string here
  8. doesn't work. Remember to change this when changing the
  9. kernel's name. */
  10. ELFNOTE_START(Linux, 0, "a")
  11. .long LINUX_VERSION_CODE
  12. ELFNOTE_END
  13. #ifdef CONFIG_XEN
  14. /*
  15. * Add a special note telling glibc's dynamic linker a fake hardware
  16. * flavor that it will use to choose the search path for libraries in the
  17. * same way it uses real hardware capabilities like "mmx".
  18. * We supply "nosegneg" as the fake capability, to indicate that we
  19. * do not like negative offsets in instructions using segment overrides,
  20. * since we implement those inefficiently. This makes it possible to
  21. * install libraries optimized to avoid those access patterns in someplace
  22. * like /lib/i686/tls/nosegneg. Note that an /etc/ld.so.conf.d/file
  23. * corresponding to the bits here is needed to make ldconfig work right.
  24. * It should contain:
  25. * hwcap 1 nosegneg
  26. * to match the mapping of bit to name that we give here.
  27. */
  28. /* Bit used for the pseudo-hwcap for non-negative segments. We use
  29. bit 1 to avoid bugs in some versions of glibc when bit 0 is
  30. used; the choice is otherwise arbitrary. */
  31. #define VDSO_NOTE_NONEGSEG_BIT 1
  32. ELFNOTE_START(GNU, 2, "a")
  33. .long 1, 1<<VDSO_NOTE_NONEGSEG_BIT /* ncaps, mask */
  34. .byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */
  35. ELFNOTE_END
  36. #endif