Skip to main content
flankerus
Associate II
May 4, 2022
Question

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

  • May 4, 2022
  • 2 replies
  • 3616 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.

    2 replies

    Tesla DeLorean
    Guru
    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.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    flankerus
    flankerusAuthor
    Associate 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!