This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: Enhance 'objdump -p' to display the contents of .rsrc sections
- From: nick clifton <nickc at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, binutils at sourceware dot org
- Date: Tue, 17 Dec 2013 17:35:13 +0000
- Subject: Re: Commit: Enhance 'objdump -p' to display the contents of .rsrc sections
- Authentication-results: sourceware.org; auth=none
- References: <87pppedokp dot fsf at redhat dot com> <000001cefb37$e4300b50$ac9021f0$ at muller@ics-cnrs.unistra.fr>
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
^