print-memory-usage.exp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Test --print-memory-usage linker functionality
  2. # By Tristan Gingold, AdaCore
  3. # Copyright (C) 2015-2022 Free Software Foundation, Inc.
  4. #
  5. # This file is part of the GNU Binutils.
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  20. # MA 02110-1301, USA.
  21. # Mips adds MIPS.abiflags section.
  22. # Spu, pdp11 memory is too small.
  23. # Tic30 needs a special linker script.
  24. # Tic54x interpret space values in bits.
  25. # XCOFF has garbage collection
  26. if { [istarget mips*-*-*]
  27. || [istarget spu*-*-*]
  28. || [istarget pdp11*-*-*]
  29. || [istarget tic30*-*-*]
  30. || [istarget tic54x*-*-*]
  31. || [is_xcoff_format] } {
  32. return
  33. }
  34. set old_LDFLAGS $LDFLAGS
  35. if { [is_pecoff_format] } {
  36. set LDFLAGS "$LDFLAGS --image-base 0"
  37. }
  38. run_ld_link_tests {
  39. {
  40. "print-memory-usage-1"
  41. "-T print-memory-usage-1.t -T print-memory-usage.t --print-memory-usage"
  42. ""
  43. ""
  44. { "print-memory-usage-1.s" }
  45. { { ld "print-memory-usage-1.l" } }
  46. "print-memory-usage-1"
  47. }
  48. {
  49. "print-memory-usage-2"
  50. "-T print-memory-usage-2.t --print-memory-usage"
  51. ""
  52. ""
  53. { "print-memory-usage-1.s" }
  54. { { ld "print-memory-usage-2.l" } }
  55. "print-memory-usage-2"
  56. }
  57. {
  58. "print-memory-usage-3"
  59. "-T print-memory-usage-3.t -T print-memory-usage.t --print-memory-usage"
  60. ""
  61. ""
  62. { "print-memory-usage-3.s" }
  63. { { ld "print-memory-usage-3.l" } }
  64. "print-memory-usage-3"
  65. }
  66. }
  67. set LDFLAGS $old_LDFLAGS