aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-22 19:11:48 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-22 19:11:48 +0000
commit88b457e59a1d0d51b2950e448c5e8deffc9b9b61 (patch)
tree15bef9c6bfb0e625d74f87fd4c4c180fabf6a3db
parent66a277abe2b75c998a0549c7818e8c10e5f6be31 (diff)
downloadgdb-88b457e59a1d0d51b2950e448c5e8deffc9b9b61.zip
gdb-88b457e59a1d0d51b2950e448c5e8deffc9b9b61.tar.gz
gdb-88b457e59a1d0d51b2950e448c5e8deffc9b9b61.tar.bz2
* config/tc-h8500.c (md_begin): Use a local variable when
initializing md_relax_table to avoid warnings about modifying a supposedly const data structure.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-h8500.c65
2 files changed, 40 insertions, 31 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b925eac..f15ea9d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 22 12:09:41 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/tc-h8500.c (md_begin): Use a local variable when
+ initializing md_relax_table to avoid warnings about modifying a
+ supposedly const data structure.
+
Thu Jul 22 10:58:51 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
* config/obj-aout.c: Only include aout/aout64.h if BFD_ASSEMBLER
diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c
index 404db3a..1cb1bcf 100644
--- a/gas/config/tc-h8500.c
+++ b/gas/config/tc-h8500.c
@@ -102,6 +102,7 @@ md_begin ()
h8500_opcode_info *opcode;
char prev_buffer[100];
int idx = 0;
+ register relax_typeS *table;
opcode_hash_control = hash_new ();
prev_buffer[0] = 0;
@@ -116,36 +117,38 @@ md_begin ()
}
}
- /* Initialize the relax table */
- md_relax_table[C (BRANCH, BYTE_DISP)].rlx_forward = BYTE_F;
- md_relax_table[C (BRANCH, BYTE_DISP)].rlx_backward = BYTE_B;
- md_relax_table[C (BRANCH, BYTE_DISP)].rlx_length = 2;
- md_relax_table[C (BRANCH, BYTE_DISP)].rlx_more = C (BRANCH, WORD_DISP);
-
- md_relax_table[C (BRANCH, WORD_DISP)].rlx_forward = WORD_F;
- md_relax_table[C (BRANCH, WORD_DISP)].rlx_backward = WORD_B;
- md_relax_table[C (BRANCH, WORD_DISP)].rlx_length = 3;
- md_relax_table[C (BRANCH, WORD_DISP)].rlx_more = 0;
-
- md_relax_table[C (SCB_F, BYTE_DISP)].rlx_forward = BYTE_F;
- md_relax_table[C (SCB_F, BYTE_DISP)].rlx_backward = BYTE_B;
- md_relax_table[C (SCB_F, BYTE_DISP)].rlx_length = 3;
- md_relax_table[C (SCB_F, BYTE_DISP)].rlx_more = C (SCB_F, WORD_DISP);
-
- md_relax_table[C (SCB_F, WORD_DISP)].rlx_forward = WORD_F;
- md_relax_table[C (SCB_F, WORD_DISP)].rlx_backward = WORD_B;
- md_relax_table[C (SCB_F, WORD_DISP)].rlx_length = 8;
- md_relax_table[C (SCB_F, WORD_DISP)].rlx_more = 0;
-
- md_relax_table[C (SCB_TST, BYTE_DISP)].rlx_forward = BYTE_F;
- md_relax_table[C (SCB_TST, BYTE_DISP)].rlx_backward = BYTE_B;
- md_relax_table[C (SCB_TST, BYTE_DISP)].rlx_length = 3;
- md_relax_table[C (SCB_TST, BYTE_DISP)].rlx_more = C (SCB_TST, WORD_DISP);
-
- md_relax_table[C (SCB_TST, WORD_DISP)].rlx_forward = WORD_F;
- md_relax_table[C (SCB_TST, WORD_DISP)].rlx_backward = WORD_B;
- md_relax_table[C (SCB_TST, WORD_DISP)].rlx_length = 10;
- md_relax_table[C (SCB_TST, WORD_DISP)].rlx_more = 0;
+ /* Initialize the relax table. We use a local variable to avoid
+ warnings about modifying a supposedly const data structure. */
+ table = (relax_typeS *) md_relax_table;
+ table[C (BRANCH, BYTE_DISP)].rlx_forward = BYTE_F;
+ table[C (BRANCH, BYTE_DISP)].rlx_backward = BYTE_B;
+ table[C (BRANCH, BYTE_DISP)].rlx_length = 2;
+ table[C (BRANCH, BYTE_DISP)].rlx_more = C (BRANCH, WORD_DISP);
+
+ table[C (BRANCH, WORD_DISP)].rlx_forward = WORD_F;
+ table[C (BRANCH, WORD_DISP)].rlx_backward = WORD_B;
+ table[C (BRANCH, WORD_DISP)].rlx_length = 3;
+ table[C (BRANCH, WORD_DISP)].rlx_more = 0;
+
+ table[C (SCB_F, BYTE_DISP)].rlx_forward = BYTE_F;
+ table[C (SCB_F, BYTE_DISP)].rlx_backward = BYTE_B;
+ table[C (SCB_F, BYTE_DISP)].rlx_length = 3;
+ table[C (SCB_F, BYTE_DISP)].rlx_more = C (SCB_F, WORD_DISP);
+
+ table[C (SCB_F, WORD_DISP)].rlx_forward = WORD_F;
+ table[C (SCB_F, WORD_DISP)].rlx_backward = WORD_B;
+ table[C (SCB_F, WORD_DISP)].rlx_length = 8;
+ table[C (SCB_F, WORD_DISP)].rlx_more = 0;
+
+ table[C (SCB_TST, BYTE_DISP)].rlx_forward = BYTE_F;
+ table[C (SCB_TST, BYTE_DISP)].rlx_backward = BYTE_B;
+ table[C (SCB_TST, BYTE_DISP)].rlx_length = 3;
+ table[C (SCB_TST, BYTE_DISP)].rlx_more = C (SCB_TST, WORD_DISP);
+
+ table[C (SCB_TST, WORD_DISP)].rlx_forward = WORD_F;
+ table[C (SCB_TST, WORD_DISP)].rlx_backward = WORD_B;
+ table[C (SCB_TST, WORD_DISP)].rlx_length = 10;
+ table[C (SCB_TST, WORD_DISP)].rlx_more = 0;
}
@@ -876,7 +879,7 @@ insert (output, index, exp, reloc, pcrel)
fix_new_exp (frag_now,
output - frag_now->fr_literal + index,
4, /* always say size is 4, but we know better */
- &exp,
+ exp,
pcrel,
reloc);
}