[PATCH] bfd: tweak SET_ARCH_MACH of aout-cris.c
Hans-Peter Nilsson
hp@bitrange.com
Wed May 6 18:50:44 GMT 2020
On Wed, 6 May 2020, Gunther Nikl wrote:
> Hans-Peter Nilsson <hp@bitrange.com> wrote:
> >
> > On Mon, 4 May 2020, Nick Clifton via Binutils wrote:
> > > Hi Gunther,
> > >
> > > > 2020-04-XX Gunther Nikl <gnikl@justmail.de>
> > > >
> > > > * aout-cris.c (DEFAULT_ARCH): Delete define.
> > > > (MY_set_arch_mach): Likewise.
> > > > (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit
> > > > architecture of bfd_arch_cris.
> > > > (swap_ext_reloc_in): Add casts to r_index extraction.
> > > > Mask valid bits of r_type before the shift.
> > >
> > > Approved and applied.
> >
> > Whoops, I missed this one, posted 2020-04-21. Thanks for taking
> > care of it!
>
> I sent the mail to the list only since I knew you are reading the list.
> I was unsure whether CCing you would be fine.
I don't know of a maintainer that would see that as bad, but
I guess it takes just one such experience...
> I assumed that you would
> notice a CRIS topic since its rather rare.
That's reasonable thinking, mea culpa.
> > Regarding the ensuing discussion, I have no recollection of the
> > events around the conception :) other than I was possibly
> > striving for consistency with other similar a.out-related files.
>
> IMO, its quite a challenge to understand all these clever macros
> filling structure elements, calling functions that have to be named
> correctly for other macros. Sometimes a function vector is called
> directly by macro (using another macro ;), and sometimes its a real
> function which then calls the function pointer. And the list goes on.
Yeah, well that's bfd for you. :)
> BTW, I didn't realize until recently that aoutx.h can be used outside
> of aout32.c/aout64.c. However I was surprised to see that aout-cris.c
> does include aout32.c directly. I guess that was a deliberate decision?
I honestly can't remember. Doesn't it match the pattern of
other aout-*.c files? ...hm, not many around. Oh wait: I think
something was sufficiently different that I couldn't use
aout32.c, perhaps the reloc format.
> Anyway including aoutx.h in my custom backend avoided ugly changes to
> aoutx.h itself. That was a surprising lesson.
I think it's actually meant to be used that way, directly or
via aout32.h/aout64.h. At least it says so in a comment.
brgds, H-P
More information about the Binutils
mailing list