diff options
author | Alan Modra <amodra@gmail.com> | 2001-04-05 04:21:36 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-04-05 04:21:36 +0000 |
commit | e66457fbf3726420435dc962c190c8ab9933a78b (patch) | |
tree | 92ccaae4770d3076aeb5aa781ac93a0f8f34ff59 /gas/config/tc-h8500.c | |
parent | 608506ed674285b7c6dc61e0bdbe9e8c473c0e7b (diff) | |
download | gdb-e66457fbf3726420435dc962c190c8ab9933a78b.zip gdb-e66457fbf3726420435dc962c190c8ab9933a78b.tar.gz gdb-e66457fbf3726420435dc962c190c8ab9933a78b.tar.bz2 |
Fix more breakages from the multiple relax pass patch.
Diffstat (limited to 'gas/config/tc-h8500.c')
-rw-r--r-- | gas/config/tc-h8500.c | 73 |
1 files changed, 33 insertions, 40 deletions
diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c index 7fe556e..d0f6192 100644 --- a/gas/config/tc-h8500.c +++ b/gas/config/tc-h8500.c @@ -86,7 +86,31 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP"; #define WORD_F 32767 #define WORD_B 32768 -relax_typeS md_relax_table[C (END, 0)]; +relax_typeS md_relax_table[C (END, 0)] = { + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + + /* BRANCH */ + { 0, 0, 0, 0 }, + { BYTE_F, BYTE_B, 2, C (BRANCH, WORD_DISP) }, + { WORD_F, WORD_B, 3, 0 }, + { 0, 0, 3, 0 }, + + /* SCB_F */ + { 0, 0, 0, 0 }, + { BYTE_F, BYTE_B, 3, C (SCB_F, WORD_DISP) }, + { WORD_F, WORD_B, 8, 0 }, + { 0, 0, 8, 0 }, + + /* SCB_TST */ + { 0, 0, 0, 0 }, + { BYTE_F, BYTE_B, 3, C (SCB_TST, WORD_DISP) }, + { WORD_F, WORD_B, 10, 0 }, + { 0, 0, 10, 0 } + +}; static struct hash_control *opcode_hash_control; /* Opcode mnemonics */ @@ -101,7 +125,6 @@ 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; @@ -115,40 +138,6 @@ md_begin () idx++; } } - - /* 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; - } static int rn; /* register number used by RN */ @@ -1442,7 +1431,7 @@ md_estimate_size_before_relax (fragP, segment_type) register fragS *fragP; register segT segment_type; { - int what = GET_WHAT (fragP->fr_subtype); + int what; switch (fragP->fr_subtype) { @@ -1452,33 +1441,37 @@ md_estimate_size_before_relax (fragP, segment_type) case C (BRANCH, UNDEF_BYTE_DISP): case C (SCB_F, UNDEF_BYTE_DISP): case C (SCB_TST, UNDEF_BYTE_DISP): + what = GET_WHAT (fragP->fr_subtype); /* used to be a branch to somewhere which was unknown */ if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type) { /* Got a symbol and it's defined in this segment, become byte sized - maybe it will fix up. */ fragP->fr_subtype = C (what, BYTE_DISP); - fragP->fr_var = md_relax_table[C (what, BYTE_DISP)].rlx_length; } else { /* Its got a segment, but its not ours, so it will always be long. */ fragP->fr_subtype = C (what, UNDEF_WORD_DISP); - fragP->fr_var = md_relax_table[C (what, WORD_DISP)].rlx_length; } break; case C (BRANCH, BYTE_DISP): + case C (BRANCH, WORD_DISP): case C (BRANCH, UNDEF_WORD_DISP): case C (SCB_F, BYTE_DISP): + case C (SCB_F, WORD_DISP): case C (SCB_F, UNDEF_WORD_DISP): case C (SCB_TST, BYTE_DISP): + case C (SCB_TST, WORD_DISP): case C (SCB_TST, UNDEF_WORD_DISP): /* When relaxing a section for the second time, we don't need to - do anything. */ + do anything besides return the current size. */ break; } + + fragP->fr_var = md_relax_table[fragP->fr_subtype].rlx_length; return fragP->fr_var; } |