aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/function_reordering_plugin
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/function_reordering_plugin')
-rw-r--r--gcc-4.6/function_reordering_plugin/ChangeLog.google-4_67
-rw-r--r--gcc-4.6/function_reordering_plugin/function_reordering_plugin.c14
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc-4.6/function_reordering_plugin/ChangeLog.google-4_6 b/gcc-4.6/function_reordering_plugin/ChangeLog.google-4_6
index 86ce33829..f5915b8bc 100644
--- a/gcc-4.6/function_reordering_plugin/ChangeLog.google-4_6
+++ b/gcc-4.6/function_reordering_plugin/ChangeLog.google-4_6
@@ -1,3 +1,10 @@
+2012-03-01 Jing Yu <jingyu@google.com>
+ Backport r184577 from google/gcc-4_6 branch.
+
+ 2012-02-25 Sriraman Tallam <tmsriram@google.com>
+ * function_reordering_plugin.c: Check for presence of elf.h.
+ Otherwise, redefine the elf macros used.
+
2011-09-27 Sriraman Tallam <tmsriram@google.com>
* config.h.in: New file.
diff --git a/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c b/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c
index d5710c581..3362a989b 100644
--- a/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c
+++ b/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c
@@ -43,11 +43,23 @@ along with this program; see the file COPYING3. If not see
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#include <elf.h>
+#if defined (__ELF__)
+ #include <elf.h>
+#endif
#include "config.h"
#include "plugin-api.h"
#include "callgraph.h"
+/* #include <elf.h> Not available on Darwin.
+ Rather than dealing with cross-compilation includes, hard code the
+ values we need, as these will not change. */
+#ifndef SHT_NULL
+ #define SHT_NULL 0
+#endif
+#ifndef SHT_PROGBITS
+ #define SHT_PROGBITS 1
+#endif
+
enum ld_plugin_status claim_file_hook (const struct ld_plugin_input_file *file,
int *claimed);
enum ld_plugin_status all_symbols_read_hook ();