On Thu, Feb 11, 2021 at 11:17:27AM +0100, Pierre Labastie wrote:
> On Thu, 2021-02-11 at 12:28 +0800, Xi Ruoyao wrote:
> > On 2021-02-10 21:57 -0500, Jean-Marc Pigeon wrote:
> > > Bonjour Xi (hello the list),
> > > 
> > > On Thu, 2021-02-11 at 10:51 +0800, Xi Ruoyao wrote:
> > > > On 2021-02-10 22:47 +0100, Pierre Labastie wrote:
> > > > > On Wed, 2021-02-10 at 21:03 +0000, Ken Moffat wrote:
> > > > > > On Wed, Feb 10, 2021 at 08:49:56PM +0000, Ken Moffat wrote:

> > > > > 
> > > > > I managed to compile objtool with -g, to recompile apic.c to
> > > > > apic.o
> > > > > (because it gets erased when objtool fails), and to run the
> > > > > objtool
> > > > > command on it under gdb. The segfault is esay to understand:
> > > > > 
> > > > > Program received signal SIGSEGV, Segmentation fault.
> > > > > 0x0000000000412f71 in elf_rebuild_rela_reloc_section
> > > > > (sec=0xe22b10,
> > > > > nr=16)
> > > > >     at elf.c:883
> > > > > 883                     relocs[idx].r_info = GELF_R_INFO(reloc-
> > > > > > sym-
> > > > > > idx, reloc->type);
> > > > > 
> > > > > and the reloc struct is:
> > > > > (gdb) p *reloc
> > > > > $2 = {list = {next = 0xe23240, prev = 0xe23160}, hash = {next =
> > > > > 0x0, 
> > > > >     pprev = 0xe23250}, {rela = {r_offset = 0, r_info = 0,
> > > > > r_addend
> > > > > =
> > > > > 0}, 
> > > > >     rel = {r_offset = 0, r_info = 0}}, sec = 0xe22b10, sym =
> > > > > 0x0,
> > > > > offset = 48, 
> > > > >   type = 2, addend = 467, idx = 0, jump_table_start = false}
> > > > > 
> > > > > So reloc->sym is zero, and reloc->sym->idx is a null
> > > > > dereference...
> > > > > 
> > > > > Now to understand why reloc->sym is zero is more complicated...
> > > > 
> > > > I can reproduce it too with Ken's config and just "make
> > > > arch/x86/kernel/apic/apic.o".
> > > > 
> > > > I seen a strange warning in build:
> > > > 
> > > > > Warning: Kernel ABI header at 'tools/arch/x86/lib/insn.c'
> > > > > differs
> > > > > from latest
> > > > > version at 'arch/x86/lib/insn.c'
> > > > 
> > > > Not sure if it causes the segfault.  I'll try 5.10.15 and if it's
> > > > not
> > > > fixed I'll
> > > > report it as a kernel bug.
> > > do you confirm it is binutil-2.36.1 related or 
> > > is it a kernel only problem?
> > 
> > I can't confirm or disconfirm.  It's beyond my knowledge.  But I
> > decided to
> > report it to the kernel bugzilla.  If kernel dev thinks it's a
> > binutils bug they
> > can report to binutils anyway.
> > 
> > And, this issue seems "fixed" in 5.11-rc7 so I think the kernel dev
> > may have
> > some idea of it.
> 
> Looks like
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=44f6a7c0755d8dd453c70557e11687bb080a6f21
> 
> 
> fixes it (at least with Ken's configuration). I've applied this patch
> to 5.10.13 tree (I had also to download the skl_dmc_ver1_27.bin
> firmware to /lib/frimware/i915 to allow the build with Ken's config).
> 
> Pierre
> 
Pierre, thanks for finding the patch.  After I'd gone to bed it
occurred to me that I would need to download earlier 5.11-rc kernels
to find which one fixed it, and then do a reverse bisect to find
which commit fixed it (the logic of that always makes me even more
confused than normal), so many thanks for saving me that confusion!

I've now applied that to 5.10.15-rc1 and confirmed it builds and
boots.  Gotta go out right now for provisions, will use my other
mail to inform the relevant people that this fixes builds with
binutils-2.36.1 when I get back.

Cheers.

ĸen
-- 
Any attempt to brew coffee with a teapot should result in the error
code "418 I'm a teapot". The resulting entity body MAY be short and
stout.     -- rfc 2324 (1st April 1998)

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to