gcc: add options to limit large object and stack usage
PD#150373: gcc: add options to limit large object and stack usage
We should restrict limit large size of global object allocated in
driver code to reduce size of .data/.bss/.rodata sections. Also,
large array/many variables declared in a function is not allowed,
this behavior may cause kernel stack overflow especially in IRQ
context or recursion calls.
Right now we just set a very high limit in order to pass comiple.
Final target is to limit:
1. large global object size should not over 4096 bytes, a page size;
2. stack usage of each function should not over 256 bytes.
If your global object is larger than a page size, we advise allocate
it as a static pointer, and allocate it's memory during probe stage.
Change-Id: Ic14995f642bc1e0b47d3a07143468e6e1dac7bfc
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>