[arm,patch] Implement unwinding table opcodes

Paul Brook paul@codesourcery.com
Sat Sep 18 17:45:00 GMT 2004


The attached patch adds extra assembly directives to allow generation of ARM 
EABI exception handling unwind tables. It depends on my previous patch fror 
SHT_ARM_EXIDX.

I designed the unwind directives so that in most cases you have one unwind 
directive per instruction in the function prologue. This is convenient for 
the gcc code generating the directives, and (hopefully) makes manual 
annotation of assembly code fairly straightforward.

Most of the directives map directly onto the encoding used in the unwind 
table. The only real divergence is when a frame pointer is used. In this case 
we need sometimes change opcodes to generate a shorter sequence.

Tested with cross to arm-none-eabi, and built --enable-targets=all.
Ok?

Paul

2004-09-18  Paul Brook  <paul@codesourcery.com>

gas/
 * config/tc-arm.c (unwind): New variable.
 (vfp_sp_reg_list, vfp_dp_reg_list): Remove.
 (vfp_parse_reg_list): New function.
 (s_arm_unwind_fnstart, s_arm_unwind_fnend, s_arm_unwind_cantunwind,
 s_arm_unwind_personality, s_arm_unwind_personalityindex,
 s_arm_unwind_handlerdata, s_arm_unwind_save, s_arm_unwind_movsp,
 s_arm_unwind_pad, s_arm_unwind_setfp, s_arm_unwind_raw): New
 functions.
 (md_pseudo_table): Add them.
 (vfp_sp_encode_reg): New function.
 (vfp_sp_reg_required_here): Use it.
 (do_vfp_reg2_from_sp2): Use vfp_parse_reg_list and vfp_sp_encode_reg.
 (do_vfp_sp2_from_reg2, vfp_sp_ldstm, vfp_dp_ldstm): Ditto.
 (set_section, add_unwind_adjustsp, flush_pending_unwind,
 finish_unwind_opcodes, start_unwind_section, create_unwind_entry,
 require_hashconst, add_unwind_opcode): New functions.
 * doc/tc-arm.text: Document unwinding opcodes.
gas/testsuite/
 * gas/arm/arm.exp: Add unwind table test.  Recognise
 arm-symbian-symbianelf and arm-none-eabi.
 * gas/arm/unwind.s: New file.
 * gas/arm/unwind.d: New file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.gas_unwind
Type: text/x-diff
Size: 46359 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20040918/81c1faee/attachment.bin>


More information about the Binutils mailing list