gas/
authorJan Beulich <jbeulich@novell.com>
Mon, 18 Jul 2005 15:24:41 +0000 (15:24 +0000)
committerJan Beulich <jbeulich@novell.com>
Mon, 18 Jul 2005 15:24:41 +0000 (15:24 +0000)
2005-07-18  Jan Beulich  <jbeulich@novell.com>

* config/tc-i386.c (md_begin): Use IS_ELF.
(tc_i386_fix_adjustable): Likewise.
(md_estimate_size_before_relax): Likewise.
(md_apply_fix): Likewise.
(i386_target_format): Likewise.
(lex_got): Define to NULL when not ELF or when LEX_AT. Check IS_ELF.
(i386_immediate): Remove #ifdef LEX_AT.
(i386_displacement): Likewise.
* config/tc-i386.h (x86_cons): Prototype only when ELF and when not
LEX_AT.

gas/ChangeLog
gas/config/tc-i386.c
gas/config/tc-i386.h

index 52189256b937cfedd3e2879a8f60f5057db6a089..8f131be92137a3fe97c0475ce1fb8a6755b27f9e 100644 (file)
@@ -1,3 +1,16 @@
+2005-07-18  Jan Beulich  <jbeulich@novell.com>
+
+       * config/tc-i386.c (md_begin): Use IS_ELF.
+       (tc_i386_fix_adjustable): Likewise.
+       (md_estimate_size_before_relax): Likewise.
+       (md_apply_fix): Likewise.
+       (i386_target_format): Likewise.
+       (lex_got): Define to NULL when not ELF or when LEX_AT. Check IS_ELF.
+       (i386_immediate): Remove #ifdef LEX_AT.
+       (i386_displacement): Likewise.
+       * config/tc-i386.h (x86_cons): Prototype only when ELF and when not
+       LEX_AT.
+
 2005-07-18  Jan Beulich  <jbeulich@novell.com>
 
        * config/tc-i386.c (reloc): Convert to ISO C90. Change first
