diff options
Diffstat (limited to 'gas/config/tc-nds32.c')
-rw-r--r-- | gas/config/tc-nds32.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index f5c021d..d107555 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -3452,8 +3452,9 @@ nds32_lookup_pseudo_opcode (const char *str) for (i = 0; i < maxlen; i++) { - if (is_whitespace (op[i] = str[i])) + if (is_end_of_stmt (str[i]) || is_whitespace (str[i])) break; + op[i] = str[i]; } op[i] = '\0'; @@ -3896,7 +3897,7 @@ nds32_adjust_label (int n) /* Only frag by alignment when needed. Otherwise, it will fail to optimize labels on 4-byte boundary. (bug8454) See md_convert_frag () and RELAX_SET_RELAXABLE (frag) for details. */ - if (frag_now_fix () & ((1 << n) -1 )) + if (frag_now_fix () & (((addressT) 1 << n) - 1)) { if (subseg_text_p (now_seg)) { @@ -3921,7 +3922,7 @@ nds32_adjust_label (int n) old_frag = symbol_get_frag (label); old_value = S_GET_VALUE (label); - new_value = (valueT) frag_now_fix (); + new_value = frag_now_fix (); /* Multiple labels may be on the same address. And the last symbol may not be a label at all, e.g., register name, external function names, @@ -4093,7 +4094,8 @@ nds32_relax_relocs (int relax) {"", "",}; name = input_line_pointer; - while (*input_line_pointer && !is_whitespace (*input_line_pointer)) + while (!is_end_of_stmt (*input_line_pointer) + && !is_whitespace (*input_line_pointer)) input_line_pointer++; saved_char = *input_line_pointer; *input_line_pointer = 0; @@ -4208,8 +4210,6 @@ struct relax_hint_id *record_id_head = NULL; /* Is the buffer large enough? */ #define MAX_BUFFER 12 -static char *nds_itoa (int n); - static char * nds_itoa (int n) { @@ -4230,7 +4230,8 @@ nds32_relax_hint (int mode ATTRIBUTE_UNUSED) struct relax_hint_id *record_id; name = input_line_pointer; - while (*input_line_pointer && !is_whitespace (*input_line_pointer)) + while (!is_end_of_stmt (*input_line_pointer) + && !is_whitespace (*input_line_pointer)) input_line_pointer++; saved_char = *input_line_pointer; *input_line_pointer = 0; @@ -4363,7 +4364,8 @@ nds32_flag (int ignore ATTRIBUTE_UNUSED) /* Skip whitespaces. */ name = input_line_pointer; - while (*input_line_pointer && !is_whitespace (*input_line_pointer)) + while (!is_end_of_stmt (*input_line_pointer) + && !is_whitespace (*input_line_pointer)) input_line_pointer++; saved_char = *input_line_pointer; *input_line_pointer = 0; @@ -4400,7 +4402,8 @@ ict_model (int ignore ATTRIBUTE_UNUSED) /* Skip whitespaces. */ name = input_line_pointer; - while (*input_line_pointer && !is_whitespace (*input_line_pointer)) + while (!is_end_of_stmt (*input_line_pointer) + && !is_whitespace (*input_line_pointer)) input_line_pointer++; saved_char = *input_line_pointer; *input_line_pointer = 0; @@ -5946,7 +5949,7 @@ nds32_elf_append_relax_relocs (const char *key, const void *value) char *where; int pcrel; - if (!relocs_pattern) + if (!relocs_pattern || !relocs_pattern->opcode) return; if (!nds32_find_reloc_table (relocs_pattern, &hint_info)) |