Fixing absolute path calculation for file module when linking

Fixes #7403