From owner-p4-projects Fri Oct 11 12:29:12 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E260737B404; Fri, 11 Oct 2002 12:28:57 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7753737B401 for ; Fri, 11 Oct 2002 12:28:57 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF28143E7B for ; Fri, 11 Oct 2002 12:28:56 -0700 (PDT) (envelope-from tzukanov@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BJSbMt042495 for ; Fri, 11 Oct 2002 12:28:37 -0700 (PDT) (envelope-from tzukanov@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.3/Submit) id g9BJSbjK042492 for perforce@freebsd.org; Fri, 11 Oct 2002 12:28:37 -0700 (PDT) Date: Fri, 11 Oct 2002 12:28:37 -0700 (PDT) Message-Id: <200210111928.g9BJSbjK042492@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to tzukanov@freebsd.org using -f From: Serguei Tzukanov Subject: PERFORCE change 19090 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=19090 Change 19090 by tzukanov@tzukanov_antares on 2002/10/11 12:27:39 Import binutils/s390 from binutils-2_13-branch Affected files ... .. //depot/projects/s390/contrib/binutils/bfd/cpu-s390.c#2 edit .. //depot/projects/s390/contrib/binutils/bfd/elf32-s390.c#2 edit .. //depot/projects/s390/contrib/binutils/bfd/elf64-s390.c#2 edit .. //depot/projects/s390/contrib/binutils/config/mh-s390pic#2 edit .. //depot/projects/s390/contrib/binutils/config/mt-s390pic#2 edit .. //depot/projects/s390/contrib/binutils/gas/config/tc-s390.c#2 edit .. //depot/projects/s390/contrib/binutils/gas/config/tc-s390.h#2 edit .. //depot/projects/s390/contrib/binutils/include/elf/s390.h#2 edit .. //depot/projects/s390/contrib/binutils/include/opcode/s390.h#2 edit .. //depot/projects/s390/contrib/binutils/ld/emulparams/elf64_s390.sh#2 edit .. //depot/projects/s390/contrib/binutils/ld/emulparams/elf_s390.sh#2 edit .. //depot/projects/s390/contrib/binutils/opcodes/s390-dis.c#2 edit .. //depot/projects/s390/contrib/binutils/opcodes/s390-mkopc.c#2 edit .. //depot/projects/s390/contrib/binutils/opcodes/s390-opc.c#2 edit .. //depot/projects/s390/contrib/binutils/opcodes/s390-opc.txt#2 edit Differences ... ==== //depot/projects/s390/contrib/binutils/bfd/cpu-s390.c#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/bfd/elf32-s390.c#2 (text+ko) ==== @@ -40,12 +40,13 @@ static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -478,13 +479,13 @@ struct elf_s390_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_s390_link_hash_table); - ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt); + ret = (struct elf_s390_link_hash_table *) bfd_malloc (amt); if (ret == NULL) return NULL; if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) { - bfd_release (abfd, ret); + free (ret); return NULL; } @@ -564,7 +565,8 @@ /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -606,7 +608,7 @@ eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and @@ -903,8 +905,8 @@ relocation. */ static asection * -elf_s390_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_s390_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -934,9 +936,7 @@ } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1064,7 +1064,7 @@ /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ + (although we could actually do it here). */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { @@ -1973,9 +1973,11 @@ break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), ==== //depot/projects/s390/contrib/binutils/bfd/elf64-s390.c#2 (text+ko) ==== @@ -40,12 +40,13 @@ static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -424,13 +425,13 @@ struct elf_s390_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_s390_link_hash_table); - ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt); + ret = (struct elf_s390_link_hash_table *) bfd_malloc (amt); if (ret == NULL) return NULL; if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) { - bfd_release (abfd, ret); + free (ret); return NULL; } @@ -471,7 +472,7 @@ (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) return false; return true; } @@ -510,7 +511,8 @@ /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -552,7 +554,7 @@ eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and @@ -776,7 +778,7 @@ flags |= SEC_ALLOC | SEC_LOAD; if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) - || ! bfd_set_section_alignment (dynobj, sreloc, 2)) + || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } elf_section_data (sec)->sreloc = sreloc; @@ -855,8 +857,8 @@ relocation. */ static asection * -elf_s390_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_s390_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -886,9 +888,7 @@ } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1019,7 +1019,7 @@ /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ + (although we could actually do it here). */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { @@ -1937,9 +1937,11 @@ break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), @@ -2339,6 +2341,7 @@ bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, bfd_elf64_slurp_reloc_table, bfd_elf64_slurp_symbol_table, ==== //depot/projects/s390/contrib/binutils/config/mh-s390pic#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/config/mt-s390pic#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/gas/config/tc-s390.c#2 (text+ko) ==== @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + 02111-1307, USA. */ #include #include "as.h" @@ -82,7 +82,7 @@ const pseudo_typeS md_pseudo_table[] = { { "align", s_align_bytes, 0 }, - /* Pseudo-ops which must be defined. */ + /* Pseudo-ops which must be defined. */ { "bss", s390_bss, 0 }, { "insn", s390_insn, 0 }, /* Pseudo-ops which must be overridden. */ @@ -121,7 +121,7 @@ sp has the value 15 lit has the value 12 - The table is sorted. Suitable for searching by a binary search. */ + The table is sorted. Suitable for searching by a binary search. */ static const struct pd_reg pre_defined_registers[] = { @@ -312,7 +312,7 @@ const int md_long_jump_size = 4; #endif -CONST char *md_shortopts = "A:m:kVQ:"; +const char *md_shortopts = "A:m:kVQ:"; struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; @@ -560,7 +560,7 @@ { addressT min, max; - max = (((addressT) 1 << (operand->bits - 1))<<1) - 1; + max = (((addressT) 1 << (operand->bits - 1)) << 1) - 1; min = (offsetT) 0; uval = (addressT) val; /* Length x in an instructions has real length x+1. */ @@ -591,7 +591,7 @@ /* Insert fragments of the operand byte for byte. */ offset = operand->shift + operand->bits; uval <<= (-offset) & 7; - insn += (offset - 1)/8; + insn += (offset - 1) / 8; while (uval != 0) { *insn-- |= uval; @@ -724,7 +724,7 @@ static int lpe_count = 0; static int -s390_exp_compare(exp1, exp2) +s390_exp_compare (exp1, exp2) expressionS *exp1; expressionS *exp2; { @@ -771,8 +771,8 @@ && (exp1->X_op_symbol == exp2->X_op_symbol) && (exp1->X_add_number == exp2->X_add_number); default: - return 0; - } + return 0; + } } /* Test for @lit and if its present make an entry in the literal pool and @@ -852,7 +852,7 @@ /* Processing for 'normal' data types. */ for (lpe = lpe_list; lpe != NULL; lpe = lpe->next) if (lpe->nbytes == nbytes && lpe->reloc == reloc - && s390_exp_compare(exp_p, &lpe->ex) != 0) + && s390_exp_compare (exp_p, &lpe->ex) != 0) break; } @@ -866,7 +866,7 @@ } else { - lpe = (struct s390_lpe *) xmalloc(sizeof (struct s390_lpe)); + lpe = (struct s390_lpe *) xmalloc (sizeof (struct s390_lpe)); } lpe->ex = *exp_p; @@ -877,7 +877,7 @@ lpe->floatnum = generic_floating_point_number; else if (exp_p->X_add_number <= 4) memcpy (lpe->bignum, generic_bignum, - exp_p->X_add_number*sizeof (LITTLENUM_TYPE)); + exp_p->X_add_number * sizeof (LITTLENUM_TYPE)); else as_bad (_("Big number is too big")); } @@ -888,13 +888,13 @@ if (lp_sym == NULL) { sprintf (tmp_name, ".L\001%i", lp_count); - lp_sym = symbol_make(tmp_name); + lp_sym = symbol_make (tmp_name); } /* Make name for literal pool entry. */ sprintf (tmp_name, ".L\001%i\002%i", lp_count, lpe_count); lpe_count++; - lpe->sym = symbol_make(tmp_name); + lpe->sym = symbol_make (tmp_name); /* Add to literal pool list. */ lpe->next = NULL; @@ -984,7 +984,7 @@ } while (*input_line_pointer++ == ','); - input_line_pointer--; /* Put terminator back into stream. */ + input_line_pointer--; /* Put terminator back into stream. */ demand_empty_rest_of_line (); } @@ -1019,7 +1019,8 @@ char *f; int fc, i; - while (ISSPACE (*str)) str++; + while (ISSPACE (*str)) + str++; parentheses = 0; skip_optional = 0; @@ -1047,7 +1048,8 @@ hold = input_line_pointer; input_line_pointer = str; - if (! register_name (&ex)) /* parse the operand */ + /* Parse the operand. */ + if (! register_name (&ex)) expression (&ex); str = input_line_pointer; @@ -1397,7 +1399,7 @@ if (strcmp (opformat->name, "e") != 0 && *input_line_pointer++ != ',') as_bad (_("missing comma after insn constant\n")); - + if ((s = strchr (input_line_pointer, '\n')) != NULL) *s = '\0'; input_line_pointer = md_gather_operands (input_line_pointer, insn, @@ -1453,7 +1455,7 @@ struct s390_lpe *lpe; if (lp_sym == NULL || lpe_count == 0) - return; /* nothing to be done */ + return; /* Nothing to be done. */ /* Emit symbol for start of literal pool. */ S_SET_SEGMENT (lp_sym, now_seg); @@ -1492,7 +1494,7 @@ generic_floating_point_number = lpe->floatnum; else memcpy (generic_bignum, lpe->bignum, - lpe->ex.X_add_number*sizeof (LITTLENUM_TYPE)); + lpe->ex.X_add_number * sizeof (LITTLENUM_TYPE)); } emit_expr (&lpe->ex, lpe->nbytes); } @@ -1590,18 +1592,18 @@ md_undefined_symbol (name) char *name; { - if (*name == '_' && *(name+1) == 'G' + if (*name == '_' && *(name + 1) == 'G' && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) - { - if (!GOT_symbol) - { - if (symbol_find (name)) - as_bad (_("GOT already in symbol table")); - GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); - } - return GOT_symbol; - } + { + if (!GOT_symbol) + { + if (symbol_find (name)) + as_bad (_("GOT already in symbol table")); + GOT_symbol = symbol_new (name, undefined_section, + (valueT) 0, &zero_address_frag); + } + return GOT_symbol; + } return 0; } @@ -1623,17 +1625,16 @@ to make sure that the dynamic relocations are done correctly, so in some cases we force the original symbol to be used. */ int -tc_s390_fix_adjustable(fixP) - fixS * fixP; +tc_s390_fix_adjustable (fixP) + fixS *fixP; { /* Prevent all adjustments to global symbols. */ if (S_IS_EXTERN (fixP->fx_addsy)) 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) + /* Don't adjust references to merge sections. */ + if ((S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0) return 0; /* adjust_reloc_syms doesn't know about the GOT. */ if ( fixP->fx_r_type == BFD_RELOC_32_GOTOFF @@ -1698,11 +1699,11 @@ segT seg; { char *where; - valueT value = * valP; + valueT value = *valP; where = fixP->fx_frag->fr_literal + fixP->fx_where; - if (fixP->fx_subsy != NULL) + if (fixP->fx_subsy != NULL) { if ((fixP->fx_addsy != NULL && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) @@ -1712,24 +1713,24 @@ if (!S_IS_DEFINED (fixP->fx_subsy)) as_bad_where (fixP->fx_file, fixP->fx_line, _("unresolved fx_subsy symbol that must be resolved")); - value -= S_GET_VALUE(fixP->fx_subsy); + value -= S_GET_VALUE (fixP->fx_subsy); if (S_GET_SEGMENT (fixP->fx_subsy) == seg && ! fixP->fx_pcrel) value += MD_PCREL_FROM_SECTION (fixP, seg); } - - if (fixP->fx_addsy != NULL) + + if (fixP->fx_addsy != NULL) { if ((fixP->fx_subsy != NULL && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) - && SEG_NORMAL (S_GET_SEGMENT(fixP->fx_addsy))) + && SEG_NORMAL (S_GET_SEGMENT (fixP->fx_addsy))) || (S_GET_SEGMENT (fixP->fx_addsy) == seg && fixP->fx_pcrel && TC_RELOC_RTSYM_LOC_FIXUP (fixP)) - || (!fixP->fx_pcrel + || (!fixP->fx_pcrel && S_GET_SEGMENT (fixP->fx_addsy) == absolute_section) || (S_GET_SEGMENT (fixP->fx_addsy) != undefined_section && !bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy)) - && TC_FIX_ADJUSTABLE(fixP))) + && TC_FIX_ADJUSTABLE (fixP))) value -= S_GET_VALUE (fixP->fx_addsy); if (fixP->fx_pcrel) @@ -1965,8 +1966,8 @@ if (reloc->howto == NULL) { as_bad_where (fixp->fx_file, fixp->fx_line, - _("cannot represent relocation type %s"), - bfd_get_reloc_code_name (code)); + _("cannot represent relocation type %s"), + bfd_get_reloc_code_name (code)); /* Set howto to a garbage value so that we can keep going. */ reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32); assert (reloc->howto != NULL); ==== //depot/projects/s390/contrib/binutils/gas/config/tc-s390.h#2 (text+ko) ==== @@ -1,5 +1,5 @@ /* tc-s390.h -- Header file for tc-s390.c. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. Written by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of GAS, the GNU Assembler. @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + 02111-1307, USA. */ #define TC_S390 @@ -34,7 +34,7 @@ are willing to perform this relocation while building the .o file. This is only used for pcrel relocations, so GOTOFF does not need to be checked here. I am not sure if some of the others are ever used with - pcrel, but it is easier to be safe than sorry. */ + pcrel, but it is easier to be safe than sorry. */ #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ ((FIX)->fx_r_type != BFD_RELOC_390_GOTENT \ @@ -59,9 +59,9 @@ /* The target BFD format. */ #define TARGET_FORMAT s390_target_format() -extern const char * s390_target_format PARAMS ((void)); +extern const char *s390_target_format PARAMS ((void)); -/* Set the endianness we are using. */ +/* Set the endianness we are using. */ #define TARGET_BYTES_BIG_ENDIAN 1 /* Whether or not the target is big endian */ ==== //depot/projects/s390/contrib/binutils/include/elf/s390.h#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/include/opcode/s390.h#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/ld/emulparams/elf64_s390.sh#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/ld/emulparams/elf_s390.sh#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/opcodes/s390-dis.c#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/opcodes/s390-mkopc.c#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/opcodes/s390-opc.c#2 (text+ko) ==== ==== //depot/projects/s390/contrib/binutils/opcodes/s390-opc.txt#2 (text+ko) ==== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message