Re: [PATCH v2] x86: Avoid relocation information in final vmlinux

From: Borislav Petkov
Date: Thu Nov 24 2022 - 10:41:27 EST


On Thu, Nov 24, 2022 at 02:33:28PM +0100, Petr Pavlu wrote:
> If the before case is with RANDOMIZE_BASE=n and the after case is with
> RANDOMIZE_BASE=y then it makes sense the resulting sizes are similar. With
> RANDOMIZE_BASE=n, vmlinux is linked without --emit-relocs and so there will be
> no relocation sections at all. With RANDOMIZE_BASE=y and my patch, the
> sections get created but are stripped eventually. The increased size in the
> second case is likely due to the logic to support the relocation process.

This is in both cases with your patch, once with RANDOMIZE_BASE=y and
once with RANDOMIZE_BASE=n.

IOW, your patch actually makes my vmlinux bigger by 51K.

IOW, I cannot reproduce your

| Configuration | With relocs | Stripped relocs |
| x86_64_defconfig | 70 MB | 43 MB |

claim, but not with a defconfig but with my specially tailored config.

I guess the next thing I'll try is without your patch.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette