1 /* tc-mcore.c -- Assemble code for M*Core
3 Copyright (C) 1993,1994, 1999 Free Software Foundation.
5 This file is part of GAS, the GNU Assembler.
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GAS is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
26 #include "../opcodes/mcore-opc.h"
31 #include "elf/mcore.h"
35 #define streq(a,b) (strcmp (a, b) == 0)
38 /* Forward declarations for dumb compilers. */
39 static void mcore_s_literals PARAMS ((int));
40 static void mcore_cons PARAMS ((int));
41 static void mcore_float_cons PARAMS ((int));
42 static void mcore_stringer PARAMS ((int));
43 static int log2 PARAMS ((unsigned int));
44 static char * parse_reg PARAMS ((char *, unsigned *));
45 static char * parse_creg PARAMS ((char *, unsigned *));
46 static char * parse_exp PARAMS ((char *, expressionS *));
47 static void make_name PARAMS ((char *, char *, int));
48 static int enter_literal PARAMS ((expressionS *, int));
49 static char * parse_rt PARAMS ((char *, char **, int, expressionS *));
50 static char * parse_imm PARAMS ((char *, unsigned *, unsigned, unsigned));
51 static char * parse_mem PARAMS ((char *, unsigned *, unsigned *, unsigned));
52 static void dump_literals PARAMS ((int));
53 static void check_literals PARAMS ((int, int));
54 static void mcore_s_text PARAMS ((int));
55 static void mcore_s_data PARAMS ((int));
57 static void mcore_s_section PARAMS ((int));
60 /* Several places in this file insert raw instructions into the
61 object. They should use MCORE_INST_XXX macros to get the opcodes
62 and then use these two macros to crack the MCORE_INST value into
63 the appropriate byte values. */
64 #define INST_BYTE0(x) (((x) >> 8) & 0xFF)
65 #define INST_BYTE1(x) ((x) & 0xFF)
67 const char comment_chars[] = "#/";
68 const char line_separator_chars[] = ";";
69 const char line_comment_chars[] = "#/";
71 const int md_reloc_size = 8;
73 static int relax; /* set if -relax seen */
74 static int do_jsri2bsr = 0; /* change here from 1 by Cruess 19 August 97 */
75 static int sifilter_mode = 0;
77 const char EXP_CHARS[] = "eE";
79 /* Chars that mean this number is a floating point constant */
82 const char FLT_CHARS[] = "rRsSfFdDxXpP";
84 #define C(what,length) (((what) << 2) + (length))
85 #define GET_WHAT(x) ((x >> 2))
87 /* These are the two types of relaxable instruction */
96 #define UNDEF_WORD_DISP 4
100 #define C32_LEN 10 /* allow for align */
102 #define U32_LEN 8 /* allow for align */
105 /* Initialize the relax table */
106 const relax_typeS md_relax_table[] =
108 { 1, 1, 0, 0 }, /* 0: unused */
109 { 1, 1, 0, 0 }, /* 1: unused */
110 { 1, 1, 0, 0 }, /* 2: unused */
111 { 1, 1, 0, 0 }, /* 3: unused */
112 { 1, 1, 0, 0 }, /* 4: unused */
113 { 2048, -2046, C12_LEN, C(COND_JUMP, COND32) }, /* 5: C(COND_JUMP, COND12) */
114 { 0, 0, C32_LEN, 0 }, /* 6: C(COND_JUMP, COND32) */
115 { 1, 1, 0, 0 }, /* 7: unused */
116 { 1, 1, 0, 0 }, /* 8: unused */
117 { 2048, -2046, U12_LEN, C(UNCD_JUMP, UNCD32) }, /* 9: C(UNCD_JUMP, UNCD12) */
118 { 0, 0, U32_LEN, 0 }, /*10: C(UNCD_JUMP, UNCD32) */
119 { 1, 1, 0, 0 }, /*11: unused */
120 { 0, 0, 0, 0 } /*12: unused */
123 /* LITERAL POOL DATA STRUCTURES */
126 unsigned short refcnt;
127 unsigned char ispcrel;
128 unsigned char unused;
132 #define MAX_POOL_SIZE (1024/4)
133 static struct literal litpool [MAX_POOL_SIZE];
134 static unsigned poolsize;
135 static unsigned poolnumber;
136 static unsigned long poolspan;
138 /* SPANPANIC: the point at which we get too scared and force a dump
139 of the literal pool, and perhaps put a branch in place.
141 1024 span of lrw/jmpi/jsri insn (actually span+1)
142 -2 possible alignment at the insn.
143 -2 possible alignment to get the table aligned.
144 -2 an inserted branch around the table.
146 at 1018, we might be in trouble.
147 -- so we have to be smaller than 1018 and since we deal with 2-byte
148 instructions, the next good choice is 1016.
149 -- Note we have a test case that fails when we've got 1018 here. */
150 #define SPANPANIC (1016) /* 1024 - 1 entry - 2 byte rounding */
151 #define SPANCLOSE (900)
152 #define SPANEXIT (600)
153 static symbolS * poolsym; /* label for current pool */
154 static char poolname[8];
155 static struct hash_control * opcode_hash_control; /* Opcode mnemonics */
157 /* This table describes all the machine specific pseudo-ops the assembler
158 has to support. The fields are:
159 Pseudo-op name without dot
160 Function to call to execute this pseudo-op
161 Integer arg to pass to the function */
162 const pseudo_typeS md_pseudo_table[] =
164 { "export", s_globl, 0 },
165 { "import", s_ignore, 0 },
166 { "literals", mcore_s_literals, 0 },
167 { "page", listing_eject, 0 },
168 { "bss", s_lcomm_bytes, 1 },
170 /* The following are to intercept the placement of data into the text
171 section (eg addresses for a switch table), so that the space they
172 occupy can be taken into account when deciding whether or not to
173 dump the current literal pool.
174 XXX - currently we do not cope with the .space and .dcb.d directives. */
175 { "ascii", mcore_stringer, 0 },
176 { "asciz", mcore_stringer, 1 },
177 { "byte", mcore_cons, 1 },
178 { "dc", mcore_cons, 2 },
179 { "dc.b", mcore_cons, 1 },
180 { "dc.d", mcore_float_cons, 'd' },
181 { "dc.l", mcore_cons, 4 },
182 { "dc.s", mcore_float_cons, 'f' },
183 { "dc.w", mcore_cons, 2 },
184 { "dc.x", mcore_float_cons, 'x' },
185 { "double", mcore_float_cons, 'd'},
186 { "float", mcore_float_cons, 'f'},
187 { "hword", mcore_cons, 2 },
188 { "int", mcore_cons, 4 },
189 { "long", mcore_cons, 4 },
190 { "octa", mcore_cons, 16 },
191 { "quad", mcore_cons, 8 },
192 { "short", mcore_cons, 2 },
193 { "single", mcore_float_cons, 'f'},
194 { "string", mcore_stringer, 1 },
195 { "word", mcore_cons, 2 },
197 /* Allow for the effect of section changes. */
198 { "text", mcore_s_text, 0 },
199 { "data", mcore_s_data, 0 },
202 { "section", mcore_s_section, 0 },
203 { "section.s", mcore_s_section, 0 },
204 { "sect", mcore_s_section, 0 },
205 { "sect.s", mcore_s_section, 0 },
211 mcore_s_literals (ignore)
215 demand_empty_rest_of_line ();
223 if (now_seg == text_section)
225 char * ptr = input_line_pointer;
228 /* Count the number of commas on the line. */
229 while (! is_end_of_line [* ptr])
230 commas += * ptr ++ == ',';
232 poolspan += nbytes * commas;
237 /* In theory we ought to call check_literals (2,0) here in case
238 we need to dump the literal table. We cannot do this however,
239 as the directives that we are intercepting may be being used
240 to build a switch table, and we must not interfere with its
241 contents. Instead we cross our fingers and pray... */
245 mcore_float_cons (float_type)
248 if (now_seg == text_section)
250 char * ptr = input_line_pointer;
253 #ifdef REPEAT_CONS_EXPRESSIONS
254 #error REPEAT_CONS_EXPRESSIONS not handled
257 /* Count the number of commas on the line. */
258 while (! is_end_of_line [* ptr])
259 commas += * ptr ++ == ',';
261 /* We would like to compute "hex_float (float_type) * commas"
262 but hex_float is not exported from read.c */
263 float_type == 'f' ? 4 : (float_type == 'd' ? 8 : 12);
264 poolspan += float_type * commas;
267 float_cons (float_type);
269 /* See the comment in mcore_cons () about calling check_literals.
270 It is unlikely that a switch table will be constructed using
271 floating point values, but it is still likely that an indexed
272 table of floating point constants is being created by these
273 directives, so again we must not interfere with their placement. */
277 mcore_stringer (append_zero)
280 if (now_seg == text_section)
282 char * ptr = input_line_pointer;
284 /* In theory we should compute how many bytes are going to
285 be occupied by the string(s) and add this to the poolspan.
286 To keep things simple however, we just add the number of
287 bytes left on the current line. This will be an over-
288 estimate, which is OK, and automatically allows for the
289 appending a zero byte, since the real string(s) is/are
290 required to be enclosed in double quotes. */
291 while (! is_end_of_line [* ptr])
294 poolspan += ptr - input_line_pointer;
297 stringer (append_zero);
299 /* We call check_literals here in case a large number of strings are
300 being placed into the text section with a sequence of stringer
301 directives. In theory we could be upsetting something if these
302 strings are actually in an indexed table instead of referenced by
303 individual labels. Let us hope that that never happens. */
304 check_literals (2, 0);
308 mcore_s_text (ignore)
317 mcore_s_data (ignore)
325 /* This function is called once, at assembler startup time. This should
326 set up all the tables, etc that the MD part of the assembler needs. */
330 mcore_opcode_info * opcode;
331 char * prev_name = "";
333 opcode_hash_control = hash_new ();
335 /* Insert unique names into hash table */
336 for (opcode = mcore_table; opcode->name; opcode ++)
338 if (streq (prev_name, opcode->name))
340 /* Make all the opcodes with the same name point to the same
342 opcode->name = prev_name;
346 prev_name = opcode->name;
347 hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
354 static expressionS immediate; /* absolute expression */
356 /* Get a log2(val). */
371 /* Try to parse a reg name. */
377 /* Strip leading whitespace. */
378 while (isspace (* s))
381 if (tolower (s[0]) == 'r')
383 if (s[1] == '1' && s[2] >= '0' && s[2] <= '5')
385 *reg = 10 + s[2] - '0';
389 if (s[1] >= '0' && s[1] <= '9')
395 else if ( tolower (s[0]) == 's'
396 && tolower (s[1]) == 'p'
397 && (isspace (s[2]) || s[2] == ','))
403 as_bad (_("register expected, but saw '%.6s'"), s);
437 /* Strip leading whitespace. */
438 while (isspace (* s))
441 if ((tolower (s[0]) == 'c' && tolower (s[1]) == 'r'))
443 if (s[2] == '3' && s[3] >= '0' && s[3] <= '1')
445 *reg = 30 + s[3] - '0';
449 if (s[2] == '2' && s[3] >= '0' && s[3] <= '9')
451 *reg = 20 + s[3] - '0';
455 if (s[2] == '1' && s[3] >= '0' && s[3] <= '9')
457 *reg = 10 + s[3] - '0';
461 if (s[2] >= '0' && s[2] <= '9')
468 /* Look at alternate creg names before giving error. */
469 for (i = 0; cregs[i].name[0] != '\0'; i++)
475 length = strlen (cregs[i].name);
477 for (j = 0; j < length; j++)
478 buf[j] = tolower (s[j]);
480 if (strncmp (cregs[i].name, buf, length) == 0)
482 *reg = cregs[i].crnum;
487 as_bad (_("control register expected, but saw '%.6s'"), s);
500 /* Skip whitespace. */
501 while (isspace (* s))
504 save = input_line_pointer;
505 input_line_pointer = s;
509 if (e->X_op == O_absent)
510 as_bad (_("missing operand"));
512 new = input_line_pointer;
513 input_line_pointer = save;
524 static const char hex[] = "0123456789ABCDEF";
529 s[3] = hex[(n >> 12) & 0xF];
530 s[4] = hex[(n >> 8) & 0xF];
531 s[5] = hex[(n >> 4) & 0xF];
532 s[6] = hex[(n) & 0xF];
537 dump_literals (isforce)
542 struct symbol * brarsym;
547 /* Must we branch around the literal table? */
553 make_name (brarname, ".YP.", poolnumber);
555 brarsym = symbol_make (brarname);
557 symbol_table_insert (brarsym);
559 output = frag_var (rs_machine_dependent,
560 md_relax_table[C (UNCD_JUMP, UNCD32)].rlx_length,
561 md_relax_table[C (UNCD_JUMP, UNCD12)].rlx_length,
562 C (UNCD_JUMP, 0), brarsym, 0, 0);
563 output[0] = INST_BYTE0 (MCORE_INST_BR); /* br .+xxx */
564 output[1] = INST_BYTE1 (MCORE_INST_BR);
567 /* Make sure that the section is sufficiently aligned and that
568 the literal table is aligned within it. */
569 record_alignment (now_seg, 2);
570 frag_align (2, 0, 0);
572 colon (S_GET_NAME (poolsym));
574 for (i = 0, p = litpool; i < poolsize; i++, p++)
575 emit_expr (& p->e, 4);
578 colon (S_GET_NAME (brarsym));
584 check_literals (kind, offset)
590 /* SPANCLOSE and SPANEXIT are smaller numbers than SPANPANIC.
591 SPANPANIC means that we must dump now.
592 kind == 0 is any old instruction.
593 kind > 0 means we just had a control transfer instruction.
594 kind == 1 means within a function
595 kind == 2 means we just left a function
597 The dump_literals (1) call inserts a branch around the table, so
598 we first look to see if its a situation where we won't have to
599 insert a branch (e.g., the previous instruction was an unconditional
602 SPANPANIC is the point where we must dump a single-entry pool.
603 it accounts for alignments and an inserted branch.
604 the 'poolsize*2' accounts for the scenario where we do:
605 lrw r1,lit1; lrw r2,lit2; lrw r3,lit3
606 Note that the 'lit2' reference is 2 bytes further along
607 but the literal it references will be 4 bytes further along,
608 so we must consider the poolsize into this equation.
609 This is slightly over-cautious, but guarantees that we won't
610 panic because a relocation is too distant. */
612 if (poolspan > SPANCLOSE && kind > 0)
614 else if (poolspan > SPANEXIT && kind > 1)
616 else if (poolspan >= (SPANPANIC - poolsize * 2))
621 enter_literal (e, ispcrel)
628 if (poolsize >= MAX_POOL_SIZE - 2)
630 /* The literal pool is as full as we can handle. We have
631 to be 2 entries shy of the 1024/4=256 entries because we
632 have to allow for the branch (2 bytes) and the alignment
633 (2 bytes before the first insn referencing the pool and
634 2 bytes before the pool itself) == 6 bytes, rounds up
641 /* Create new literal pool. */
642 if (++ poolnumber > 0xFFFF)
643 as_fatal (_("more than 65K literal pools"));
645 make_name (poolname, ".XP.", poolnumber);
646 poolsym = symbol_make (poolname);
647 symbol_table_insert (poolsym);
651 /* Search pool for value so we don't have duplicates. */
652 for (p = litpool, i = 0; i < poolsize; i++, p++)
654 if (e->X_op == p->e.X_op
655 && e->X_add_symbol == p->e.X_add_symbol
656 && e->X_add_number == p->e.X_add_number
657 && ispcrel == p->ispcrel)
665 p->ispcrel = ispcrel;
673 /* Parse a literal specification. -- either new or old syntax.
674 old syntax: the user supplies the label and places the literal.
675 new syntax: we put it into the literal pool. */
677 parse_rt (s, outputp, ispcrel, ep)
687 /* Indicate nothing there. */
692 s = parse_exp (s + 1, & e);
697 as_bad (_("missing ']'"));
701 s = parse_exp (s, & e);
703 n = enter_literal (& e, ispcrel);
708 /* Create a reference to pool entry. */
710 e.X_add_symbol = poolsym;
711 e.X_add_number = n << 2;
714 * outputp = frag_more (2);
716 fix_new_exp (frag_now, (*outputp) - frag_now->fr_literal, 2, & e, 1,
717 BFD_RELOC_MCORE_PCREL_IMM8BY4);
723 parse_imm (s, val, min, max)
732 new = parse_exp (s, & e);
734 if (e.X_op == O_absent)
735 ; /* An error message has already been emitted. */
736 else if (e.X_op != O_constant)
737 as_bad (_("operand must be a constant"));
738 else if (e.X_add_number < min || e.X_add_number > max)
739 as_bad (_("operand must be absolute in range %d..%d, not %d"),
740 min, max, e.X_add_number);
742 * val = e.X_add_number;
748 parse_mem (s, reg, off, siz)
758 while (isspace (* s))
763 s = parse_reg (s + 1, reg);
765 while (isspace (* s))
770 s = parse_imm (s + 1, off, 0, 63);
777 as_bad (_("operand must be a multiple of 4"));
784 as_bad (_("operand must be a multiple of 2"));
791 while (isspace (* s))
798 as_bad (_("base register expected"));
803 /* This is the guts of the machine-dependent assembler. STR points to a
804 machine dependent instruction. This function is supposed to emit
805 the frags/bytes it assembles to. */
813 mcore_opcode_info * opcode;
823 /* Drop leading whitespace. */
824 while (isspace (* str))
827 /* Find the op code end. */
828 for (op_start = op_end = str;
829 * op_end && nlen < 20 && !is_end_of_line [*op_end] && *op_end != ' ';
832 name[nlen] = op_start[nlen];
840 as_bad (_("can't find opcode "));
844 opcode = (mcore_opcode_info *) hash_find (opcode_hash_control, name);
847 as_bad (_("unknown opcode \"%s\""), name);
854 switch (opcode->opclass)
857 output = frag_more (2);
861 op_end = parse_imm (op_end + 1, & reg, 0, 3);
863 output = frag_more (2);
867 op_end = parse_reg (op_end + 1, & reg);
869 output = frag_more (2);
873 op_end = parse_reg (op_end + 1, & reg);
875 output = frag_more (2);
876 /* In a sifilter mode, we emit this insn 2 times,
877 fixes problem of an interrupt during a jmp.. */
880 output[0] = (inst >> 8);
882 output = frag_more (2);
887 op_end = parse_reg (op_end + 1, & reg);
890 as_bad (_("invalid register: r15 illegal"));
893 output = frag_more (2);
897 /* Replace with: bsr .+2 ; addi r15,6; jmp rx ; jmp rx */
898 inst = MCORE_INST_BSR; /* with 0 displacement */
899 output[0] = (inst >> 8);
902 output = frag_more (2);
903 inst = MCORE_INST_ADDI;
904 inst |= 15; /* addi r15,6 */
905 inst |= (6 - 1) << 4; /* over the jmp's */
906 output[0] = (inst >> 8);
909 output = frag_more (2);
910 inst = MCORE_INST_JMP | reg;
911 output[0] = (inst >> 8);
914 output = frag_more (2); /* 2nd emitted in fallthru */
919 op_end = parse_reg (op_end + 1, & reg);
922 /* Skip whitespace. */
923 while (isspace (* op_end))
928 op_end = parse_creg (op_end + 1, & reg);
932 output = frag_more (2);
936 op_end = parse_reg (op_end + 1, & reg);
939 /* Skip whitespace. */
940 while (isspace (* op_end))
945 op_end = parse_reg (op_end + 1, & reg);
949 as_bad (_("second operand missing"));
951 output = frag_more (2);
954 case X1: /* Handle both syntax-> xtrb- r1,rx OR xtrb- rx */
955 op_end = parse_reg (op_end + 1, & reg);
957 /* Skip whitespace. */
958 while (isspace (* op_end))
961 if (* op_end == ',') /* xtrb- r1,rx */
964 as_bad (_("destination register must be r1"));
966 op_end = parse_reg (op_end + 1, & reg);
970 output = frag_more (2);
973 case O1R1: /* div- rx,r1 */
974 op_end = parse_reg (op_end + 1, & reg);
977 /* Skip whitespace. */
978 while (isspace (* op_end))
983 op_end = parse_reg (op_end + 1, & reg);
985 as_bad (_("source register must be r1"));
988 as_bad (_("second operand missing"));
990 output = frag_more (2);
994 op_end = parse_reg (op_end + 1, & reg);
997 /* Skip whitespace. */
998 while (isspace (* op_end))
1001 if (* op_end == ',')
1003 op_end = parse_imm (op_end + 1, & reg, 1, 32);
1004 inst |= (reg - 1) << 4;
1007 as_bad (_("second operand missing"));
1009 output = frag_more (2);
1013 op_end = parse_reg (op_end + 1, & reg);
1016 /* Skip whitespace. */
1017 while (isspace (* op_end))
1020 if (* op_end == ',')
1022 op_end = parse_imm (op_end + 1, & reg, 0, 31);
1026 as_bad (_("second operand missing"));
1028 output = frag_more (2);
1031 case OB2: /* like OB, but arg is 2^n instead of n */
1032 op_end = parse_reg (op_end + 1, & reg);
1035 /* Skip whitespace. */
1036 while (isspace (* op_end))
1039 if (* op_end == ',')
1041 op_end = parse_imm (op_end + 1, & reg, 1, 1 << 31);
1042 /* Further restrict the immediate to a power of two. */
1043 if ((reg & (reg - 1)) == 0)
1048 as_bad (_("immediate is not a power of two"));
1053 as_bad (_("second operand missing"));
1055 output = frag_more (2);
1058 case OBRa: /* Specific for bgeni: imm of 0->6 translate to movi. */
1061 op_end = parse_reg (op_end + 1, & reg);
1064 /* Skip whitespace. */
1065 while (isspace (* op_end))
1068 if (* op_end == ',')
1070 op_end = parse_imm (op_end + 1, & reg, 0, 31);
1071 /* immediate values of 0 -> 6 translate to movi */
1074 inst = (inst & 0xF) | MCORE_INST_BGENI_ALT;
1076 as_warn (_("translating bgeni to movi"));
1082 as_bad (_("second operand missing"));
1084 output = frag_more (2);
1087 case OBR2: /* like OBR, but arg is 2^n instead of n */
1088 op_end = parse_reg (op_end + 1, & reg);
1091 /* Skip whitespace. */
1092 while (isspace (* op_end))
1095 if (* op_end == ',')
1097 op_end = parse_imm (op_end + 1, & reg, 1, 1 << 31);
1099 /* Further restrict the immediate to a power of two. */
1100 if ((reg & (reg - 1)) == 0)
1105 as_bad (_("immediate is not a power of two"));
1108 /* Immediate values of 0 -> 6 translate to movi. */
1111 inst = (inst & 0xF) | MCORE_INST_BGENI_ALT;
1113 as_warn (_("translating mgeni to movi"));
1119 as_bad (_("second operand missing"));
1121 output = frag_more (2);
1124 case OMa: /* Specific for bmaski: imm 1->7 translate to movi. */
1127 op_end = parse_reg (op_end + 1, & reg);
1130 /* Skip whitespace. */
1131 while (isspace (* op_end))
1134 if (* op_end == ',')
1136 op_end = parse_imm (op_end + 1, & reg, 1, 32);
1138 /* Immediate values of 1 -> 7 translate to movi. */
1141 inst = (inst & 0xF) | MCORE_INST_BMASKI_ALT;
1142 reg = (0x1 << reg) - 1;
1145 as_warn (_("translating bmaski to movi"));
1150 inst |= (reg & 0x1F) << 4;
1154 as_bad (_("second operand missing"));
1156 output = frag_more (2);
1160 op_end = parse_reg (op_end + 1, & reg);
1163 /* Skip whitespace. */
1164 while (isspace (* op_end))
1167 if (* op_end == ',')
1169 op_end = parse_imm (op_end + 1, & reg, 1, 31);
1173 as_bad (_("second operand missing"));
1175 output = frag_more (2);
1179 op_end = parse_reg (op_end + 1, & reg);
1182 /* Skip whitespace. */
1183 while (isspace (* op_end))
1186 if (* op_end == ',')
1188 op_end = parse_imm (op_end + 1, & reg, 0, 0x7F);
1192 as_bad (_("second operand missing"));
1194 output = frag_more (2);
1198 op_end = parse_reg (op_end + 1, & reg);
1201 /* Skip whitespace. */
1202 while (isspace (* op_end))
1205 if (* op_end == ',')
1209 if ((inst & 0x6000) == 0)
1211 else if ((inst & 0x6000) == 0x4000)
1213 else if ((inst & 0x6000) == 0x2000)
1216 op_end = parse_mem (op_end + 1, & reg, & off, size);
1219 as_bad (_("displacement too large (%d)"), off);
1221 inst |= (reg) | (off << 4);
1224 as_bad (_("second operand missing"));
1226 output = frag_more (2);
1230 op_end = parse_reg (op_end + 1, & reg);
1232 if (reg == 0 || reg == 15)
1233 as_bad (_("Invalid register: r0 and r15 illegal"));
1237 /* Skip whitespace. */
1238 while (isspace (* op_end))
1241 if (* op_end == ',')
1242 /* parse_rt calls frag_more() for us. */
1243 input_line_pointer = parse_rt (op_end + 1, & output, 0, 0);
1246 as_bad (_("second operand missing"));
1247 output = frag_more (2); /* save its space */
1252 input_line_pointer = parse_rt (op_end + 1, & output, 1, 0);
1253 /* parse_rt() calls frag_more() for us. */
1257 op_end = parse_reg (op_end + 1, & reg);
1259 if (reg == 0 || reg == 15)
1260 as_bad (_("bad starting register: r0 and r15 invalid"));
1264 /* Skip whitespace. */
1265 while (isspace (* op_end))
1268 if (* op_end == '-')
1270 op_end = parse_reg (op_end + 1, & reg);
1273 as_bad (_("ending register must be r15"));
1275 /* Skip whitespace. */
1276 while (isspace (* op_end))
1280 if (* op_end == ',')
1284 /* Skip whitespace. */
1285 while (isspace (* op_end))
1288 if (* op_end == '(')
1290 op_end = parse_reg (op_end + 1, & reg);
1293 as_bad (_("bad base register: must be r0"));
1295 if (* op_end == ')')
1299 as_bad (_("base register expected"));
1302 as_bad (_("second operand missing"));
1304 output = frag_more (2);
1308 op_end = parse_reg (op_end + 1, & reg);
1311 as_fatal (_("first register must be r4"));
1313 /* Skip whitespace. */
1314 while (isspace (* op_end))
1317 if (* op_end == '-')
1319 op_end = parse_reg (op_end + 1, & reg);
1322 as_fatal (_("last register must be r7"));
1324 /* Skip whitespace. */
1325 while (isspace (* op_end))
1328 if (* op_end == ',')
1332 /* Skip whitespace. */
1333 while (isspace (* op_end))
1336 if (* op_end == '(')
1338 op_end = parse_reg (op_end + 1, & reg);
1340 if (reg >= 4 && reg <= 7)
1341 as_fatal ("base register cannot be r4, r5, r6, or r7");
1345 /* Skip whitespace. */
1346 while (isspace (* op_end))
1349 if (* op_end == ')')
1353 as_bad (_("base register expected"));
1356 as_bad (_("second operand missing"));
1359 as_bad (_("reg-reg expected"));
1361 output = frag_more (2);
1365 input_line_pointer = parse_exp (op_end + 1, & e);
1367 output = frag_more (2);
1369 fix_new_exp (frag_now, output-frag_now->fr_literal,
1370 2, & e, 1, BFD_RELOC_MCORE_PCREL_IMM11BY2);
1374 op_end = parse_reg (op_end + 1, & reg);
1377 /* Skip whitespace. */
1378 while (isspace (* op_end))
1381 if (* op_end == ',')
1383 op_end = parse_exp (op_end + 1, & e);
1384 output = frag_more (2);
1386 fix_new_exp (frag_now, output-frag_now->fr_literal,
1387 2, & e, 1, BFD_RELOC_MCORE_PCREL_IMM4BY2);
1391 as_bad (_("second operand missing"));
1392 output = frag_more (2);
1397 input_line_pointer = parse_exp (op_end + 1, & e);
1399 output = frag_var (rs_machine_dependent,
1400 md_relax_table[C (COND_JUMP, COND32)].rlx_length,
1401 md_relax_table[C (COND_JUMP, COND12)].rlx_length,
1402 C (COND_JUMP, 0), e.X_add_symbol, e.X_add_number, 0);
1407 input_line_pointer = parse_exp (op_end + 1, & e);
1408 output = frag_var (rs_machine_dependent,
1409 md_relax_table[C (UNCD_JUMP, UNCD32)].rlx_length,
1410 md_relax_table[C (UNCD_JUMP, UNCD12)].rlx_length,
1411 C (UNCD_JUMP, 0), e.X_add_symbol, e.X_add_number, 0);
1416 inst = MCORE_INST_JSRI; /* jsri */
1417 input_line_pointer = parse_rt (op_end + 1, & output, 1, & e);
1418 /* parse_rt() calls frag_more for us */
1420 /* Only do this if we know how to do it ... */
1421 if (e.X_op != O_absent && do_jsri2bsr)
1423 /* Look at adding the R_PCREL_JSRIMM11BY2. */
1424 fix_new_exp (frag_now, output-frag_now->fr_literal,
1425 2, & e, 1, BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2);
1429 case RSI: /* SI, but imm becomes 32-imm */
1430 op_end = parse_reg (op_end + 1, & reg);
1433 /* Skip whitespace. */
1434 while (isspace (* op_end))
1437 if (* op_end == ',')
1439 op_end = parse_imm (op_end + 1, & reg, 1, 31);
1445 as_bad (_("second operand missing"));
1447 output = frag_more (2);
1450 case DO21: /* O2, dup rd, lit must be 1 */
1451 op_end = parse_reg (op_end + 1, & reg);
1455 /* Skip whitespace. */
1456 while (isspace (* op_end))
1459 if (* op_end == ',')
1461 op_end = parse_imm (op_end + 1, & reg, 1, 31);
1464 as_bad (_("second operand must be 1"));
1467 as_bad (_("second operand missing"));
1469 output = frag_more (2);
1473 op_end = parse_reg (op_end + 1, & reg);
1476 /* Skip whitespace. */
1477 while (isspace (* op_end))
1480 if (* op_end == ',')
1482 op_end = parse_imm (op_end + 1, & reg, 1, 31);
1485 as_bad (_("zero used as immediate value"));
1490 as_bad (_("second operand missing"));
1492 output = frag_more (2);
1496 as_bad (_("unimplemented opcode \"%s\""), name);
1499 output[0] = inst >> 8;
1502 check_literals (opcode->transfer, isize);
1506 md_undefined_symbol (name)
1516 subseg_set (text_section, 0);
1519 /* Various routines to kill one day. */
1520 /* Equal to MAX_PRECISION in atof-ieee.c */
1521 #define MAX_LITTLENUMS 6
1523 /* Turn a string in input_line_pointer into a floating point constant of type
1524 type, and store the appropriate bytes in *litP. The number of LITTLENUMS
1525 emitted is stored in *sizeP. An error message is returned, or NULL on OK.*/
1527 md_atof (type, litP, sizeP)
1533 LITTLENUM_TYPE words[MAX_LITTLENUMS];
1534 LITTLENUM_TYPE * wordP;
1536 char * atof_ieee ();
1566 return _("Bad call to MD_NTOF()");
1569 t = atof_ieee (input_line_pointer, type, words);
1572 input_line_pointer = t;
1574 *sizeP = prec * sizeof (LITTLENUM_TYPE);
1576 for (wordP = words; prec--;)
1578 md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE));
1579 litP += sizeof (LITTLENUM_TYPE);
1585 CONST char * md_shortopts = "";
1587 #define OPTION_RELAX (OPTION_MD_BASE)
1588 #define OPTION_JSRI2BSR_ON (OPTION_MD_BASE + 1)
1589 #define OPTION_JSRI2BSR_OFF (OPTION_MD_BASE + 2)
1590 #define OPTION_SIFILTER_ON (OPTION_MD_BASE + 3)
1591 #define OPTION_SIFILTER_OFF (OPTION_MD_BASE + 4)
1593 struct option md_longopts[] =
1595 { "relax", no_argument, NULL, OPTION_RELAX},
1596 { "no-jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_OFF},
1597 { "jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_ON},
1598 { "sifilter", no_argument, NULL, OPTION_SIFILTER_ON},
1599 { "no-sifilter", no_argument, NULL, OPTION_SIFILTER_OFF},
1600 { NULL, no_argument, NULL, 0}
1603 size_t md_longopts_size = sizeof (md_longopts);
1606 md_parse_option (c, arg)
1616 case OPTION_RELAX: relax = 1; break;
1617 case OPTION_JSRI2BSR_ON: do_jsri2bsr = 1; break;
1618 case OPTION_JSRI2BSR_OFF: do_jsri2bsr = 0; break;
1619 case OPTION_SIFILTER_ON: sifilter_mode = 1; break;
1620 case OPTION_SIFILTER_OFF: sifilter_mode = 0; break;
1628 md_show_usage (stream)
1631 fprintf (stream, _("\
1632 MCORE specific options:\n\
1633 -{no-}jsri2bsr {dis}able jsri to bsr transformation (def: off)\n\
1634 -{no-}sifilter {dis}able silicon filter behavior (def: off)\n\
1635 -relax alter jump instructions for long displacements\n"));
1638 int md_short_jump_size;
1641 md_create_short_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol)
1646 symbolS * to_symbol;
1648 as_fatal (_("failed sanity check: short_jump"));
1652 md_create_long_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol)
1657 symbolS * to_symbol;
1659 as_fatal (_("failed sanity check: long_jump"));
1662 /* Called after relaxing, change the frags so they know how big they are. */
1664 md_convert_frag (abfd, sec, fragP)
1667 register fragS * fragP;
1669 unsigned char * buffer;
1670 int targ_addr = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
1672 buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal);
1673 targ_addr += fragP->fr_symbol->sy_frag->fr_address;
1675 switch (fragP->fr_subtype)
1677 case C (COND_JUMP, COND12):
1678 case C (UNCD_JUMP, UNCD12):
1680 /* Get the address of the end of the instruction */
1681 int next_inst = fragP->fr_fix + fragP->fr_address + 2;
1683 int disp = targ_addr - next_inst;
1686 as_bad (_("odd displacement at %x"), next_inst - 2);
1689 t0 = buffer[0] & 0xF8;
1691 md_number_to_chars (buffer, disp, 2);
1693 buffer[0] = (buffer[0] & 0x07) | t0;
1699 case C (COND_JUMP, COND32):
1700 case C (COND_JUMP, UNDEF_WORD_DISP):
1702 /* A conditional branch wont fit into 12 bits so:
1709 * if the b!cond is 4 byte aligned, the literal which would
1710 * go at x+4 will also be aligned.
1712 int first_inst = fragP->fr_fix + fragP->fr_address;
1713 int needpad = (first_inst & 3);
1715 buffer[0] ^= 0x08; /* Toggle T/F bit */
1717 buffer[2] = INST_BYTE0 (MCORE_INST_JMPI); /* Build jmpi */
1718 buffer[3] = INST_BYTE1 (MCORE_INST_JMPI);
1722 buffer[1] = 4; /* branch over jmpi, pad, and ptr */
1723 buffer[3] = 1; /* jmpi offset of 1 gets the pointer */
1724 buffer[4] = 0; /* alignment/pad */
1726 buffer[6] = 0; /* space for 32 bit address */
1731 /* Make reloc for the long disp */
1732 fix_new (fragP, fragP->fr_fix + 6, 4,
1733 fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
1735 fragP->fr_fix += C32_LEN;
1739 /* See comment below about this given gas' limitations for
1740 shrinking the fragment. '3' is the amount of code that
1741 we inserted here, but '4' is right for the space we reserved
1742 for this fragment. */
1743 buffer[1] = 3; /* branch over jmpi, and ptr */
1744 buffer[3] = 0; /* jmpi offset of 0 gets the pointer */
1745 buffer[4] = 0; /* space for 32 bit address */
1750 /* Make reloc for the long disp. */
1751 fix_new (fragP, fragP->fr_fix + 4, 4,
1752 fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
1753 fragP->fr_fix += C32_LEN;
1755 /* frag is actually shorter (see the other side of this ifdef)
1756 but gas isn't prepared for that. We have to re-adjust
1757 the branch displacement so that it goes beyond the
1758 full length of the fragment, not just what we actually
1760 buffer[1] = 4; /* jmpi, ptr, and the 'tail pad' */
1767 case C (UNCD_JUMP, UNCD32):
1768 case C (UNCD_JUMP, UNDEF_WORD_DISP):
1770 /* An unconditional branch will not fit in 12 bits, make code which
1775 we need a pad if "first_inst" is 4 byte aligned.
1776 [because the natural literal place is x + 2] */
1777 int first_inst = fragP->fr_fix + fragP->fr_address;
1778 int needpad = !(first_inst & 3);
1780 buffer[0] = INST_BYTE0 (MCORE_INST_JMPI); /* Build jmpi */
1781 buffer[1] = INST_BYTE1 (MCORE_INST_JMPI);
1785 buffer[1] = 1; /* jmpi offset of 1 since padded */
1786 buffer[2] = 0; /* alignment */
1788 buffer[4] = 0; /* space for 32 bit address */
1793 /* Make reloc for the long disp */
1794 fix_new (fragP, fragP->fr_fix + 4, 4,
1795 fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
1797 fragP->fr_fix += U32_LEN;
1801 buffer[1] = 0; /* jmpi offset of 0 if no pad */
1802 buffer[2] = 0; /* space for 32 bit address */
1807 /* Make reloc for the long disp */
1808 fix_new (fragP, fragP->fr_fix + 2, 4,
1809 fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
1810 fragP->fr_fix += U32_LEN;
1822 /* Applies the desired value to the specified location.
1823 Also sets up addends for 'rela' type relocations. */
1825 md_apply_fix3 (fixP, valp, segment)
1830 char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
1831 char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
1832 const char * symname;
1833 /* Note: use offsetT because it is signed, valueT is unsigned. */
1834 offsetT val = (offsetT) * valp;
1836 symname = fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : _("<unknown>");
1837 /* Save this for the addend in the relocation record. */
1838 fixP->fx_addnumber = val;
1840 /* If the fix is relative to a symbol which is not defined, or not
1841 in the same segment as the fix, we cannot resolve it here. */
1842 if (fixP->fx_addsy != NULL
1843 && ( ! S_IS_DEFINED (fixP->fx_addsy)
1844 || (S_GET_SEGMENT (fixP->fx_addsy) != segment)))
1848 /* For ELF we can just return and let the reloc that will be generated
1849 take care of everything. For COFF we still have to insert 'val'
1850 into the insn since the addend field will be ignored. */
1857 switch (fixP->fx_r_type)
1859 case BFD_RELOC_MCORE_PCREL_IMM11BY2: /* second byte of 2 byte opcode */
1861 as_bad_where (file, fixP->fx_line,
1862 _("odd distance branch (0x%x bytes)"), val);
1864 if (((val & ~0x3ff) != 0) && ((val | 0x3ff) != -1))
1865 as_bad_where (file, fixP->fx_line,
1866 _("pcrel for branch to %s too far (0x%x)"),
1868 buf[0] |= ((val >> 8) & 0x7);
1869 buf[1] |= (val & 0xff);
1872 case BFD_RELOC_MCORE_PCREL_IMM8BY4: /* lower 8 bits of 2 byte opcode */
1876 as_bad_where (file, fixP->fx_line,
1877 _("pcrel for lrw/jmpi/jsri to %s too far (0x%x)"),
1880 buf[1] |= (val & 0xff);
1883 case BFD_RELOC_MCORE_PCREL_IMM4BY2: /* loopt instruction */
1884 if ((val < -32) || (val > -2))
1885 as_bad_where (file, fixP->fx_line,
1886 _("pcrel for loopt too far (0x%x)"), val);
1888 buf[1] |= (val & 0xf);
1891 case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2:
1892 /* Conditional linker map jsri to bsr. */
1893 /* If its a local target and close enough, fix it.
1894 NB: >= -2k for backwards bsr; < 2k for forwards... */
1895 if (fixP->fx_addsy == 0 && val >= -2048 && val < 2048)
1897 long nval = (val / 2) & 0x7ff;
1898 nval |= MCORE_INST_BSR;
1900 /* REPLACE the instruction, don't just modify it. */
1901 buf[0] = ((nval >> 8) & 0xff);
1902 buf[1] = (nval & 0xff);
1908 case BFD_RELOC_MCORE_PCREL_32:
1909 case BFD_RELOC_VTABLE_INHERIT:
1910 case BFD_RELOC_VTABLE_ENTRY:
1915 if (fixP->fx_addsy != NULL)
1917 /* If the fix is an absolute reloc based on a symbol's
1918 address, then it cannot be resolved until the final link. */
1925 if (fixP->fx_size == 4)
1932 else if (fixP->fx_size == 2 && val >= -32768 && val <= 32767)
1937 else if (fixP->fx_size == 1 && val >= -256 && val <= 255)
1945 return 0; /* Return value is ignored. */
1949 md_operand (expressionP)
1950 expressionS * expressionP;
1952 /* Ignore leading hash symbol, if poresent. */
1953 if (* input_line_pointer == '#')
1955 input_line_pointer ++;
1956 expression (expressionP);
1960 int md_long_jump_size;
1962 /* Called just before address relaxation, return the length
1963 by which a fragment must grow to reach it's destination. */
1965 md_estimate_size_before_relax (fragP, segment_type)
1966 register fragS * fragP;
1967 register segT segment_type;
1969 switch (fragP->fr_subtype)
1971 case C (UNCD_JUMP, UNDEF_DISP):
1972 /* Used to be a branch to somewhere which was unknown. */
1973 if (!fragP->fr_symbol)
1975 fragP->fr_subtype = C (UNCD_JUMP, UNCD12);
1976 fragP->fr_var = md_relax_table[C (UNCD_JUMP, UNCD12)].rlx_length;
1978 else if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type)
1980 fragP->fr_subtype = C (UNCD_JUMP, UNCD12);
1981 fragP->fr_var = md_relax_table[C (UNCD_JUMP, UNCD12)].rlx_length;
1985 fragP->fr_subtype = C (UNCD_JUMP, UNDEF_WORD_DISP);
1986 fragP->fr_var = md_relax_table[C (UNCD_JUMP, UNCD32)].rlx_length;
1987 return md_relax_table[C (UNCD_JUMP, UNCD32)].rlx_length;
1994 case C (COND_JUMP, UNDEF_DISP):
1995 /* Used to be a branch to somewhere which was unknown. */
1996 if (fragP->fr_symbol
1997 && S_GET_SEGMENT (fragP->fr_symbol) == segment_type)
1999 /* Got a symbol and it's defined in this segment, become byte
2000 sized - maybe it will fix up */
2001 fragP->fr_subtype = C (COND_JUMP, COND12);
2002 fragP->fr_var = md_relax_table[C (COND_JUMP, COND12)].rlx_length;
2004 else if (fragP->fr_symbol)
2006 /* Its got a segment, but its not ours, so it will always be long. */
2007 fragP->fr_subtype = C (COND_JUMP, UNDEF_WORD_DISP);
2008 fragP->fr_var = md_relax_table[C (COND_JUMP, COND32)].rlx_length;
2009 return md_relax_table[C (COND_JUMP, COND32)].rlx_length;
2013 /* We know the abs value. */
2014 fragP->fr_subtype = C (COND_JUMP, COND12);
2015 fragP->fr_var = md_relax_table[C (COND_JUMP, COND12)].rlx_length;
2021 return fragP->fr_var;
2024 /* Put number into target byte order */
2027 md_number_to_chars (ptr, use, nbytes)
2034 case 4: *ptr++ = (use >> 24) & 0xff; /* fall through */
2035 case 3: *ptr++ = (use >> 16) & 0xff; /* fall through */
2036 case 2: *ptr++ = (use >> 8) & 0xff; /* fall through */
2037 case 1: *ptr++ = (use >> 0) & 0xff; break;
2042 /* Round up a section size to the appropriate boundary. */
2044 md_section_align (segment, size)
2048 return size; /* Byte alignment is fine */
2052 /* The location from which a PC relative jump should be calculated,
2053 given a PC relative reloc. */
2055 md_pcrel_from_section (fixp, sec)
2060 /* If the symbol is undefined or defined in another section
2061 we leave the add number alone for the linker to fix it later.
2062 Only account for the PC pre-bump (which is 2 bytes on the MCore). */
2063 if (fixp->fx_addsy != (symbolS *) NULL
2064 && (! S_IS_DEFINED (fixp->fx_addsy)
2065 || (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
2068 assert (fixp->fx_size == 2); /* must be an insn */
2069 return fixp->fx_size;
2073 /* The case where we are going to resolve things... */
2074 return fixp->fx_size + fixp->fx_where + fixp->fx_frag->fr_address;
2077 #define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
2078 #define MAP(SZ,PCREL,TYPE) case F (SZ, PCREL): code = (TYPE); break
2081 tc_gen_reloc (section, fixp)
2086 bfd_reloc_code_real_type code;
2089 switch (fixp->fx_r_type)
2091 /* These confuse the size/pcrel macro approach. */
2092 case BFD_RELOC_VTABLE_INHERIT:
2093 case BFD_RELOC_VTABLE_ENTRY:
2094 case BFD_RELOC_MCORE_PCREL_IMM4BY2:
2095 case BFD_RELOC_MCORE_PCREL_IMM8BY4:
2096 case BFD_RELOC_MCORE_PCREL_IMM11BY2:
2097 case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2:
2098 code = fixp->fx_r_type;
2102 switch (F (fixp->fx_size, fixp->fx_pcrel))
2104 MAP (1, 0, BFD_RELOC_8);
2105 MAP (2, 0, BFD_RELOC_16);
2106 MAP (4, 0, BFD_RELOC_32);
2107 MAP (1, 1, BFD_RELOC_8_PCREL);
2108 MAP (2, 1, BFD_RELOC_16_PCREL);
2109 MAP (4, 1, BFD_RELOC_32_PCREL);
2111 code = fixp->fx_r_type;
2112 as_bad (_("Can not do %d byte %srelocation"),
2114 fixp->fx_pcrel ? _("pc-relative") : "");
2119 rel = (arelent *) xmalloc (sizeof (arelent));
2120 rel->sym_ptr_ptr = & fixp->fx_addsy->bsym;
2121 rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
2122 /* Always pass the addend along! */
2123 rel->addend = fixp->fx_addnumber;
2125 rel->howto = bfd_reloc_type_lookup (stdoutput, code);
2127 if (rel->howto == NULL)
2129 as_bad_where (fixp->fx_file, fixp->fx_line,
2130 _("Cannot represent relocation type %s"),
2131 bfd_get_reloc_code_name (code));
2133 /* Set howto to a garbage value so that we can keep going. */
2134 rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
2135 assert (rel->howto != NULL);
2142 /* See whether we need to force a relocation into the output file.
2143 This is used to force out switch and PC relative relocations when
2146 mcore_force_relocation (fix)
2149 if ( fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
2150 || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
2156 /* Return true if the fix can be handled by GAS, false if it must
2157 be passed through to the linker. */
2159 mcore_fix_adjustable (fixP)
2162 if (fixP->fx_addsy == NULL)
2165 /* We need the symbol name for the VTABLE entries. */
2166 if ( fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
2167 || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
2173 /* Handle the .section pseudo-op. This is like the usual one, but it
2174 dumps the literal pool before changing the section. */
2176 mcore_s_section (ignore)
2181 obj_elf_section (ignore);
2183 #endif /* OBJ_ELF */