Re: [PATCH] ld: don't use SAME_INODE for the duplicate-script check on hosts without inodes

Cole Munz <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <HhtEJS1Ry05c5YCaC4ZfG8AvJy4-b07k5zRsRD9zY03gWyBy5qkCqE_1ZiScUlrtaW0jg_MyaU3ywVAJXH7QRFrG6kx_ybyWjhtqJ-3ExVQ=@proton.me>
On Tue, Aug 18, 2026 at 03:30:44PM +0930, Alan Modra wrote:
> That says there is a bug in SAME_INODE, and in upstream gnulib too.
> I will apply the following.

Agreed, and that is the right layer for it. I tested the two macros side by
side:

  two different files on D: (st_ino 0, st_dev 3)
     old -> 1   treats them as the same file
     new -> 0   correct
  two different files on drive 0 (st_ino 0, st_dev 0)
     old -> 0   new -> 0
  same file, real inode info
     old -> 1   new -> 1   still detects real duplicates
  different files, real inode info
     old -> 0   new -> 0

So it removes the false positive without weakening the case where inodes
work.

One consequence worth a decision. Once SAME_INODE is false whenever st_ino
is 0, ld's PR 24576 check goes inert on native Windows, so someone who does
pass the same script twice there gets no diagnostic at all. My patch kept
that check alive on such hosts by falling back to a name comparison when
stat gives nothing usable.

Either is defensible. Drop my ld patch and let PR 24576 only cover hosts
with real inodes, or take same-inode.h plus the name fallback and keep the
diagnostic everywhere. I have no preference, I just did not want the check
to go quiet as a side effect rather than as a choice.

Cole
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.