dyn_weak_ref_2.c 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. // dyn_weak_ref_1.c -- test that a weak ref remains weak in output when
  2. // there is a DSO with the same weak ref.
  3. // Copyright (C) 2010-2015 Free Software Foundation, Inc.
  4. // Written by Doug Kwan <dougkwan@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. // We test that we correctly deal with a weak reference to from both
  19. // a DSO and a weak reference to the same symbol in an executable. The
  20. // symbol should remains weak.
  21. // This source is used to build a DSO that contains a weak reference.
  22. extern void weak_ref (void) __attribute__((weak));
  23. void* ptr2 = weak_ref;