This patch: http://sourceware.org/ml/binutils/2007-08/msg00433.html caused FAIL: undefined line on Linux/x86-64 with gcc 3.4.6. Before the change, ld generated /net/gnu-6/export/gnu/src/binutils-next/binutils/ld/testsuite/ld-undefined/undefined.c:9: undefined reference to `this_function_is_not_defined' After the patch, ld generates /net/gnu-6/export/gnu/src/binutils-last/binutils/ld/testsuite/ld-undefined/undefined.c:8: undefined reference to `this_function_is_not_defined' Gcc 3.4.6 generates .globl function .type function, @function function: .LFB2: .file 1 "/net/gnu-6/export/gnu/src/binutils-last/binutils/ld/testsuite/l d-undefined/undefined.c" .loc 1 8 0 .loc 1 9 0 xorl %eax, %eax jmp this_function_is_not_defined .. Should we adjust _bfd_dwarf2_find_nearest_line/_bfd_dwarf2_find_line for this?
A patch is posted at http://sourceware.org/ml/binutils/2007-09/msg00003.html
I checked in my patch. But it doesn't work on ia64 with gcc 3.4 and 4.1. I got Line Number Statements: Extended opcode 2: set Address to 0x0 Special opcode 12: advance Address by 0 to 0x0 and Line by 7 to 8 Copy Special opcode 230: advance Address by 16 to 0x10 and Line by 1 to 9 Special opcode 6: advance Address by 0 to 0x10 and Line by 1 to 10 Special opcode 4: advance Address by 0 to 0x10 and Line by -1 to 9 Special opcode 229: advance Address by 16 to 0x20 and Line by 0 to 9 Copy Special opcode 34: advance Address by 2 to 0x22 and Line by 1 to 10 Advance PC by 30 to 0x40 Extended opcode 1: End of Sequence We wind up with line 10 instead of line 9.
An updated patch is posted at http://sourceware.org/ml/binutils/2007-09/msg00005.html
Fixed.