Hello support team,

Thank you for your replies.

The our shared RL78/G14 project has the following source line. LLVM-RL78 clang ld.lld generates correct relocation address. But if I remove the line, LLVM-RL78 clang generates incorrect relocation address.

This problem might be caused in the following condition A & B & C.

(A) Variable is defined in C source file.
(B) The variable isn’t used in C source file.
(C) The variable is used in assembly source file.

Screen copies:



Best regards,


At first post, I mistakenly used -O0 optimization option. Now -Os is used in the screen copies.

Best regards,

Open Source Tools Support 回答済
    • Dear NoMaY-san,

      We have managed to reproduce the issue, thank you for bringing it to our attention.

      While we are working on a fix, a possible workaround could be changing the output sections for the functions present in portasm.S (and for any other in similar situation) from .lowtext.* to .text.* This change resulted in the correct detection of symbol reference in the assembly files, preventing their removal by the –gc-sections option.

      Please let us know if this workaround works for you.

      Best regards,
      The Open Source Tools Team