foss-for-synopsys-dwc-arc-processors/toolchain — pull request #18 by anthony-kolesov (2013-09-06 09:43:17+00:00)
Title: Ensure that function _exit() is not created by testglue

ARC newlib doesn't have function _exit, however testglue is intended to wrap around it. This function gets created even though it is never called. When performing execution tests Dejagnu sets breakpoints at "exit" functions: abort() and _exit(), if it couldn't set at _exit() then at exit(). That latter case should be applied to ARC, but instead we get breakpoint at function created by testglue which is never called. To resolve this without altering generic code following is done: first we compile wrapper with -ffunction-sectionsi so that each function is compiled into it's own section, then we link with --gc-section, so that unneeded sections will be excluded from final application. Thus application will not include stale _exit() function that will confuse Dejagnu.