+/**
+ * Mangles an entity linker (ld) name for win32 usage.
+ *
+ * @param ent the entity to be mangled
+ * @param declaration the declaration
+ */
+static ident *create_ld_ident_win32(ir_entity *ent, declaration_t *declaration)
+{
+ ident *id;
+
+ if (is_Method_type(get_entity_type(ent)))
+ id = decorate_win32_c_fkt(ent, get_entity_ident(ent));
+ else {
+ /* always add an underscore in win32 */
+ id = mangle(id_underscore, get_entity_ident(ent));
+ }
+
+ decl_modifiers_t decl_modifiers = declaration->decl_modifiers;
+ if (decl_modifiers & DM_DLLIMPORT) {
+ /* add prefix for imported symbols */
+ id = mangle(id_imp, id);
+ }
+ return id;
+}
+
+/**
+ * Mangles an entity linker (ld) name for Linux ELF usage.
+ *
+ * @param ent the entity to be mangled
+ * @param declaration the declaration
+ */
+static ident *create_ld_ident_linux_elf(ir_entity *entity,
+ declaration_t *declaration)
+{
+ (void) declaration;
+ return get_entity_ident(entity);
+}
+
+/**
+ * Mangles an entity linker (ld) name for Mach-O usage.
+ *
+ * @param ent the entity to be mangled
+ * @param declaration the declaration
+ */
+static ident *create_ld_ident_macho(ir_entity *ent, declaration_t *declaration)
+{
+ (void) declaration;
+ ident *id = mangle(id_underscore, get_entity_ident(ent));
+ return id;
+}
+
+typedef ident* (*create_ld_ident_func)(ir_entity *entity,
+ declaration_t *declaration);
+create_ld_ident_func create_ld_ident = create_ld_ident_linux_elf;
+