> I have inherited an application that makes extensive use of ld scripts. ...
> -L $APP_LIBS -( -lnwiss -lr -)
The shell expands environment variable APP_LIBS here as part of a ld (or gcc) command line.
> @$APP_LIBS lib.ld
Inside a linker script, then ld does not expand shell environment variables.
> Is there a special notation for employing environment variables in ld scripts?
No; instead you must perform the expansion before invoking ld.
One way to do this is with a shell "Here Document" which is invoked by the syntax "<<".
See the documentation for any shell, such as "man bash" or "info bash".
Example:
cat - > my_linker_script.txt <<EOF
@$APP_LIBS lib.ld
EOF
The shell will expand "$APP_LIBS" as it reads the lines until EOF.
The utility program 'cat' then writes those lines to its stdout,
which in this case is re-directed to file "my_linker_script.txt".
ld ... -T my_linker_script.txt ...
Use the file my_linker_script.txt with the already-expanded environment variables.
--