> -----Original Message----- > From: Mark Wielaard <m...@klomp.org> > Sent: Thursday, April 4, 2024 11:29 AM > To: Brian Cain <bc...@quicinc.com>; Matheus Bernardino (QUIC) > <quic_mathb...@quicinc.com>; elfutils-devel@sourceware.org > Cc: Sid Manning <sidn...@quicinc.com>; Andrew Pinski (QUIC) > <quic_apin...@quicinc.com> > Subject: Re: [PATCH v2 2/2] Hexagon: implement machine flag check > > WARNING: This email originated from outside of Qualcomm. Please be wary > of any links or attachments, and do not enable macros. > > Hi, > > On Tue, 2024-04-02 at 21:38 +0000, Brian Cain wrote: > > > diff --git a/backends/hexagon_symbol.c b/backends/hexagon_symbol.c > > > index b341243e..1e681e9f 100644 > > > --- a/backends/hexagon_symbol.c > > > +++ b/backends/hexagon_symbol.c > > > @@ -56,3 +56,11 @@ hexagon_reloc_simple_type (Ebl *ebl __attribute__ > > > ((unused)), int type, > > > return ELF_T_NUM; > > > } > > > } > > > + > > > +bool > > > +hexagon_machine_flag_check (GElf_Word flags) > > > +{ > > > + GElf_Word arch_variant = flags &~ EF_HEXAGON_MACH; > > > + /* 0x8000 covers the "tiny core" arch variants. */ > > > + return arch_variant == 0 || arch_variant == 0x8000; > > > +} > > > -- > > > 2.37.2 > > > > What about this instead? > > > > bool hexagon_machine_flag_check(GElf_Word flags) { > > GElf_Word reserved_flags = ~(EF_HEXAGON_TINY | > EF_HEXAGON_MACH); > > > > return (flags & reserved_flags) == 0; > > } > > > > ... implies a new EF_HEXAGON_TINY 0x8000 definition BTW. > > You obviously know this architecture better than me. But is the TINY > flag (bit 15) appropriate for all machines? It looks like it can only > be set on V67 and V71. If so maybe just check those two explicitly?
So far, V67T and V71T are the only ones with this variation. It could also be specified on yet-to-be-created future devices (some theoretical V99T might exist). What should the behavior be in those cases? -Brian