Commit 341f402f authored by Matthias Braun's avatar Matthias Braun
Browse files

block labels are not PIC affected

parent eefa1524
......@@ -1705,6 +1705,9 @@ static void fix_pic_symconsts(ir_node *node, void *data)
trampoline);
set_irn_n(node, i, trampoline_const);
continue;
} else if (get_entity_type(entity) == get_code_type()) {
/* block labels can always be addressed directly */
continue;
}
/* everything else is accessed relative to EIP */
......
......@@ -198,7 +198,7 @@ static void ia32_emit_entity(ir_entity *entity, int no_pic_adjust)
}
}
if (do_pic && !no_pic_adjust) {
if (do_pic && !no_pic_adjust && get_entity_type(entity) != get_code_type()) {
be_emit_char('-');
be_emit_string(pic_base_label);
}
......
......@@ -992,10 +992,13 @@ int entity_is_externally_visible(const ir_entity *entity)
int entity_has_definition(const ir_entity *entity)
{
if (is_method_entity(entity)) {
switch (entity->entity_kind) {
case IR_ENTITY_METHOD:
return get_entity_irg(entity) != NULL
&& (get_entity_linkage(entity) & IR_LINKAGE_NO_CODEGEN) == 0;
} else {
case IR_ENTITY_LABEL:
return true;
default:
return entity->initializer != NULL;
}
}
......
Markdown is supported
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