Skip to content

Commit 58c92de

Browse files
ARC: MWDT: workaround for libs with stackcheck
As of today we have libraries provided by MWDT build with stackcheck enabled. So we have to provide dummy _fstack, _estack to make it working. Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent e6a9233 commit 58c92de

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/arch/arc/v2/linker.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,16 @@ SECTIONS {
224224
__kernel_ram_end = .;
225225
__kernel_ram_size = __kernel_ram_end - __kernel_ram_start;
226226

227+
#ifdef __MWDT_LINKER_CMD__
228+
/* mwdt requires _fstack, _estack which will be used in _stkchk.
229+
* _stkchk is inserted by mwdt automatically, if _fstack, _estack is not
230+
* set correctly, the brk_s instruction will be called
231+
* here, we use a trick to deceive the compiler.
232+
*/
233+
_fstack = _image_ram_start;
234+
_estack = .;
235+
#endif /* __MWDT_LINKER_CMD__ */
236+
227237
GROUP_END(RAMABLE_REGION)
228238

229239
/* Located in generated directory. This file is populated by the

0 commit comments

Comments
 (0)