index cdc915b6213dcd884288b807c0f25455c6d9599f..514ff4bff8d8d79957c47753af78f94bba9eb299 100644 (file)
@@ -1021,7 +1021,7 @@ md_begin ()
   }
 
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-  if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+  if (IS_ELF)
     {
       record_alignment (text_section, 2);
       record_alignment (data_section, 2);
@@ -1291,7 +1291,7 @@ tc_i386_fix_adjustable (fixP)
      fixS *fixP ATTRIBUTE_UNUSED;
 {
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-  if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
+  if (!IS_ELF)
     return 1;
 
   /* Don't adjust pc-relative references to merge sections in 64-bit
@@ -3741,7 +3741,9 @@ output_imm (insn_start_frag, insn_start_off)
     }
 }
 \f
-#ifndef LEX_AT
+#if (!defined (OBJ_ELF) && !defined (OBJ_MAYBE_ELF)) || defined (LEX_AT)
+# define lex_got(reloc, adjust, types) NULL
+#else
 /* Parse operands of the form
    <symbol>@GOTOFF+<nnn>
    and similar .plt or .got references.
@@ -3779,6 +3781,9 @@ lex_got (enum bfd_reloc_code_real *reloc,
   char *cp;
   unsigned int j;
 
+  if (!IS_ELF)
+    return NULL;
+
   for (cp = input_line_pointer; *cp != '@'; cp++)
     if (is_end_of_line[(unsigned char) *cp])
       return NULL;
@@ -3944,9 +3949,7 @@ i386_immediate (imm_start)
      char *imm_start;
 {
   char *save_input_line_pointer;
-#ifndef LEX_AT
   char *gotfree_input_line;
-#endif
   segT exp_seg = 0;
   expressionS *exp;
   unsigned int types = ~0U;
@@ -3966,11 +3969,9 @@ i386_immediate (imm_start)
   save_input_line_pointer = input_line_pointer;
   input_line_pointer = imm_start;
 
-#ifndef LEX_AT
   gotfree_input_line = lex_got (&i.reloc[this_operand], NULL, &types);
   if (gotfree_input_line)
     input_line_pointer = gotfree_input_line;
-#endif
 
   exp_seg = expression (exp);
 
@@ -3979,10 +3980,8 @@ i386_immediate (imm_start)
     as_bad (_("junk `%s' after expression"), input_line_pointer);
 
   input_line_pointer = save_input_line_pointer;
-#ifndef LEX_AT
   if (gotfree_input_line)
     free (gotfree_input_line);
-#endif
 
   if (exp->X_op == O_absent || exp->X_op == O_big)
     {
@@ -4089,9 +4088,7 @@ i386_displacement (disp_start, disp_end)
   expressionS *exp;
   segT exp_seg = 0;
   char *save_input_line_pointer;
-#ifndef LEX_AT
   char *gotfree_input_line;
-#endif
   int bigdisp = Disp32;
   unsigned int types = Disp;
 
@@ -4155,11 +4152,9 @@ i386_displacement (disp_start, disp_end)
       *displacement_string_end = '0';
     }
 #endif
-#ifndef LEX_AT
   gotfree_input_line = lex_got (&i.reloc[this_operand], NULL, &types);
   if (gotfree_input_line)
     input_line_pointer = gotfree_input_line;
-#endif
 
   exp_seg = expression (exp);
 
@@ -4171,10 +4166,8 @@ i386_displacement (disp_start, disp_end)
 #endif
   RESTORE_END_STRING (disp_end);
   input_line_pointer = save_input_line_pointer;
-#ifndef LEX_AT
   if (gotfree_input_line)
     free (gotfree_input_line);
-#endif
 
   /* We do this to make sure that the section symbol is in
      the symbol table.  We will ultimately change the relocation
@@ -4657,7 +4650,7 @@ md_estimate_size_before_relax (fragP, segment)
      shared library.  */
   if (S_GET_SEGMENT (fragP->fr_symbol) != segment
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-      || (OUTPUT_FLAVOR == bfd_target_elf_flavour
+      || (IS_ELF
          && (S_IS_EXTERNAL (fragP->fr_symbol)
              || S_IS_WEAK (fragP->fr_symbol)))
 #endif
@@ -4944,7 +4937,7 @@ md_apply_fix (fixP, valP, seg)
         subtract the current location (for partial_inplace, PC relative
         relocations); see more below.  */
 #ifndef OBJ_AOUT
-      if (OUTPUT_FLAVOR == bfd_target_elf_flavour
+      if (IS_ELF
 #ifdef TE_PE
          || OUTPUT_FLAVOR == bfd_target_coff_flavour
 #endif
@@ -4952,7 +4945,7 @@ md_apply_fix (fixP, valP, seg)
        value += fixP->fx_where + fixP->fx_frag->fr_address;
 #endif
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-      if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+      if (IS_ELF)
        {
          segT sym_seg = S_GET_SEGMENT (fixP->fx_addsy);
 
@@ -4984,8 +4977,7 @@ md_apply_fix (fixP, valP, seg)
   /* Fix a few things - the dynamic linker expects certain values here,
      and we must not disappoint it.  */
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-  if (OUTPUT_FLAVOR == bfd_target_elf_flavour
-      && fixP->fx_addsy)
+  if (IS_ELF && fixP->fx_addsy)
     switch (fixP->fx_r_type)
       {
       case BFD_RELOC_386_PLT32:
@@ -5328,8 +5320,7 @@ i386_target_format ()
 #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
 void i386_elf_emit_arch_note ()
 {
-  if (OUTPUT_FLAVOR == bfd_target_elf_flavour
-      && cpu_arch_name != NULL)
+  if (IS_ELF && cpu_arch_name != NULL)
     {
       char *p;
       asection *seg = now_seg;
index 4acf3c1aa403e9b58a2d597b6fd1c3b7a27bbf06..0bd0660d82d0bff54b055a8dc6c005dd6b928c00 100644 (file)
@@ -391,7 +391,7 @@ arch_entry;
 #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
 #endif
 
-#ifndef LEX_AT
+#if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && !defined (LEX_AT)
 #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES)
 extern void x86_cons PARAMS ((expressionS *, int));
 
This page took 0.039465 seconds and 4 git commands to generate.