https://sourceware.org/bugzilla/show_bug.cgi?id=17444
Bug ID: 17444 Summary: g++ tests g++.dg/ipa/pr61160-2.C and g++.dg/ipa/pr61160-3 fail on arm-none-linux-gnueabi with -mthumb Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: sandra at codesourcery dot com I'm seeing runtime failures (segfaults) when running the g++ tests g++.dg/ipa/pr61160-2.C and g++.dg/ipa/pr61160-3 on arm-none-linux-gnueabi with -mthumb. I think this is a linker problem, or possibly a bad relocation being emitted by the assembler. For pr61160-2.C, GCC is producing this assembly output: main: .fnstart .LFB12: push {lr} ldr r3, .L17 sub sp, sp, #28 str r3, [sp, #4] add r3, r3, #16 str r3, [sp, #8] mov r3, #0 ldr r2, .L17+4 add r0, sp, #8 str r3, [sp, #12] str r2, [sp, #16] str r3, [sp, #20] bl _ZThn4_N8CExample9MixinFuncEiPv.artificial_thunk.1 mov r0, #0 add sp, sp, #28 @ sp needed pop {pc} .L18: .align 2 .L17: .word _ZTV8CExample+8 .word 48879 .cantunwind .fnend .size main, .-main Disassembling the .o file: 00000000 <main>: 0: b500 push {lr} 2: 4b08 ldr r3, [pc, #32] ; (24 <main+0x24>) 4: b087 sub sp, #28 6: 9301 str r3, [sp, #4] 8: 3310 adds r3, #16 a: 9302 str r3, [sp, #8] c: 2300 movs r3, #0 e: 4a06 ldr r2, [pc, #24] ; (28 <main+0x28>) 10: a802 add r0, sp, #8 12: 9303 str r3, [sp, #12] 14: 9204 str r2, [sp, #16] 16: 9305 str r3, [sp, #20] 18: f000 f808 bl 28 <main+0x28> 18: R_ARM_THM_CALL _ZThn4_N8CExample9MixinFuncEiPv.artificial_thunk.1 1c: 2000 movs r0, #0 1e: b007 add sp, #28 20: bd00 pop {pc} 22: 46c0 nop ; (mov r8, r8) 24: 00000008 .word 0x00000008 24: R_ARM_ABS32 _ZTV8CExample 28: 0000beef .word 0x0000beef And disassembling the .exe: 00010610 <main>: 10610: b500 push {lr} 10612: 4b08 ldr r3, [pc, #32] ; (10634 <main+0x24>) 10614: b087 sub sp, #28 10616: 9301 str r3, [sp, #4] 10618: 3310 adds r3, #16 1061a: 9302 str r3, [sp, #8] 1061c: 2300 movs r3, #0 1061e: 4a06 ldr r2, [pc, #24] ; (10638 <main+0x28>) 10620: a802 add r0, sp, #8 10622: 9303 str r3, [sp, #12] 10624: 9204 str r2, [sp, #16] 10626: 9305 str r3, [sp, #20] 10628: f000 f90c bl 10844 <_ZTS5CBase> 1062c: 2000 movs r0, #0 1062e: b007 add sp, #28 10630: bd00 pop {pc} 10632: 46c0 nop ; (mov r8, r8) 10634: 00010898 .word 0x00010898 10638: 0000beef .word 0x0000beef So the original "bl _ZThn4_N8CExample9MixinFuncEiPv.artificial_thunk.1" has been turned into "bl 10844 <_ZTS5CBase>", which is data, not code. :-( Problem was confirmed with a fresh build with both binutils and gcc from mainline head today. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils