[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
    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
    const char* date_format = "%m/%d/%y";

    Also emits the same linker error.


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


    does not.

  • 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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • 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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!