Skip to main content
Visitor II
May 4, 2022
Question

ERROR from SDCC Linker - "?ASlink-Warning-Undefined Global 'null' referenced by module 'main'"

  • May 4, 2022
  • 1 reply
  • 2900 views

$ sdcc -mstm8 --out-fmt-elf -o build/firmware.elf build/{main.rel,uart3.rel,misc.rel}

?ASlink-Warning-Undefined Global 'null' referenced by module 'main'

What is meaning?

Module "main.rel" was compile without errors/warning.stm8-gdb has segfault when i load this elf :(

    This topic has been closed for replies.

    1 reply

    Graduate II
    May 4, 2022

    Perhaps you have some object dumping tools, or you can look for correlating data in the .MAP or .LST files.

    >>Module "main.rel" was compile without errors/warning.

    You understand that means Very Little, simply that the code appears syntactically correct, not that it is functionally correct, or sufficient to get closure in the linker.

    Perhaps use bi-section techniques to isolate the portion of code involved, or the delta from the last code that compiled and linked properly.

    flankerusAuthor
    Visitor II
    May 5, 2022

    >Perhaps use bi-section techniques to isolate the portion of code involved, or the delta from the last code that compiled and linked properly.

    yeah, i was figure out with it!

    "static uint16_t tick=0"

    using a static variable in the main loop broke the build project in ELF format

    fixed it through replace to local variable. Thanks for answer!