I can confirm that I am seeing this with a gfortran-compiled code which uses a 6GB static area, run on an M1 with a recent macOS (Darwin Kernel 23.2.0 as I can see in the
terminal - it's a remote login, I have no idea how to convert it into the usual Apple OS names/version).
Lowering it to 1GB fixes the issue, although that's of course not a real fix.
It seems that the only way out is to use dynamic memory allocation instead, which is, in case of Fortran 77, MALLOC, and ALLOCATE for later Fortran dialects.
The error message is very confusing, of course, this is rather weird that a large static area breaks linking.