From a7e6196bb886ff17d0c87650b6f458d5366122ac Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Thu, 25 Jun 2020 13:54:42 +0200 Subject: [PATCH] Don't include *sol2-tdep.o on Linux/sparc* Linux/sparc* currently links Solaris-specific files (sparc-sol2-tdep.o, sparc64-sol2-tdep.o, sol2-tdep.o) for no apparent reason. It has no business doing so, and none of the functions/variables defined there are used explicitly. If support for the Solaris OSABI were desired, this should be done using --enable-targets instead. Since neither sparc{32,64}_sol2_init_abi currently declared in common headers (sparc*-tdep.h) are used outside their source files, they are made static and the declarations removed. Tested on sparcv9-sun-solaris2.11 and sparc64-unknown-linux-gnu. * configure.tgt (gdb_target_obs): Remove sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o. (gdb_target_obs): Remove sparc64-sol2-tdep.o, sol2-tdep.o, sparc-sol2-tdep.o. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Make static. * sparc-tdep.h (sparc32_sol2_init_abi): Remove. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Make static. * sparc64-tdep.h (sparc64_sol2_init_abi): Remove. --- gdb/ChangeLog | 11 +++++++++++ gdb/configure.tgt | 8 ++++---- gdb/sparc-sol2-tdep.c | 2 +- gdb/sparc-tdep.h | 3 --- gdb/sparc64-sol2-tdep.c | 2 +- gdb/sparc64-tdep.h | 3 --- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0799ec3a5c8..7298617b80e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2020-06-25 Rainer Orth + + * configure.tgt (gdb_target_obs): Remove + sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o. + (gdb_target_obs): Remove sparc64-sol2-tdep.o, + sol2-tdep.o, sparc-sol2-tdep.o. + * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Make static. + * sparc-tdep.h (sparc32_sol2_init_abi): Remove. + * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Make static. + * sparc64-tdep.h (sparc64_sol2_init_abi): Remove. + 2020-06-25 Rainer Orth * amd64-sol2-tdep.c (amd64_sol2_sigtramp_p): Remove. diff --git a/gdb/configure.tgt b/gdb/configure.tgt index b3f31af763c..d66f01bb9f7 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -585,20 +585,20 @@ sh*) sparc-*-linux*) # Target: GNU/Linux SPARC - gdb_target_obs="sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o \ + gdb_target_obs="sparc-tdep.o \ sparc-linux-tdep.o solib-svr4.o symfile-mem.o \ linux-tdep.o \ ravenscar-thread.o sparc-ravenscar-thread.o" if test "x$enable_64_bit_bfd" = "xyes"; then # Target: GNU/Linux UltraSPARC - gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o \ + gdb_target_obs="sparc64-tdep.o \ sparc64-linux-tdep.o ${gdb_target_obs}" fi ;; sparc64-*-linux*) # Target: GNU/Linux UltraSPARC - gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sol2-tdep.o \ - sparc64-linux-tdep.o sparc-tdep.o sparc-sol2-tdep.o \ + gdb_target_obs="sparc64-tdep.o \ + sparc64-linux-tdep.o sparc-tdep.o \ sparc-linux-tdep.o solib-svr4.o linux-tdep.o \ ravenscar-thread.o sparc-ravenscar-thread.o" ;; diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c index dfd6e3454e5..1c61ecc960f 100644 --- a/gdb/sparc-sol2-tdep.c +++ b/gdb/sparc-sol2-tdep.c @@ -192,7 +192,7 @@ static const struct frame_unwind sparc32_sol2_sigtramp_frame_unwind = -void +static void sparc32_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h index 59eaf29be4d..625b3e8914a 100644 --- a/gdb/sparc-tdep.h +++ b/gdb/sparc-tdep.h @@ -245,9 +245,6 @@ extern int sparc_is_annulled_branch_insn (CORE_ADDR pc); extern const struct sparc_gregmap sparc32_sol2_gregmap; extern const struct sparc_fpregmap sparc32_sol2_fpregmap; -extern void sparc32_sol2_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch); - /* Functions and variables exported from sparcnbsd-tdep.c. */ /* Register offsets for NetBSD. */ diff --git a/gdb/sparc64-sol2-tdep.c b/gdb/sparc64-sol2-tdep.c index 31ee8739e6f..824444dd669 100644 --- a/gdb/sparc64-sol2-tdep.c +++ b/gdb/sparc64-sol2-tdep.c @@ -195,7 +195,7 @@ static const struct frame_unwind sparc64_sol2_sigtramp_frame_unwind = -void +static void sparc64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/sparc64-tdep.h b/gdb/sparc64-tdep.h index 614160e90fa..d3ba9e22a45 100644 --- a/gdb/sparc64-tdep.h +++ b/gdb/sparc64-tdep.h @@ -119,9 +119,6 @@ extern void sparc64_collect_fpregset (const struct sparc_fpregmap *fpregmap, extern const struct sparc_gregmap sparc64_sol2_gregmap; extern const struct sparc_fpregmap sparc64_sol2_fpregmap; -extern void sparc64_sol2_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch); - /* Variables exported from sparc64-fbsd-tdep.c. */ /* Register offsets for FreeBSD/sparc64. */ -- 2.30.2