From: Alan Modra Date: Sat, 27 Apr 2002 13:44:15 +0000 (+0000) Subject: Merge from mainline. X-Git-Tag: binutils-2_12_1~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3ca1dea9d4757829780284e414eb9be68a0561e;p=thirdparty%2Fbinutils-gdb.git Merge from mainline. 2002-04-17 Martin Schwidefsky * config/tc-s390.c (tc_s390_fix_adjustable): Prevent adjustments to symbols in merge sections. 2002-02-19 Martin Schwidefsky * config/tc-s390.c (md_parse_option): Add switches -m31 and -m64. Make bit size independent of architecture switch. (md_begin): Add warning for -m64 with -Aesa. (s390_md_end): Use renamed architecture defines. 2002-02-19 Tom Tromey * config/tc-xstormy16.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. Tue Apr 9 16:45:48 2002 J"orn Rennecke * config/tc-sh.h (TC_FIX_ADJUSTABLE): Disable adjusting if symbol_used_in_reloc_p is true. * config/tc-sh.c (md_apply_fix3): Don't zero relocations on big endian hosts. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 4e1bd8e6785..6b09fddf0e0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,6 +1,25 @@ 2002-04-27 Alan Modra Merge from mainline. + 2002-04-17 Martin Schwidefsky + * config/tc-s390.c (tc_s390_fix_adjustable): Prevent adjustments to + symbols in merge sections. + + 2002-02-19 Martin Schwidefsky + * config/tc-s390.c (md_parse_option): Add switches -m31 and -m64. + Make bit size independent of architecture switch. + (md_begin): Add warning for -m64 with -Aesa. + (s390_md_end): Use renamed architecture defines. + + 2002-02-19 Tom Tromey + * config/tc-xstormy16.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + + Tue Apr 9 16:45:48 2002 J"orn Rennecke + * config/tc-sh.h (TC_FIX_ADJUSTABLE): Disable adjusting if + symbol_used_in_reloc_p is true. + * config/tc-sh.c (md_apply_fix3): Don't zero relocations on big + endian hosts. + 2002-04-03 Alan Modra * symbols.c (resolve_symbol_value ): Derive final_seg from add_symbol. diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 2fb2c6c3a25..ef631adac4d 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1,5 +1,5 @@ /* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of GAS, the GNU Assembler. @@ -373,6 +373,12 @@ md_parse_option (c, arg) else if (arg != NULL && strcmp (arg, "warn-areg-zero") == 0) warn_areg_zero = TRUE; + else if (arg != NULL && strcmp (arg, "31") == 0) + s390_arch_size = 31; + + else if (arg != NULL && strcmp (arg, "64") == 0) + s390_arch_size = 64; + else { as_bad (_("invalid switch -m%s"), arg); @@ -382,15 +388,9 @@ md_parse_option (c, arg) case 'A': if (arg != NULL && strcmp (arg, "esa") == 0) - { - current_architecture = S390_OPCODE_ESA; - s390_arch_size = 32; - } + current_architecture = S390_OPCODE_ESA; else if (arg != NULL && strcmp (arg, "esame") == 0) - { - current_architecture = S390_OPCODE_ESAME; - s390_arch_size = 64; - } + current_architecture = S390_OPCODE_ESAME; else as_bad ("invalid architecture -A%s", arg); current_arch_mask = 1 << current_architecture; @@ -422,7 +422,9 @@ md_show_usage (stream) S390 options:\n\ -mregnames Allow symbolic names for registers\n\ -mwarn-areg-zero Warn about zero base/index registers\n\ - -mno-regnames Do not allow symbolic names for registers\n")); + -mno-regnames Do not allow symbolic names for registers\n\ + -m31 Set file format to 31 bit format\n\ + -m64 Set file format to 64 bit format\n")); fprintf (stream, _("\ -V print assembler version number\n\ -Qy, -Qn ignored\n")); @@ -440,6 +442,10 @@ md_begin () boolean dup_insn = false; const char *retval; + /* Give a warning if the combination -m64-bit and -Aesa is used. */ + if (s390_arch_size == 64 && current_arch_mask == (1 << S390_OPCODE_ESA)) + as_warn ("The 64 bit file format is used without esame instructions."); + /* Set the ELF flags if desired. */ if (s390_flags) bfd_set_private_flags (stdoutput, s390_flags); @@ -487,9 +493,9 @@ void s390_md_end () { if (s390_arch_size == 64) - bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_esame); + bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_64); else - bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_esa); + bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_31); } void @@ -1624,6 +1630,10 @@ tc_s390_fix_adjustable(fixP) return 0; if (S_IS_WEAK (fixP->fx_addsy)) return 0; + /* Don't adjust pc-relative references to merge sections. */ + if ((S_GET_SEGMENT(fixP->fx_addsy)->flags & SEC_MERGE) != 0 + && fixP->fx_pcrel) + return 0; /* adjust_reloc_syms doesn't know about the GOT. */ if ( fixP->fx_r_type == BFD_RELOC_32_GOTOFF || fixP->fx_r_type == BFD_RELOC_390_PLT16DBL diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 5afaad89683..1f33e10dbcf 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -3310,7 +3310,7 @@ md_apply_fix3 (fixP, valP, seg) char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; int lowbyte = target_big_endian ? 1 : 0; int highbyte = target_big_endian ? 0 : 1; - long val = * (long *) valP; + long val = (long) *valP; long max, min; int shift; diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h index 7d9214a76ec..313ac88c1b0 100644 --- a/gas/config/tc-sh.h +++ b/gas/config/tc-sh.h @@ -68,7 +68,12 @@ extern boolean sh_fix_adjustable PARAMS ((struct fix *)); /* This arranges for gas/write.c to not apply a relocation if obj_fix_adjustable() says it is not adjustable. */ -#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) +/* ??? fixups with symbols in SEC_MERGE sections are marked with + obj_fix_adjustable and have a non-section symbol, as in + "vwxyz"+1 in execute/string-opt-6.c . Maybe the test of + (symbol_used_in_reloc_p should be done in the machine-independent code. */ +#define TC_FIX_ADJUSTABLE(fixP) \ + (! symbol_used_in_reloc_p (fixP->fx_addsy) && obj_fix_adjustable (fixP)) #endif #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) diff --git a/gas/config/tc-xstormy16.h b/gas/config/tc-xstormy16.h index 07ff3149312..875a874a17c 100644 --- a/gas/config/tc-xstormy16.h +++ b/gas/config/tc-xstormy16.h @@ -1,5 +1,5 @@ /* tc-xstormy16.h -- Header file for tc-xstormy16.c. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -67,3 +67,6 @@ extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); extern void xstormy16_cons_fix_new PARAMS ((fragS *f, int, int, expressionS *)); #define md_cgen_record_fixup_exp xstormy16_cgen_record_fixup_exp + +/* Minimum instruction is two bytes. */ +#define DWARF2_LINE_MIN_INSN_LENGTH 2