From 8ce3d284cb47f1b08c74d8a20b6b0cfd2d225d2c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 18 Jan 2013 16:37:08 +0000 Subject: [PATCH] Support size relocation only for ELF * config/tc-i386.c (reloc): Support size relocation only for ELF. (tc_i386_fix_adjustable): Likewise. (lex_got): Likewise. (tc_gen_reloc): Likewise. --- gas/ChangeLog | 7 +++++++ gas/config/tc-i386.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 31653de286..bc3fd1019a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2013-01-18 H.J. Lu + + * config/tc-i386.c (reloc): Support size relocation only for ELF. + (tc_i386_fix_adjustable): Likewise. + (lex_got): Likewise. + (tc_gen_reloc): Likewise. + 2013-01-17 Yufeng Zhang * config/tc-aarch64.c (output_operand_error_record): Change to output diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index c96229e9bf..c8ec0c0430 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2686,6 +2686,7 @@ reloc (unsigned int size, break; } +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (other == BFD_RELOC_SIZE32) { if (size == 8) @@ -2693,6 +2694,7 @@ reloc (unsigned int size, if (pcrel) as_bad (_("there are no pc-relative size relocations")); } +#endif /* Sign-checking 4-byte relocations in 16-/32-bit code is pointless. */ if (size == 4 && (flag_code != CODE_64BIT || disallow_64bit_reloc)) @@ -6719,9 +6721,11 @@ lex_got (enum bfd_reloc_code_real *rel, const enum bfd_reloc_code_real rel[2]; const i386_operand_type types64; } gotrel[] = { +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) { STRING_COMMA_LEN ("SIZE"), { BFD_RELOC_SIZE32, BFD_RELOC_SIZE32 }, OPERAND_TYPE_IMM32_64 }, +#endif { STRING_COMMA_LEN ("PLTOFF"), { _dummy_first_bfd_reloc_code_real, BFD_RELOC_X86_64_PLTOFF64 }, OPERAND_TYPE_IMM64 }, @@ -9245,6 +9249,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) switch (fixp->fx_r_type) { +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) case BFD_RELOC_SIZE32: case BFD_RELOC_SIZE64: if (S_IS_DEFINED (fixp->fx_addsy) @@ -9262,6 +9267,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) md_apply_fix (fixp, (valueT *) &value, NULL); return NULL; } +#endif case BFD_RELOC_X86_64_PLT32: case BFD_RELOC_X86_64_GOT32: