strong_ref_weak_def.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # strong_ref_weak_def.sh -- test non-weak reference to a weak symbol defined
  3. # in a DSO.
  4. # Copyright (C) 2010-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 checks that the reference to 'weak_def' have GLOBAL binding.
  20. check()
  21. {
  22. file=$1
  23. pattern=$2
  24. found=`grep "$pattern" $file`
  25. if test -z "$found"; then
  26. echo "pattern \"$pattern\" not found in file $file."
  27. echo $found
  28. exit 1
  29. fi
  30. }
  31. check strong_ref_weak_def.stdout ".* FUNC.* GLOBAL.* UND.* weak_def"
  32. exit 0