Re: [RFC PATCH 1/2] x86/relocs: Improve diagnostic for rejected absolute references
From: Ingo Molnar
Date: Sat Feb 22 2025 - 07:03:23 EST
* Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> So after another 2 weeks there's been no new upstream regressions I'm
> aware of, so - knock on wood - it seems we can leave the die() in
> place?
>
> But could we perhaps make it more debuggable, should it trigger -
> such as not removing the relevant object file and improving the
> message? I.e. make the build failure experience Linus had somewhat
> more palatable...
For example, the new message is far better, even when combined with a
die() build failure:
- die("Absolute reference to symbol '%s' not permitted in .head.text\n",
- symname);
- break;
+ fprintf(stderr,
+ "Absolute reference to symbol '%s+0x%lx' detected in .head.text (0x%lx).\n"
+ "This kernel might not boot.\n",
+ symname, rel->r_addend, offset);
as it points out that the underlying bug might result in an unbootable
kernel image. So the user at least knows what the pain is about ...
Thanks,
Ingo