Symlinks are relative to the parent directory of the link, not of the current directory of the ln process.
When you do:
cd /top/dir
ln -s test/src test/firefox
(where test/firefox is a directory), you're making a test/firefox/src symlink whose target is test/src.
That test/src is relative to the test/firefox directory, so that's a symlink to /top/dir/test/firefox/test/src.
If you wanted that symlink to be a link to /top/dir/test/src, you'd need to write:
ln -s ../src test/firefox/
Or
ln -s /top/dir/test/src test/firefox/
though it's generally a bad idea to make symlinks to absolute paths as they are easily broken when directories are renamed or filesystems are mounted elsewhere.
With GNU ln, you can use its -r option to let it make the calculation by itself:
$ ln -rs test/src test/firefox/
$ ls -ld test/firefox/src
lrwxrwxrwx 1 chazelas chazelas 6 Nov 29 15:59 test/firefox/src -> ../src
ls -ld test test/*, or the exact sequence of commands that you ran to create these files. – Gilles 'SO- stop being evil' Jul 09 '14 at 00:53cd test/firefox/srcwould show the errorcd: no such file or directory: test/firefox/src, becausetest/firefox/srcis a dangling symbolic link. Are you runningcdon some other symbolic link calledsrc? – Gilles 'SO- stop being evil' Jul 09 '14 at 01:18ln -sand thecdthat you don't tell us. Assuming that there is only atestsubdirectory in your current directory, acd src(or whatever you executed) should throw an error. Did you put something intotest/firefox? – Dubu Jul 09 '14 at 07:44/some/path, aln -s test/src test/firefoxwill create a symlink pointing from/some/path/test/firefox/srcto/some/path/test/firefox/test/src, not to/some/path/test/src. – Dubu Jul 09 '14 at 07:48