[PATCH] ld: Align the PDB DBI source-info substream

Jan Beulich jbeulich@suse.com
Fri Sep 18 06:38:52 GMT 2026


On 13.09.2026 19:56, Oleg Tolmatcev wrote:
> Round the source-info substream size up to four bytes and zero the
> padding.  Extend the test to exercise this case.

Please can you add a reference here to where this is specified?

> --- a/ld/pdb.c
> +++ b/ld/pdb.c
> @@ -4391,6 +4391,10 @@ create_source_info_substream (void **data, uint32_t *size,
>    *size += sizeof (uint32_t) * source_files_count;
>    *size += strings_len;
>  
> +  /* Subsequent DBI substreams must be 4-byte aligned.  */
> +
> +  *size = (*size + 3) & ~3u;
> +
>    *data = xmalloc (*size);

Please omit the blank line between the comment and the new statement.
(Ftoad the other blank line you add should indeed stay.)

Oh, and: The ~3u wants to be just ~3, to be correct regardless of
the type "size" points to.

Jan


More information about the Binutils mailing list