no_version_test.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # no_version_test.sh -- test that .gnu.version* sections are not created
  3. # in a shared object when symbol versioning is not used.
  4. # Copyright (C) 2009-2022 Free Software Foundation, Inc.
  5. # Written by Doug Kwan <dougkwan@google.com>
  6. # This file is part of gold.
  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. # 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. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  18. # MA 02110-1301, USA.
  19. # This file goes with no_version_test.c, a C source file
  20. # linked with option -shared -nostdlib. We run objdump on
  21. # the resulting executable and check that .gnu.version* sections
  22. # are not created.
  23. check()
  24. {
  25. file=$1
  26. found=`egrep "\.gnu\.version.*" $file`
  27. if test -n "$found"; then
  28. echo "These section should not be in $file:"
  29. echo "$found"
  30. exit 1
  31. fi
  32. }
  33. check "no_version_test.stdout"
  34. exit 0