aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-08-14 09:35:38 +0000
committerIan Lance Taylor <ian@airs.com>2009-08-14 09:35:38 +0000
commitcc70f101e24176980f0cb5d88d25ee9128b6d0cd (patch)
treed68f07b10ba929aa004a510b89a7ee0ee9b28761 /gold
parent340cf1cfb699a8b49b8a93967a3ac5c23dd00453 (diff)
downloadgdb-cc70f101e24176980f0cb5d88d25ee9128b6d0cd.zip
gdb-cc70f101e24176980f0cb5d88d25ee9128b6d0cd.tar.gz
gdb-cc70f101e24176980f0cb5d88d25ee9128b6d0cd.tar.bz2
* gold.h (FUNCTION_NAME): Define.
(gold_unreachable): Use FUNCTION_NAME.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/gold.h13
2 files changed, 17 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 14709bf..687693a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-14 Ian Lance Taylor <iant@google.com>
+
+ * gold.h (FUNCTION_NAME): Define.
+ (gold_unreachable): Use FUNCTION_NAME.
+
2009-08-12 Sriraman Tallam <tmsriram@google.com>
* icf.cc (Icf::find_identical_sections): Issue a warning when a
diff --git a/gold/gold.h b/gold/gold.h
index 1319699..3f514cd 100644
--- a/gold/gold.h
+++ b/gold/gold.h
@@ -253,11 +253,22 @@ gold_undefined_symbol_at_location(const Symbol*,
extern void
gold_nomem() ATTRIBUTE_NORETURN;
+// In versions of gcc before 4.3, using __FUNCTION__ in a template
+// function can cause gcc to get confused about whether or not the
+// function can return. See http://gcc.gnu.org/PR30988. Use a macro
+// to avoid the problem. This can be removed when we no longer need
+// to care about gcc versions before 4.3.
+#if defined(__GNUC__) && GCC_VERSION < 4003
+#define FUNCTION_NAME static_cast<const char*>(__FUNCTION__)
+#else
+#define FUNCTION_NAME __FUNCTION__
+#endif
+
// This macro and function are used in cases which can not arise if
// the code is written correctly.
#define gold_unreachable() \
- (gold::do_gold_unreachable(__FILE__, __LINE__, __FUNCTION__))
+ (gold::do_gold_unreachable(__FILE__, __LINE__, FUNCTION_NAME))
extern void do_gold_unreachable(const char*, int, const char*)
ATTRIBUTE_NORETURN;