From 17766210f25e09070abeb1e4117e052e6bef94dc Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 19 May 2011 07:36:39 +0200 Subject: [PATCH] Handle GNU __REDIRECT on MACHO. --- mangle.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mangle.c b/mangle.c index 4aacb56..ea4bc79 100644 --- a/mangle.c +++ b/mangle.c @@ -377,8 +377,16 @@ ident *create_name_macho(entity_t *entity) if (entity->kind == ENTITY_FUNCTION) { type_t *type = skip_typeref(entity->declaration.type); assert(is_type_function(type)); - if (type->function.linkage == LINKAGE_INVALID) - panic("linkage type of function is invalid"); + + switch (type->function.linkage) { + case LINKAGE_INVALID: + panic("linkage type of function is invalid"); + + default: + if (entity->function.actual_name != NULL) + return new_id_from_str(entity->function.actual_name->string); + break; + } } obstack_printf(&obst, "_%s", entity->base.symbol->string); -- 2.20.1