[PATCH] ld: Limit "readelf --got-contents" tests

H.J. Lu hjl.tools@gmail.com
Thu Sep 4 15:01:34 GMT 2025


On Thu, Sep 4, 2025 at 7:51 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 04.09.2025 16:45, H.J. Lu wrote:
> > On Thu, Sep 4, 2025 at 7:41 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>
> >> On 04.09.2025 16:34, H.J. Lu wrote:
> >>> On Thu, Sep 4, 2025 at 7:12 AM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >>>>
> >>>> Hi H.J.,
> >>>>
> >>>>> On Thu, Sep 4, 2025 at 6:40 AM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >>>>>>
> >>>>>> Hi H.J.,
> >>>>>>
> >>>>>>> Since "readelf --got-contents" tests use -melf_i386, -melf_x86_64 and
> >>>>>>> -melf32_x86_64 emulations, limit theses tests to targets with those
> >>>>>>> emulations.
> >>>>>>>
> >>>>>>>       PR ld/33350
> >>>>>>>       * testsuite/ld-i386/binutils.exp: Limit tests to targets with
> >>>>>>>       -melf_i386 support.
> >>>>>>>       * testsuite/ld-x86-64/binutils.exp: Limit tests to targets with
> >>>>>>>       -melf_x86_64 and -melf32_x86_64 support.
> >>>>>>
> >>>>>> TBH, this feels like pure lazyness to me: as reported in the PR, if you
> >>>>>> exclude the x32 tests (which are strictly Linux-only), at least
> >>>>>> FreeBSD/amd64 has clean results.  Solaris/x86 is partially different,
> >>>>>> but some of this is already addressed in the patch attached to the PR.
> >>>>>>
> >>>>>> FreeBSD/amd64 supports both -melf_i386 and -melf_x86_64, but isn't
> >>>>>> included in the list above.  Besides, that patch already handles the
> >>>>>> -melf_i386 vs. -melf_i386_sol2 (and x86_64 equivalent) difference: it's
> >>>>>> effectively trivial.
> >>>>>
> >>>>> I'd like to make sure that readelf outputs match exactly for a given
> >>>>> emulation.  If Solaris doesn't support such emulation, it should be
> >>>>> skipped.
> >>>>
> >>>> the only difference of those emulations is the additions of a couple of
> >>>> symbols as per ld/emultempl/solaris2.em.
> >>>
> >>> My v2 patch checks the emulation support.
> >>>
> >>>> I honestly wonder why you ask me to test your patches at all if your
> >>>> only response to the slightest issue is to restrict the patches to
> >>>> Linux.  After all, binutils isn's a Linux-only project (nor x86-only).
> >>>
> >>> I want to make sure that --plt-contents displays all relevant
> >>> information correctly.  My tests are emulation specific.   There
> >>> is nothing Linux specific.
> >>
> >> Yet still the question stands - if it's just a few extra symbols, can't
> >> you cater for them using #?REGEXP constructs in the expectations?
> >
> > It sounds wrong.  Are you saying that the same emulation generates
> > extra symbols for Solaris?
>
> I'm not saying that, no, but see what Rainer said. Tests shouldn't be
> artificially restricted - the wider their coverage, the better.
>

Please see the v2 patch:

https://patchwork.sourceware.org/project/binutils/list/?series=51595


-- 
H.J.


More information about the Binutils mailing list