public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: "Ulf Samuelsson" <binutils@emagii.com>,
	"Martin Liška" <mliska@suse.cz>,
	binutils@sourceware.org, schwab@suse.de
Subject: Re: [PATCH v12 0/11 Add support for CRC64 generation in linker
Date: Wed, 8 Mar 2023 12:52:58 +0000	[thread overview]
Message-ID: <9f8b7d8d-4058-315c-0469-e8853a4e1576@redhat.com> (raw)
In-Reply-To: <b99af7ff-eabd-6838-ce4d-37e96531a0db@emagii.com>

Hi Ulf,

>  From the error message, it looks like it it is 32-bit on 32-bit hosts, and 64-bit on 64-bit hosts.

Weel, it can be 64-bit on 32-bit hosts, provided that
   a) they support 64-bit arithmetic in the compiler
   b) the binutils are configured with --enable-64-bit-bfd

> TEMPORARY WORKAROUND:
> 
> There is (according to comments in bfd/bfd-in2.h) a workaround by
> configuring with "--enable-64-bit-bfd".
> 
> I do not know if that has any other side effects.
> 
> QUESTION: Can You guys, test "./configure --enable-64-bit-bfd" ?

Yes, and it does "fix" the problem, but ...

> QUESTION: What are the main drawbacks to this workaround?

Most 32-bit versions of the binutils are not built with --enable-64-bit-bfd
so there will still be an issue.

> Building using 32-bit bfd_vma makes life a lot more difficult since a lot of the code uses the bfd_vma type.

Actually not so much.  It is still safe to use the bfd_vma type for
addresses.  The only real change is to use uint64_t instead of bfd_vma
when talking about 64-bit crc values.


> So if you do DIGEST POLY (64,0xD800000000000000ULL,x,y,z,v,w)
> the expression calculator will return the wrong value for the all the 64 bit
> constants larger than 0xFFFFFFFF.
> 
> You  do not get around this, except by redesigning a **lot**.
> 
> CONCLUSION: I do not see a permanent fix that allows the DIGEST feature
> to work when building with a 32-bit BFD.

I am testing a local patch which solves (most of) the problem
by using uin64_t.  It does not resolve the arguments to the POLY
digest issue that you describe above, but instead it adds a note
to the documentation saying that the generation of 64-bit polynomes
is not supported when the host and target are both 32-bit.  My
assumption is that for this kind of host/target combination the
user is never going to want 64-bit polynomes anyway, so the
restriction should not be too bad.

Cheers
   Nick




  reply	other threads:[~2023-03-08 12:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 13:31 binutils
2023-03-06 13:31 ` [PATCH v12 01/11] DIGEST: LICENSING binutils
2023-03-06 13:31 ` [PATCH v12 02/11] DIGEST: NEWS binutils
2023-03-06 13:31 ` [PATCH v12 03/11] DIGEST: Documentation binutils
2023-03-06 13:31 ` [PATCH v12 04/11] DIGEST: testsuite binutils
2023-03-06 13:31 ` [PATCH v12 05/11] DIGEST: ldlex.l binutils
2023-03-06 13:31 ` [PATCH v12 06/11] DIGEST: ldgram.y binutils
2023-03-06 13:31 ` [PATCH v12 07/11] DIGEST: ldmain.c binutils
2023-03-06 13:31 ` [PATCH v12 08/11] DIGEST: ldlang.*: add timestamp binutils
2023-03-06 13:31 ` [PATCH v12 09/11] DIGEST: calculation binutils
2023-03-06 13:31 ` [PATCH v12 10/11] DIGEST: Makefile.* binutils
2023-03-06 13:31 ` [PATCH v12 11/11] Build ldint binutils
2023-03-07 13:59 ` [PATCH v12 0/11 Add support for CRC64 generation in linker Nick Clifton
2023-03-07 18:03   ` Ulf Samuelsson
2023-03-07 18:08   ` Ulf Samuelsson
2023-03-08  9:31     ` Martin Liška
2023-03-08 11:48       ` Ulf Samuelsson
2023-03-08 12:52         ` Nick Clifton [this message]
2023-03-08 13:23           ` Ulf Samuelsson
2023-03-08 12:57         ` Alan Modra
2023-03-08 13:39           ` Ulf Samuelsson
2023-03-09  8:48           ` Ulf Samuelsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f8b7d8d-4058-315c-0469-e8853a4e1576@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=mliska@suse.cz \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).