From 718ddfc073092b46dde6d7c1eea2057808f8e554 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 18 Jul 2005 15:24:41 +0000 Subject: gas/ 2005-07-18 Jan Beulich * 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 | 13 +++++++++++++ gas/config/tc-i386.c | 35 +++++++++++++---------------------- gas/config/tc-i386.h | 2 +- 3 files changed, 27 insertions(+), 23 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 5218925..8f131be 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,18 @@ 2005-07-18 Jan Beulich + * 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 + * config/tc-i386.c (reloc): Convert to ISO C90. Change first parameter to unsigned. Parameter sign now is tristate - zero/ positive mean unsigned/signed, negative means signedness doesn't diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index cdc915b..514ff4bf 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -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) } } -#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 @GOTOFF+ 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; diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 4acf3c1..0bd0660 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -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)); -- cgit v1.1