two_file_test_1b.cc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // two_file_test_1b.cc -- supplementary file for a three-file test case
  2. // for gold.
  3. // Copyright (C) 2008-2015 Free Software Foundation, Inc.
  4. // Written by Cary Coutant <ccoutant@google.com>.
  5. // This file is part of gold.
  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. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  17. // MA 02110-1301, USA.
  18. // This file is used as part of a mixed PIC/non-PIC test.
  19. // Files 1 and 1b are linked together in a shared library.
  20. // File 1 is compiled non-PIC, and file 1a is compiled PIC.
  21. // File 2 is compiled PIC and linked in a second shared library.
  22. // This tests that a non-PIC call does not accidentally get
  23. // bound to a PIC PLT entry.
  24. // We test the following cases.
  25. #include "two_file_test.h"
  26. // 16 Call a function directly after its address has been taken.
  27. bool
  28. t16a()
  29. {
  30. return f10() == 135;
  31. }