vdso.lds.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 2012 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #define VDSO_VERSION_STRING LINUX_2.6
  15. OUTPUT_ARCH(tile)
  16. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  17. ENTRY(__vdso_rt_sigreturn);
  18. SECTIONS
  19. {
  20. . = SIZEOF_HEADERS;
  21. .hash : { *(.hash) } :text
  22. .gnu.hash : { *(.gnu.hash) }
  23. .dynsym : { *(.dynsym) }
  24. .dynstr : { *(.dynstr) }
  25. .gnu.version : { *(.gnu.version) }
  26. .gnu.version_d : { *(.gnu.version_d) }
  27. .gnu.version_r : { *(.gnu.version_r) }
  28. .note : { *(.note.*) } :text :note
  29. .dynamic : { *(.dynamic) } :text :dynamic
  30. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  31. .eh_frame : { KEEP (*(.eh_frame)) } :text
  32. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  33. /*
  34. * This linker script is used both with -r and with -shared.
  35. * For the layouts to match, we need to skip more than enough
  36. * space for the dynamic symbol table et al. If this amount
  37. * is insufficient, ld -shared will barf. Just increase it here.
  38. */
  39. . = 0x1000;
  40. .text : { *(.text .text.*) } :text
  41. .data : {
  42. *(.got.plt) *(.got)
  43. *(.data .data.* .gnu.linkonce.d.*)
  44. *(.dynbss)
  45. *(.bss .bss.* .gnu.linkonce.b.*)
  46. }
  47. }
  48. /*
  49. * We must supply the ELF program headers explicitly to get just one
  50. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  51. */
  52. PHDRS
  53. {
  54. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  55. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  56. note PT_NOTE FLAGS(4); /* PF_R */
  57. eh_frame_hdr PT_GNU_EH_FRAME;
  58. }
  59. /*
  60. * This controls what userland symbols we export from the vDSO.
  61. */
  62. VERSION
  63. {
  64. VDSO_VERSION_STRING {
  65. global:
  66. __vdso_rt_sigreturn;
  67. __vdso_gettimeofday;
  68. gettimeofday;
  69. __vdso_clock_gettime;
  70. clock_gettime;
  71. local:*;
  72. };
  73. }