two_file_test_1b_v1.cc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // two_file_test_1b_v1.cc -- supplementary file for a three-file test case
  2. // for gold.
  3. // Copyright (C) 2008-2022 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 is an alternate version of the source file two_file_test_1b.cc,
  19. // used to test incremental linking. We build a binary first using this
  20. // source file, then do an incremental link with the primary version of
  21. // the file.
  22. // This file is used as part of a mixed PIC/non-PIC test.
  23. // Files 1 and 1b are linked together in a shared library.
  24. // File 1 is compiled non-PIC, and file 1a is compiled PIC.
  25. // File 2 is compiled PIC and linked in a second shared library.
  26. // This tests that a non-PIC call does not accidentally get
  27. // bound to a PIC PLT entry.
  28. // We test the following cases.
  29. #include "two_file_test.h"
  30. // 16 Call a function directly after its address has been taken.
  31. bool
  32. t16a()
  33. {
  34. return f10() == 125;
  35. }