How to fail the build based on the conditional values of linker variables defined in linker script?
I am compiling C code using GCC. I defined a linker variable BINARY_TEST. If Value of BINARY_TEST > 32KB, then i want to Fail the build. How to write a conditional test and fail the build using linker script? Please suggest any script.
SECTIONS
{
. = 0x0000 ;
.text :
{
*(.text)
*(.rdata)
}
.data :
{
*(*.data)
*(*.bss)
}
BINARY_TEST = . ;
/*Want something like below */
if (BINARY_TEST > 32KB)
Throw Error and stop
/* ******* */
END = . ;
}