armlink : error L6065: Load region LR$$Debug (size 0x9e19f85c) is larger than maximum writable contiguous block size of 0x80000000.
Is this a bug in the arm compiler?
This is impossible to say, so far, with this little information on the issue. Please provide a test project, with this the problem can be reproduced. For that, you can also open a support case if you don't want to share possibly sensitive data. But only with this, we can have a look.
I don't know how to reproduce this in a simple project. We have temporarily avoided this problem by modifying some files to compile with O1. I guess it may be related to our large number of global variables. These global variables have two characteristics: 1 ) There are static variables in the global variable constructor. 2) Global variables have member variables like "std::variant<std::monostate, std::function<bool(char* strBuf, const size_t bufSize)>"
The error as reported seems valid - the size is larger than 0x80000000. However is this load region supposed to be this huge?
I also think it should not be so big. What is more suspicious is that we have more than 5000 global variables, and each of these variables has a static variable in the constructor. A static variable is a structure, and some members are initialized with a lamda function during initialization.
As Andreas commented above, I suggest you raise an official support case so that Arm can properly investigate, as this will likely require some sharing of files.