Notice: We have migrated to GitLab launching 2024-05-01 see here:

#2576 closed defect (fixed)

arm/lpc176x: linker script update (add KEEP() sections)

Reported by: Joel Sherrill Owned by: Joel Sherrill <joel@…>
Priority: normal Milestone: 5.1
Component: arch/arm Version: 5
Severity: normal Keywords: function sections, KEEP
Cc: Blocked By:


This BSP's linker script does not include KEEP() directives and thus cannot have per-function and per-data element section support enabled.

The preferred solution is to convert the BSP to use a shared base linker script. The acceptable solution is to add the proper KEEP directives to the existing linker script(s).

Shared linker scripts for the arm, m68k, and sparc have the proper KEEP sections and can serve as examples.

Change History (8)

comment:1 Changed on 02/06/16 at 16:26:47 by Joel Sherrill <joel@…>

In [changeset:"e41d8ce5a764d57952102009ff1c5e5ace69a1c8/rtems"]:

arm/.../lpc1768_embed.cfg: Disable per function sections

updates #2576.

comment:2 Changed on 03/17/16 at 20:12:25 by Marcos Diaz

I looked into the linkerscript and it uses the shared for all arm's, which uses KEEP directives. Then I tested this BSP enabling the flags, and samples work ok:

hello.exe :
section size addr
.start 772 0
.text 79136 776
.rodata 4152 79936
.vector 1256 268435456
.data 1656 268436712
.bss 5656 268438368

With flags:
hello.exe :
section size addr
.start 772 0
.text 61424 776
.rodata 3512 62224
.vector 1256 268435456
.data 1604 268436712
.bss 5592 268438336

And the same for the other samples.

comment:3 Changed on 03/22/16 at 14:51:04 by Marcos Diaz

I suggest to apply the linker flags and deprecate this bug

comment:4 Changed on 03/22/16 at 15:10:51 by Joel Sherrill <joel@…>

Owner: set to Joel Sherrill <joel@…>
Resolution: fixed
Status: newclosed

In [changeset:"1a738edb39d462b9d99be4537782934f5ec56ca5/rtems"]:

lpc1768_mbed.cfg: Turn on per function sections

Closes #2576.

comment:5 Changed on 05/11/17 at 07:31:02 by Sebastian Huber


comment:6 Changed on 10/10/17 at 06:54:12 by Sebastian Huber

Component: bspsarch/arm

comment:7 Changed on 11/09/17 at 06:27:14 by Sebastian Huber


Milestone renamed

comment:8 Changed on 09/14/18 at 19:03:46 by Joel Sherrill

Keywords: function sections KEEP added
Note: See TracTickets for help on using tickets.