patch: Updated windres tool Part 1 of 2

Nick Clifton nickc@redhat.com
Tue May 22 13:37:00 GMT 2007


Hi Kai,

> this is the update of the windres patch correcting the resource id writing 
> in resres.c writing 0xfff instead of correct 0xffff.

Great - the patch is looking very good, but unfortunately there is still 
one problem - I am getting some FAIL results in the windres part of the 
binutils testsuite:

   FAIL: windres/capstyle (compare)
   FAIL: windres/checkbox (compare)
   FAIL: windres/combobox (compare)
   FAIL: windres/deflang (compare)
   FAIL: windres/dialog0 (compare)
   FAIL: windres/dialog1 (compare)
   FAIL: windres/dialogid (compare)
   FAIL: windres/dialogsignature (compare)
   FAIL: windres/edittext (compare)
   FAIL: windres/escapex-2 (compare)
   FAIL: windres/html (parse)
   FAIL: windres/lang (compare)
   FAIL: windres/listbox (compare)
   FAIL: windres/messagetable (parse)
   FAIL: windres/nocaption (compare)
   FAIL: windres/printstyle (compare)
   FAIL: windres/sublang (compare)

These are all happening because there are two zero-bytes missing from 
the end of the objdump output in each of the tests.  eg from the 
capstyle test:

   <  0070 4b000000 00000000                    K.......
   >  0070 4b000000 0000                        K.....
   FAIL: windres/capstyle (compare)

This is from a toolchain targeted at "i686-pc-cygwin" and built on an 
x86_64 host running a 64-bit Linux OS.

Is the testsuite wrong or is the resource compiler not putting in enough 
bytes ?


I also have one other comment, based on Dave Korn's observation:

>> I don't understand changes like this.  A bfd_vma represents a 
>> memory address.  The base_style and default_style are IIUIC bitmasks
>> of windows style flags.  It seems very wrong to use such an unrelated 
>> type.

> I used the type bfd_vma for preventing people to think that rc_res_(XXX) 
> structures are anyhow related to binary layout of these structures. 
> Because this leads in fact to problems for different architectures with 
> different base type sizes.

I understand that, but using bfd_vma is still very confusing.  It really 
is meant to be a type for handling addresses.  Why not use bfd_size_type 
instead ?  The underlying type will be the same as bfd_vma, but its name 
is more open to non-address uses.

In fact even better would be to define your own type in terms of 
bfd_size_type.  eg something like:

   /* Use bfd_size_type to ensure a sufficient number of bits.  */
   typedef rc_bitfield_type bfd_size_type;

Then you can use rc_bitfield_type where you are currently using bfd_vma.

Cheers
   Nick



More information about the Binutils mailing list