Commit 780d1704 authored by Matthias Braun's avatar Matthias Braun
Browse files

emit arm symconsts as .LC%u instead of .L%u to avoid clashed with block numbers

[r27722]
parent 55aa3a39
...@@ -326,6 +326,11 @@ static unsigned get_unique_label(void) ...@@ -326,6 +326,11 @@ static unsigned get_unique_label(void)
return ++id; return ++id;
} }
static void emit_constant_name(const sym_or_tv_t *entry)
{
be_emit_irprintf("%sC%u", be_gas_get_private_prefix(), entry->label);
}
/** /**
* Emit a SymConst. * Emit a SymConst.
*/ */
...@@ -348,7 +353,8 @@ static void emit_arm_SymConst(const ir_node *irn) ...@@ -348,7 +353,8 @@ static void emit_arm_SymConst(const ir_node *irn)
/* load the symbol indirect */ /* load the symbol indirect */
be_emit_cstring("\tldr "); be_emit_cstring("\tldr ");
arm_emit_dest_register(irn, 0); arm_emit_dest_register(irn, 0);
be_emit_irprintf(", %s%u", be_gas_get_private_prefix(), label); be_emit_cstring(", ");
emit_constant_name(entry);
be_emit_finish_line_gas(irn); be_emit_finish_line_gas(irn);
} }
...@@ -391,7 +397,8 @@ static void emit_arm_fpaConst(const ir_node *irn) ...@@ -391,7 +397,8 @@ static void emit_arm_fpaConst(const ir_node *irn)
be_emit_char(' '); be_emit_char(' ');
arm_emit_dest_register(irn, 0); arm_emit_dest_register(irn, 0);
be_emit_irprintf(", %s%u", be_gas_get_private_prefix(), label); be_emit_cstring(", ");
emit_constant_name(entry);
be_emit_finish_line_gas(irn); be_emit_finish_line_gas(irn);
} }
...@@ -1149,8 +1156,9 @@ void arm_gen_routine(const arm_code_gen_t *arm_cg, ir_graph *irg) ...@@ -1149,8 +1156,9 @@ void arm_gen_routine(const arm_code_gen_t *arm_cg, ir_graph *irg)
be_emit_cstring("\t.align 2\n"); be_emit_cstring("\t.align 2\n");
foreach_set(sym_or_tv, entry) { foreach_set(sym_or_tv, entry) {
be_emit_irprintf("%s%u:\n", be_gas_get_private_prefix(), emit_constant_name(entry);
entry->label); be_emit_cstring(":\n");
be_emit_write_line();
if (entry->is_entity) { if (entry->is_entity) {
be_emit_cstring("\t.word\t"); be_emit_cstring("\t.word\t");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment