This error can be easily reproduced by executing the following with binutils 2.20.1 (I'm using gcc 4.4.3).
$ echo "int main() { return 0; }" | gcc -x c - -gstabs /tmp/ccautrgB.s: Assembler messages: /tmp/ccautrgB.s:2: Internal error! Assertion failure in obj_elf_init_stab_section at ../../gas/config/obj-elf.c line 1782. Please report this bug. When the program is passed from stdin, gcc uses an empty string as the value of the .file directive. The assembler output is as follows: .file "" .stabs "",100,0,2,.Ltext0 .text ... The assertion fails in obj_elf_init_stab_section which calls get_stab_string_offset (stabs.c) with the value of the .file directive. When this is an empty string, get_stab_string_offset returns 0 which appears to be a failure value as the offset is actually 1 (and in all other cases it will return a value >= 1). obj_elf_init_stab_section asserts the return value is 1 and thus fails. Note that this issue is present in earlier versions of gas (at least 2.19.1) however assertions seem to be switched off by default in this version and so the issue does not present itself. A potential fix is to allow empty string values for stab sections as in the patch attached, however I don't know the full implications of this (what problems it might cause).
stabs.c.diff
Description: Binary data
_______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils