nacl.cc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // nacl.cc -- Native Client support for gold
  2. // Copyright (C) 2012-2015 Free Software Foundation, Inc.
  3. // This file is part of gold.
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; either version 3 of the License, or
  7. // (at your option) any later version.
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. // You should have received a copy of the GNU General Public License
  13. // along with this program; if not, write to the Free Software
  14. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. // MA 02110-1301, USA.
  16. #include "gold.h"
  17. #include <cstdio>
  18. #include "libiberty.h"
  19. #include "nacl.h"
  20. #include "elfcpp.h"
  21. namespace gold
  22. {
  23. // Copied from object.cc:Object::error.
  24. void
  25. Sniff_file::error(const char* format, ...) const
  26. {
  27. va_list args;
  28. va_start(args, format);
  29. char* buf = NULL;
  30. if (vasprintf(&buf, format, args) < 0)
  31. gold_nomem();
  32. va_end(args);
  33. gold_error(_("%s: %s"), this->file_.filename().c_str(), buf);
  34. free(buf);
  35. }
  36. } // end namespace gold