public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Ulf Samuelsson <ulf@emagii.com>
Subject: [PATCH v10 02/11] DIGEST: NEWS
Date: Fri,  3 Mar 2023 00:10:42 +0100	[thread overview]
Message-ID: <20230302231051.1928782-3-binutils@emagii.com> (raw)
In-Reply-To: <20230302231051.1928782-1-binutils@emagii.com>

From: Ulf Samuelsson <ulf@emagii.com>

Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
---
 ld/NEWS | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 77 insertions(+), 4 deletions(-)

diff --git a/ld/NEWS b/ld/NEWS
index 4b91f2c3b0a..5bfe3ba87d3 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,78 @@
 -*- text -*-
 
+* The linker script has a new command to insert a timestamp
+  TIMESTAMP
+  inserts the current time (seconds since Epoch) as a 64-bit value
+
+* The linker script syntax has new commands for debugging a linker script
+  DEBUG ON  turns on debugging
+  DEBUG OFF turns off debugging
+
+* The linker script syntax has new commands for handling CRC-32/64 calculations
+  on the '.text' section
+  It uses code from https://www.libcrc.org/
+
+  DIGEST "<label>[#<endian>]" "CRC32"              (start, end)
+  DIGEST "<label>[#<endian>]" "CRC64-ECMA"         (start, end)
+  DIGEST "<label>[#<endian>]" "CRC64-GO-ISO"       (start, end)
+  DIGEST "<label>[#<endian>]" "CRC64-GO-ISO-R"     (start, end)
+  DIGEST "<label>[#<endian>]" "CRC64-WE"           (start, end)
+  DIGEST "<label>[#<endian>]" "CRC64-XZ"           (start, end)
+  DIGEST "<label>[#<endian>]"  POLY (<params>)     (start, end)
+  DIGEST TABLE "<label>[#<endian>]"
+  DIGEST SECTION "<section>"
+
+  The CRC32, CRC64-ECMA, CRC64-ISO, CRC64-WE and POLY defines
+  the polynome to use and reserves space for the 32/64-bit CRC in the
+  current section (default ".text"). It also defines a label "<label>".
+  The endian can be specified through "#BE" or "#LE" modifiers for
+  big endian or little endian. This overrides the "-BE" or "-LE" switches on the
+  command line. If no specification is used, little endian
+  digest and table will be emitted.
+  The generated label does not include the modifier.
+
+  When generating a custom polynome you have to supply parameters
+  in the  following order
+  * size            {32 | 64 }
+  * polynome
+  * initial         initial value of crc
+  * xor value       xor with this before returning result
+  * input reflect   bitreverse input data
+  * output reflect  bitreverse result
+  * reciprocal      bitreverse polynome
+
+  These terms are explained at
+  http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html
+
+  The user can do the CRC check in another section through the
+  DIGEST SECTION command by specifying the name of the section.
+
+  The 32 bit DIGEST <polynome> command defines some global symbols.
+  ___CRC32___ is the address of the CRC64 checksum
+  ___CRC32_START___ is the address where CRC calculation starts
+  ___CRC32_END___ The CRC calculation ends before this address.
+
+  The 64-bit DIGEST <polynome> command defines some global symbols.
+  ___CRC64___ is the address of the CRC64 checksum
+  ___CRC64_START___ is the address where CRC calculation starts
+  ___CRC64_END___ The CRC calculation ends before this address.
+
+  All three symbols must refer to addresses in the selected section.
+  If they are defined at the end of the linking process, then
+  the CRC## will be calculated between
+
+    ___CRC##_START___ .. ___CRC##_END___ -1
+
+  and the result will be inserted at ___CRC##___.
+
+  ___CRC##___ must be outside the region where CRC is calculated
+
+  The DIGEST TABLE command generates a table for CRC generation.
+  A table is not neccessary, but will speed up the calculation.
+  It defines the ___CRC##_TABLE___ symbol at the start of the table.
+  The user may choose to add this table to his code instead of using
+  the linker.
+
 * The linker script syntax has two new commands for inserting text into output
   sections:
     ASCII (<size>) "string"
@@ -41,16 +114,16 @@ Changes in 2.39:
   re-enabled via the --warn-rwx-segments option.
 
   New configure options can also control these new features:
-  
+
   --enable-warn-execstack=no
      will disable the warnings about creating an executable stack.
-     
+
   --enable-warn-execstack=yes
      will make --warn-execstack enabled by default.
-     
+
   --enable-warn-rwx-segments=no
      will make --no-warn-rwx-segments enabled by default.
-     
+
   --enable-default-execstack=no
      will stop the creation of an executable stack simply because an input file
      is missing a .note.GNU-stack section, even on architectures where this
-- 
2.34.1


  parent reply	other threads:[~2023-03-02 23:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 23:10 [PATCH v10 0/11 Add support for CRC64 generation in linker binutils
2023-03-02 23:10 ` [PATCH v10 01/11] DIGEST: LICENSING binutils
2023-03-02 23:10 ` binutils [this message]
2023-03-02 23:10 ` [PATCH v10 03/11] DIGEST: Documentation binutils
2023-03-02 23:10 ` [PATCH v10 04/11] DIGEST: testsuite binutils
2023-03-02 23:10 ` [PATCH v10 05/11] DIGEST: ldlex.l binutils
2023-03-02 23:10 ` [PATCH v10 06/11] DIGEST: ldgram.y binutils
2023-03-02 23:10 ` [PATCH v10 07/11] DIGEST: ldmain.c binutils
2023-03-02 23:10 ` [PATCH v10 08/11] DIGEST: ldlang.*: add timestamp binutils
2023-03-02 23:10 ` [PATCH v10 09/11] DIGEST: calculation binutils
2023-03-08 10:38   ` Andreas Schwab
2023-03-02 23:10 ` [PATCH v10 10/11] DIGEST: Makefile.* binutils
2023-03-02 23:10 ` [PATCH v10 11/11] Build ldint binutils

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=20230302231051.1928782-3-binutils@emagii.com \
    --to=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=ulf@emagii.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).