Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365673 - remove references to atexit(), exit() and abort() from System module
Summary: remove references to atexit(), exit() and abort() from System module
Status: CLOSED FIXED
Alias: None
Product: RTSC
Classification: Technology
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Vikram Adiga CLA
QA Contact:
URL:
Whiteboard: target:3.26.00
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 17:26 EST by Karl Wechsler CLA
Modified: 2014-06-16 20:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Wechsler CLA 2011-12-05 17:26:48 EST
The atexit() reference requires malloc() for the TI/EABI/ELF targets.  And the TI/COFF implementation has a large static array.   If app doesn't call System_exit(), the app still suffers from the data footprint for this static array.
Comment 1 Sasha Slijepcevic CLA 2013-01-22 20:28:30 EST
If we remove the call to exit() from System_exit, we could still run atexitHandlers in a loop in System_exit, instead of relying on exit() to call System_rtsExit(), where the loop is currently run.
However, CCS automatically sets a breakpoint at C$$EXIT, and if we don't call exit() we will not hit that code. SYS/BIOS regressions rely on the tests hitting C$$EXIT, but they could be changed to set a breakpoint at System_exit. Karl thinks that this bug raises too many small issues, and we should probably postpone it.
Comment 2 Vikram Adiga CLA 2013-11-07 18:44:50 EST
The usage of exit() and abort() in System module is now configurable. The System Module contains configurable variables which can be set to point to user defined abort() and exit() implementation to avoid the large footprint from C Standard APIs.

This allows backward compatibility though atexit() is no longer used. The atexit() was used to connect the System_atexit()'s to atexit() so that all functions bound via atexit() or System_atexit() were processed when exit() or System_exit(). Now, it users responsibility to connect the System_atexit() to atexit().

This has been fixed in xdc-A03
Comment 3 Karl Wechsler CLA 2014-03-18 12:19:31 EDT
verified by code review.   also verified the .map file for a few .out files and atexit() is gone. 

verify pass.
Comment 4 Sasha Slijepcevic CLA 2014-06-16 20:33:48 EDT
- shipped in 3.30.0