[PATCH] bfd/pdb: Increase the PDB block size to 4096
Oleg Tolmatcev
oleg.tolmatcev@gmail.com
Tue Nov 24 21:49:58 GMT 2026
пт, 16 окт. 2026 г. в 15:20, Jan Beulich <jbeulich@suse.com>:
>
> On 30.09.2026 21:37, Oleg Tolmatcev wrote:
> > The block map of the stream directory is itself a single block, so with
> > 1024 byte blocks it can only hold 256 block numbers, which limits a PDB
> > file to about 64 MB. Writing a larger one fails partway through and
> > leaves a truncated file behind, which llvm-pdbutil rejects with "Too
> > many directory blocks".
>
> That sounds pretty limiting, making me wonder why it was done like that.
> Mark?
>
> > 4096 is what MSVC uses, and is the largest block size that both our
> > reader and LLVM accept. It raises the limit to about 4 GB.
>
> The claim on what MSVC uses could do with some reference / proof. And
> then, while surely many will say disk space is cheap, isn't this a little
> wasteful for smallish PDBs? I.e. ...
>
> > --- a/bfd/pdb.c
> > +++ b/bfd/pdb.c
> > @@ -713,7 +713,7 @@ static bool
> > pdb_write_contents (bfd *abfd)
> > {
> > char tmp[sizeof (uint32_t)];
> > - const uint32_t block_size = 0x400;
> > + const uint32_t block_size = 0x1000;
> > uint32_t block_map_addr;
> > uint32_t num_blocks;
> > uint32_t num_files = 0;
>
> ... may this want to become dynamically determined?
>
> Jan
What do I need to do to get this accepted? This is a real problem that
occurs in practice.
Oleg
More information about the Binutils
mailing list