debug: symtab: fix linking issue due to variable redefinition

Employs the same linkonce magic of sw_isr_table to fix the
multiple definition of the symtab variables issue that I
get in my application build that doesn't use `west`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
diff --git a/scripts/build/gen_symtab.py b/scripts/build/gen_symtab.py
index 1d93344..ac20506 100644
--- a/scripts/build/gen_symtab.py
+++ b/scripts/build/gen_symtab.py
@@ -125,10 +125,11 @@
     with open(args.output, 'w') as wf:
         print("/* AUTO-GENERATED by gen_symtab.py, do not edit! */", file=wf)
         print("", file=wf)
+        print("#include <zephyr/linker/sections.h>", file=wf)
         print("#include <zephyr/debug/symtab.h>", file=wf)
         print("", file=wf)
         print(
-            f"const struct z_symtab_entry z_symtab_entries[{len(symtab_list) + 1}] = {{", file=wf)
+            f"const struct z_symtab_entry __symtab_entry z_symtab_entries[{len(symtab_list) + 1}] = {{", file=wf)
         for i, entry in enumerate(symtab_list):
             print(
                 f"\t/* ADDR: {hex(entry.addr)} SIZE: {hex(entry.size)} */", file=wf)
@@ -145,7 +146,7 @@
             f"\t[{len(symtab_list)}] = {{.offset = {dummy_offset}, .name = \"?\"}},", file=wf)
         print(f"}};\n", file=wf)
 
-        print(f"const struct symtab_info z_symtab = {{", file=wf)
+        print(f"const struct symtab_info __symtab_info z_symtab = {{", file=wf)
         print(f"\t.first_addr = {hex(first_addr)},", file=wf)
         print(f"\t.length = {len(symtab_list)},", file=wf)
         print(f"\t.entries = z_symtab_entries,", file=wf)