From ac9b8c676e9f52c5238bbc61a2cdd27e3d59db10 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Fri, 9 Sep 2022 08:44:50 -0700 Subject: Constify target_desc declarations This patch changes various global target_desc declarations to const, thereby correcting a prominent source of ODR violations in PowerPC-related target code. The majority of files/changes are mechanical const-ifications accomplished by regenerating the C files in features/. This also required manually updating mips-linux-tdep.h, s390-linux-tdep.h, nios2-tdep.h, s390-tdep.h, arch/ppc-linux-tdesc.h, arch/ppc-linux-common.c, and rs6000-tdep.c. Patch tested against the sourceware trybot, and fully regression tested against our (Red Hat's) internal test infrastructure on Rawhide aarch64, s390x, x86_64, and powerpcle. With this patch, I can finally enable LTO in our GDB package builds. [Tested with a rawhide scratch build containing this patch.] Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24835 --- gdb/s390-tdep.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/s390-tdep.h') diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h index f51423c..bfee9a8 100644 --- a/gdb/s390-tdep.h +++ b/gdb/s390-tdep.h @@ -317,7 +317,7 @@ extern struct value *s390_trad_frame_prev_register (struct frame_info *this_frame, struct trad_frame_saved_reg saved_regs[], int regnum); -extern struct target_desc *tdesc_s390_linux32; -extern struct target_desc *tdesc_s390x_linux64; +extern const struct target_desc *tdesc_s390_linux32; +extern const struct target_desc *tdesc_s390x_linux64; #endif /* S390_TDEP_H */ -- cgit v1.1