aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-07-14 15:38:20 +0000
committerNick Clifton <nickc@redhat.com>2009-07-14 15:38:20 +0000
commit63b33ceb0b1e4c8554b7d773d068819aa5ca2af6 (patch)
tree1395daf49959f2030520ce817455669f71b12aea /gas
parentb101f7a1257f10f7e9d596bef5c59b4ae082f4ab (diff)
downloadgdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.zip
gdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.tar.gz
gdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.tar.bz2
PR 10387
* config/tc-arm.h (THUMB_IS_FUNC): Handle a NULL pointer. (ARM_IS_FUNC): Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.h26
2 files changed, 20 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index e8864c8..bf7dc29 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-14 Nick Clifton <nickc@redhat.com>
+
+ PR 10387
+ * config/tc-arm.h (THUMB_IS_FUNC): Handle a NULL pointer.
+ (ARM_IS_FUNC): Likewise.
+
2009-07-14 Daniel Gutson <dgutson@codesourcery.com>
* config/tc-arm.c (md_assemble): Added validation.
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 05841df..47fce80 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -128,24 +128,26 @@ bfd_boolean arm_is_eabi (void);
/* For ELF objects THUMB_IS_FUNC is inferred from
ARM_IS_THUMB and the function type. */
-#define THUMB_IS_FUNC(s) \
- ((arm_is_eabi () \
- && (ARM_IS_THUMB (s)) \
- && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \
- || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC))
-
-#define ARM_IS_FUNC(s) \
- ((arm_is_eabi () \
- && !(ARM_IS_THUMB (s)) \
- /* && !(THUMB_FLAG_FUNC & ARM_GET_FLAG (s)) \ */ \
+#define THUMB_IS_FUNC(s) \
+ ((s) != NULL \
+ && ((arm_is_eabi () \
+ && (ARM_IS_THUMB (s)) \
+ && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \
+ || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)))
+
+#define ARM_IS_FUNC(s) \
+ (((s) != NULL \
+ && arm_is_eabi () \
+ && !(ARM_IS_THUMB (s)) \
+ /* && !(THUMB_FLAG_FUNC & ARM_GET_FLAG (s)) \ */ \
&& (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)))
#else
-#define THUMB_IS_FUNC(s) (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)
+#define THUMB_IS_FUNC(s) ((s) && ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)
#define ARM_IS_FUNC(s) (!THUMB_IS_FUNC (s) \
- && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION))
+ && (s) && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION))
#endif
#define ARM_SET_THUMB(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_THUMB) : ARM_RESET_FLAG (s, ARM_FLAG_THUMB))