Constify target_desc declarations
authorKeith Seitz <keiths@redhat.com>
Fri, 9 Sep 2022 15:44:50 +0000 (08:44 -0700)
committerKeith Seitz <keiths@redhat.com>
Thu, 29 Sep 2022 17:00:13 +0000 (10:00 -0700)
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

78 files changed:
gdb/arch/ppc-linux-common.c
gdb/arch/ppc-linux-tdesc.h
gdb/features/Makefile
gdb/features/microblaze-with-stack-protect.c
gdb/features/microblaze.c
gdb/features/mips-dsp-linux.c
gdb/features/mips-linux.c
gdb/features/mips64-dsp-linux.c
gdb/features/mips64-linux.c
gdb/features/nds32.c
gdb/features/nios2.c
gdb/features/or1k-linux.c
gdb/features/or1k.c
gdb/features/rs6000/powerpc-32.c
gdb/features/rs6000/powerpc-32l.c
gdb/features/rs6000/powerpc-403.c
gdb/features/rs6000/powerpc-403gc.c
gdb/features/rs6000/powerpc-405.c
gdb/features/rs6000/powerpc-505.c
gdb/features/rs6000/powerpc-601.c
gdb/features/rs6000/powerpc-602.c
gdb/features/rs6000/powerpc-603.c
gdb/features/rs6000/powerpc-604.c
gdb/features/rs6000/powerpc-64.c
gdb/features/rs6000/powerpc-64l.c
gdb/features/rs6000/powerpc-7400.c
gdb/features/rs6000/powerpc-750.c
gdb/features/rs6000/powerpc-860.c
gdb/features/rs6000/powerpc-altivec32.c
gdb/features/rs6000/powerpc-altivec32l.c
gdb/features/rs6000/powerpc-altivec64.c
gdb/features/rs6000/powerpc-altivec64l.c
gdb/features/rs6000/powerpc-e500.c
gdb/features/rs6000/powerpc-e500l.c
gdb/features/rs6000/powerpc-isa205-32l.c
gdb/features/rs6000/powerpc-isa205-64l.c
gdb/features/rs6000/powerpc-isa205-altivec32l.c
gdb/features/rs6000/powerpc-isa205-altivec64l.c
gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c
gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c
gdb/features/rs6000/powerpc-isa205-vsx32l.c
gdb/features/rs6000/powerpc-isa205-vsx64l.c
gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c
gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c
gdb/features/rs6000/powerpc-isa207-vsx32l.c
gdb/features/rs6000/powerpc-isa207-vsx64l.c
gdb/features/rs6000/powerpc-vsx32.c
gdb/features/rs6000/powerpc-vsx32l.c
gdb/features/rs6000/powerpc-vsx64.c
gdb/features/rs6000/powerpc-vsx64l.c
gdb/features/rs6000/rs6000.c
gdb/features/rx.c
gdb/features/s390-gs-linux64.c
gdb/features/s390-linux32.c
gdb/features/s390-linux32v1.c
gdb/features/s390-linux32v2.c
gdb/features/s390-linux64.c
gdb/features/s390-linux64v1.c
gdb/features/s390-linux64v2.c
gdb/features/s390-te-linux64.c
gdb/features/s390-tevx-linux64.c
gdb/features/s390-vx-linux64.c
gdb/features/s390x-gs-linux64.c
gdb/features/s390x-linux64.c
gdb/features/s390x-linux64v1.c
gdb/features/s390x-linux64v2.c
gdb/features/s390x-te-linux64.c
gdb/features/s390x-tevx-linux64.c
gdb/features/s390x-vx-linux64.c
gdb/features/sparc/sparc32-solaris.c
gdb/features/sparc/sparc64-solaris.c
gdb/features/z80.c
gdb/mips-linux-tdep.h
gdb/nios2-tdep.h
gdb/rs6000-tdep.c
gdb/s390-linux-tdep.h
gdb/s390-tdep.h
gdb/target-descriptions.c

