[RTEMS Project] #2407: Enable function and data sections

RTEMS trac trac at rtems.org
Wed Sep 2 12:29:49 UTC 2015


#2407: Enable function and data sections
-----------------------------+------------------
 Reporter:  sebastian.huber  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  4.12
Component:  build            |    Version:  4.10
 Severity:  normal           |   Keywords:
-----------------------------+------------------
 In order to reduce the size of executables it is beneficial to put all
 global functions and data into separate sections. This enables the linker
 to perform a garbage collection which removes all items not directly
 referenced. The following steps are necessary:

 1. Modify the build system to use the following compiler and linker flags:

 CFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS += -Wl,--gc-sections

 2. Review all linker command files and ensure that linker sets and global
 constructor sections are not affected by the garbage collection (e.g. use
 the KEEP() directive of GNU ld).

--
Ticket URL: <http://devel.rtems.org/ticket/2407>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list