Linker returned Errorcode 139

Help
2014-01-09
2014-01-12
  • Hi,

    I am using a multiple file project. The compiler works fine and everything is compiling. But the linker said there is an error but I can't understand it because I can't find any error description. My platform is a STM8.

    Here is the linker call from my makefile

    sdcc --code-loc $(CODE_LOCATION) --data-loc $(RAM_LOCATION) \ --stack-loc $(STACK_LOCATION) --debug -V --verbose --iram-size $(RAM_SIZE) \ --code-size $(CODE_SIZE) debug/main.rel debug/display.rel \ debug/steuerung.rel debug/timer3.rel debug/timer1.rel debug/uart2.rel \
    debug/qepn.rel debug/qfn.rel debug/qfn_init.rel debug/stm8s_clk.rel \
    debug/stm8s_gpio.rel debug/stm8s_tim1.rel debug/stm8s_tim2.rel \ debug/stm8s_tim3.rel debug/stm8s_tim4.rel debug/stm8s_uart2.rel debug/bsp.rel \ debug/keys.rel

    For this call I get the following messages:

    sdcc --code-loc 0x008000 --data-loc 0x000000 --stack-loc 0x0005FF \

    --debug -V --verbose --iram-size 0x000800 --code-size 0x007D00 \ debug/main.rel debug/display.rel debug/steuerung.rel debug/timer3.rel \ debug/timer1.rel debug/uart2.rel debug/qepn.rel debug/qfn.rel debug/qfn_init.rel \ debug/stm8s_clk.rel debug/stm8s_gpio.rel debug/stm8s_tim1.rel debug/stm8s_tim2.rel \ debug/stm8s_tim3.rel debug/stm8s_tim4.rel debug/stm8s_uart2.rel debug/bsp.rel \ debug/keys.rel
    sdcc: Calling linker...
    sdcc: Calling linker...
    + /usr/bin/sdld -nf main.lk
    + /usr/bin/sdld -nf main.lk returned errorcode 139

    My question is now, what das this errorcode mean? Or what did I wrong?

     
  • It looks as if your command line lacks the -mstm8 option.

    Philipp

     
  • Thanks for the help Phillip!!

    That was my mistake.

     
  • Mine as well as yours, but I improved it a bit: sdcc from current svn (and thus sdcc in snapshots from tomorrow or so) now is a bit more informative:

    ?ASlink-Warning-Conflicting sdcc options:
    "-mstm8" in module "test" and
    "-mmcs51 --model-small" in module "abs".

    Philipp