[RFC v0 0/1] Add support for CRC64 generation in linker
Fangrui Song
i@maskray.me
Thu Feb 16 21:30:41 GMT 2023
On Thu, Feb 16, 2023 at 12:40 PM Ulf Samuelsson via Binutils
<binutils@sourceware.org> wrote:
>
> 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
>
Hi Ulf, can you state why a built-in support of ld is needed? If you
want to embed a checksum, you can use Output Section Data to reserve a
few bytes in the output, then use a post-link tool to compute the
checksum and rewrite the reserved bytes.
I am asking because I am unsure whether this feature is generic enough
to meet a majority of future users' needs. We can reasonably expect
that other users may want to use different message digest
algorithms...
Cheers
More information about the Binutils
mailing list