? bfd/doc/bfd.info ? bfd/doc/bfd.info-1 ? gas/doc/as.info ? gas/doc/as.info-1 ? gprof/gprof.info ? gprof/gprof.info-1 Index: gas/config/tc-arm.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-arm.c,v retrieving revision 1.193 diff -c -p -r1.193 tc-arm.c *** gas/config/tc-arm.c 23 Feb 2005 12:28:03 -0000 1.193 --- gas/config/tc-arm.c 3 Mar 2005 22:18:25 -0000 *************** static struct *** 83,88 **** --- 83,93 ---- unsigned sp_restored:1; } unwind; + /* Bit N indicates that an R_ARM_NONE relocation has been output for + __aeabi_unwind_cpp_prN already if set. This enables dependencies to be + emitted only once per file, to save unnecessary bloat. */ + static unsigned int marked_pr_dependency = 0; + #endif /* OBJ_ELF */ enum arm_float_abi *************** create_unwind_entry (int have_data) *** 13902,13914 **** fix_new (frag_now, where, 4, unwind.personality_routine, 0, 1, BFD_RELOC_ARM_PREL31); - /* Indicate dependency to linker. */ - { - char *name = "__aeabi_unwind_cpp_pr0"; - symbolS *pr = symbol_find_or_make (name); - fix_new (frag_now, where, 4, pr, 0, 1, BFD_RELOC_NONE); - } - where += 4; ptr += 4; --- 13907,13912 ---- *************** create_unwind_entry (int have_data) *** 13922,13945 **** /* Three opcodes bytes are packed into the first word. */ data = 0x80; n = 3; ! goto emit_reloc; case 1: case 2: /* The size and first two opcode bytes go in the first word. */ data = ((0x80 + unwind.personality_index) << 8) | size; n = 2; - goto emit_reloc; - - emit_reloc: - { - /* Indicate dependency to linker. */ - char *name[] = { "__aeabi_unwind_cpp_pr0", - "__aeabi_unwind_cpp_pr1", - "__aeabi_unwind_cpp_pr2" }; - symbolS *pr = symbol_find_or_make (name[unwind.personality_index]); - fix_new (frag_now, where, 4, pr, 0, 1, BFD_RELOC_NONE); - } break; default: --- 13920,13932 ---- /* Three opcodes bytes are packed into the first word. */ data = 0x80; n = 3; ! break; case 1: case 2: /* The size and first two opcode bytes go in the first word. */ data = ((0x80 + unwind.personality_index) << 8) | size; n = 2; break; default: *************** s_arm_unwind_fnend (int ignored ATTRIBUT *** 14048,14053 **** --- 14035,14055 ---- fix_new (frag_now, where, 4, unwind.proc_start, 0, 1, BFD_RELOC_ARM_PREL31); + /* Indicate dependency on EHABI-defined personality routines to the + linker, if it hasn't been done already. */ + if (unwind.personality_index >= 0 && unwind.personality_index < 3) + { + char *name[] = { "__aeabi_unwind_cpp_pr0", + "__aeabi_unwind_cpp_pr1", + "__aeabi_unwind_cpp_pr2" }; + if (!(marked_pr_dependency & (1 << unwind.personality_index))) + { + symbolS *pr = symbol_find_or_make (name[unwind.personality_index]); + fix_new (frag_now, where, 0, pr, 0, 1, BFD_RELOC_NONE); + marked_pr_dependency |= 1 << unwind.personality_index; + } + } + if (val) /* Inline exception table entry. */ md_number_to_chars (ptr + 4, val, 4); Index: gas/testsuite/gas/arm/unwind.d =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/arm/unwind.d,v retrieving revision 1.4 diff -c -p -r1.4 unwind.d *** gas/testsuite/gas/arm/unwind.d 10 Feb 2005 12:39:17 -0000 1.4 --- gas/testsuite/gas/arm/unwind.d 3 Mar 2005 22:18:30 -0000 *************** *** 5,20 **** RELOCATION RECORDS FOR \[.ARM.extab\]: OFFSET TYPE VALUE - 00000000 R_ARM_NONE __aeabi_unwind_cpp_pr1 0000000c R_ARM_PREL31 .text - 0000000c R_ARM_NONE __aeabi_unwind_cpp_pr0 - 0000001c R_ARM_NONE __aeabi_unwind_cpp_pr1 RELOCATION RECORDS FOR \[.ARM.exidx\]: OFFSET TYPE VALUE 00000000 R_ARM_PREL31 .text 00000008 R_ARM_PREL31 .text 0000000c R_ARM_PREL31 .ARM.extab 00000010 R_ARM_PREL31 .text 00000014 R_ARM_PREL31 .ARM.extab --- 5,19 ---- RELOCATION RECORDS FOR \[.ARM.extab\]: OFFSET TYPE VALUE 0000000c R_ARM_PREL31 .text RELOCATION RECORDS FOR \[.ARM.exidx\]: OFFSET TYPE VALUE 00000000 R_ARM_PREL31 .text + 00000000 R_ARM_NONE __aeabi_unwind_cpp_pr0 00000008 R_ARM_PREL31 .text + 00000008 R_ARM_NONE __aeabi_unwind_cpp_pr1 0000000c R_ARM_PREL31 .ARM.extab 00000010 R_ARM_PREL31 .text 00000014 R_ARM_PREL31 .ARM.extab