public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ulf Samuelsson <binutils@emagii.com>
To: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH v4 1/5] CRC64 commands documentation
Date: Tue, 21 Feb 2023 14:24:45 +0100	[thread overview]
Message-ID: <c064a500-dc4a-0b82-ae18-4b5f95ac154f@emagii.com> (raw)
In-Reply-To: <d2af6867-a8e6-403d-2200-84ab8ba65b75@redhat.com>


Den 2023-02-21 kl. 13:53, skrev Nick Clifton:
> Hi Ulf,
>
>> diff --git a/COPYING.CRC64 b/COPYING.CRC64
>> new file mode 100755
>> index 00000000000..618e1c63dae
>> --- /dev/null
>> +++ b/COPYING.CRC64
>> @@ -0,0 +1,42 @@
>> +The GNU linker contains CRC routines that are used to implement the
>> +CRC64 command in the output section.
>> +
>> +The CRC routines are extracted from LIBCRC available at
>> +
>> +They are used to
>> +* https://www.libcrc.org/
>> +* https://github.com/lammertb/libcrc/tree/v2.0
>
> Umm, why do you have the "They are used to" line here ?


Cut and paste, sorry about that.

>
>> +/*
>> + * Library: libcrc
>> + * File:    src/crc64.c
>> + * Author:  Lammert Bies
>> + *
>> + * This file is licensed under the MIT License as stated below
>> + *
>> + * Copyright (c) 2016 Lammert Bies
>> + *
>> + * Permission is hereby granted, free of charge, to any person 
>> obtaining a copy
>> + * of this software and associated documentation files (the 
>> "Software"), to deal
>> + * in the Software without restriction, including without limitation 
>> the rights
>> + * to use, copy, modify, merge, publish, distribute, sublicense, 
>> and/or sell
>> + * copies of the Software, and to permit persons to whom the 
>> Software is
>> + * furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be 
>> included in all
>> + * copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
>> EXPRESS OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
>> MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 
>> SHALL THE
>> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
>> OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
>> ARISING FROM,
>> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
>> DEALINGS IN THE
>> + * SOFTWARE.
>> + *
>> + * Description
>> + * -----------
>> + * The source file src/crc64.c contains the routines which are 
>> needed to
>> + * calculate a 64 bit CRC value of a sequence of bytes.
>> + */
>
> Given that the library is not being incorporated as-is into the linker 
> sources
> you should probably indicate the relocated location of the src/crc64.c 
> code.
>
That is the LICENSE, right?.

The user needs to supply his own routines which uses the table.
They can do so by extracting the routines from the libcrc.

A cool feature would be to be able to print out the CRC routine
from the linker.

>
>> diff --git a/ld/ld.texi b/ld/ld.texi
>> index 7802f0661b0..2042fadb33e 100644
>
>> +The CRC32 <polynome> command defines some global symbols.
>> +
>> +* @code{___CRC32___}       address of the CRC32 checksum
>> +
>> +* @code{___CRC32_START___} first address in the checked area.
>> +
>> +* @code{___CRC32_END___}   first address past the checked area.
>
> I probably should have mentioned this in my comments for the [v4 0/5]
> email, but are these symbol definitions really necessary ?  Given
> that the CRC functions have to be invoked from the linker script with
> symbol names in their parameters, why define extra symbols ?

I expect that the user can provide an expression.

    CRC64 ECMA   (header + 16, header + 256 + sizeof(...))

so I do not neccessary have a label to find.

Creating my own labels seemed to simplify a lot.

I think, but am not 100% sure, that you could add "illegal" names
if we want to avoid conflict with the user defined labels.

I.E: CRC-32, CRC-32-START, CRC-32-END


>
> Cheers
>   Nick
>

  reply	other threads:[~2023-02-21 13:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 19:45 [PATCH v4 0/5 Add support for CRC64 generation in linker binutils
2023-02-19 19:45 ` [PATCH v4 1/5] CRC64 commands documentation binutils
2023-02-19 19:50   ` [PATCH v4 0/5] Add support for CRC64 generation in linker Ulf Samuelsson
2023-02-21 12:02     ` Nick Clifton
2023-02-21 13:10       ` Ulf Samuelsson
2023-02-21 13:30       ` Ulf Samuelsson
2023-02-21 12:53   ` [PATCH v4 1/5] CRC64 commands documentation Nick Clifton
2023-02-21 13:24     ` Ulf Samuelsson [this message]
2023-02-19 19:45 ` [PATCH v4 2/5] CRC64 testsuite binutils
2023-02-21 12:42   ` Nick Clifton
2023-02-21 15:13     ` Ulf Samuelsson
2023-02-23 10:10       ` Nick Clifton
2023-02-23 10:53         ` Ulf Samuelsson
2023-02-23 11:01           ` Nick Clifton
2023-02-28 11:11         ` Ulf Samuelsson
2023-02-28 12:37           ` Nick Clifton
2023-02-28 13:01             ` Ulf Samuelsson
2023-02-28 13:06               ` Nick Clifton
2023-02-28 14:24                 ` Ulf Samuelsson
2023-02-28 13:45             ` Ulf Samuelsson
2023-02-19 19:45 ` [PATCH v4 3/5] ldlex.l: CRC64 binutils
2023-02-19 19:45 ` [PATCH v4 4/5] ldgram.y: CRC64 binutils
2023-02-19 19:45 ` [PATCH v4 5/5] Calculate CRC64 over the .text area binutils
2023-02-21 13:26   ` Nick Clifton
2023-02-23  8:36     ` 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=c064a500-dc4a-0b82-ae18-4b5f95ac154f@emagii.com \
    --to=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /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).