or1k.exp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Expect script for ld-or1k tests
  2. # Copyright (C) 2015-2022 Free Software Foundation, Inc.
  3. #
  4. # This file is part of the GNU Binutils.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  19. # MA 02110-1301, USA.
  20. #
  21. if { ![istarget "or1k*-*-*"] } {
  22. return
  23. }
  24. # List contains test-items with 3 items followed by 2 lists:
  25. # 0:name 1:ld early options 2:ld late options 3:assembler options
  26. # 4:filenames of assembler files 5: action and options. 6: name of output file
  27. # Actions:
  28. # objdump: Apply objdump options on result. Compare with regex (last arg).
  29. # nm: Apply nm options on result. Compare with regex (last arg).
  30. # readelf: Apply readelf options on result. Compare with regex (last arg).
  31. set or1ktests {
  32. {"offsets1" "" "" "" {offsets1.s}
  33. {{objdump -drj.text offsets1.d}}
  34. "offsets1"}
  35. }
  36. set or1kplttests {
  37. {"PLTA -fpic -shared" "-fpic -shared" ""
  38. "" {plta1.s}
  39. {{objdump -dr plta1.dd}}
  40. "libplta1.so"}
  41. {"PLT -fpic -shared" "-fpic -shared" ""
  42. "" {plt1.s}
  43. {{objdump -dr plt1.dd}}
  44. "libplt1.so"}
  45. {"Helper shared library" "-fpic -shared" ""
  46. "" {pltlib.s} {} "libpltlib.so"}
  47. {"PLT -fno-pic exec -relax" "-relax tmpdir/libpltlib.so" ""
  48. "" {plt1.s}
  49. {{objdump -dr plt1.x.dd}}
  50. "plt1.x"}
  51. {"gotha exec plt" "tmpdir/libpltlib.so" ""
  52. "" {gotha1.s}
  53. {{objdump -dr gotha1.dd}}
  54. "gotha1.x"}
  55. {"gotha -fpic -shared" "-fpic -shared" ""
  56. "" {gotha2.s}
  57. {{objdump -dr gotha2.dd}}
  58. "gotha2.x"}
  59. }
  60. # Not implemented yet
  61. # {"TLS -fpic -shared" "-shared -melf64alpha" ""
  62. # "" {align.s tlspic1.s tlspic2.s}
  63. # {{readelf -WSsrl tlspic.rd} {objdump -drj.text tlspic.dd}
  64. # {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
  65. # "libtlspic.so"}
  66. # {"Helper shared library" "-shared -melf64alpha" ""
  67. # "" {tlslib.s} {} "libtlslib.so"}
  68. # {"TLS -fpic and -fno-pic exec"
  69. # "-melf64alpha tmpdir/libtlslib.so" "" "" {align.s tlsbinpic.s tlsbin.s}
  70. # {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
  71. # {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
  72. # "tlsbin"}
  73. # {"TLS -fpic and -fno-pic exec -relax"
  74. # "-relax -melf64alpha tmpdir/libtlslib.so" ""
  75. # "" {align.s tlsbinpic.s tlsbin.s}
  76. # {{readelf -WSsrl tlsbinr.rd} {objdump -drj.text tlsbinr.dd}
  77. # {objdump -sj.got tlsbinr.sd}}
  78. # "tlsbinr"}
  79. # {"empty got"
  80. # "-melf64alpha" "" ""
  81. # {emptygot.s}
  82. # {{nm "-n" emptygot.nm}}
  83. # "emptygot"}
  84. # {"TLS in debug sections" "-melf64alpha" ""
  85. # "" {tlsg.s}
  86. # {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
  87. # Shared objects not supported on newlib
  88. run_ld_link_tests $or1ktests
  89. if { ![istarget "or1k*-*-elf*"] } {
  90. run_ld_link_tests $or1kplttests
  91. return
  92. }