Menu

#2906 static local variables problem

open
nobody
STM8
5
2019-06-06
2019-05-05
harryzz
No

hello
there is problem with static local variables initialization: Error: <r> relocation error</r>

example:

int test() {
static int a = 1;
return 0;
}

void test2() {
test();
}

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 3.9.1 #11242 (MINGW64)
published under GNU General Public License (GPL)

br
Zahari

Related

Wiki: SDCC 4.3.0 Release
Wiki: SDCC 4.4.0 Release
Wiki: SDCC 4.5.0 Release
Wiki: SDCC 4.6.0 Release
Wiki: SDCC-STD-UX

Discussion

  • Philipp Klaus Krause

    I can't reproduce this issue on my Debian GNU/Linux testing system using SDCC 3.9.1 #11249.

    Could you post the .asm file (if possible compiling with --no-peep and --fverbose-asm).

    Philipp

     
  • harryzz

    harryzz - 2019-05-29

    sdcc: Calling assembler...
    sdcc: sdasstm8.exe -plosgffwy ""./build\main".asm"
    ./build\main.asm:638: Error: <r> relocation error
    make: *** [makefile:49: compile] Error 1
    The terminal process terminated with exit code: 2</r>

    sorry but i cant find SDCC 3.9.1 #11249 in nightly build. I use latest version from 29.05.2019
    http://sourceforge.net/projects/sdcc/files/snapshot_builds/x86_64-w64-mingw32/sdcc-snapshot-x86_64-w64-mingw32-20190529-11242.zip/download

    reported as:
    $ /opt/sdcc/bin/sdcc -v
    SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 3.9.1 #11242 (MINGW64)
    published under GNU General Public License (GPL)

    br
    Harry

     
  • Philipp Klaus Krause

    The .asm file looks as if you are compiling with --debug --out-fmt-elf. Maybe this be a duplicate of Bug [#2741].

     

    Related

    Bugs: #2741


    Last edit: Maarten Brock 2019-11-02
  • harryzz

    harryzz - 2019-06-06

    yes if i remove --debug option error goes away.

    br
    Harry

     

Log in to post a comment.

MongoDB Logo MongoDB