index 02523840070a526889c9e4189e41f564ab3e9f18..a0c38f5aa4a2cf1dfe0a3d83bbf983b12dcf6ef0 100644 (file)
@@ -46,7 +46,7 @@ ppc_linux_has_isa205 (CORE_ADDR hwcap)
 const struct target_desc *
 ppc_linux_match_description (struct ppc_linux_features features)
 {
-  struct target_desc *tdesc = NULL;
+  const struct target_desc *tdesc = NULL;
 
   if (features.wordsize == 8)
     {
index 6bda06467e39875244c4043bf9c672eb7151627d..b17e03361d6a002b3b7e1f4ebbc79e4ee0c0ce5b 100644 (file)
 
 struct target_desc;
 
-extern struct target_desc *tdesc_powerpc_32l;
-extern struct target_desc *tdesc_powerpc_altivec32l;
-extern struct target_desc *tdesc_powerpc_vsx32l;
-extern struct target_desc *tdesc_powerpc_isa205_32l;
-extern struct target_desc *tdesc_powerpc_isa205_altivec32l;
-extern struct target_desc *tdesc_powerpc_isa205_vsx32l;
-extern struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l;
-extern struct target_desc *tdesc_powerpc_isa207_vsx32l;
-extern struct target_desc *tdesc_powerpc_isa207_htm_vsx32l;
-extern struct target_desc *tdesc_powerpc_e500l;
-
-extern struct target_desc *tdesc_powerpc_64l;
-extern struct target_desc *tdesc_powerpc_altivec64l;
-extern struct target_desc *tdesc_powerpc_vsx64l;
-extern struct target_desc *tdesc_powerpc_isa205_64l;
-extern struct target_desc *tdesc_powerpc_isa205_altivec64l;
-extern struct target_desc *tdesc_powerpc_isa205_vsx64l;
-extern struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l;
-extern struct target_desc *tdesc_powerpc_isa207_vsx64l;
-extern struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
+extern const struct target_desc *tdesc_powerpc_32l;
+extern const struct target_desc *tdesc_powerpc_altivec32l;
+extern const struct target_desc *tdesc_powerpc_vsx32l;
+extern const struct target_desc *tdesc_powerpc_isa205_32l;
+extern const struct target_desc *tdesc_powerpc_isa205_altivec32l;
+extern const struct target_desc *tdesc_powerpc_isa205_vsx32l;
+extern const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l;
+extern const struct target_desc *tdesc_powerpc_isa207_vsx32l;
+extern const struct target_desc *tdesc_powerpc_isa207_htm_vsx32l;
+extern const struct target_desc *tdesc_powerpc_e500l;
+
+extern const struct target_desc *tdesc_powerpc_64l;
+extern const struct target_desc *tdesc_powerpc_altivec64l;
+extern const struct target_desc *tdesc_powerpc_vsx64l;
+extern const struct target_desc *tdesc_powerpc_isa205_64l;
+extern const struct target_desc *tdesc_powerpc_isa205_altivec64l;
+extern const struct target_desc *tdesc_powerpc_isa205_vsx64l;
+extern const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l;
+extern const struct target_desc *tdesc_powerpc_isa207_vsx64l;
+extern const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
 
 #endif /* ARCH_PPC_LINUX_TDESC_H */
index 1f2b8963ad88db62eea6222e9f136883b520ec54..c3e07809db3d3c08f646df90449d027f01a5bdea 100644 (file)
@@ -74,6 +74,7 @@ mips-dsp-expedite = r29,pc
 mips64-expedite = r29,pc
 mips64-dsp-expedite = r29,pc
 nios2-linux-expedite = sp,pc
+or1k-expedite = r1,npc
 powerpc-expedite = r1,pc
 s390-linux32-expedite = r14,r15,pswa
 s390-linux32v1-expedite = r14,r15,pswa
index aa180bf35d54c9d99da8aee0772be3215ce59690..574dc02db67d20ddfa19c8ae40216a7dcf456670 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_microblaze_with_stack_protect;
+const struct target_desc *tdesc_microblaze_with_stack_protect;
 static void
 initialize_tdesc_microblaze_with_stack_protect (void)
 {
index ef2c64c720ecbc7f01682d71f2798430a049610a..8f1fb0a142fbfd355a1fdbfdd215aa9ca60ba884 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_microblaze;
+const struct target_desc *tdesc_microblaze;
 static void
 initialize_tdesc_microblaze (void)
 {
index 76a91775e26a5450b4fc2478e51c580f565d3d25..d9d928c80128f16e61e62a352b57c8f733f0c843 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_mips_dsp_linux;
+const struct target_desc *tdesc_mips_dsp_linux;
 static void
 initialize_tdesc_mips_dsp_linux (void)
 {
index f97232c8a75f49033f85d74d4d396b5d6cd4a98f..8557bc8357df3c27f788cf82bb806303f8ebefef 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_mips_linux;
+const struct target_desc *tdesc_mips_linux;
 static void
 initialize_tdesc_mips_linux (void)
 {
index 48d212ad907d41560352a43aa9c1c1fa6565ad15..80bbbcbd152f5460442bbaebde18180f79cf4f00 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_mips64_dsp_linux;
+const struct target_desc *tdesc_mips64_dsp_linux;
 static void
 initialize_tdesc_mips64_dsp_linux (void)
 {
index 4b37d3ddb120b944e334b297d71fb5938bf6718c..21e8c37b933397d69027f937dc5299b70817a311 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_mips64_linux;
+const struct target_desc *tdesc_mips64_linux;
 static void
 initialize_tdesc_mips64_linux (void)
 {
index 4e520163931b51071aa0853000b65a0e2a16fdc3..7a08d2c85bb05c3d3f6dcedb97b9e9becc7313e3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_nds32;
+const struct target_desc *tdesc_nds32;
 static void
 initialize_tdesc_nds32 (void)
 {
index 6872aaea02d14a28e00b64583c0977113e112a21..648f7ed57abeec210fdcf042a089d04f4d472530 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_nios2;
+const struct target_desc *tdesc_nios2;
 static void
 initialize_tdesc_nios2 (void)
 {
index e718d3179900fb71681975a7056e2bcdc9cd9c64..3eb65489383fda4dcafb8dfc28e9d2cb5631e088 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_or1k_linux;
+const struct target_desc *tdesc_or1k_linux;
 static void
 initialize_tdesc_or1k_linux (void)
 {
index c1fd26ce8d6e6a80a6a778faa188049e54798208..67040965bd54e087f5e50ef9303d21c8e4864583 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_or1k;
+const struct target_desc *tdesc_or1k;
 static void
 initialize_tdesc_or1k (void)
 {
index 4c766b7bf0e6508f872faf460a2866195f829a16..a4f4bed180fa229ac244de1334f1ebdda78a55b4 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_32;
+const struct target_desc *tdesc_powerpc_32;
 static void
 initialize_tdesc_powerpc_32 (void)
 {
index 34cba5d8a828a0f4a177a9f15fb455f5bfde06c1..f5893bff01bf48a5ef31008f392c1ce5cd3f04a2 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_32l;
+const struct target_desc *tdesc_powerpc_32l;
 static void
 initialize_tdesc_powerpc_32l (void)
 {
index 1b16e081c6154307ff7d5d12bb9eaa7a18bb86c6..2783287b981e7046c0d1cb528569f35095975985 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_403;
+const struct target_desc *tdesc_powerpc_403;
 static void
 initialize_tdesc_powerpc_403 (void)
 {
index 4ff844dcd73fa7adb2d59a80976f1d1b84b8b5f7..c69a1342773bf4353074cbde7d8e797f40b9e86b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_403gc;
+const struct target_desc *tdesc_powerpc_403gc;
 static void
 initialize_tdesc_powerpc_403gc (void)
 {
index 4c97aa5ef629e9cd14c25ee54344cb010b163401..1146d6601bd68843c1d62f8e16783d21e1dfbbc2 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_405;
+const struct target_desc *tdesc_powerpc_405;
 static void
 initialize_tdesc_powerpc_405 (void)
 {
index b9cae668aac07aa42acf0d99656bad0fc94eaac2..a36157f6c74d19456963921eb37e32f9fff5d8a8 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_505;
+const struct target_desc *tdesc_powerpc_505;
 static void
 initialize_tdesc_powerpc_505 (void)
 {
index ba35dc97bf2cd239431172594a1ad497630fb9bb..ceaf789f3d73de2482aff77f431fc02948378485 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_601;
+const struct target_desc *tdesc_powerpc_601;
 static void
 initialize_tdesc_powerpc_601 (void)
 {
index 7f69f44ca34d2939b4a0173fd8ffd0417fbe7b55..eb85e69d6a0ddc8b8f47536b1a9efb6516dfe221 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_602;
+const struct target_desc *tdesc_powerpc_602;
 static void
 initialize_tdesc_powerpc_602 (void)
 {
index 28c3628dbf5d62b109a6f67860d305cd3ce078f1..223919ca2d73dd70757da28425d766b404a50f25 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_603;
+const struct target_desc *tdesc_powerpc_603;
 static void
 initialize_tdesc_powerpc_603 (void)
 {
index fe0fe2fc7e46ff895fd31021c580130763aa25ae..09cbb50129f58ee04ce74a313c6609ec5b76db75 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_604;
+const struct target_desc *tdesc_powerpc_604;
 static void
 initialize_tdesc_powerpc_604 (void)
 {
index d0688ee28ebf4b57dee4d05c06ff5738a82dbeb9..43dee105954f1aba3e2cbe8eec4a0a42d3c02d68 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_64;
+const struct target_desc *tdesc_powerpc_64;
 static void
 initialize_tdesc_powerpc_64 (void)
 {
index 465c023696a657d6d425f2c91244a1fea71a7404..83a6a15904827a95619457e501807c0060a6bbe6 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_64l;
+const struct target_desc *tdesc_powerpc_64l;
 static void
 initialize_tdesc_powerpc_64l (void)
 {
index 0e71dd7c2bb5c41c8e9c345e473b4f4b3109bbbb..d5fbf4bd3d79639d9830bfa698a547106605431c 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_7400;
+const struct target_desc *tdesc_powerpc_7400;
 static void
 initialize_tdesc_powerpc_7400 (void)
 {
index 396ec45665164526c63d8dc7a1b3b0ffc1d22db5..60a7b4120707b3dd6596d083269add35a3a64d7e 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_750;
+const struct target_desc *tdesc_powerpc_750;
 static void
 initialize_tdesc_powerpc_750 (void)
 {
index 328ad195772eb09b666c8aae8cf130c14e8c3fda..3e9a25f8e97428d923c9531aa04acdd413edf98a 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_860;
+const struct target_desc *tdesc_powerpc_860;
 static void
 initialize_tdesc_powerpc_860 (void)
 {
index 743ca06fdd154f9ef33bdd74f3b88f417b2d3cb0..41cca727be8eec2dec25d5b380619c74546d65b4 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_altivec32;
+const struct target_desc *tdesc_powerpc_altivec32;
 static void
 initialize_tdesc_powerpc_altivec32 (void)
 {
index a19016bbac46eca74e432937ec3e9b24025183cf..9cd935551db7f4aa2b507999081806806033135b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_altivec32l;
+const struct target_desc *tdesc_powerpc_altivec32l;
 static void
 initialize_tdesc_powerpc_altivec32l (void)
 {
index b8a157bb98eac3fb0e70aaa65a00e28e3f683010..8422708ec7fa38d889a736e64bba8c90d4c2ebc3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_altivec64;
+const struct target_desc *tdesc_powerpc_altivec64;
 static void
 initialize_tdesc_powerpc_altivec64 (void)
 {
index 1846d067330689ec643d190c25b58051094497a6..977af8c941f677e5736e4b942e45d99523d2d90b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_altivec64l;
+const struct target_desc *tdesc_powerpc_altivec64l;
 static void
 initialize_tdesc_powerpc_altivec64l (void)
 {
index bf6240561d03712f0ffc816e9a846b49a04bcd78..84f721d948f38860f1138afc77ee562665ef3b69 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_e500;
+const struct target_desc *tdesc_powerpc_e500;
 static void
 initialize_tdesc_powerpc_e500 (void)
 {
index 8199989d3a1c7836a878442bf68ecc9fc0cfe39c..a1e133d1c7308b8bf213a5d477a85cb6645d0072 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_e500l;
+const struct target_desc *tdesc_powerpc_e500l;
 static void
 initialize_tdesc_powerpc_e500l (void)
 {
index 7791fa7e029753692c28cefb4d2bc0ace29f82d0..57fb20a4b12c6c74bae85b4e3e3f3244b859d73f 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_32l;
+const struct target_desc *tdesc_powerpc_isa205_32l;
 static void
 initialize_tdesc_powerpc_isa205_32l (void)
 {
index fb05df7911b64434a44279af60301e1104b71233..b9ce8e604fba2c0e4682db1f42e0097ed99f5ba5 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_64l;
+const struct target_desc *tdesc_powerpc_isa205_64l;
 static void
 initialize_tdesc_powerpc_isa205_64l (void)
 {
index a510931ea3c4fcd933e6c095cd9fa7b1e2d3ab1c..54b914c3714be2c15cd2009d7baae00c191abba6 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_altivec32l;
+const struct target_desc *tdesc_powerpc_isa205_altivec32l;
 static void
 initialize_tdesc_powerpc_isa205_altivec32l (void)
 {
index f91c2e845186efa609bed6e8886dad12029daecc..42e6f03e93c2e1bfbde284601b1969bcc8ee1e4b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_altivec64l;
+const struct target_desc *tdesc_powerpc_isa205_altivec64l;
 static void
 initialize_tdesc_powerpc_isa205_altivec64l (void)
 {
index 28a7c3b2c4fc99b1535ad67824ecccdaed081e34..a2c6172c6d27f6d2aafbb4293efecbd94e40cf5b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l;
+const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l;
 static void
 initialize_tdesc_powerpc_isa205_ppr_dscr_vsx32l (void)
 {
index d34a197b4f52189ad624c2c6989e26efd9655be7..3e7915a0619c7f8f0b08ff49eca9c1b72bd7d585 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l;
+const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l;
 static void
 initialize_tdesc_powerpc_isa205_ppr_dscr_vsx64l (void)
 {
index 763915502c01718d6fc4cc1fd9391fd0fa8ecd10..4cefcc36de57418649b3ba144071c12a90f2ee4b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_vsx32l;
+const struct target_desc *tdesc_powerpc_isa205_vsx32l;
 static void
 initialize_tdesc_powerpc_isa205_vsx32l (void)
 {
index fad4227b095dd8068cb6e12c2b5efedc38e13812..2fb151d12c5178b5184e0aca19400d7c7c293f68 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa205_vsx64l;
+const struct target_desc *tdesc_powerpc_isa205_vsx64l;
 static void
 initialize_tdesc_powerpc_isa205_vsx64l (void)
 {
index 78f2047272a7054005fff69d1d9a65e5dca36384..b945039ca28d269d6e0277b6c8885aef4a056f28 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa207_htm_vsx32l;
+const struct target_desc *tdesc_powerpc_isa207_htm_vsx32l;
 static void
 initialize_tdesc_powerpc_isa207_htm_vsx32l (void)
 {
index 5517201043fc2a662de5e35ecf1ee64ceb438dd7..3aa579fd5f91d6c719147a1ef23f29a29d04b090 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
+const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
 static void
 initialize_tdesc_powerpc_isa207_htm_vsx64l (void)
 {
index 7fc15bfbfbd0d7dd16cc70b9483671bf88ec84da..e5ce7f956cfbe814ec4f256c291f4f3f1db5bf71 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa207_vsx32l;
+const struct target_desc *tdesc_powerpc_isa207_vsx32l;
 static void
 initialize_tdesc_powerpc_isa207_vsx32l (void)
 {
index 3ad55f756584a315fa225bc978a6cf27f51f77c7..adf6d3eec7f29efc0f51ed8203305ff93346ad80 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_isa207_vsx64l;
+const struct target_desc *tdesc_powerpc_isa207_vsx64l;
 static void
 initialize_tdesc_powerpc_isa207_vsx64l (void)
 {
index d7278d9a52bd40845444d411044ed6de0dcbe558..6fccdb374fb36d6b28992cc6a0e9d4b9ba295c4b 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_vsx32;
+const struct target_desc *tdesc_powerpc_vsx32;
 static void
 initialize_tdesc_powerpc_vsx32 (void)
 {
index 7097ffac8c62ed6b449220fdc02364c00387ee43..1efe880d379c8bcd522ad37d13bcb0bc9fc9780c 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_vsx32l;
+const struct target_desc *tdesc_powerpc_vsx32l;
 static void
 initialize_tdesc_powerpc_vsx32l (void)
 {
index 7e9055991e2fe71b4650753570ea689a367911f8..df6d0f4bef915b5000d03edc75d22a1232e33771 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_vsx64;
+const struct target_desc *tdesc_powerpc_vsx64;
 static void
 initialize_tdesc_powerpc_vsx64 (void)
 {
index 4affa35d0ccc91eb9613ec7b8888882b3dd5d022..89aa13de662764ff9446a414754e02b23b4d3113 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_powerpc_vsx64l;
+const struct target_desc *tdesc_powerpc_vsx64l;
 static void
 initialize_tdesc_powerpc_vsx64l (void)
 {
index 826d9ad758266bd49e1cfba9cee30e71bbe2fada..4aa5a8764a023f41813b25a85a4c1fe684bdc4b8 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_rs6000;
+const struct target_desc *tdesc_rs6000;
 static void
 initialize_tdesc_rs6000 (void)
 {
index dd765c2c63af8bebefe7cd104ea2ddb798965a89..825a4ac4538f97cd091ed92676a6e481d1fac3c3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_rx;
+const struct target_desc *tdesc_rx;
 static void
 initialize_tdesc_rx (void)
 {
index 331b6e27e8cce246fefeee051ecffd7d3d95adac..d48f8312f20b9ebc25beb3ee554ca3e8be4c80d3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_gs_linux64;
+const struct target_desc *tdesc_s390_gs_linux64;
 static void
 initialize_tdesc_s390_gs_linux64 (void)
 {
index 18b0d0f37be627d3bd6ce6504dbaf8e84258f70c..03ec11a26b33277f0eb499e33fbe173c26b5f39f 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux32;
+const struct target_desc *tdesc_s390_linux32;
 static void
 initialize_tdesc_s390_linux32 (void)
 {
index d1180f98b28426a9a144456422b0b9d973e44b9f..65de6f254f7768fd0a9e1660eaf99e0e45a83cf1 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux32v1;
+const struct target_desc *tdesc_s390_linux32v1;
 static void
 initialize_tdesc_s390_linux32v1 (void)
 {
index d1da31a7c9a03a27274727aadc7214ac3d391b73..0e3e04dfd43512394506140abedc55a0a0418df3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux32v2;
+const struct target_desc *tdesc_s390_linux32v2;
 static void
 initialize_tdesc_s390_linux32v2 (void)
 {
index 235da0f63c26c766ad2de2c438982771125c7cab..f0ec91992f9235386961d1c7f2ad2e520b9a7133 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux64;
+const struct target_desc *tdesc_s390_linux64;
 static void
 initialize_tdesc_s390_linux64 (void)
 {
index 108c0ef404ffccfa8d98d8ddafc57ddff1243714..9a360c7e2676759cf113dcda795d41eb66236a3e 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux64v1;
+const struct target_desc *tdesc_s390_linux64v1;
 static void
 initialize_tdesc_s390_linux64v1 (void)
 {
index 057a12978a7a534d97a47d237f486971f0d95799..18bc6ed4f9c1f1af26c7c86a4133091cf958ae60 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_linux64v2;
+const struct target_desc *tdesc_s390_linux64v2;
 static void
 initialize_tdesc_s390_linux64v2 (void)
 {
index f8f2217c69b3c183cfa7461ed69386d89db091d7..a8909b36bbf4389d7bf461451008265fe1f583e3 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_te_linux64;
+const struct target_desc *tdesc_s390_te_linux64;
 static void
 initialize_tdesc_s390_te_linux64 (void)
 {
index cbc20775cc6b9a5edf6e574e5081654594ac37a6..8f8aec61a49f914e62c4ac9a4ed343f162a8aaa8 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_tevx_linux64;
+const struct target_desc *tdesc_s390_tevx_linux64;
 static void
 initialize_tdesc_s390_tevx_linux64 (void)
 {
index 779332ca5e40fb0a0ff89b075f43e9007c8a0a38..0bcc14d7d089ce6f821a0c84e191c31ea2edfe70 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390_vx_linux64;
+const struct target_desc *tdesc_s390_vx_linux64;
 static void
 initialize_tdesc_s390_vx_linux64 (void)
 {
index a779dafe6c31b9b87cebd71a9147a9bf2ed6192f..074c38d668c9436306ee40333161c91c55380c90 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_gs_linux64;
+const struct target_desc *tdesc_s390x_gs_linux64;
 static void
 initialize_tdesc_s390x_gs_linux64 (void)
 {
index f8097e94d5b3a21e31193cf36d6eb9bedea94d8a..af5ba23dc383938a574915f929f18901df6a3c55 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_linux64;
+const struct target_desc *tdesc_s390x_linux64;
 static void
 initialize_tdesc_s390x_linux64 (void)
 {
index c79ee40efb9dcef764ea2b116705dcebd6daacf0..a33bdc1672f88503363a319f9d65fda6ecffb1df 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_linux64v1;
+const struct target_desc *tdesc_s390x_linux64v1;
 static void
 initialize_tdesc_s390x_linux64v1 (void)
 {
index 95009170fe8c1a4431932553a83b2cce2bbb48b4..8b906a47e44c14d99706d2dbac75b8d6667eb2d4 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_linux64v2;
+const struct target_desc *tdesc_s390x_linux64v2;
 static void
 initialize_tdesc_s390x_linux64v2 (void)
 {
index 64a0fe599df46cbd71531de4f3d112ee77bd12bc..de8bf61047013c18563979ecf52f0c7dfb3df4fb 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_te_linux64;
+const struct target_desc *tdesc_s390x_te_linux64;
 static void
 initialize_tdesc_s390x_te_linux64 (void)
 {
index ec68e702f7ccc55b3dc08936a75bf39a8e3d6cc6..8bd5cc6c43906c6732e3730c8dd7bd4ff6a56cd0 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_tevx_linux64;
+const struct target_desc *tdesc_s390x_tevx_linux64;
 static void
 initialize_tdesc_s390x_tevx_linux64 (void)
 {
index 4362e53ad3fde1e1142952b83bc91696b851d385..f450c45144d643cf72effc7cd9c04b8226d6c2ce 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_s390x_vx_linux64;
+const struct target_desc *tdesc_s390x_vx_linux64;
 static void
 initialize_tdesc_s390x_vx_linux64 (void)
 {
index c2f16062fc148610f6bebef8b030625dde434d8b..3353d4f44f7a7cdb30eeeec05c192d2945a1f263 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_sparc32_solaris;
+const struct target_desc *tdesc_sparc32_solaris;
 static void
 initialize_tdesc_sparc32_solaris (void)
 {
index bb8f68538414465210c75047fb146f22eb1f8c0b..1150c884b444cd97f962452f3bd2929bb16c17c8 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_sparc64_solaris;
+const struct target_desc *tdesc_sparc64_solaris;
 static void
 initialize_tdesc_sparc64_solaris (void)
 {
index 944b563aca4700bb4e0b2de2c65b5fc1e7d24473..f8e2a1988d0e67be24a4889b84e8e98dc9258bd0 100644 (file)
@@ -5,7 +5,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 
-struct target_desc *tdesc_z80;
+const struct target_desc *tdesc_z80;
 static void
 initialize_tdesc_z80 (void)
 {
index 4b9940c0485facf2c04be9e9e2557e248db95b42..1b79302a3a576df5aa346b40843791d37e2e585f 100644 (file)
@@ -108,9 +108,9 @@ enum {
 int mips_linux_restart_reg_p (struct gdbarch *gdbarch);
 
 /* Target descriptions.  */
-extern struct target_desc *tdesc_mips_linux;
-extern struct target_desc *tdesc_mips64_linux;
-extern struct target_desc *tdesc_mips_dsp_linux;
-extern struct target_desc *tdesc_mips64_dsp_linux;
+extern const struct target_desc *tdesc_mips_linux;
+extern const struct target_desc *tdesc_mips64_linux;
+extern const struct target_desc *tdesc_mips_dsp_linux;
+extern const struct target_desc *tdesc_mips64_dsp_linux;
 
 #endif /* MIPS_LINUX_TDEP_H */
index cbf2599f5c09c01e4ffec157c887ca3bb65adeff..4711b6a2ac5cd4b264c2afaaf5e0bc73b905c0b8 100644 (file)
@@ -84,7 +84,7 @@ struct nios2_gdbarch_tdep : gdbarch_tdep_base
   int jb_pc = 0;
 };
 
-extern struct target_desc *tdesc_nios2_linux;
-extern struct target_desc *tdesc_nios2;
+extern const struct target_desc *tdesc_nios2_linux;
+extern const struct target_desc *tdesc_nios2;
 
 #endif /* NIOS2_TDEP_H */
index 87b2faad36a8092049fb05546289fcb327c37e0d..2a396eff4c495e7b9de28d1dd6366032de848416 100644 (file)
@@ -3466,7 +3466,7 @@ struct ppc_variant
     unsigned long mach;
 
     /* Target description for this variant.  */
-    struct target_desc **tdesc;
+    const struct target_desc **tdesc;
   };
 
 static struct ppc_variant variants[] =
index acc57ab92916adee5e26624f7d6e81a6aa7697b8..a73c20f356026179a4b2b26a3b254025e6a66498 100644 (file)
@@ -48,20 +48,20 @@ extern const struct regset s390_gs_regset;
 extern const struct regset s390_gsbc_regset;
 
 /* GNU/Linux target descriptions.  */
-extern struct target_desc *tdesc_s390_linux32v1;
-extern struct target_desc *tdesc_s390_linux32v2;
-extern struct target_desc *tdesc_s390_linux64;
-extern struct target_desc *tdesc_s390_linux64v1;
-extern struct target_desc *tdesc_s390_linux64v2;
-extern struct target_desc *tdesc_s390_te_linux64;
-extern struct target_desc *tdesc_s390_vx_linux64;
-extern struct target_desc *tdesc_s390_tevx_linux64;
-extern struct target_desc *tdesc_s390_gs_linux64;
-extern struct target_desc *tdesc_s390x_linux64v1;
-extern struct target_desc *tdesc_s390x_linux64v2;
-extern struct target_desc *tdesc_s390x_te_linux64;
-extern struct target_desc *tdesc_s390x_vx_linux64;
-extern struct target_desc *tdesc_s390x_tevx_linux64;
-extern struct target_desc *tdesc_s390x_gs_linux64;
+extern const struct target_desc *tdesc_s390_linux32v1;
+extern const struct target_desc *tdesc_s390_linux32v2;
+extern const struct target_desc *tdesc_s390_linux64;
+extern const struct target_desc *tdesc_s390_linux64v1;
+extern const struct target_desc *tdesc_s390_linux64v2;
+extern const struct target_desc *tdesc_s390_te_linux64;
+extern const struct target_desc *tdesc_s390_vx_linux64;
+extern const struct target_desc *tdesc_s390_tevx_linux64;
+extern const struct target_desc *tdesc_s390_gs_linux64;
+extern const struct target_desc *tdesc_s390x_linux64v1;
+extern const struct target_desc *tdesc_s390x_linux64v2;
+extern const struct target_desc *tdesc_s390x_te_linux64;
+extern const struct target_desc *tdesc_s390x_vx_linux64;
+extern const struct target_desc *tdesc_s390x_tevx_linux64;
+extern const struct target_desc *tdesc_s390x_gs_linux64;
 
 #endif /* S390_LINUX_TDEP_H */
index f51423cb0185d5f41ccc746a99983a7d3e94f9fc..bfee9a80dd5a6a5802f952214d8deca5af9f373b 100644 (file)
@@ -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 */
index 20a79d5d4583e5d7c15a673b5b55a04b8376ec12..13cc9e44a531ba5d8c138818a098fd1434223dc0 100644 (file)
@@ -1370,7 +1370,7 @@ public:
     gdb_printf ("#include \"target-descriptions.h\"\n");
     gdb_printf ("\n");
 
-    gdb_printf ("struct target_desc *tdesc_%s;\n", m_function);
+    gdb_printf ("const struct target_desc *tdesc_%s;\n", m_function);
     gdb_printf ("static void\n");
     gdb_printf ("initialize_tdesc_%s (void)\n", m_function);
     gdb_printf ("{\n");