Lld linker script file incorrectly parsing default definition

I’m trying to use a linker script file for lld using GNU flavor. I’m trying to set a default value for a variable using code such as:

__internal_code_size = DEFINED(__internal_code_size) ? __internal_code_size : 1M;

This script doesn’t work. Debugging LinkerScript.cpp, I can see that lld detects __internal_code_size as a “Defined Symbol”, so getting the default value seems to be impossible. The GNU documentation clearly has this as an example of a classic use of define, so I’m pretty sure that line should work.


Is this a bug in the LLVM implementation?

Thanks in advance,