[PATCH 3/3] ld/testsuite: Add comprehensive PE COFF weak external tests

Alan Modra amodra@gmail.com
Tue Jun 30 23:52:25 GMT 2026


On Sun, Jun 07, 2026 at 10:19:36PM +0200, Peter Damianov wrote:
> On 2026-06-01 12:39, Alan Modra wrote:
> > On Sat, May 30, 2026 at 03:15:22PM -0400, Peter Damianov wrote:
> > > Add tests covering the full matrix of weak/strong symbol interactions
> > > for PE COFF weak externals, based on testcases by Martin Storsjo.
> > 
> > On a cross build of x86_64-w64-mingw32 from x86_64-linux with gcc
> > 13.2.0-6ubuntu1+26.1 installed, I see
> > x86_64-w64-mingw32  +FAIL: weak external: strong undef + weak def (link)
> > x86_64-w64-mingw32  +FAIL: weak external: duplicate weak defs (link)
> 
> I tried this myself, and while I don't know for sure what is wrong for you,
> I saw these logs:
> 
> ERROR:
> ************************************************************************
> ERROR: Your compiler apparently ignores -B when choosing ld.
> ERROR: Hint: don't configure gcc using --with-ld (or --with-as)
> ERROR: You will not be testing the new ld in many of the following tests.
> ERROR: It seems you will be testing /usr/bin/x86_64-w64-mingw32-ld instead.
> ERROR:
> ************************************************************************
> 
> So I suspect it's testing the wrong LD.

Right, I should have checked that before I tried your patch set, and
worked around the compiler config problem by installing sym-links.

I have committed your v3 patchset upstream.  I think there are some
potential buffer overflow problems reading aux entries from fuzzed
object files, but at least some of those are pre-existing.

> FAIL: weak external: strong undef + weak def (link)
> FAIL: weak external: duplicate weak defs (link)
> 
> I did manage to reproduce your same failures, but my local gcc which is
> probably configured differently is fine.
> 

-- 
Alan Modra


More information about the Binutils mailing list