https://sourceware.org/bugzilla/show_bug.cgi?id=30354
--- Comment #3 from Torbjörn SVENSSON <torbjorn.svensson at foss dot st.com> --- Hi Nick, Long time...! (In reply to Nick Clifton from comment #1) > (In reply to Torbjörn SVENSSON from comment #0) > Hi Torbjörn, > > > Attached is a small demonstration of what's happening. > > I may be mistaken here, but when an implib is being created, shouldn't the > binary file that is being created be linked as a shared library not a fully > linked executable ? This should stop the linker's garbage collection from > even running, so the problem should not arise ... While this is most likely true for most implibs, it's not the case with Cortex-M33 targets with TrustZone (CMSE). In this case, the implib is used as an interface between the secure and non-secure applications with a jump table (veneer functions) that is places in a non-secure callable area of the flash. Maybe this explains why the symbols got garbage collected? A simple misunderstanding about when the implib is used? Anyway, the compile units should be marked to be preserved in the CMSE use-case of implib. > > The linker script in the attached example is the default one with one > > addition: > > .gnu.sgstubs : { *(.gnu.sgstubs*) } > > I suppose this is an overlook and that this section should be added to the > > default linker script for Arm targets in order to not force the user to > > define there own linker script. > > Yes, that is an omission from the default scripts. I will fix it. Thanks for fixing this in master! -- You are receiving this mail because: You are on the CC list for the bug.