diff options
Diffstat (limited to 'gas/config/tc-nds32.c')
-rw-r--r-- | gas/config/tc-nds32.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index 2e0b8e5..a159ddb 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -4633,16 +4633,15 @@ nds32_handle_align (fragS *fragp) { static const unsigned char nop16[] = { 0x92, 0x00 }; static const unsigned char nop32[] = { 0x40, 0x00, 0x00, 0x09 }; - int bytes; - char *p; if (fragp->fr_type != rs_align_code) return; - bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; - p = fragp->fr_literal + fragp->fr_fix; + int bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + char *p = fragp->fr_literal + fragp->fr_fix; + int fix = bytes & 1; - if (bytes & 1) + if (fix != 0) { *p++ = 0; bytes--; @@ -4659,17 +4658,15 @@ nds32_handle_align (fragS *fragp) memcpy (p, nop16, 2); p += 2; bytes -= 2; + fix += 2; } + fragp->fr_fix += fix; - while (bytes >= 4) + if (bytes != 0) { + fragp->fr_var = 4; memcpy (p, nop32, 4); - p += 4; - bytes -= 4; } - - bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; - fragp->fr_fix += bytes; } /* md_flush_pending_output */ @@ -6268,7 +6265,7 @@ static int nds32_elf_append_relax_relocs_traverse (void **slot, void *arg ATTRIBUTE_UNUSED) { string_tuple_t *tuple = *((string_tuple_t **) slot); - nds32_elf_append_relax_relocs (tuple->key, tuple->value); + nds32_elf_append_relax_relocs (tuple->key, (void *) tuple->value); return 1; } |