This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Enhance 'objdump -p' to display the contents of .rsrc sections


Hi Pierre,

   your patch introduced a compilation error for mingw64
target in pe_print_rsrc function,
which is due to the infamous 'long' type is 32-bit of Windows OS
even for amd64 where pointer size is 64-bit.

oops - sorry.

Changing that typecast:
+	  data = (bfd_byte *) (((long) (data + align)) & ~ align);
to:
+	  data = (bfd_byte *) (((bfd_size_type) (data + align)) & ~ align);
is enough to fix the compilation error.

   Could you fix the error or should I submit a full RFA?

Unfortunately that fix breaks building on my 32-bit machine:

error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    data = (bfd_byte *) (((bfd_size_type) (data + align)) & ~ align);

However this patch works for me. Please could you try it out and let me know if it works for you before I check it in ?

@@ -2205,7 +2205,7 @@ rsrc_print_section (bfd * abfd, void * vfile)
          /* Align data before continuing.  */
          int align = (1 << section->alignment_power) - 1;

-         data = (bfd_byte *) (((long) (data + align)) & ~ align);
+         data = (bfd_byte *) (((ptrdiff_t) (data + align)) & ~ align);
          rva_bias += data - p;

/* For reasons that are unclear .rsrc sections are sometimes created

Cheers
  Nick
                          ^


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]