* configure.ac: Check for chsize and posix_fallocate. Replace
[deliverable/binutils-gdb.git] / gold / gold.h
index ad26d46034b88af85791557c43fa35dffc11363e..780561d42197bac5c54822096ae1e4f5aa1a0709 100644 (file)
@@ -1,6 +1,6 @@
 // gold.h -- general definitions for gold   -*- C++ -*-
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
 #include "config.h"
 #include "ansidecl.h"
 
+#include <cstddef>
+#include <cstring>
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifndef ENABLE_NLS
+  // The Solaris version of locale.h always includes libintl.h.  If we
+  // have been configured with --disable-nls then ENABLE_NLS will not
+  // be defined and the dummy definitions of bindtextdomain (et al)
+  // below will conflict with the defintions in libintl.h.  So we
+  // define these values to prevent the bogus inclusion of libintl.h.
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
+// Always include <clocale> first to avoid conflicts with the macros
+// used when ENABLE_NLS is not defined.
+#include <clocale>
+
 #ifdef ENABLE_NLS
 # include <libintl.h>
 # define _(String) gettext (String)
@@ -102,6 +121,10 @@ struct hash<T*>
 extern "C" ssize_t pread(int, void*, size_t, off_t);
 #endif
 
+#ifndef HAVE_FTRUNCATE
+extern "C" int ftruncate(int, off_t);
+#endif
+
 namespace gold
 {
 
@@ -112,6 +135,7 @@ class Command_line;
 class Input_argument_list;
 class Dirsearch;
 class Input_objects;
+class Mapfile;
 class Symbol;
 class Symbol_table;
 class Layout;
@@ -154,13 +178,25 @@ gold_error(const char* msg, ...) ATTRIBUTE_PRINTF_1;
 extern void
 gold_warning(const char* msg, ...) ATTRIBUTE_PRINTF_1;
 
+// This function is called to print an informational message.
+extern void
+gold_info(const char* msg, ...) 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
+#define TEMPLATE_ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF_4
+#else
+#define TEMPLATE_ATTRIBUTE_PRINTF_4
+#endif
+
 // This function is called to issue an error at the location of a
 // reloc.
 template<int size, bool big_endian>
 extern void
 gold_error_at_location(const Relocate_info<size, big_endian>*,
                       size_t, off_t, const char* format, ...)
-  ATTRIBUTE_PRINTF_4;
+  TEMPLATE_ATTRIBUTE_PRINTF_4;
 
 // This function is called to issue a warning at the location of a
 // reloc.
@@ -168,14 +204,24 @@ template<int size, bool big_endian>
 extern void
 gold_warning_at_location(const Relocate_info<size, big_endian>*,
                         size_t, off_t, const char* format, ...)
-  ATTRIBUTE_PRINTF_4;
+  TEMPLATE_ATTRIBUTE_PRINTF_4;
+
+// This function is called to report an undefined symbol without
+// a relocation (e.g., referenced by a dynamic object).  SYM is
+// the undefined symbol.  The file name associated with the SYM
+// is used to print a location for the undefined symbol.
+extern void
+gold_undefined_symbol(const Symbol*);
 
-// This function is called to report an undefined symbol.
+// This function is called to report an undefined symbol resulting
+// from a relocation.  SYM is the undefined symbol.  RELINFO is the
+// general relocation info.  RELNUM is the number of the reloc,
+// and RELOFFSET is the reloc's offset.
 template<int size, bool big_endian>
 extern void
-gold_undefined_symbol(const Symbol*,
-                     const Relocate_info<size, big_endian>*,
-                     size_t, off_t);
+gold_undefined_symbol_at_location(const Symbol*,
+                                 const Relocate_info<size, big_endian>*,
+                                 size_t, off_t);
 
 // This is function is called in some cases if we run out of memory.
 extern void
@@ -226,7 +272,20 @@ queue_initial_tasks(const General_options&,
                    Workqueue*,
                    Input_objects*,
                    Symbol_table*,
-                   Layout*);
+                   Layout*,
+                   Mapfile*);
+
+// Queue up the set of tasks to be done before
+// the middle set of tasks.  Only used when garbage
+// collection is to be done. 
+extern void
+queue_middle_gc_tasks(const General_options&,
+                      const Task*,
+                      const Input_objects*,
+                      Symbol_table*,
+                      Layout*,
+                      Workqueue*,
+                      Mapfile*);
 
 // Queue up the middle set of tasks.
 extern void
@@ -235,7 +294,8 @@ queue_middle_tasks(const General_options&,
                   const Input_objects*,
                   Symbol_table*,
                   Layout*,
-                  Workqueue*);
+                  Workqueue*,
+                  Mapfile*);
 
 // Queue up the final set of tasks.
 extern void
@@ -246,6 +306,12 @@ queue_final_tasks(const General_options&,
                  Workqueue*,
                  Output_file* of);
 
+inline bool
+is_prefix_of(const char* prefix, const char* str)
+{
+  return strncmp(prefix, str, strlen(prefix)) == 0;
+}
+
 } // End namespace gold.
 
 #endif // !defined(GOLD_GOLD_H)
This page took 0.025087 seconds and 4 git commands to generate.