Skip to content

Commit

Permalink
overlays/mtk: Fix linker API
Browse files Browse the repository at this point in the history
The name of the rmap array changed in upstream bintuils commit
2b16913cdca2 ("gdb: make gdbarch_alloc take ownership of the tdep").
At the same time it seems like the xtensa_tdep definition (which
contra the filename is actually a C++ object definition and not a
function prototype!) moved into this file from elsewhere in binutils.

The xtensa_rmap symbol is only used by newer binutils versions than
the Zephyr SDK builds, but add an alias so it builds with upstream
crosstools-ng, and commit it here as a reference if we want to port
the other Xtensa overlays.

Signed-off-by: Andy Ross <andyross@google.com>
  • Loading branch information
andyross authored and stephanosio committed Dec 9, 2024
1 parent 7144272 commit fff0928
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions overlays/xtensa_mtk_mt818x_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));

xtensa_gdbarch_tdep xtensa_tdep (rmap);

#ifdef XTENSA_CONFIG_INSTANTIATE
XTENSA_CONFIG_INSTANTIATE(rmap,16)
Expand Down
4 changes: 3 additions & 1 deletion overlays/xtensa_mtk_mt8195_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const xtensa_mask_t xtensa_mask39 = { 1, xtensa_submask39 };


/* Register map. */
static xtensa_register_t rmap[] =
xtensa_register_t rmap[] =
{
/* idx ofs bi sz al targno flags cp typ group name */
XTREG( 0, 0,32, 4, 4,0x0020,0x0006,-2, 9,0x2100,pc, 0,0,0,0,0,0)
Expand Down Expand Up @@ -496,4 +496,6 @@ static xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));

xtensa_gdbarch_tdep xtensa_tdep (rmap);
2 changes: 2 additions & 0 deletions overlays/xtensa_mtk_mt8196_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));

xtensa_gdbarch_tdep xtensa_tdep (rmap);

#ifdef XTENSA_CONFIG_INSTANTIATE
XTENSA_CONFIG_INSTANTIATE(rmap,16)
Expand Down

0 comments on commit fff0928

Please sign in to comment.