GooTal commented on issue #8886:
URL: https://github.com/apache/nuttx/issues/8886#issuecomment-1495545478

   I was porting a kernel build version for loongarch and encounterd this too.
   We used some CXXFLAGS to avoid using got.
   BTW, i saw linux ignored the got symbol, maybe we could do this.
   ```
   static int ignore_undef_symbol(struct elf_info *info, const char *symname)
   {
        /* ignore __this_module, it will be resolved shortly */
        if (strcmp(symname, "__this_module") == 0)
                return 1;
        /* ignore global offset table */
        if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
                return 1;
        if (info->hdr->e_machine == EM_PPC)
                /* Special register function linked on all modules during final 
link of .ko */
                if (strstarts(symname, "_restgpr_") ||
                    strstarts(symname, "_savegpr_") ||
                    strstarts(symname, "_rest32gpr_") ||
                    strstarts(symname, "_save32gpr_") ||
                    strstarts(symname, "_restvr_") ||
                    strstarts(symname, "_savevr_"))
                        return 1;
        if (info->hdr->e_machine == EM_PPC64)
                /* Special register function linked on all modules during final 
link of .ko */
                if (strstarts(symname, "_restgpr0_") ||
                    strstarts(symname, "_savegpr0_") ||
                    strstarts(symname, "_restvr_") ||
                    strstarts(symname, "_savevr_") ||
                    strcmp(symname, ".TOC.") == 0)
                        return 1;
        /* Do not ignore this symbol */
        return 0;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to