#2125 wrong file extension for s19 file

Ben Shi
linker (61)

Using the --out-fmt-s19 option with SDCC no longer generates a output file with the extension ".s19". It instead ends up with the extension ".s37".

Looking at the linker source, it appears that it is attempting to use an s-record format appropriate to the address size of the target and it has somehow selected the wrong size, at least at the point the file is created. S19 is used with 16-bit addresses, S28 is used with 24-bit addresses, and S37 is used with 32-bit addresses. Although the file generate has an ".s37" extension, it actually is a correctly formatted S19 format file. It would be a quick fix for me to simply change the text of the string used for the extension, but I'm hoping someone more familiar with the assembler/linker sources knows a more proper fix.


  • Maarten Brock

    Maarten Brock - 2013-01-07

    I have no objections to a quick fix if that helps you. But please leave this bug open then.

  • FlowSwitch

    FlowSwitch - 2014-04-15

    There is another bug related to s-record extension handling:
    this command sdcc --out-fmt-s19 -mmcs51 -o main main.c produces main.s37,
    this command sdcc --out-fmt-s19 -mmcs51 -o main.abc main.c ALSO produces main.s37,
    this command sdcc --out-fmt-s19 -mmcs51 -o main.s37 main.c DOESN'T produce any s-record file. All other lk,rst,mem,map etc are produced as usual.

    SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.4.0 #8981 (Apr 5 2014) (MINGW64)

    Last edit: FlowSwitch 2014-04-15
  • Ben Shi

    Ben Shi - 2015-07-13
    • status: open --> closed-fixed
    • assigned_to: Ben Shi
    • Category: --> sdld
  • Ben Shi

    Ben Shi - 2015-07-13

    Fixed in reversion #9284. Since s28 and s37 are actually not used in sdld, they are entirely removed.

  • Maarten Brock

    Maarten Brock - 2015-07-13

    Does this mean that it is now no longer possible to generate >64k output files? What if someone wants to do bankswitching?

    How does this deviate from the original aslink? Is that broken too in this sense or did we break something when merging? Or is sdcc just using the linker incorrectly?

  • Ben Shi

    Ben Shi - 2015-07-13

    I do not think the removal of 'case 3' and 'case 4' break anything. The worst damage might be an actual .s37 file be named to .s19.

    But I only find sdas/linksrc/lks19.c which generates .s19 files, and nothing for .s37 and .s29.


Log in to post a comment.