[PATCH 0/1] gas: add new command line option --no-group-check

Tan Yuan tanyuan@tinylab.org
Sun Jul 23 09:31:39 GMT 2023


Hi,

> On Sat, 2023-07-22 at 11:47 +0800, Tan Yuan wrote:
> > 
> > We hope to modify code like this in the kernel:
> > +   #define ___PASTE(a,b) a##b
> > +   #define __PASTE(a,b) ___PASTE(a,b)
> > +   #define __UNIQUE_ID_GROUP __PASTE(__PASTE(__COUNTER__, _),
> > __LINE__)
> >     
> >     #define __ASM_EXTABLE_RAW(insn, fixup, type, data)     \
> > -           ".pushsection   __ex_table, \"a\"\n"            \
> > +           ".attach_to_group " __stringify(__UNIQUE_ID_GROUP) "\n" \
> > +           ".pushsection   __ex_table, \"a?\"\n"           \
> >             "…"                            \
> >             ".popsection\n"
> 
> Note that even if this Binutils patch is accepted, it will only show up
> in Binutils-2.42 and later.  So the kernel maintainers will reject this
> change, as you cannot tell everyone "use Binutils >= 2.42 to build the
> kernel".
> 
> I'd suggest to try figuring out a better solution.
> -- 
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University

Thanks your suggestion and I really need some new idea to solve this problems.

This method is the best I can come up with so far.  However, I don’t think
"Binutils >= 2.42" is a problem, as what I am adding to kernel is an optional
feature, user can choose to enable it. And it seems that we can check version
of Binutils in the code[1].

[1]: https://stackoverflow.com/a/51008423

Tan Yuan


More information about the Binutils mailing list