[SOLVED] Segger linker merge string constants vs. strftime

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Segger linker merge string constants vs. strftime

    Hello,

    I'm currently testing the Segger linker and ran into a problem when "merge string constants" is enabled:


    C Source Code

    1. strftime(buffer,len,"%d-%m-%Y %H:%M:%S",datetime);


    Gives the linker error:

    assertion failure: section '.rodata.str.%m/%d/%y.merge' from - Linker created - is not mapped

    Digging a little further (after disabling strftime()):

    C Source Code

    1. const char* date_format = "%m/%d/%y";
    Also emits the same linker error.


    C Source Code

    1. const char* date_format = "%M/%d/%y";

    does not.
  • New

    Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.

    Do you have string merging enabled in project options under Linker->Merge String Constants?
    If yes could you disable this and report back if that changes anything?

    Could you provide an example project for reproduction purposes so we can investigate if the Linker behaviour can be improved?

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support system can be used as well: segger.com/ticket/
  • New

    The issue is not present when "Merge String Constants is disabled. Furthermore, it seems that "Merge String Constants" must be used with "inline small functions" linker option for the issue to be present.

    I've attached a SES project that reproduces the issue. Tested with SES for ARM v4.18.

    /Rune
    Files
  • New

    Hi,

    Thank you for providing the project. With it the issue was reproducible. It will be fixed with the next Embedded Studio release. For now try not to merge strings.
    Sorry for any inconveniences caused.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support system can be used as well: segger.com/ticket/