GCC Bugzilla – Bug 11387
using stop without any argument
Last modified: 2003-08-08 04:40:31 UTC
Using stop with any argument cause no data to be output in the asm which confusses the darwin's as: /var/tmp//ccZrWjym.s:18:section difference relocatable subtraction expression, "LC0" minus "L00000000001$pb" using a symbol at the end of section will not produce an assembly time constant /var/tmp//ccZrWjym.s:18:use a symbol with a constant value created with an assignment instead of the expression, L_const_sym = LC0 - L00000000001$pb /var/tmp//ccZrWjym.s:17:section difference relocatable subtraction expression, "LC0" minus "L00000000001$pb" using a symbol at the end of section will not produce an assembly time constant /var/tmp//ccZrWjym.s:17:use a symbol with a constant value created with an assignment instead of the expression, L_const_sym = LC0 - L00000000001$pb The way to fix this would be output one byte so it would not confuse the Darwin's as. Note that you need download the update to the compiler package to get the new version of as which has this error. source: PROGRAM DUMB STOP END
Andrew, can you post the assembly (produced from this) that Apple's newer assembler doesn't like? Thanks.
.data .const .align 2 LC0: <--- no is nothing below this!!! .text .align 2 .globl _MAIN__ _MAIN__: mflr r2 bcl 20,31,"L00000000001$pb" "L00000000001$pb": stw r31,-4(r1) li r4,0 mflr r31 stw r2,8(r1) stwu r1,-80(r1) addis r2,r31,ha16(LC0-"L00000000001$pb") <---errors here la r3,lo16(LC0-"L00000000001$pb")(r2) <---and here bl L_s_stop$stub
Confirmed then. Is this really a bug in gcc, or in the assembler? Whatever it is, it's going to cause a lot of people trouble, so updating to "critical" severity.
In fact it already has, that is the reason why I reported it, someone on the darwin- development list found it.
Fixed by: 2003-07-26 Geoffrey Keating * varasm.c (output_constant_def_contents): Use ASM_DECLARE_CONSTANT_NAME if defined. * doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME. * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized objects get at least one byte to prevent assembler problems. (ASM_DECLARE_CONSTANT_NAME): New.