// gold.h -- general definitions for gold -*- C++ -*-
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
#include "ansidecl.h"
#include <cstddef>
+#include <cstdlib>
#include <cstring>
#include <stdint.h>
#include <sys/types.h>
extern "C" int ftruncate(int, off_t);
#endif
-#ifndef HAVE_MREMAP
-#define MREMAP_MAYMOVE 1
-extern "C" void *mremap(void *, size_t, size_t, int, ...);
-#endif
-
#ifndef HAVE_FFSLL
extern "C" int ffsll(long long);
#endif
template<int size, bool big_endian>
struct Relocate_info;
+// Exit status codes.
+
+enum Exit_status
+{
+ GOLD_OK = EXIT_SUCCESS,
+ GOLD_ERR = EXIT_FAILURE,
+ GOLD_FALLBACK = EXIT_FAILURE + 1
+};
+
// Some basic types. For these we use lower case initial letters.
// For an offset in an input or output file, use off_t. Note that
// This function is called to exit the program. Status is true to
// exit success (0) and false to exit failure (1).
extern void
-gold_exit(bool status) ATTRIBUTE_NORETURN;
+gold_exit(Exit_status status) ATTRIBUTE_NORETURN;
// This function is called to emit an error message and then
// immediately exit with failure.
extern void
gold_info(const char* msg, ...) ATTRIBUTE_PRINTF_1;
+// This function is called to emit an error message and then
+// immediately exit with fallback status (e.g., when
+// --incremental-update fails and the link needs to be restarted
+// with --incremental-full).
+extern void
+gold_fallback(const char* format, ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
+
// Work around a bug in gcc 4.3.0. http://gcc.gnu.org/PR35546 . This
// can probably be removed after the bug has been fixed for a while.
#ifdef HAVE_TEMPLATE_ATTRIBUTES