May 09, 2019 Re: Cortex-M3 low level assert issue. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jack Applegame | On Thursday, 9 May 2019 at 11:23:27 UTC, Jack Applegame wrote: > I tried to use `lld` instead of `arm-none-eabi-ld` and got some interesting results. > `lld` successfully removed unused string constants. > > I found that there is special SFH_MERGE flag. The linker should remove unused constants and merge duplicates in sections marked with this flag. But it seems that the GNU linker ignores it. Ah, nice. [A non-ancient version of] gold may strip them too then (maybe even recent version of bfd), according to this snippet from the gcc bugzilla linked above (from 2015): > > [...] perhaps ld's --gc-sections or new special option should just remove unused string literals from mergeable sections. > > I believe (I've read, but I haven't verified) that Gold already does this. |
Copyright © 1999-2021 by the D Language Foundation