[RFC v0 0/1] Add support for CRC64 generation in linker
Ulf Samuelsson
binutils@emagii.com
Fri Feb 17 07:53:01 GMT 2023
Den 2023-02-16 kl. 21:40, skrev Ulf Samuelsson via Binutils:
> Cleaned up attempt to generate CRC64.
>
>
> Added code in lang_end() to calculate the CRC.
> So far, I can retrieve the location of the CRC
> and the start and end for the area.
> I can fetch the .text segment as an asection but
>
> if ( bfd_get_section_contents (link_info.output_bfd,
> ts,
> text_section,
> 0,
> ts->size))
>
> fails...
>
> The patchset should contain the LICENSE and the testsuite
> but git-send-email does not like if I send 8 patches.
> Sending 6 patches is OK for some reason...
>
> [PATCH v0 1/6] CRC64 header
> [PATCH v0 2/6] ldlang.h: CRC64
> [PATCH v0 3/6] ldlex.l: CRC64
> [PATCH v0 4/6] ldgram.y: CRC64
> [PATCH v0 5/6] ldlang.c: CRC64
> [PATCH v0 6/6] ldlang.c: Try to get the .text section for checking
>
gcc -c crc.s
../bin/bin/ld -T crc.t -o crc crc.o
Adding Syndrome: 0x42f0e1eba9ea3693
Adding Syndrome: 0xd800000000000000
../bin/bin/ld:crc.t:18: warning: CRC polynome declared twice (ignored)
.text: [0x00001100 .. 0x00002810]
bfd_malloc_and_get_section succeeded
Before CRC:
0x00001100: 0xefbeadde45444f43 0x0000000000000000 0x0000000000000000
0x0000000000001118
*CRC [0xc79d3a1ef51fb737] update at 0x00001110 succeeded*
After CRC:
0x00001100: 0xefbeadde45444f43 0x0000000000000000 0xc79d3a1ef51fb737
0x0000000000001118
Full Section After CRC:
0x00001100: 0xefbeadde45444f43 0x0000000000000000 0xc79d3a1ef51fb737
0x0000000000001118
0x00001140: 0xffffffffffffffff 0xffffffffffffffff 0xffffffffffffffff
0xffffffffffffffff
0x00001180: 0xffffffffffffffff 0xffffffffffffffff 0xffffffffffffffff
0xffffffffffffffff
0x000011c0: 0xffffffffffffffff 0xffffffffffffffff 0xffffffffffffffff
0xffffffffffffffff
:-)
Best Regards
Ulf Samuelsson
More information about the Binutils
mailing list