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

Cole Munz Munzzyy1@proton.me
Sat Aug 22 07:57:07 GMT 2026


On 22.08.2026 09:08, Jan Dubiec wrote:
> Agreed. BTW. What value does st_ino have on Linux for a file on a FAT
> filesystem?

Linux makes the number up rather than reading it off the disk.
fat_build_inode() sets i_ino = iunique(sb, MSDOS_ROOT_INO) in
fs/fat/inode.c, and iunique() starts its counter above max_reserved and
keeps going until it finds a value not already in use, so you get a
nonzero number and never 0. The comment above that code says it
outright: "i_ino is constant and has nothing with on-disk location".
The root directory is a fixed 1 and FSINFO is 2.

The catch is where the number comes from. fat_build_inode() looks for
an existing inode by on-disk position first and only calls iunique()
when it has to build a new one, so the value is stable while that inode
is alive, but it is not derived from the disk and a remount hands out
fresh ones.

So SAME_INODE does work on Linux over FAT, which is what makes the zero
check a Windows thing rather than a FAT thing. That is read out of the
source though, not measured. I have no FAT filesystem here to stat.

Cole



More information about the Binutils mailing list