This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH 1/4] pe/coff: Display GUID build-id in the conventional way
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Jon TURNEY'" <jon dot turney at dronecode dot org dot uk>, <binutils at sourceware dot org>
- Date: Mon, 21 Apr 2014 19:25:34 +0200
- Subject: RE: [PATCH 1/4] pe/coff: Display GUID build-id in the conventional way
- Authentication-results: sourceware.org; auth=none
- References: <1397151908-4336-1-git-send-email-jon dot turney at dronecode dot org dot uk> <1397151908-4336-2-git-send-email-jon dot turney at dronecode dot org dot uk> <20140421140412 dot GC661 at ednor dot casa dot cgf dot cx>
Hi everyone,
> > bfd/peXXigen.c | 15 ++++++++++++++-
> > 1 file changed, 14 insertions(+), 1 deletion(-)
> >
> >diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
> >index ea7846f..ebb80b1 100644
> >--- a/bfd/peXXigen.c
> >+++ b/bfd/peXXigen.c
> >@@ -2435,7 +2435,20 @@ pe_print_debugdata (bfd * abfd, void * vfile)
> > idd.SizeOfData, cvinfo))
> > continue;
> >
> >- for (i = 0; i < cvinfo->SignatureLength; i++)
> >+ /* The standard way to display a GUID seems to be as 4,2,2
> bytes in
> >+ host order, followed by 8 single bytes, which we adopt
> for
> >+ consistency with other tools. Display non-GUID
> signatures as a
> >+ sequence of bytes. */
> >+ i = 0;
> >+ if (cvinfo->SignatureLength >= CV_INFO_SIGNATURE_LENGTH)
> >+ {
> >+ char *guid = &(cvinfo->Signature[0]);
> Isn't this just 'cvinfo->Signature'?
>
> >+ sprintf (signature, "%08x", *(uint32_t *)(guid));
> Can't this just be coalesced into one sprintf?
>
> >+ sprintf (signature + 8, "%04x", *(uint16_t *)(guid +
> 4));
> >+ sprintf (signature + 12, "%04x", *(uint16_t *)(guid +
I was also wondering if this would not require some
byte swapping to write the 32 and 16 bit integers correctly on
a big endian machine.
Pierre Muller