[v12,02/11] DIGEST: NEWS

Message ID 20230306133158.91917-3-binutils@emagii.com
State Repeat Merge
Headers
Series [v12,01/11] DIGEST: LICENSING |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Ulf Samuelsson March 6, 2023, 1:31 p.m. UTC
  From: Ulf Samuelsson <ulf@emagii.com>

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

Patch

diff --git a/ld/NEWS b/ld/NEWS
index 4b91f2c3b0a..b79023ecb95 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,74 @@ 
 -*- 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>]"
+
+  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 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 +110,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