aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog2
-rw-r--r--binutils/dlltool.c18
2 files changed, 13 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 79ebd28..49a7bbe 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,7 @@
Wed Nov 22 13:17:15 1995 Ian Lance Taylor <ian@cygnus.com>
+ * dlltool.c (fill_ordinals): Start assigning ordinals at 1.
+
* Makefile.in (EXPECT): Use $$r, not $${rootme}.
(check): Set r, not rootme.
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 421675a..2a5b640 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -363,7 +363,7 @@ void
process_def_file (name)
char *name;
{
- FILE *f = fopen (name, "r");
+ FILE *f = fopen (name, FOPEN_RT);
if (!f)
{
fprintf (stderr, "%s: Can't open def file %s\n", program_name, name);
@@ -849,7 +849,7 @@ gen_exp_file ()
fprintf (stderr, "%s: Generate exp file %s\n",
program_name, exp_name);
- f = fopen (outfile, "w");
+ f = fopen (outfile, FOPEN_WT);
if (!f)
{
fprintf (stderr, "%s: Unable to open output file %s\n", program_name, outfile);
@@ -1187,7 +1187,7 @@ int i;
FILE *f;
char *prefix="d";
sprintf (outfile, "%ss%d.s", prefix, i);
- f = fopen (outfile, "w");
+ f = fopen (outfile, FOPEN_WT);
fprintf (f, "\t.text\n");
fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
@@ -1428,7 +1428,7 @@ static
bfd *
make_head()
{
- FILE * f = fopen ("dh.s", "w");
+ FILE * f = fopen ("dh.s", FOPEN_WT);
fprintf (f, "%s IMAGE_IMPORT_DESCRIPTOR\n", ASM_C);
fprintf (f, "\t.section .idata$2\n");
@@ -1480,7 +1480,7 @@ make_head()
static
bfd * make_tail()
{
- FILE * f = fopen ("dt.s", "w");
+ FILE * f = fopen ("dt.s", FOPEN_WT);
fprintf (f, "\t.section .idata$7\n");
fprintf (f, "\t%s\t__%s_iname\n", ASM_GLOBAL, imp_name_lab);
fprintf (f, "__%s_iname:\t%s\t\"%s\"\n",
@@ -1730,6 +1730,10 @@ fill_ordinals (d_export_vec)
}
}
+ /* Start at 1 for compatibility with MS toolchain. */
+ if (lowest == 0)
+ lowest = 1;
+
for (i = 0; i < d_nfuncs; i++)
{
if (d_export_vec[i]->ordinal == -1)
@@ -1919,7 +1923,7 @@ main (ac, av)
add_indirect = 1;
break;
case 'z':
- output_def = fopen (optarg, "w");
+ output_def = fopen (optarg, FOPEN_WT);
break;
case 'D':
dll_name = optarg;
@@ -1956,7 +1960,7 @@ main (ac, av)
dontdeltemps++;
break;
case 'b':
- base_file = fopen (optarg, "r");
+ base_file = fopen (optarg, FOPEN_RB);
if (!base_file)
{
fprintf (stderr, "%s: Unable to open base-file %s\n",