This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] ld/pe-dll.c: ordinals and noname
- To: nickc at redhat dot com
- Subject: Re: [patch] ld/pe-dll.c: ordinals and noname
- From: DJ Delorie <dj at delorie dot com>
- Date: Mon, 18 Sep 2000 14:58:24 -0400
- CC: binutils at sources dot redhat dot com
- References: <200009152224.PAA13929@elmo.cygnus.com>
> : if (!pe_def_file->exports[s].flag_noname)
> : {
> : char *ename = pe_def_file->exports[s].name;
> : bfd_put_32 (abfd, ERVA (enamestr), (void *) enameptrs);
> : strcpy (enamestr, ename);
> : enamestr += strlen (enamestr) + 1;
> : ! bfd_put_16 (abfd, i, (void *) eordinals);
> : ! enameptrs++;
> : pe_def_file->exports[s].hint = hint++;
> : }
> : --- 704,722 ----
> : if (!pe_def_file->exports[s].flag_noname)
> : {
> : char *ename = pe_def_file->exports[s].name;
> : bfd_put_32 (abfd, ERVA (enamestr), (void *) enameptrs);
> : + enameptrs++;
> : strcpy (enamestr, ename);
> : enamestr += strlen (enamestr) + 1;
> : ! bfd_put_16 (abfd, ord, (void *) eordinals);
> : ! eordinals++;
> : pe_def_file->exports[s].hint = hint++;
> : }
>
> Why did you change the placement of the "enameptrs++" expression ?
I wrote this code a while ago, and when I went back to read it I said
to myself "Why did I put that way down there? There must have been a
reason. After all, I put the eordinals++ elsewhere..." Then it
occurred to me that the eordinals++ was wrong. So, to prevent further
confusion, I moved the enameptrs++ right up with the use of enameptrs
to keep everything consistent so that the next person who has to read
this code won't get confused.