[PATCH v1 2/5] ldgram.y: CRC64
binutils@emagii.com
binutils@emagii.com
Fri Feb 17 11:20:13 GMT 2023
More information about the Binutils mailing list
Fri Feb 17 11:20:13 GMT 2023
- Previous message (by thread): [PATCH v1 1/5] ldlex.l: CRC64
- Next message (by thread): [RFC] Move static archive dependencies into ld
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Ulf Samuelsson <binutils@emagii.com> Signed-off-by: Ulf Samuelsson <binutils@emagii.com> --- ld/ldgram.y | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/ld/ldgram.y b/ld/ldgram.y index faffeec94b8..d543d47a5ef 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -41,6 +41,7 @@ #include "mri.h" #include "ldctor.h" #include "ldlex.h" +#include "checksum.h" #ifndef YYDEBUG #define YYDEBUG 1 @@ -130,6 +131,8 @@ static int error_index; %token DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END %token SORT_BY_NAME SORT_BY_ALIGNMENT SORT_NONE %token SORT_BY_INIT_PRIORITY +%token CRC64 ECMA ISO POLY POLYI TABLE +%token DEBUG ON OFF %token '{' '}' %token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH %token INHIBIT_COMMON_ALLOCATION FORCE_GROUP_ALLOCATION @@ -682,6 +685,28 @@ statement: { lang_add_fill ($3); } + | DEBUG ON + { + yydebug = 1; + } + | DEBUG OFF + { + yydebug = 0; + } + | CRC64 + { + lang_add_assignment (exp_assign (CRC_ADDRESS, exp_nameop (NAME,"."), false)); + } + polynome '(' mustbe_exp ',' mustbe_exp ')' + { + lang_add_assignment (exp_assign (CRC_START, $5, false)); + lang_add_assignment (exp_assign (CRC_END, $7, false)); + } + | CRC64 TABLE + { + lang_add_assignment (exp_assign (CRC_TABLE, exp_nameop (NAME,"."), false)); + lang_add_crc_table(); + } | ASSERT_K { ldlex_expression (); } '(' exp ',' NAME ')' separator @@ -696,6 +721,25 @@ statement: statement_list_opt END ; +polynome: + ECMA + { + lang_add_crc_syndrome(false, CRC_POLY_64); + } + | ISO + { + lang_add_crc_syndrome(false, CRC_POLY_64_ISO); + } + | POLY mustbe_exp + { + lang_add_crc_syndrome(false, $2->value.value); + } + + | POLYI mustbe_exp + { + lang_add_crc_syndrome(true, $2->value.value); + } + statement_list: statement_list statement | statement -- 2.17.1
- Previous message (by thread): [PATCH v1 1/5] ldlex.l: CRC64
- Next message (by thread): [RFC] Move static archive dependencies into ld
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list