This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Xtensa] fix up some error handling issues

I'm committing this patch on mainline to fix some problems with error handling in the assembler and linker. The various "xtensa_opcode_is_*" functions return 0/1 with -1 on error, but many of the calls to these functions were only checking for non-zero results. The most serious problem fixed here is a comparison in the "check_loop_aligned" function that was reversed, but it appears that the only effect of this bug was overly pessimistic alignment. The rest of the changes in bfd are to speed up the error checking in the "compute_ebb_proposed_actions" function. Previously the instruction was being decoded multiple times, but I've changed it to move the decoding in-line so that it is only done once. I've tested these changes by using them at Tensilica for a few weeks and by running the testsuites with an xtensa-elf target.

bfd ChangeLog:

2006-05-15  David Heine  <>
            Bob Wilson  <>

* elf32-xtensa.c (check_loop_aligned): Fix reversed check for
undefined opcode. Clean up assertions.
(narrow_instruction, widen_instruction): Remove "do_it" parameters.
Factor most of the code into separate functions....
(can_narrow_instruction, can_widen_instruction): New.
(prev_instr_is_a_loop): New.
(compute_ebb_proposed_actions): Combine error handling code for
decode errors. Replace call to insn_decode_len with inline code.
Use can_narrow_instruction and can_widen_instruction. Handle errors
from call to xtensa_opcode_is_loop.
(relax_section): Adjust calls to narrow_instruction and

gas ChangeLog:

2006-05-15 Bob Wilson <>

* config/tc-xtensa.c (is_direct_call_opcode, is_branch_jmp_to_next,
xg_assemble_vliw_tokens, xtensa_mark_narrow_branches,
xtensa_fix_short_loop_frags, is_local_forward_loop, relax_frag_immed):
Handle errors from calls to xtensa_opcode_is_* functions.

Attachment: bu.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]