Expand paths before making relative symlink

Fixes #27702.
Fixes #27704.