$NetBSD: binutils-af,v 1.3 2004/03/09 12:19:12 kent Exp $ --- binutils/dlltool.c.orig 2003-07-08 12:35:36.000000000 +0900 +++ binutils/dlltool.c @@ -1437,6 +1437,8 @@ match_exclude (string) for (excl_item = excludes; excl_item; excl_item = excl_item->next) if (strcmp (string, excl_item->string) == 0) return TRUE; + if (string[0] != '_') + return TRUE; return FALSE; } @@ -2351,6 +2353,7 @@ make_one_lib_file (exp, i) asymbol * exp_label; asymbol * iname = 0; asymbol * iname2; + asymbol * iname_nm = 0; asymbol * iname_lab; asymbol ** iname_lab_pp; asymbol ** iname_pp; @@ -2362,7 +2365,7 @@ make_one_lib_file (exp, i) #ifndef EXTRA #define EXTRA 0 #endif - asymbol * ptrs[NSECS + 4 + EXTRA + 1]; + asymbol * ptrs[NSECS + 5 + EXTRA + 1]; flagword applicable; char * outname = xmalloc (strlen (TMP_STUB) + 10); @@ -2460,6 +2463,15 @@ make_one_lib_file (exp, i) iname2->flags = BSF_GLOBAL; iname2->value = 0; + if (exp->data) + { + iname_nm = bfd_make_empty_symbol (abfd); + iname_nm->name = make_imp_label ("__nm_", exp->name); + iname_nm->section = secdata[IDATA6].sec; + iname_nm->flags = BSF_GLOBAL; + iname_nm->value = 0; + } + iname_lab = bfd_make_empty_symbol(abfd); iname_lab->name = head_label; @@ -2471,6 +2483,8 @@ make_one_lib_file (exp, i) if (create_compat_implib) ptrs[oidx++] = iname; ptrs[oidx++] = iname2; + if (exp->data) + ptrs[oidx++] = iname_nm; iname_lab_pp = ptrs + oidx; ptrs[oidx++] = iname_lab; @@ -2781,7 +2795,7 @@ make_head () fprintf (f, "\t%sdoesn't load DLLs when this is set.\n", ASM_C); fprintf (f, "\t%s\t0\t%s loaded time\n", ASM_LONG, ASM_C); fprintf (f, "\t%s\t0\t%s Forwarder chain\n", ASM_LONG, ASM_C); - fprintf (f, "\t%s__%s_iname%s\t%s imported dll's name\n", + fprintf (f, "\t%s_%s_iname%s\t%s imported dll's name\n", ASM_RVA_BEFORE, imp_name_lab, ASM_RVA_AFTER, @@ -2862,8 +2876,8 @@ make_tail () fprintf (f, "\t.section .idata$7\n"); #endif - fprintf (f, "\t%s\t__%s_iname\n", ASM_GLOBAL, imp_name_lab); - fprintf (f, "__%s_iname:\t%s\t\"%s\"\n", + fprintf (f, "\t%s\t_%s_iname\n", ASM_GLOBAL, imp_name_lab); + fprintf (f, "_%s_iname:\t%s\t\"%s\"\n", imp_name_lab, ASM_TEXT, dll_name); fclose (f);