[PATCH] pe/coff - add support for base64 encoded long section names

Martin Storsjö martin@martin.st
Mon May 22 08:53:09 GMT 2023


On Mon, 22 May 2023, Jan Beulich via Binutils wrote:

> I further wonder what LLVM's motivation is to zero-pad (i.e. 'A'-prefix)
> the encoded values, rather than - like pre-existing section name
> representation - nul-padding at the end.

FYI, this format isn't LLVM's own invention, it's modelled after what MSVC 
does produce. See 
https://github.com/llvm/llvm-project/commit/9d2c15eff7edd220a3246ebedd2e502051e49844 
for the commit where it was introduced in LLVM:

> MC: Support COFF string tables larger than 10MB
> 
> Offsets past the range of single-slash encoding are encoded as base64,
> padded to 6 characters, and prefixed with two slashes. This encoding is
> undocumented but used by MSVC.


> At the very least I'm inclined to suggest that we also support that 
> obvious (I think) alternative here.

I guess that's fine, but it's probably safest to produce the zero-padded 
format, if support for generating it gets added later.

// Martin



More information about the Binutils mailing list