note.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * At runtime, the fake hardware feature will be considered to be present
  29. * if its bit is set in the mask word. So, we start with the mask 0, and
  30. * at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen.
  31. */
  32. #include "../../xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */
  33. ELFNOTE_START(GNU, 2, "a")
  34. .long 1 /* ncaps */
  35. VDSO32_NOTE_MASK: /* Symbol used by arch/x86/xen/setup.c */
  36. .long 0 /* mask */
  37. .byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */
  38. ELFNOTE_END
  39. #endif