[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/boot: Fix build with LLVM toolchain



On Tue, Nov 5, 2024 at 5:06 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 05.11.2024 17:35, Frediano Ziglio wrote:
> > On Tue, Nov 5, 2024 at 3:32 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
> >>
> >> On 05.11.2024 15:55, Frediano Ziglio wrote:
> >>> This toolchain generates different object and map files.
> >>> Account for these changes.
> >>
> >> At least briefly mentioning what exactly the differences are would be
> >> quite nice, imo.
> >>
> >
> > What about.
> >
> > Object have 3 additional sections which must be handled by the linker 
> > script.
>
> I expect these sections are there in both cases. The difference, I assume,
> is that for the GNU linker they don't need mentioning in the linker script.
> Maybe that's what you mean to say, but to me at least the sentence can also
> be interpreted differently.
>

Why do you expect such sections? They are used for dynamic symbols in
shared objects, we don't use shared objects here. Normal object
symbols are not handled by these sections. GNU compiler+linker (we
link multiple objects together) do not generate these sections. So the
comment looks correct to me.

> >>> +    symbol_re_gnu = re.compile(r'\s{15,}0x([0-9a-f]+)\s+(\S+)\n')
> >>>      for line in open(args.mapfile):
> >>> -        m = symbol_re.match(line)
> >>> -        if not m or m.group(2) not in exports:
> >>> +        name = None
> >>> +        m = symbol_re_clang.match(line)
> >>> +        if m:
> >>> +            name = m.group(5)
> >>> +        else:
> >>> +            m = symbol_re_gnu.match(line)
> >>> +            if m:
> >>> +                name = m.group(2)
> >>
> >> ... uniformly use m.group(2) here (outside of the conditional)?
> >>
> >
> > It could be done. The initial idea was testing that VMA and LMA fields
> > should be identical, which gives a bit more certainty about the format
> > used.
> > About map file format, both formats have some headers. Would it be
> > sensible to detect such headers? BTW, probably a mis-detection would
> > cause symbols not to be detected.
>
> Not sure either way, to be honest.
>
> Jan

Mumble... I'm looking for an alternative, maybe I can avoid using map files.

Frediano



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.