diff -Nupr binutils-2.11.90.0.25/ChangeLog.linux binutils-2.11.90.0.27/ChangeLog.linux --- binutils-2.11.90.0.25/ChangeLog.linux Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/ChangeLog.linux Sat Aug 4 19:52:15 2001 @@ -1,3 +1,7 @@ +2001-08-02 H.J. Lu + + * binutils.spec.in: Remove gas-mips-dwarf2.patch. + 2001-07-26 H.J. Lu * binutils.spec.in: Apply gas-mips-dwarf2.patch for mips. diff -Nupr binutils-2.11.90.0.25/bfd/ChangeLog binutils-2.11.90.0.27/bfd/ChangeLog --- binutils-2.11.90.0.25/bfd/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/bfd/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,178 @@ +2001-08-10 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static. + Add prototypes where needed. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Fix a typo in the last change. + (bfd_fprintf_vma): Likewise. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Don't return void. + (bfd_fprintf_vma): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * elf.c (bfd_elf_sprintf_vma): Add ATTRIBUTE_UNUSED to quiet + warning if not BFD64. Add braces so emacs auto format works. + (bfd_elf_fprintf_vma): Likewise. + + * libxcoff.h (struct xcoff_backend_data_rec): Constify src param + of _xcoff_swap_ld*. + * coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external + param to agree with libxcoff.h. + (xcoff_swap_ldhdr_out): Likewise. + (xcoff_swap_ldsym_in): Likewise. + (xcoff_swap_ldsym_out): Likewise. + (xcoff_swap_ldrel_in): Likewise. + (xcoff_swap_ldrel_out): Likewise. + (xcoff_create_csect_from_smclas): Likewise. + * coff64-rs6000.c: Add missing prototypes. + (xcoff64_swap_ldhdr_in): Modify type of external param to agree + with libxcoff.h. + (xcoff64_swap_ldhdr_out): Likewise. + (xcoff64_swap_ldsym_in): Likewise. + (xcoff64_swap_ldsym_out): Likewise. + (xcoff64_swap_ldrel_in): Likewise. + (xcoff64_swap_ldrel_out): Likewise. + (xcoff64_ppc_relocate_section): Make static. + (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_sizeof_headers): Likewise. + (xcoff64_is_lineno_count_overflow): Likewise. + (xcoff64_is_reloc_count_overflow): Likewise. + (xcoff64_loader_symbol_offset): Likewise. + (xcoff64_loader_reloc_offset): Likewise. + * elf64-gen.c: Add missing prototypes. + +2001-08-09 H.J. Lu + + * elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_elf_sprintf_vma, bfd_elf_fprintf_vma): Moved + to ... + * elf-bfd.h: Here. + * bfd-in2.h: Regenerated. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_sprintf_vma): New prototype. + (bfd_fprintf_vma): Likewise. + (bfd_elf_sprintf_vma): Likewise. + (bfd_elf_fprintf_vma): Likewise. + (bfd_printf_vma): New. Defined with bfd_fprintf_vma. + * bfd-in2.h: Regenerated. + + * bfd.c (bfd_sprintf_vma): New. Defined. + (bfd_fprintf_vma): Likewise. + + * elf.c (bfd_elf_sprintf_vma): New. Defined. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 Alan Modra + + * coff-rs6000.c: Add missing prototypes. + (xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset): Make static. + * dwarf1.c: Add missing prototypes. + * dwarf2.c: Add missing prototypes. + (struct abbrev_info): Move definition. + (struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise. + * elf.c: Add missing prototypes. + * elf32-gen.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-ppc.c: Likewise. + (ppc_elf_sort_rela): Use PTR instead of "void *". + * elflink.h: Add missing prototypes. Formatting fixes. + * merge.c: Add missing prototypes. + (last4_eq): Use PTR instead of "void *". + (last_eq): Likewise. + * syms.c: Add missing prototypes. + +2001-08-09 Nick Clifton + + * bfd.c: Fix formatting. + * bfd-in2.h: Regenerate. + +2001-08-09 Nick Clifton + + * elf32-arc.c (R_ARC_B22_PCREL): Change 'partial_inplace' to + true (this target uses REL relocations) and 'pcrel_offset' to + false (the PC is implied, not stored in the offset). + +2001-08-08 Alan Modra + + 1999-10-19 Linus Nordberg + * elf-bfd.h (struct elf_backend_data): Add want_got_sym. + * elfxx-target.h (elf_backend_want_got_sym): Define. + (elfNN_bed): Add elf_backend_want_got_sym. + * elflink.c (_bfd_elf_create_got_section): Define + _GLOBAL_OFFSET_TABLE_ only if bed->want_got_sym. + +2001-08-08 Alexandre Oliva + + * dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms. + (find_rela_addend): New function. + (parse_comp_unit): Call it to find the abbrev offset addend. + (_bfd_dwarf2_find_nearest_line): Initialize and maintain the new + members of dwarf2_debug as debugging information is read. + +2001-08-07 Nick Clifton + + * coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff + targets as well as sh-pe. + +2001-08-03 Ben Harris + + * elf32-arm.h (elf32_arm_final_link_relocate): Include offset of + reloc from start of section when computing value for R_ARM_REL32 + reloc. + +2001-08-03 Alan Modra + + From H.J. Lu + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't + keep relocs for undefined syms if there are no dynamic sections in + executable. + * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. + +2001-08-02 Paul Sokolovsky + + * cofflink.c (coff_link_check_ar_symbols): also search for + __imp__symbol as well as _symbol. + * linker.c (_bfd_generic_link_add_archive_symbols): also + search for __imp__symbol as well as _symbol. + +2001-08-01 Adam Nemet + + * elf.c (elf_sort_sections): Return zero only as the last step. + +2001-08-01 Nick Clifton + + * config.bfd (arm-vxworks): Change name of define from VXWORKS to + ARM_COFF_BUGFIX. + (arm-epoc-pe): Define ARM_COFF_BUGFIX. + coff-arm.c (coff_arm_relocate_section): Replace VXWORKS with + ARM_COFF_BUGFIX. + +2001-07-30 Rainer Orth + + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Changed return type + to match corresponding bfd_coff_backend data member. + 2001-07-24 Alan Modra * Makefile.am: Update dependencies with "make dep-am". @@ -114,7 +289,7 @@ 2001-06-29 H.J. Lu * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if - hplink->sgot is NULL before filling GOT. Checck if hplink->splt + hplink->sgot is NULL before filling GOT. Check if hplink->splt is NULL before filling PLT. 2001-06-29 Alan Modra diff -Nupr binutils-2.11.90.0.25/bfd/bfd-in.h binutils-2.11.90.0.27/bfd/bfd-in.h --- binutils-2.11.90.0.25/bfd/bfd-in.h Tue Jun 19 11:57:32 2001 +++ binutils-2.11.90.0.27/bfd/bfd-in.h Fri Aug 10 14:08:01 2001 @@ -183,7 +183,11 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ +extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); + #define printf_vma(x) fprintf_vma(stdout,x) +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) typedef unsigned int flagword; /* 32 bits of flags */ typedef unsigned char bfd_byte; diff -Nupr binutils-2.11.90.0.25/bfd/bfd-in2.h binutils-2.11.90.0.27/bfd/bfd-in2.h --- binutils-2.11.90.0.25/bfd/bfd-in2.h Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/bfd/bfd-in2.h Fri Aug 10 14:08:01 2001 @@ -183,7 +183,11 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ +extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); + #define printf_vma(x) fprintf_vma(stdout,x) +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) typedef unsigned int flagword; /* 32 bits of flags */ typedef unsigned char bfd_byte; @@ -2958,7 +2962,7 @@ bfd_copy_private_symbol_data PARAMS ((bf struct _bfd { /* The filename the application opened the BFD with. */ - CONST char *filename; + const char *filename; /* A pointer to the target jump table. */ const struct bfd_target *xvec; @@ -3141,11 +3145,11 @@ bfd_get_error PARAMS ((void)); void bfd_set_error PARAMS ((bfd_error_type error_tag)); -CONST char * +const char * bfd_errmsg PARAMS ((bfd_error_type error_tag)); void -bfd_perror PARAMS ((CONST char *message)); +bfd_perror PARAMS ((const char *message)); typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); @@ -3197,7 +3201,7 @@ void bfd_set_gp_size PARAMS ((bfd *abfd, int i)); bfd_vma -bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base)); +bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); boolean bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); diff -Nupr binutils-2.11.90.0.25/bfd/bfd.c binutils-2.11.90.0.27/bfd/bfd.c --- binutils-2.11.90.0.25/bfd/bfd.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/bfd.c Fri Aug 10 14:08:01 2001 @@ -37,7 +37,7 @@ CODE_FRAGMENT .struct _bfd .{ . {* The filename the application opened the BFD with. *} -. CONST char *filename; +. const char *filename; . . {* A pointer to the target jump table. *} . const struct bfd_target *xvec; @@ -269,27 +269,28 @@ CODE_FRAGMENT static bfd_error_type bfd_error = bfd_error_no_error; -CONST char *CONST bfd_errmsgs[] = { - N_("No error"), - N_("System call error"), - N_("Invalid bfd target"), - N_("File in wrong format"), - N_("Invalid operation"), - N_("Memory exhausted"), - N_("No symbols"), - N_("Archive has no index; run ranlib to add one"), - N_("No more archived files"), - N_("Malformed archive"), - N_("File format not recognized"), - N_("File format is ambiguous"), - N_("Section has no contents"), - N_("Nonrepresentable section on output"), - N_("Symbol needs debug section which does not exist"), - N_("Bad value"), - N_("File truncated"), - N_("File too big"), - N_("#") - }; +const char *const bfd_errmsgs[] = +{ + N_("No error"), + N_("System call error"), + N_("Invalid bfd target"), + N_("File in wrong format"), + N_("Invalid operation"), + N_("Memory exhausted"), + N_("No symbols"), + N_("Archive has no index; run ranlib to add one"), + N_("No more archived files"), + N_("Malformed archive"), + N_("File format not recognized"), + N_("File format is ambiguous"), + N_("Section has no contents"), + N_("Nonrepresentable section on output"), + N_("Symbol needs debug section which does not exist"), + N_("Bad value"), + N_("File truncated"), + N_("File too big"), + N_("#") +}; /* FUNCTION @@ -331,14 +332,14 @@ FUNCTION bfd_errmsg SYNOPSIS - CONST char *bfd_errmsg (bfd_error_type error_tag); + const char *bfd_errmsg (bfd_error_type error_tag); DESCRIPTION Return a string describing the error @var{error_tag}, or the system error if @var{error_tag} is <>. */ -CONST char * +const char * bfd_errmsg (error_tag) bfd_error_type error_tag; { @@ -348,8 +349,8 @@ bfd_errmsg (error_tag) if (error_tag == bfd_error_system_call) return xstrerror (errno); - if ((((int)error_tag <(int) bfd_error_no_error) || - ((int)error_tag > (int)bfd_error_invalid_error_code))) + if ((((int) error_tag < (int) bfd_error_no_error) || + ((int) error_tag > (int) bfd_error_invalid_error_code))) error_tag = bfd_error_invalid_error_code;/* sanity check */ return _(bfd_errmsgs [(int)error_tag]); @@ -360,7 +361,7 @@ FUNCTION bfd_perror SYNOPSIS - void bfd_perror (CONST char *message); + void bfd_perror (const char *message); DESCRIPTION Print to the standard error stream a string describing the @@ -372,16 +373,18 @@ DESCRIPTION void bfd_perror (message) - CONST char *message; + const char *message; { if (bfd_get_error () == bfd_error_system_call) - perror((char *)message); /* must be system error then... */ - else { - if (message == NULL || *message == '\0') - fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); - else - fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); - } + /* Must be a system error then. */ + perror ((char *)message); + else + { + if (message == NULL || *message == '\0') + fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); + else + fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); + } } /* @@ -550,10 +553,11 @@ bfd_get_reloc_upper_bound (abfd, asect) bfd *abfd; sec_ptr asect; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } return BFD_SEND (abfd, _get_reloc_upper_bound, (abfd, asect)); } @@ -589,10 +593,12 @@ bfd_canonicalize_reloc (abfd, asect, loc arelent **location; asymbol **symbols; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_invalid_operation); - return -1; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + return BFD_SEND (abfd, _bfd_canonicalize_reloc, (abfd, asect, location, symbols)); } @@ -648,23 +654,26 @@ bfd_set_file_flags (abfd, flags) bfd *abfd; flagword flags; { - if (abfd->format != bfd_object) { - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (abfd->format != bfd_object) + { + bfd_set_error (bfd_error_wrong_format); + return false; + } - if (bfd_read_p (abfd)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + if (bfd_read_p (abfd)) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } bfd_get_file_flags (abfd) = flags; - if ((flags & bfd_applicable_file_flags (abfd)) != flags) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + if ((flags & bfd_applicable_file_flags (abfd)) != flags) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } -return true; + return true; } void @@ -786,9 +795,9 @@ RETURNS */ boolean -bfd_set_start_address(abfd, vma) -bfd *abfd; -bfd_vma vma; +bfd_set_start_address (abfd, vma) + bfd *abfd; + bfd_vma vma; { abfd->start_address = vma; return true; @@ -869,7 +878,7 @@ bfd_get_size (abfd) return ((struct bfd_in_memory *) abfd->iostream)->size; fp = bfd_cache_lookup (abfd); - if (0 != fstat (fileno (fp), &buf)) + if (0 != fstat (fileno (fp), & buf)) return 0; return buf.st_size; @@ -920,9 +929,10 @@ bfd_set_gp_size (abfd, i) bfd *abfd; int i; { - /* Don't try to set GP size on an archive or core file! */ + /* Don't try to set GP size on an archive or core file! */ if (abfd->format != bfd_object) return; + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) ecoff_data (abfd)->gp_size = i; else if (abfd->xvec->flavour == bfd_target_elf_flavour) @@ -937,13 +947,14 @@ bfd_vma _bfd_get_gp_value (abfd) bfd *abfd; { - if (abfd->format == bfd_object) - { - if (abfd->xvec->flavour == bfd_target_ecoff_flavour) - return ecoff_data (abfd)->gp; - else if (abfd->xvec->flavour == bfd_target_elf_flavour) - return elf_gp (abfd); - } + if (abfd->format != bfd_object) + return 0; + + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) + return ecoff_data (abfd)->gp; + else if (abfd->xvec->flavour == bfd_target_elf_flavour) + return elf_gp (abfd); + return 0; } @@ -956,6 +967,7 @@ _bfd_set_gp_value (abfd, v) { if (abfd->format != bfd_object) return; + if (abfd->xvec->flavour == bfd_target_ecoff_flavour) ecoff_data (abfd)->gp = v; else if (abfd->xvec->flavour == bfd_target_elf_flavour) @@ -967,7 +979,7 @@ FUNCTION bfd_scan_vma SYNOPSIS - bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base); + bfd_vma bfd_scan_vma(const char *string, const char **end, int base); DESCRIPTION Convert, like <>, a numerical expression @@ -984,8 +996,8 @@ DESCRIPTION bfd_vma bfd_scan_vma (string, end, base) - CONST char *string; - CONST char **end; + const char *string; + const char **end; int base; { bfd_vma value; @@ -1005,17 +1017,18 @@ bfd_scan_vma (string, end, base) { if ((string[1] == 'x') || (string[1] == 'X')) base = 16; - /* XXX should we also allow "0b" or "0B" to set base to 2? */ + /* XXX should we also allow "0b" or "0B" to set base to 2? */ else base = 8; } else base = 10; } + if ((base == 16) && (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X'))) string += 2; - /* XXX should we also skip over "0b" or "0B" if base is 2? */ + /* XXX should we also skip over "0b" or "0B" if base is 2? */ /* Speed could be improved with a table like hex_value[] in gas. */ #define HEX_VALUE(c) \ @@ -1025,13 +1038,11 @@ bfd_scan_vma (string, end, base) : (10 + c - (islower ((unsigned char) c) ? 'a' : 'A'))) \ : 42) - for (value = 0; (digit = HEX_VALUE(*string)) < base; string++) - { - value = value * base + digit; - } + for (value = 0; (digit = HEX_VALUE (* string)) < base; string ++) + value = value * base + digit; if (end) - *end = string; + * end = string; return value; } @@ -1194,11 +1205,12 @@ bfd_get_relocated_section_contents (abfd if (link_order->type == bfd_indirect_link_order) { abfd2 = link_order->u.indirect.section->owner; - if (abfd2 == 0) + if (abfd2 == NULL) abfd2 = abfd; } else abfd2 = abfd; + fn = abfd2->xvec->_bfd_get_relocated_section_contents; return (*fn) (abfd, link_info, link_order, data, relocateable, symbols); @@ -1249,4 +1261,28 @@ bfd_record_phdr (abfd, type, flags_valid *pm = m; return true; +} + +void +bfd_sprintf_vma (abfd, buf, value) + bfd *abfd; + char *buf; + bfd_vma value; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + bfd_elf_sprintf_vma (abfd, buf, value); + else + sprintf_vma (buf, value); +} + +void +bfd_fprintf_vma (abfd, stream, value) + bfd *abfd; + PTR stream; + bfd_vma value; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + bfd_elf_fprintf_vma (abfd, stream, value); + else + fprintf_vma ((FILE *) stream, value); } diff -Nupr binutils-2.11.90.0.25/bfd/coff-arm.c binutils-2.11.90.0.27/bfd/coff-arm.c --- binutils-2.11.90.0.25/bfd/coff-arm.c Fri Apr 27 14:03:44 2001 +++ binutils-2.11.90.0.27/bfd/coff-arm.c Sat Aug 4 19:52:15 2001 @@ -1246,10 +1246,10 @@ coff_arm_relocate_section (output_bfd, i continue; /* FIXME - it is not clear which targets need this next test and which do not. It is known that it is needed for the - VXworks target (hence the #ifdef), but it is also known - that it was supressed for other (arm) targets. This ought - to be sorted out one day. */ -#ifdef VXWORKS + VxWorks and EPOC-PE targets, but it is also known that it + was supressed for other ARM targets. This ought to be + sorted out one day. */ +#ifdef ARM_COFF_BUGFIX /* We must not ignore the symbol value. If the symbol is within the same section, the relocation should have already been fixed, but if it is not, we'll be handed a reloc into diff -Nupr binutils-2.11.90.0.25/bfd/coff-rs6000.c binutils-2.11.90.0.27/bfd/coff-rs6000.c --- binutils-2.11.90.0.25/bfd/coff-rs6000.c Fri May 25 14:26:23 2001 +++ binutils-2.11.90.0.27/bfd/coff-rs6000.c Fri Aug 10 14:08:01 2001 @@ -111,6 +111,41 @@ extern int rs6000coff_core_file_failing_ /* The main body of code is in coffcode.h. */ static const char *normalize_filename PARAMS ((bfd *)); +static boolean xcoff_write_armap_old + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +static boolean xcoff_write_one_armap_big + PARAMS ((bfd *, struct orl *, unsigned int, unsigned int, unsigned int, + int, const char *, char *)); +static boolean xcoff_write_armap_big + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +static boolean xcoff_write_archive_contents_old PARAMS ((bfd *)); +static boolean xcoff_write_archive_contents_big PARAMS ((bfd *)); +static void xcoff_swap_ldhdr_in + PARAMS ((bfd *, const PTR, struct internal_ldhdr *)); +static void xcoff_swap_ldhdr_out + PARAMS ((bfd *, const struct internal_ldhdr *, PTR)); +static void xcoff_swap_ldsym_in + PARAMS ((bfd *, const PTR, struct internal_ldsym *)); +static void xcoff_swap_ldsym_out + PARAMS ((bfd *, const struct internal_ldsym *, PTR)); +static void xcoff_swap_ldrel_in + PARAMS ((bfd *, const PTR, struct internal_ldrel *)); +static void xcoff_swap_ldrel_out + PARAMS ((bfd *, const struct internal_ldrel *, PTR)); +static boolean xcoff_ppc_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + struct internal_reloc *, struct internal_syment *, asection **)); +static boolean _bfd_xcoff_put_ldsymbol_name + PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, + const char *)); +static asection *xcoff_create_csect_from_smclas + PARAMS ((bfd *, union internal_auxent *, const char *)); +static boolean xcoff_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma)); +static boolean xcoff_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma)); +static bfd_vma xcoff_loader_symbol_offset + PARAMS ((bfd *, struct internal_ldhdr *)); +static bfd_vma xcoff_loader_reloc_offset + PARAMS ((bfd *, struct internal_ldhdr *)); /* We use our own tdata type. Its first field is the COFF tdata type, so the COFF routines are compatible. */ @@ -2237,11 +2272,13 @@ _bfd_xcoff_sizeof_headers (abfd, reloc) /* Swap in the ldhdr structure. */ static void -xcoff_swap_ldhdr_in (abfd, src, dst) +xcoff_swap_ldhdr_in (abfd, s, dst) bfd *abfd; - const struct external_ldhdr *src; + const PTR s; struct internal_ldhdr *dst; { + const struct external_ldhdr *src = (const struct external_ldhdr *) s; + dst->l_version = bfd_get_32 (abfd, src->l_version); dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms); dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc); @@ -2255,11 +2292,13 @@ xcoff_swap_ldhdr_in (abfd, src, dst) /* Swap out the ldhdr structure. */ static void -xcoff_swap_ldhdr_out (abfd, src, dst) +xcoff_swap_ldhdr_out (abfd, src, d) bfd *abfd; const struct internal_ldhdr *src; - struct external_ldhdr *dst; + PTR d; { + struct external_ldhdr *dst = (struct external_ldhdr *) d; + bfd_put_32 (abfd, src->l_version, dst->l_version); bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms); bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc); @@ -2273,11 +2312,13 @@ xcoff_swap_ldhdr_out (abfd, src, dst) /* Swap in the ldsym structure. */ static void -xcoff_swap_ldsym_in (abfd, src, dst) +xcoff_swap_ldsym_in (abfd, s, dst) bfd *abfd; - const struct external_ldsym *src; + const PTR s; struct internal_ldsym *dst; { + const struct external_ldsym *src = (const struct external_ldsym *) s; + if (bfd_get_32 (abfd, src->_l._l_l._l_zeroes) != 0) { memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); } else { @@ -2295,11 +2336,12 @@ xcoff_swap_ldsym_in (abfd, src, dst) /* Swap out the ldsym structure. */ static void -xcoff_swap_ldsym_out (abfd, src, dst) +xcoff_swap_ldsym_out (abfd, src, d) bfd *abfd; const struct internal_ldsym *src; - struct external_ldsym *dst; + PTR d; { + struct external_ldsym *dst = (struct external_ldsym *) d; if (src->_l._l_l._l_zeroes != 0) memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); @@ -2319,11 +2361,13 @@ xcoff_swap_ldsym_out (abfd, src, dst) /* Swap in the ldrel structure. */ static void -xcoff_swap_ldrel_in (abfd, src, dst) +xcoff_swap_ldrel_in (abfd, s, dst) bfd *abfd; - const struct external_ldrel *src; + const PTR s; struct internal_ldrel *dst; { + const struct external_ldrel *src = (const struct external_ldrel *) s; + dst->l_vaddr = bfd_get_32 (abfd, src->l_vaddr); dst->l_symndx = bfd_get_32 (abfd, src->l_symndx); dst->l_rtype = bfd_get_16 (abfd, src->l_rtype); @@ -2333,11 +2377,13 @@ xcoff_swap_ldrel_in (abfd, src, dst) /* Swap out the ldrel structure. */ static void -xcoff_swap_ldrel_out (abfd, src, dst) +xcoff_swap_ldrel_out (abfd, src, d) bfd *abfd; const struct internal_ldrel *src; - struct external_ldrel *dst; + PTR d; { + struct external_ldrel *dst = (struct external_ldrel *) d; + bfd_put_32 (abfd, src->l_vaddr, dst->l_vaddr); bfd_put_32 (abfd, src->l_symndx, dst->l_symndx); bfd_put_16 (abfd, src->l_rtype, dst->l_rtype); @@ -2350,7 +2396,7 @@ xcoff_swap_ldrel_out (abfd, src, dst) This is currently the only processor which uses XCOFF; I hope that will never change. */ -boolean +static boolean xcoff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) @@ -2782,7 +2828,7 @@ static asection * xcoff_create_csect_from_smclas (abfd, aux, symbol_name) bfd *abfd; union internal_auxent *aux; - char *symbol_name; + const char *symbol_name; { asection *return_value = NULL; @@ -2814,7 +2860,7 @@ xcoff_create_csect_from_smclas (abfd, au return return_value; } -boolean +static boolean xcoff_is_lineno_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; @@ -2825,7 +2871,7 @@ xcoff_is_lineno_count_overflow (abfd, va return false; } -boolean +static boolean xcoff_is_reloc_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; @@ -2836,7 +2882,7 @@ xcoff_is_reloc_count_overflow (abfd, val return false; } -bfd_vma +static bfd_vma xcoff_loader_symbol_offset (abfd, ldhdr) bfd *abfd; struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; @@ -2844,7 +2890,7 @@ xcoff_loader_symbol_offset (abfd, ldhdr) return bfd_xcoff_ldhdrsz(abfd); } -bfd_vma +static bfd_vma xcoff_loader_reloc_offset (abfd, ldhdr) bfd *abfd; struct internal_ldhdr *ldhdr; @@ -3393,4 +3439,3 @@ const bfd_target pmac_xcoff_vec = /* back end data */ (void *) &bfd_pmac_xcoff_backend_data, }; - diff -Nupr binutils-2.11.90.0.25/bfd/coff-sh.c binutils-2.11.90.0.27/bfd/coff-sh.c --- binutils-2.11.90.0.25/bfd/coff-sh.c Fri Mar 9 11:37:54 2001 +++ binutils-2.11.90.0.27/bfd/coff-sh.c Fri Aug 10 14:08:01 2001 @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" #include "sysdep.h" +#include "libiberty.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/sh.h" @@ -460,6 +461,8 @@ coff_sh_rtype_to_howto (abfd, sec, rel, return howto; } +#endif /* COFF_WITH_PE */ + /* This structure is used to map BFD reloc codes to SH PE relocs. */ struct shcoff_reloc_map { @@ -486,16 +489,13 @@ sh_coff_reloc_type_lookup (abfd, code) { unsigned int i; - for (i = 0; i < sizeof (sh_reloc_map) / sizeof (struct shcoff_reloc_map); i++) - { - if (sh_reloc_map[i].bfd_reloc_val == code) - return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val]; - } + for (i = ARRAY_SIZE (sh_reloc_map); i--;) + if (sh_reloc_map[i].bfd_reloc_val == code) + return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val]; fprintf (stderr, "SH Error: unknown reloc type %d\n", code); return NULL; } -#endif /* COFF_WITH_PE */ /* This macro is used in coffcode.h to get the howto corresponding to an internal reloc. */ diff -Nupr binutils-2.11.90.0.25/bfd/coff64-rs6000.c binutils-2.11.90.0.27/bfd/coff64-rs6000.c --- binutils-2.11.90.0.25/bfd/coff64-rs6000.c Fri May 25 14:26:24 2001 +++ binutils-2.11.90.0.27/bfd/coff64-rs6000.c Fri Aug 10 14:08:01 2001 @@ -92,6 +92,12 @@ do { \ #define GETBYTE bfd_h_get_8 +static void _bfd_xcoff64_swap_lineno_in PARAMS ((bfd *, PTR, PTR)); +static unsigned int _bfd_xcoff64_swap_lineno_out PARAMS ((bfd *, PTR, PTR)); +static boolean _bfd_xcoff64_put_ldsymbol_name + PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, + const char *)); + /* For XCOFF64, the effective width of symndx changes depending on whether we are the first entry. Sigh. */ static void @@ -488,14 +494,46 @@ extern int rs6000coff_core_file_failing_ moved to another file shared by the linker (which XCOFF calls the ``binder'') and the loader. */ +static void xcoff64_swap_ldhdr_in + PARAMS ((bfd *, const PTR, struct internal_ldhdr *)); +static void xcoff64_swap_ldhdr_out + PARAMS ((bfd *, const struct internal_ldhdr *, PTR d)); +static void xcoff64_swap_ldsym_in + PARAMS ((bfd *, const PTR, struct internal_ldsym *)); +static void xcoff64_swap_ldsym_out + PARAMS ((bfd *, const struct internal_ldsym *, PTR d)); +static void xcoff64_swap_ldrel_in + PARAMS ((bfd *, const PTR, struct internal_ldrel *)); +static void xcoff64_swap_ldrel_out + PARAMS ((bfd *, const struct internal_ldrel *, PTR d)); +static boolean xcoff64_write_object_contents PARAMS ((bfd *)); +static boolean xcoff64_ppc_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + struct internal_reloc *, struct internal_syment *, + asection **sections)); +static boolean xcoff64_slurp_armap PARAMS ((bfd *)); +static const bfd_target *xcoff64_archive_p PARAMS ((bfd *)); +static bfd *xcoff64_openr_next_archived_file PARAMS ((bfd *, bfd *)); +static int xcoff64_sizeof_headers PARAMS ((bfd *, boolean)); +static asection *xcoff64_create_csect_from_smclas + PARAMS ((bfd *, union internal_auxent *, const char *)); +static boolean xcoff64_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma)); +static boolean xcoff64_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma)); +static bfd_vma xcoff64_loader_symbol_offset + PARAMS ((bfd *, struct internal_ldhdr *)); +static bfd_vma xcoff64_loader_reloc_offset + PARAMS ((bfd *, struct internal_ldhdr *)); + /* Swap in the ldhdr structure. */ static void -xcoff64_swap_ldhdr_in (abfd, src, dst) - bfd *abfd; - const struct external_ldhdr *src; - struct internal_ldhdr *dst; - { +xcoff64_swap_ldhdr_in (abfd, s, dst) + bfd *abfd; + const PTR s; + struct internal_ldhdr *dst; +{ + const struct external_ldhdr *src = (const struct external_ldhdr *) s; + dst->l_version = bfd_get_32 (abfd, src->l_version); dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms); dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc); @@ -511,11 +549,13 @@ xcoff64_swap_ldhdr_in (abfd, src, dst) /* Swap out the ldhdr structure. */ static void -xcoff64_swap_ldhdr_out (abfd, src, dst) +xcoff64_swap_ldhdr_out (abfd, src, d) bfd *abfd; const struct internal_ldhdr *src; - struct external_ldhdr *dst; + PTR d; { + struct external_ldhdr *dst = (struct external_ldhdr *) d; + bfd_put_32 (abfd, src->l_version, dst->l_version); bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms); bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc); @@ -531,11 +571,12 @@ xcoff64_swap_ldhdr_out (abfd, src, dst) /* Swap in the ldsym structure. */ static void -xcoff64_swap_ldsym_in (abfd, src, dst) +xcoff64_swap_ldsym_in (abfd, s, dst) bfd *abfd; - const struct external_ldsym *src; + const PTR s; struct internal_ldsym *dst; { + const struct external_ldsym *src = (const struct external_ldsym *) s; /* * XCOFF64 does not use l_zeroes like XCOFF32 * Set the internal l_zeroes to 0 so the common 32/64 code uses l_value @@ -554,11 +595,13 @@ xcoff64_swap_ldsym_in (abfd, src, dst) /* Swap out the ldsym structure. */ static void -xcoff64_swap_ldsym_out (abfd, src, dst) +xcoff64_swap_ldsym_out (abfd, src, d) bfd *abfd; const struct internal_ldsym *src; - struct external_ldsym *dst; + PTR d; { + struct external_ldsym *dst = (struct external_ldsym *) d; + bfd_put_64 (abfd, src->l_value, dst->l_value); bfd_put_32 (abfd, src->_l._l_l._l_offset, dst->l_offset); bfd_put_16 (abfd, src->l_scnum, dst->l_scnum); @@ -571,11 +614,13 @@ xcoff64_swap_ldsym_out (abfd, src, dst) /* Swap in the ldrel structure. */ static void -xcoff64_swap_ldrel_in (abfd, src, dst) +xcoff64_swap_ldrel_in (abfd, s, dst) bfd *abfd; - const struct external_ldrel *src; + const PTR s; struct internal_ldrel *dst; { + const struct external_ldrel *src = (const struct external_ldrel *) s; + dst->l_vaddr = bfd_get_64 (abfd, src->l_vaddr); dst->l_symndx = bfd_get_32 (abfd, src->l_symndx); dst->l_rtype = bfd_get_16 (abfd, src->l_rtype); @@ -585,11 +630,13 @@ xcoff64_swap_ldrel_in (abfd, src, dst) /* Swap out the ldrel structure. */ static void -xcoff64_swap_ldrel_out (abfd, src, dst) +xcoff64_swap_ldrel_out (abfd, src, d) bfd *abfd; const struct internal_ldrel *src; - struct external_ldrel *dst; + PTR d; { + struct external_ldrel *dst = (struct external_ldrel *) d; + bfd_put_64 (abfd, src->l_vaddr, dst->l_vaddr); bfd_put_16 (abfd, src->l_rtype, dst->l_rtype); bfd_put_16 (abfd, src->l_rsecnm, dst->l_rsecnm); @@ -926,7 +973,7 @@ xcoff64_write_object_contents (abfd) This is currently the only processor which uses XCOFF; I hope that will never change. */ -boolean +static boolean xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) @@ -1698,7 +1745,7 @@ xcoff64_reloc_type_lookup (abfd, code) /* Read in the armap of an XCOFF archive. */ -boolean +static boolean xcoff64_slurp_armap (abfd) bfd *abfd; { @@ -1791,7 +1838,7 @@ xcoff64_slurp_armap (abfd) /* See if this is an NEW XCOFF archive. */ -const bfd_target * +static const bfd_target * xcoff64_archive_p (abfd) bfd *abfd; { @@ -1860,7 +1907,7 @@ xcoff64_archive_p (abfd) /* Open the next element in an XCOFF archive. */ -bfd * +static bfd * xcoff64_openr_next_archived_file (archive, last_file) bfd *archive; bfd *last_file; @@ -1901,7 +1948,7 @@ xcoff64_openr_next_archived_file (archiv always uses an a.out header. */ /*ARGSUSED*/ -int +static int xcoff64_sizeof_headers (abfd, reloc) bfd *abfd; boolean reloc ATTRIBUTE_UNUSED; @@ -1960,7 +2007,7 @@ xcoff64_create_csect_from_smclas (abfd, return return_value; } -boolean +static boolean xcoff64_is_lineno_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value ATTRIBUTE_UNUSED; @@ -1968,7 +2015,7 @@ xcoff64_is_lineno_count_overflow (abfd, return false; } -boolean +static boolean xcoff64_is_reloc_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value ATTRIBUTE_UNUSED; @@ -1976,7 +2023,7 @@ xcoff64_is_reloc_count_overflow (abfd, v return false; } -bfd_vma +static bfd_vma xcoff64_loader_symbol_offset (abfd, ldhdr) bfd *abfd ATTRIBUTE_UNUSED; struct internal_ldhdr *ldhdr; @@ -1984,7 +2031,7 @@ xcoff64_loader_symbol_offset (abfd, ldhd return (ldhdr->l_symoff); } -bfd_vma +static bfd_vma xcoff64_loader_reloc_offset (abfd, ldhdr) bfd *abfd ATTRIBUTE_UNUSED; struct internal_ldhdr *ldhdr; @@ -2269,5 +2316,3 @@ const bfd_target rs6000coff64_vec = /* back end data */ (void *) &bfd_xcoff_backend_data, }; - - diff -Nupr binutils-2.11.90.0.25/bfd/cofflink.c binutils-2.11.90.0.27/bfd/cofflink.c --- binutils-2.11.90.0.25/bfd/cofflink.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/cofflink.c Sat Aug 4 19:52:15 2001 @@ -277,6 +277,16 @@ coff_link_check_ar_symbols (abfd, info, return false; h = bfd_link_hash_lookup (info->hash, name, false, false, true); + /* auto import */ + if (!h && info->pei386_auto_import) + { + if (!strncmp (name,"__imp_", 6)) + { + h = + bfd_link_hash_lookup (info->hash, name + 6, false, false, + true); + } + } /* We are only interested in symbols that are currently undefined. If a symbol is currently known to be common, COFF linkers do not bring in an object file which defines diff -Nupr binutils-2.11.90.0.25/bfd/config.bfd binutils-2.11.90.0.27/bfd/config.bfd --- binutils-2.11.90.0.25/bfd/config.bfd Sun Jun 3 16:58:25 2001 +++ binutils-2.11.90.0.27/bfd/config.bfd Sat Aug 4 19:52:15 2001 @@ -120,6 +120,7 @@ case "${targ}" in targ_defvec=arm_epoc_pe_little_vec targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec" targ_underscore=no + targ_cflags=-DARM_COFF_BUGFIX ;; arm-wince-pe | arm-*-wince) targ_defvec=armpe_little_vec @@ -144,7 +145,7 @@ case "${targ}" in targ_defvec=armcoff_little_vec targ_selvecs=armcoff_big_vec targ_underscore=yes - targ_cflags=-DVXWORKS + targ_cflags=-DARM_COFF_BUGFIX ;; arm-*-coff) targ_defvec=armcoff_little_vec diff -Nupr binutils-2.11.90.0.25/bfd/configure binutils-2.11.90.0.27/bfd/configure --- binutils-2.11.90.0.25/bfd/configure Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/bfd/configure Fri Aug 10 14:08:01 2001 @@ -1116,7 +1116,7 @@ fi PACKAGE=bfd -VERSION=2.11.90.0.25 +VERSION=2.11.90.0.27 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -2269,7 +2269,7 @@ else want_mmap=false fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" diff -Nupr binutils-2.11.90.0.25/bfd/configure.in binutils-2.11.90.0.27/bfd/configure.in --- binutils-2.11.90.0.25/bfd/configure.in Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/bfd/configure.in Fri Aug 10 14:08:01 2001 @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.11.90.0.25) +AM_INIT_AUTOMAKE(bfd, 2.11.90.0.27) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -50,7 +50,7 @@ AC_ARG_WITH(mmap, *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; esac],[want_mmap=false])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff -Nupr binutils-2.11.90.0.25/bfd/dwarf1.c binutils-2.11.90.0.27/bfd/dwarf1.c --- binutils-2.11.90.0.25/bfd/dwarf1.c Sat May 12 00:05:17 2001 +++ binutils-2.11.90.0.27/bfd/dwarf1.c Fri Aug 10 14:08:01 2001 @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -125,6 +125,18 @@ struct linenumber { /* Find the form of an attr, from the attr field. */ #define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */ + +static struct dwarf1_unit *alloc_dwarf1_unit PARAMS ((struct dwarf1_debug *)); +static struct dwarf1_func *alloc_dwarf1_func + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean parse_die PARAMS ((bfd *, struct die_info *, char *)); +static boolean parse_line_table + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean parse_functions_in_unit + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); +static boolean dwarf1_unit_find_nearest_line + PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *, unsigned long, + const char **, const char **, unsigned int *)); /* Return a newly allocated dwarf1_unit. It should be cleared and then attached into the 'stash' at 'stash->lastUnit'. */ diff -Nupr binutils-2.11.90.0.25/bfd/dwarf2.c binutils-2.11.90.0.27/bfd/dwarf2.c --- binutils-2.11.90.0.25/bfd/dwarf2.c Mon May 21 10:34:51 2001 +++ binutils-2.11.90.0.27/bfd/dwarf2.c Fri Aug 10 14:08:01 2001 @@ -96,6 +96,14 @@ struct dwarf2_debug /* Pointer to the end of the .debug_info section memory buffer. */ char* info_ptr_end; + /* Pointer to the section and address of the beginning of the + section. */ + asection* sec; + char* sec_info_ptr; + + /* Pointer to the symbol table. */ + asymbol** syms; + /* Pointer to the .debug_abbrev section loaded into memory. */ char* dwarf_abbrev_buffer; @@ -165,6 +173,72 @@ struct comp_unit unsigned char addr_size; }; +/* This data structure holds the information of an abbrev. */ +struct abbrev_info +{ + unsigned int number; /* Number identifying abbrev. */ + enum dwarf_tag tag; /* DWARF tag. */ + int has_children; /* Boolean. */ + unsigned int num_attrs; /* Number of attributes. */ + struct attr_abbrev *attrs; /* An array of attribute descriptions. */ + struct abbrev_info *next; /* Next in chain. */ +}; + +struct attr_abbrev +{ + enum dwarf_attribute name; + enum dwarf_form form; +}; + +#ifndef ABBREV_HASH_SIZE +#define ABBREV_HASH_SIZE 121 +#endif +#ifndef ATTR_ALLOC_CHUNK +#define ATTR_ALLOC_CHUNK 4 +#endif + +static unsigned int read_1_byte PARAMS ((bfd *, char *)); +static int read_1_signed_byte PARAMS ((bfd *, char *)); +static unsigned int read_2_bytes PARAMS ((bfd *, char *)); +static unsigned int read_4_bytes PARAMS ((bfd *, char *)); +static unsigned int read_8_bytes PARAMS ((bfd *, char *)); +static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int)); +static char *read_string PARAMS ((bfd *, char *, unsigned int *)); +static unsigned int read_unsigned_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static int read_signed_leb128 + PARAMS ((bfd *, char *, unsigned int *)); +static bfd_vma read_address PARAMS ((struct comp_unit *, char *)); +static struct abbrev_info *lookup_abbrev + PARAMS ((unsigned int, struct abbrev_info **)); +static struct abbrev_info **read_abbrevs + PARAMS ((bfd *, unsigned int, struct dwarf2_debug *)); +static char *read_attribute + PARAMS ((struct attribute *, struct attr_abbrev *, + struct comp_unit *, char *)); +static void add_line_info + PARAMS ((struct line_info_table *, bfd_vma, char *, + unsigned int, unsigned int, int)); +static char *concat_filename PARAMS ((struct line_info_table *, unsigned int)); +static void arange_add PARAMS ((struct comp_unit *, bfd_vma, bfd_vma)); +static struct line_info_table *decode_line_info + PARAMS ((struct comp_unit *, struct dwarf2_debug *)); +static boolean lookup_address_in_line_info_table + PARAMS ((struct line_info_table *, bfd_vma, const char **, unsigned int *)); +static boolean lookup_address_in_function_table + PARAMS ((struct funcinfo *, bfd_vma, const char **)); +static boolean scan_unit_for_functions PARAMS ((struct comp_unit *)); +static bfd_vma find_rela_addend + PARAMS ((bfd *, asection *, bfd_size_type, asymbol**)); +static struct comp_unit *parse_comp_unit + PARAMS ((bfd *, struct dwarf2_debug *, bfd_vma, unsigned int)); +static boolean comp_unit_contains_address + PARAMS ((struct comp_unit *, bfd_vma)); +static boolean comp_unit_find_nearest_line + PARAMS ((struct comp_unit *, bfd_vma, const char **, const char **, + unsigned int *, struct dwarf2_debug *)); +static asection *find_debug_info PARAMS ((bfd *, asection *)); + /* VERBATIM The following function up to the END VERBATIM mark are copied directly from dwarf2read.c. */ @@ -349,30 +423,6 @@ read_address (unit, buf) } } -/* This data structure holds the information of an abbrev. */ -struct abbrev_info -{ - unsigned int number; /* Number identifying abbrev. */ - enum dwarf_tag tag; /* DWARF tag. */ - int has_children; /* Boolean. */ - unsigned int num_attrs; /* Number of attributes. */ - struct attr_abbrev *attrs; /* An array of attribute descriptions. */ - struct abbrev_info *next; /* Next in chain. */ -}; - -struct attr_abbrev -{ - enum dwarf_attribute name; - enum dwarf_form form; -}; - -#ifndef ABBREV_HASH_SIZE -#define ABBREV_HASH_SIZE 121 -#endif -#ifndef ATTR_ALLOC_CHUNK -#define ATTR_ALLOC_CHUNK 4 -#endif - /* Lookup an abbrev_info structure in the abbrev hash table. */ static struct abbrev_info * @@ -1219,6 +1269,60 @@ scan_unit_for_functions (unit) return true; } +/* Look for a RELA relocation to be applied on OFFSET of section SEC, + and return the addend if such a relocation is found. Since this is + only used to find relocations referring to the .debug_abbrev + section, we make sure the relocation refers to this section, but + this is not strictly necessary, and it can probably be safely + removed if needed. However, it is important to note that this + function only returns the addend, it doesn't serve the purpose of + applying a generic relocation. + + If no suitable relocation is found, or if it is not a real RELA + relocation, this function returns 0. */ + +static bfd_vma +find_rela_addend (abfd, sec, offset, syms) + bfd* abfd; + asection* sec; + bfd_size_type offset; + asymbol** syms; +{ + long reloc_size = bfd_get_reloc_upper_bound (abfd, sec); + arelent **relocs = NULL; + long reloc_count, relc; + + if (reloc_size <= 0) + return 0; + + relocs = (arelent **) bfd_malloc ((size_t) reloc_size); + if (relocs == NULL) + return 0; + + reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, syms); + + if (reloc_count <= 0) + { + free (relocs); + return 0; + } + + for (relc = 0; relc < reloc_count; relc++) + if (relocs[relc]->address == offset + && (*relocs[relc]->sym_ptr_ptr)->flags & BSF_SECTION_SYM + && strcmp ((*relocs[relc]->sym_ptr_ptr)->name, + ".debug_abbrev") == 0) + { + bfd_vma addend = (relocs[relc]->howto->partial_inplace + ? 0 : relocs[relc]->addend); + free (relocs); + return addend; + } + + free (relocs); + return 0; +} + /* Parse a DWARF2 compilation unit starting at INFO_PTR. This includes the compilation unit header that proceeds the DIE's, but does not include the length field that preceeds each compilation @@ -1259,6 +1363,13 @@ parse_comp_unit (abfd, stash, unit_lengt abbrev_offset = read_4_bytes (abfd, info_ptr); else if (abbrev_length == 8) abbrev_offset = read_8_bytes (abfd, info_ptr); + /* The abbrev offset is generally a relocation pointing to + .debug_abbrev+offset. On RELA targets, we have to find the + relocation and extract the addend to obtain the actual + abbrev_offset, so do it here. */ + abbrev_offset += find_rela_addend (abfd, stash->sec, + info_ptr - stash->sec_info_ptr, + stash->syms); info_ptr += abbrev_length; addr_size = read_1_byte (abfd, info_ptr); info_ptr += 1; @@ -1498,7 +1609,7 @@ _bfd_dwarf2_find_nearest_line (abfd, sec addr_size, pinfo) bfd *abfd; asection *section; - asymbol **symbols ATTRIBUTE_UNUSED; + asymbol **symbols; bfd_vma offset; const char **filename_ptr; const char **functionname_ptr; @@ -1584,7 +1695,11 @@ _bfd_dwarf2_find_nearest_line (abfd, sec stash->info_ptr_end = stash->info_ptr + start + size; } - BFD_ASSERT (stash->info_ptr_end = stash->info_ptr + total_size); + BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); + + stash->sec = find_debug_info (abfd, NULL); + stash->sec_info_ptr = stash->info_ptr; + stash->syms = symbols; } /* FIXME: There is a problem with the contents of the @@ -1631,6 +1746,13 @@ _bfd_dwarf2_find_nearest_line (abfd, sec { each = parse_comp_unit (abfd, stash, length, addr_size); stash->info_ptr += length; + + if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) + == stash->sec->_raw_size) + { + stash->sec = find_debug_info (abfd, stash->sec); + stash->sec_info_ptr = stash->info_ptr; + } if (each) { diff -Nupr binutils-2.11.90.0.25/bfd/elf-bfd.h binutils-2.11.90.0.27/bfd/elf-bfd.h --- binutils-2.11.90.0.25/bfd/elf-bfd.h Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elf-bfd.h Fri Aug 10 14:08:01 2001 @@ -702,6 +702,7 @@ struct elf_backend_data unsigned plt_not_loaded : 1; unsigned plt_alignment : 4; unsigned can_gc_sections : 1; + unsigned want_got_sym : 1; unsigned want_dynbss : 1; }; @@ -1005,6 +1006,9 @@ extern void bfd_elf_print_symbol PARAMS #define bfd_elf32_print_symbol bfd_elf_print_symbol #define bfd_elf64_print_symbol bfd_elf_print_symbol + +extern void bfd_elf_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); +extern void bfd_elf_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); extern unsigned long bfd_elf_hash PARAMS ((const char *)); diff -Nupr binutils-2.11.90.0.25/bfd/elf.c binutils-2.11.90.0.27/bfd/elf.c --- binutils-2.11.90.0.25/bfd/elf.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elf.c Fri Aug 10 14:08:01 2001 @@ -57,10 +57,16 @@ static INLINE int sym_is_global PARAMS ( static boolean elf_map_symbols PARAMS ((bfd *)); static bfd_size_type get_program_header_size PARAMS ((bfd *)); static boolean elfcore_read_notes PARAMS ((bfd *, bfd_vma, bfd_vma)); -static boolean elf_find_function PARAMS ((bfd *, asection *, - asymbol **, - bfd_vma, const char **, - const char **)); +static boolean elf_find_function PARAMS ((bfd *, asection *, asymbol **, + bfd_vma, const char **, + const char **)); +static int elfcore_make_pid PARAMS ((bfd *)); +static boolean elfcore_maybe_make_sect PARAMS ((bfd *, char *, asection *)); +static boolean elfcore_make_note_pseudosection PARAMS ((bfd *, char *, + Elf_Internal_Note *)); +static boolean elfcore_grok_prfpreg PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean elfcore_grok_prxfpreg PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean elfcore_grok_note PARAMS ((bfd *, Elf_Internal_Note *)); /* Swap version information in and out. The version information is currently size independent. If that ever changes, this code will @@ -2678,18 +2684,22 @@ elf_sort_sections (arg1, arg2) if (TOEND (sec1)) { if (TOEND (sec2)) - return sec1->target_index - sec2->target_index; + { + /* If the indicies are the same, do not return 0 + here, but continue to try the next comparison. */ + if (sec1->target_index - sec2->target_index != 0) + return sec1->target_index - sec2->target_index; + } else return 1; } - - if (TOEND (sec2)) + else if (TOEND (sec2)) return -1; #undef TOEND - /* Sort by size, to put zero sized sections before others at the - same address. */ + /* Sort by size, to put zero sized sections + before others at the same address. */ if (sec1->_raw_size < sec2->_raw_size) return -1; @@ -5421,6 +5431,8 @@ _bfd_elfcore_make_pseudosection (abfd, n */ #if defined (HAVE_PRSTATUS_T) +static boolean elfcore_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); + static boolean elfcore_grok_prstatus (abfd, note) bfd *abfd; @@ -5566,6 +5578,7 @@ _bfd_elfcore_strndup (abfd, start, max) } #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) +static boolean elfcore_grok_psinfo PARAMS ((bfd *, Elf_Internal_Note *)); static boolean elfcore_grok_psinfo (abfd, note) @@ -5981,4 +5994,67 @@ bfd_get_elf_phdrs (abfd, phdrs) num_phdrs * sizeof (Elf_Internal_Phdr)); return num_phdrs; +} + +void +bfd_elf_sprintf_vma (abfd, buf, value) + bfd *abfd ATTRIBUTE_UNUSED; + char *buf; + bfd_vma value; +{ +#ifdef BFD64 + Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ + + i_ehdrp = elf_elfheader (abfd); + if (i_ehdrp == NULL) + sprintf_vma (buf, value); + else + { + if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64) + { +#if BFD_HOST_64BIT_LONG + sprintf (buf, "%016lx", value); +#else + sprintf (buf, "%08lx%08lx", _bfd_int64_high (value), + _bfd_int64_low (value)); +#endif + } + else + sprintf (buf, "%08lx", (unsigned long) (value & 0xffffffff)); + } +#else + sprintf_vma (buf, value); +#endif +} + +void +bfd_elf_fprintf_vma (abfd, stream, value) + bfd *abfd ATTRIBUTE_UNUSED; + PTR stream; + bfd_vma value; +{ +#ifdef BFD64 + Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ + + i_ehdrp = elf_elfheader (abfd); + if (i_ehdrp == NULL) + fprintf_vma ((FILE *) stream, value); + else + { + if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64) + { +#if BFD_HOST_64BIT_LONG + fprintf ((FILE *) stream, "%016lx", value); +#else + fprintf ((FILE *) stream, "%08lx%08lx", + _bfd_int64_high (value), _bfd_int64_low (value)); +#endif + } + else + fprintf ((FILE *) stream, "%08lx", + (unsigned long) (value & 0xffffffff)); + } +#else + fprintf_vma ((FILE *) stream, value); +#endif } diff -Nupr binutils-2.11.90.0.25/bfd/elf32-arc.c binutils-2.11.90.0.27/bfd/elf32-arc.c --- binutils-2.11.90.0.25/bfd/elf32-arc.c Sat May 12 08:21:34 2001 +++ binutils-2.11.90.0.27/bfd/elf32-arc.c Fri Aug 10 14:08:01 2001 @@ -95,10 +95,10 @@ static reloc_howto_type elf_arc_howto_ta complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_B22_PCREL", /* name */ - false, /* partial_inplace */ + true, /* partial_inplace */ 0x07ffff80, /* src_mask */ 0x07ffff80, /* dst_mask */ - true), /* pcrel_offset */ + false), /* pcrel_offset */ }; diff -Nupr binutils-2.11.90.0.25/bfd/elf32-arm.h binutils-2.11.90.0.27/bfd/elf32-arm.h --- binutils-2.11.90.0.25/bfd/elf32-arm.h Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/bfd/elf32-arm.h Sat Aug 4 19:52:15 2001 @@ -1295,7 +1295,7 @@ elf32_arm_final_link_relocate (howto, in case R_ARM_REL32: value -= (input_section->output_section->vma - + input_section->output_offset); + + input_section->output_offset + rel->r_offset); value += addend; break; } diff -Nupr binutils-2.11.90.0.25/bfd/elf32-gen.c binutils-2.11.90.0.27/bfd/elf32-gen.c --- binutils-2.11.90.0.25/bfd/elf32-gen.c Tue Mar 27 08:47:16 2001 +++ binutils-2.11.90.0.27/bfd/elf32-gen.c Fri Aug 10 14:08:01 2001 @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -39,6 +39,13 @@ static reloc_howto_type dummy = 0, /* src_mask */ 0, /* dst_mask */ false); /* pcrel_offset */ + +static void elf_generic_info_to_howto + PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static void elf_generic_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); +static boolean elf32_generic_link_add_symbols + PARAMS ((bfd *, struct bfd_link_info *)); static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) diff -Nupr binutils-2.11.90.0.25/bfd/elf32-hppa.c binutils-2.11.90.0.27/bfd/elf32-hppa.c --- binutils-2.11.90.0.25/bfd/elf32-hppa.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elf32-hppa.c Sat Aug 4 19:52:15 2001 @@ -2141,8 +2141,9 @@ allocate_plt_and_got_and_discard_relocs if (!info->shared && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)) + || (hplink->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ diff -Nupr binutils-2.11.90.0.25/bfd/elf32-i386.c binutils-2.11.90.0.27/bfd/elf32-i386.c --- binutils-2.11.90.0.25/bfd/elf32-i386.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elf32-i386.c Fri Aug 10 14:08:01 2001 @@ -41,6 +41,12 @@ static boolean elf_i386_create_dynamic_s static boolean elf_i386_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static asection *elf_i386_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf_i386_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static boolean elf_i386_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean allocate_plt_and_got_and_discard_relocs @@ -55,6 +61,8 @@ static boolean elf_i386_finish_dynamic_s Elf_Internal_Sym *)); static boolean elf_i386_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf_i386_fake_sections + PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); #define USE_REL 1 /* 386 uses REL relocations instead of RELA */ @@ -1199,8 +1207,9 @@ allocate_plt_and_got_and_discard_relocs if (!info->shared && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)) + || (htab->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ diff -Nupr binutils-2.11.90.0.25/bfd/elf32-ppc.c binutils-2.11.90.0.27/bfd/elf32-ppc.c --- binutils-2.11.90.0.25/bfd/elf32-ppc.c Fri Mar 9 11:37:58 2001 +++ binutils-2.11.90.0.27/bfd/elf32-ppc.c Fri Aug 10 14:08:01 2001 @@ -38,6 +38,9 @@ static reloc_howto_type *ppc_elf_reloc_t static void ppc_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); static void ppc_elf_howto_init PARAMS ((void)); +static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR)); +static boolean ppc_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static bfd_reloc_status_type ppc_elf_addr16_ha_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword)); @@ -989,8 +992,8 @@ ppc_elf_howto_init () static int ppc_elf_sort_rela (arg1, arg2) - const void *arg1; - const void *arg2; + const PTR arg1; + const PTR arg2; { const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; diff -Nupr binutils-2.11.90.0.25/bfd/elf64-gen.c binutils-2.11.90.0.27/bfd/elf64-gen.c --- binutils-2.11.90.0.25/bfd/elf64-gen.c Wed May 2 23:29:56 2001 +++ binutils-2.11.90.0.27/bfd/elf64-gen.c Fri Aug 10 14:08:01 2001 @@ -40,6 +40,13 @@ static reloc_howto_type dummy = 0, /* dst_mask */ false); /* pcrel_offset */ +static void elf_generic_info_to_howto + PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); +static void elf_generic_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); +static boolean elf64_generic_link_add_symbols + PARAMS ((bfd *, struct bfd_link_info *)); + static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; diff -Nupr binutils-2.11.90.0.25/bfd/elf64-x86-64.c binutils-2.11.90.0.27/bfd/elf64-x86-64.c --- binutils-2.11.90.0.25/bfd/elf64-x86-64.c Sat Jun 23 00:05:22 2001 +++ binutils-2.11.90.0.27/bfd/elf64-x86-64.c Fri Aug 10 14:08:01 2001 @@ -126,6 +126,17 @@ static void elf64_x86_64_info_to_howto PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create PARAMS ((bfd *)); +static boolean elf64_x86_64_elf_object_p PARAMS ((bfd *abfd)); +static boolean elf64_x86_64_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, + const Elf_Internal_Rela *)); +static asection *elf64_x86_64_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static boolean elf64_x86_64_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static struct bfd_hash_entry *elf64_x86_64_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); @@ -331,7 +342,7 @@ elf64_x86_64_link_hash_table_create (abf return &ret->root.root; } -boolean +static boolean elf64_x86_64_elf_object_p (abfd) bfd *abfd; { diff -Nupr binutils-2.11.90.0.25/bfd/elflink.c binutils-2.11.90.0.27/bfd/elflink.c --- binutils-2.11.90.0.25/bfd/elflink.c Sat May 12 00:57:56 2001 +++ binutils-2.11.90.0.27/bfd/elflink.c Fri Aug 10 14:08:01 2001 @@ -73,24 +73,27 @@ _bfd_elf_create_got_section (abfd, info) return false; } - /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got - (or .got.plt) section. We don't do this in the linker script - because we don't want to define the symbol if we are not creating - a global offset table. */ - h = NULL; - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, - bed->got_symbol_offset, (const char *) NULL, false, - bed->collect, (struct bfd_link_hash_entry **) &h))) - return false; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; + if (bed->want_got_sym) + { + /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got + (or .got.plt) section. We don't do this in the linker script + because we don't want to define the symbol if we are not creating + a global offset table. */ + h = NULL; + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, + bed->got_symbol_offset, (const char *) NULL, false, + bed->collect, (struct bfd_link_hash_entry **) &h))) + return false; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + h->type = STT_OBJECT; - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + if (info->shared + && ! _bfd_elf_link_record_dynamic_symbol (info, h)) + return false; - elf_hash_table (info)->hgot = h; + elf_hash_table (info)->hgot = h; + } /* The first bit of the global offset table is the header. */ s->_raw_size += bed->got_header_size + bed->got_symbol_offset; diff -Nupr binutils-2.11.90.0.25/bfd/elflink.h binutils-2.11.90.0.27/bfd/elflink.h --- binutils-2.11.90.0.25/bfd/elflink.h Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elflink.h Fri Aug 10 14:08:01 2001 @@ -30,6 +30,10 @@ struct elf_info_failed struct bfd_elf_version_tree *verdefs; }; +static boolean is_global_data_symbol_definition + PARAMS ((bfd *, Elf_Internal_Sym *)); +static boolean elf_link_is_defined_archive_symbol + PARAMS ((bfd *, carsym *)); static boolean elf_link_add_object_symbols PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_link_add_archive_symbols @@ -54,6 +58,8 @@ static boolean elf_collect_hash_codes PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_link_read_relocs_from_section PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); +static size_t compute_bucket_count + PARAMS ((struct bfd_link_info *)); static void elf_link_output_relocs PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); static boolean elf_link_size_reloc_section @@ -2085,8 +2091,7 @@ elf_link_add_object_symbols (abfd, info) && ! new_weakdef && h->weakdef->dynindx == -1) { - if (! _bfd_elf_link_record_dynamic_symbol (info, - h->weakdef)) + if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) goto error_return; } } @@ -2771,7 +2776,6 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o /* Record an assignment to a symbol made by a linker script. We need this in case some dynamic object refers to this symbol. */ -/*ARGSUSED*/ boolean NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) bfd *output_bfd ATTRIBUTE_UNUSED; @@ -2789,7 +2793,7 @@ NAME(bfd_elf,record_link_assignment) (ou return false; if (h->root.type == bfd_link_hash_new) - h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; + h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -2811,7 +2815,7 @@ NAME(bfd_elf,record_link_assignment) (ou h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - /* When possible, keep the original type of the symbol */ + /* When possible, keep the original type of the symbol. */ if (h->type == STT_NOTYPE) h->type = STT_OBJECT; @@ -3307,7 +3311,7 @@ NAME(bfd_elf,size_dynamic_sections) (out defaux.vda_next = 0; _bfd_elf_swap_verdef_out (output_bfd, &def, - (Elf_External_Verdef *)p); + (Elf_External_Verdef *) p); p += sizeof (Elf_External_Verdef); _bfd_elf_swap_verdaux_out (output_bfd, &defaux, (Elf_External_Verdaux *) p); @@ -4891,7 +4895,7 @@ elf_bfd_final_link (abfd, info) { Elf_Internal_Sym sym; Elf_External_Sym *dynsym = - (Elf_External_Sym *)finfo.dynsym_sec->contents; + (Elf_External_Sym *) finfo.dynsym_sec->contents; long last_local = 0; /* Write out the section symbols for the output sections. */ @@ -5281,8 +5285,7 @@ elf_link_output_sym (finfo, name, elfsym else { elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab, - name, true, - false); + name, true, false); if (elfsym->st_name == (unsigned long) -1) return false; } @@ -5566,8 +5569,8 @@ elf_link_output_extsym (h, data) finish_dynamic_symbol routine gets through with it. */ if (sym.st_shndx == SHN_UNDEF && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 - && (ELF_ST_BIND(sym.st_info) == STB_GLOBAL - || ELF_ST_BIND(sym.st_info) == STB_WEAK)) + && (ELF_ST_BIND (sym.st_info) == STB_GLOBAL + || ELF_ST_BIND (sym.st_info) == STB_WEAK)) { int bindtype; @@ -5581,7 +5584,7 @@ elf_link_output_extsym (h, data) /* If a symbol is not defined locally, we clear the visibility field. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); + sym.st_other ^= ELF_ST_VISIBILITY (sym.st_other); /* If this symbol should be put in the .dynsym section, then put it there now. We have already know the symbol index. We also fill @@ -6193,9 +6196,8 @@ elf_link_input_bfd (finfo, input_bfd) since it is needed by a reloc, we must output it now. */ link = symtab_hdr->sh_link; - name = bfd_elf_string_from_elf_section (input_bfd, - link, - isym->st_name); + name = (bfd_elf_string_from_elf_section + (input_bfd, link, isym->st_name)); if (name == NULL) return false; @@ -6210,7 +6212,8 @@ elf_link_input_bfd (finfo, input_bfd) if (! finfo->info->relocateable) isym->st_value += osec->vma; - finfo->indices[r_symndx] = bfd_get_symcount (output_bfd); + finfo->indices[r_symndx] + = bfd_get_symcount (output_bfd); if (! elf_link_output_sym (finfo, name, isym, sec)) return false; @@ -6225,7 +6228,8 @@ elf_link_input_bfd (finfo, input_bfd) /* Swap out the relocs. */ if (bed->elf_backend_emit_relocs - && ! (finfo->info->relocateable || finfo->info->emitrelocations)) + && !(finfo->info->relocateable + || finfo->info->emitrelocations)) reloc_emitter = bed->elf_backend_emit_relocs; else reloc_emitter = elf_link_output_relocs; @@ -6477,10 +6481,10 @@ elf_create_pointer_linker_section (abfd, BFD_ASSERT (lsect != NULL); - /* Is this a global symbol? */ + /* Is this a global symbol? */ if (h != NULL) { - /* Has this symbol already been allocated, if so, our work is done */ + /* Has this symbol already been allocated? If so, our work is done. */ if (_bfd_elf_find_pointer_linker_section (h->linker_section_pointer, rel->r_addend, lsect->which)) @@ -6497,29 +6501,30 @@ elf_create_pointer_linker_section (abfd, if (lsect->rel_section) lsect->rel_section->_raw_size += sizeof (Elf_External_Rela); } - - else /* Allocation of a pointer to a local symbol */ + else { + /* Allocation of a pointer to a local symbol. */ elf_linker_section_pointers_t **ptr = elf_local_ptr_offsets (abfd); - /* Allocate a table to hold the local symbols if first time */ + /* Allocate a table to hold the local symbols if first time. */ if (!ptr) { unsigned int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info; register unsigned int i; ptr = (elf_linker_section_pointers_t **) - bfd_alloc (abfd, num_symbols * sizeof (elf_linker_section_pointers_t *)); + bfd_alloc (abfd, + num_symbols * sizeof (elf_linker_section_pointers_t *)); if (!ptr) return false; elf_local_ptr_offsets (abfd) = ptr; for (i = 0; i < num_symbols; i++) - ptr[i] = (elf_linker_section_pointers_t *)0; + ptr[i] = (elf_linker_section_pointers_t *) 0; } - /* Has this symbol already been allocated, if so, our work is done */ + /* Has this symbol already been allocated? If so, our work is done. */ if (_bfd_elf_find_pointer_linker_section (ptr[r_symndx], rel->r_addend, lsect->which)) @@ -6537,8 +6542,8 @@ elf_create_pointer_linker_section (abfd, } } - /* Allocate space for a pointer in the linker section, and allocate a new pointer record - from internal memory. */ + /* Allocate space for a pointer in the linker section, and allocate + a new pointer record from internal memory. */ BFD_ASSERT (ptr_linker_section_ptr != NULL); linker_section_ptr = (elf_linker_section_pointers_t *) bfd_alloc (abfd, sizeof (elf_linker_section_pointers_t)); @@ -6555,17 +6560,19 @@ elf_create_pointer_linker_section (abfd, #if 0 if (lsect->hole_size && lsect->hole_offset < lsect->max_hole_offset) { - linker_section_ptr->offset = lsect->section->_raw_size - lsect->hole_size + (ARCH_SIZE / 8); + linker_section_ptr->offset = (lsect->section->_raw_size + - lsect->hole_size + (ARCH_SIZE / 8)); lsect->hole_offset += ARCH_SIZE / 8; lsect->sym_offset += ARCH_SIZE / 8; - if (lsect->sym_hash) /* Bump up symbol value if needed */ + if (lsect->sym_hash) { + /* Bump up symbol value if needed. */ lsect->sym_hash->root.u.def.value += ARCH_SIZE / 8; #ifdef DEBUG fprintf (stderr, "Bump up %s by %ld, current value = %ld\n", lsect->sym_hash->root.root.string, - (long)ARCH_SIZE / 8, - (long)lsect->sym_hash->root.u.def.value); + (long) ARCH_SIZE / 8, + (long) lsect->sym_hash->root.u.def.value); #endif } } @@ -6576,8 +6583,10 @@ elf_create_pointer_linker_section (abfd, lsect->section->_raw_size += ARCH_SIZE / 8; #ifdef DEBUG - fprintf (stderr, "Create pointer in linker section %s, offset = %ld, section size = %ld\n", - lsect->name, (long)linker_section_ptr->offset, (long)lsect->section->_raw_size); + fprintf (stderr, + "Create pointer in linker section %s, offset = %ld, section size = %ld\n", + lsect->name, (long) linker_section_ptr->offset, + (long) lsect->section->_raw_size); #endif return true; @@ -6593,7 +6602,8 @@ elf_create_pointer_linker_section (abfd, /* Fill in the address for a pointer generated in a linker section. */ bfd_vma -elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, relocation, rel, relative_reloc) +elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, + relocation, rel, relative_reloc) bfd *output_bfd; bfd *input_bfd; struct bfd_link_info *info; @@ -6607,11 +6617,13 @@ elf_finish_pointer_linker_section (outpu BFD_ASSERT (lsect != NULL); - if (h != NULL) /* global symbol */ + if (h != NULL) { - linker_section_ptr = _bfd_elf_find_pointer_linker_section (h->linker_section_pointer, - rel->r_addend, - lsect->which); + /* Handle global symbol. */ + linker_section_ptr = (_bfd_elf_find_pointer_linker_section + (h->linker_section_pointer, + rel->r_addend, + lsect->which)); BFD_ASSERT (linker_section_ptr != NULL); @@ -6631,23 +6643,27 @@ elf_finish_pointer_linker_section (outpu if (!linker_section_ptr->written_address_p) { linker_section_ptr->written_address_p = true; - bfd_put_ptr (output_bfd, relocation + linker_section_ptr->addend, - lsect->section->contents + linker_section_ptr->offset); + bfd_put_ptr (output_bfd, + relocation + linker_section_ptr->addend, + (lsect->section->contents + + linker_section_ptr->offset)); } } } - else /* local symbol */ + else { + /* Handle local symbol. */ unsigned long r_symndx = ELF_R_SYM (rel->r_info); BFD_ASSERT (elf_local_ptr_offsets (input_bfd) != NULL); BFD_ASSERT (elf_local_ptr_offsets (input_bfd)[r_symndx] != NULL); - linker_section_ptr = _bfd_elf_find_pointer_linker_section (elf_local_ptr_offsets (input_bfd)[r_symndx], - rel->r_addend, - lsect->which); + linker_section_ptr = (_bfd_elf_find_pointer_linker_section + (elf_local_ptr_offsets (input_bfd)[r_symndx], + rel->r_addend, + lsect->which)); BFD_ASSERT (linker_section_ptr != NULL); - /* Write out pointer if it hasn't been rewritten out before */ + /* Write out pointer if it hasn't been rewritten out before. */ if (!linker_section_ptr->written_address_p) { linker_section_ptr->written_address_p = true; @@ -6661,18 +6677,23 @@ elf_finish_pointer_linker_section (outpu struct elf_backend_data *bed = get_elf_backend_data (output_bfd); unsigned int i; - outrel = (Elf_Internal_Rela *) bfd_zmalloc (sizeof (Elf_Internal_Rela) - * bed->s->int_rels_per_ext_rel); + outrel = (Elf_Internal_Rela *) + bfd_zmalloc (sizeof (Elf_Internal_Rela) + * bed->s->int_rels_per_ext_rel); if (outrel == NULL) { (*_bfd_error_handler) (_("Error: out of memory")); return 0; } - /* We need to generate a relative reloc for the dynamic linker. */ + /* We need to generate a relative reloc for the dynamic + linker. */ if (!srel) - lsect->rel_section = srel = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - lsect->rel_name); + { + srel = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + lsect->rel_name); + lsect->rel_section = srel; + } BFD_ASSERT (srel != NULL); @@ -6685,7 +6706,8 @@ elf_finish_pointer_linker_section (outpu elf_swap_reloca_out (output_bfd, outrel, (((Elf_External_Rela *) lsect->section->contents) - + elf_section_data (lsect->section)->rel_count)); + + (elf_section_data (lsect->section) + ->rel_count))); ++elf_section_data (lsect->section)->rel_count; free (outrel); @@ -6699,8 +6721,9 @@ elf_finish_pointer_linker_section (outpu - lsect->sym_offset); #ifdef DEBUG - fprintf (stderr, "Finish pointer in linker section %s, offset = %ld (0x%lx)\n", - lsect->name, (long)relocation, (long)relocation); + fprintf (stderr, + "Finish pointer in linker section %s, offset = %ld (0x%lx)\n", + lsect->name, (long) relocation, (long) relocation); #endif /* Subtract out the addend, because it will get added back in by the normal @@ -6987,7 +7010,6 @@ elf_gc_propagate_vtable_entries_used (h, size_t n; boolean *cu, *pu; - /* Or the parent's entries into ours. */ cu = h->vtable_entries_used; cu[-1] = true; @@ -7036,7 +7058,7 @@ elf_gc_smash_unused_vtentry_relocs (h, o relstart = (NAME(_bfd_elf,link_read_relocs) (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, true)); if (!relstart) - return *(boolean *)okp = false; + return *(boolean *) okp = false; bed = get_elf_backend_data (sec->owner); file_align = bed->s->file_align; @@ -7111,7 +7133,7 @@ elf_gc_sections (abfd, info) } /* ... and mark SEC_EXCLUDE for those that go. */ - if (!elf_gc_sweep(info, get_elf_backend_data (abfd)->gc_sweep_hook)) + if (!elf_gc_sweep (info, get_elf_backend_data (abfd)->gc_sweep_hook)) return false; return true; @@ -7154,7 +7176,7 @@ elf_gc_record_vtinherit (abfd, sec, h, o (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT", bfd_get_filename (abfd), sec->name, - (unsigned long)offset); + (unsigned long) offset); bfd_set_error (bfd_error_invalid_operation); return false; @@ -7218,8 +7240,9 @@ elf_gc_record_vtentry (abfd, sec, h, add { size_t oldbytes; - oldbytes = (h->vtable_entries_size/file_align + 1) * sizeof (boolean); - memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes); + oldbytes = ((h->vtable_entries_size / file_align + 1) + * sizeof (boolean)); + memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes); } } else diff -Nupr binutils-2.11.90.0.25/bfd/elfxx-target.h binutils-2.11.90.0.27/bfd/elfxx-target.h --- binutils-2.11.90.0.25/bfd/elfxx-target.h Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/elfxx-target.h Fri Aug 10 14:08:01 2001 @@ -101,6 +101,9 @@ Foundation, Inc., 59 Temple Place - Suit #ifndef elf_backend_can_gc_sections #define elf_backend_can_gc_sections 0 #endif +#ifndef elf_backend_want_got_sym +#define elf_backend_want_got_sym 1 +#endif #ifndef elf_backend_gc_mark_hook #define elf_backend_gc_mark_hook NULL #endif @@ -439,7 +442,8 @@ static CONST struct elf_backend_data elf elf_backend_plt_not_loaded, elf_backend_plt_alignment, elf_backend_can_gc_sections, - elf_backend_want_dynbss + elf_backend_want_dynbss, + elf_backend_want_got_sym }; #endif diff -Nupr binutils-2.11.90.0.25/bfd/libecoff.h binutils-2.11.90.0.27/bfd/libecoff.h --- binutils-2.11.90.0.25/bfd/libecoff.h Tue Jun 19 11:57:33 2001 +++ binutils-2.11.90.0.27/bfd/libecoff.h Sat Aug 4 19:52:15 2001 @@ -340,7 +340,7 @@ extern PTR _bfd_ecoff_mkobject_hook PARA #define _bfd_ecoff_set_alignment_hook \ ((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void) extern boolean _bfd_ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr)); -extern flagword _bfd_ecoff_styp_to_sec_flags +extern boolean _bfd_ecoff_styp_to_sec_flags PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd)); diff -Nupr binutils-2.11.90.0.25/bfd/libxcoff.h binutils-2.11.90.0.27/bfd/libxcoff.h --- binutils-2.11.90.0.25/bfd/libxcoff.h Thu May 24 21:23:11 2001 +++ binutils-2.11.90.0.27/bfd/libxcoff.h Fri Aug 10 14:08:01 2001 @@ -42,12 +42,12 @@ struct xcoff_backend_data_rec long _xcoff_machine; /* function pointers to xcoff specific swap routines */ - void (* _xcoff_swap_ldhdr_in)(bfd *, PTR, struct internal_ldhdr *); - void (* _xcoff_swap_ldhdr_out)(bfd *, struct internal_ldhdr *, PTR); - void (* _xcoff_swap_ldsym_in)(bfd *, PTR, struct internal_ldsym *); - void (* _xcoff_swap_ldsym_out)(bfd *, struct internal_ldsym *, PTR); - void (* _xcoff_swap_ldrel_in)(bfd *, PTR, struct internal_ldrel *); - void (* _xcoff_swap_ldrel_out)(bfd *, struct internal_ldrel *, PTR); + void (* _xcoff_swap_ldhdr_in)(bfd *, const PTR, struct internal_ldhdr *); + void (* _xcoff_swap_ldhdr_out)(bfd *, const struct internal_ldhdr *, PTR); + void (* _xcoff_swap_ldsym_in)(bfd *, const PTR, struct internal_ldsym *); + void (* _xcoff_swap_ldsym_out)(bfd *, const struct internal_ldsym *, PTR); + void (* _xcoff_swap_ldrel_in)(bfd *, const PTR, struct internal_ldrel *); + void (* _xcoff_swap_ldrel_out)(bfd *, const struct internal_ldrel *, PTR); /* size of the the external struct */ unsigned int _xcoff_ldhdrsz; diff -Nupr binutils-2.11.90.0.25/bfd/linker.c binutils-2.11.90.0.27/bfd/linker.c --- binutils-2.11.90.0.25/bfd/linker.c Fri Jul 6 09:26:10 2001 +++ binutils-2.11.90.0.27/bfd/linker.c Sat Aug 4 19:52:15 2001 @@ -1003,10 +1003,20 @@ _bfd_generic_link_add_archive_symbols (a arh = archive_hash_lookup (&arsym_hash, h->root.string, false, false); if (arh == (struct archive_hash_entry *) NULL) { - pundef = &(*pundef)->next; - continue; + /* If we haven't found the exact symbol we're looking for, + let's look for its import thunk */ + if (info->pei386_auto_import) + { + char *buf = alloca (strlen (h->root.string) + 10); + sprintf (buf, "__imp_%s", h->root.string); + arh = archive_hash_lookup (&arsym_hash, buf, false, false); + } + if (arh == (struct archive_hash_entry *) NULL) + { + pundef = &(*pundef)->next; + continue; + } } - /* Look at all the objects which define this symbol. */ for (l = arh->defs; l != (struct archive_list *) NULL; l = l->next) { diff -Nupr binutils-2.11.90.0.25/bfd/merge.c binutils-2.11.90.0.27/bfd/merge.c --- binutils-2.11.90.0.25/bfd/merge.c Sat May 12 00:05:39 2001 +++ binutils-2.11.90.0.27/bfd/merge.c Fri Aug 10 14:08:01 2001 @@ -108,6 +108,12 @@ static struct sec_merge_hash_entry *sec_ struct sec_merge_sec_info *)); static boolean sec_merge_emit PARAMS ((bfd *, struct sec_merge_hash_entry *)); +static int cmplengthentry PARAMS ((const PTR, const PTR)); +static int last4_eq PARAMS ((const PTR, const PTR)); +static int last_eq PARAMS ((const PTR, const PTR)); +static boolean record_section + PARAMS ((struct sec_merge_info *, struct sec_merge_sec_info *)); +static void merge_strings PARAMS ((struct sec_merge_info *)); /* Routine to create an entry in a section merge hashtab. */ @@ -475,7 +481,8 @@ cmplengthentry (a, b) static int last4_eq (a, b) - const void *a, *b; + const PTR a; + const PTR b; { struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; @@ -502,7 +509,8 @@ last4_eq (a, b) static int last_eq (a, b) - const void *a, *b; + const PTR a; + const PTR b; { struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; diff -Nupr binutils-2.11.90.0.25/bfd/syms.c binutils-2.11.90.0.27/bfd/syms.c --- binutils-2.11.90.0.25/bfd/syms.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/bfd/syms.c Fri Aug 10 14:08:01 2001 @@ -1,6 +1,6 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000 + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -312,6 +312,7 @@ CODE_FRAGMENT #include "aout/stab_gnu.h" static char coff_section_type PARAMS ((const char *)); +static int cmpindexentry PARAMS ((const PTR, const PTR)); /* DOCDD diff -Nupr binutils-2.11.90.0.25/binutils/ChangeLog binutils-2.11.90.0.27/binutils/ChangeLog --- binutils-2.11.90.0.25/binutils/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,94 @@ +2001-08-10 H.J. Lu + + * nm.c (print_value): Add one arg, bfd *. + (print_value): Replace fprintf_vma with bfd_fprintf_vma. + (print_symbol_info_bsd): Also pass `abfd' to print_value (). + (print_symbol_info_sysv): Likewise. + (print_symbol_info_posix): Likewise. + + * objdump.c (dump_section_header): Replace printf_vma with + bfd_printf_vma. + (print_section_stabs): Likewise. + (dump_bfd_header): Likewise. + (objdump_print_value): Replace sprintf_vma with + bfd_sprintf_vma. + (disassemble_bytes): Likewise. + (dump_reloc_set): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-09 Alan Modra + + * readelf.c: Add missing prototypes. + * objdump.c: Likewise. Format existing prototypes. + +2001-08-08 Alexandre Oliva + + * readelf.c (display_debug_info): Add to abbrev_offset the addend + of any RELA relocation for the abbrev_offset memory location that + refers to the .debug_abbrev section symbol. + +2001-08-07 H.J. Lu + + * readelf.c (process_file): Return 0 if OK, otherwise return 1. + (main): Return process_file (). + +2001-08-05 Philip Blundell + + * doc/binutils.texi: Use "Thumb" not "THUMB". + +2001-08-03 John Healy + + Patch suggested by Frank Eigler . + * objdump.c (disassemble_data): Fill in section member of the + disasm_info structure. + +2001-08-03 Tom Walsh + + * configure.in: Added --with-windres option. + * configure: Regenerated. + +2001-07-11 Stephane Carrez + + * doc/binutils.texi: Use @command{name} for commands; + use @option{-opt} for options; use @table @env for list of options; + remove spaces arround [ | ] in synopsis. + + * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for the + center title. + +2001-07-31 Nick Clifton + + * objcopy.c: Fix formatting. + (section_rename): New structure. + (OPTION_RENAME_SECTION): New switch. + (copy_usage): Document new switch. + (add_section_rename): New function: Add a node to the section + rename list. + (find_section_rename): New function: Find the new name and + flags for a section. + (setup_section): Call find_section_name to determine the name + of the output section. + (copy_main): Handle OPTION_RENAME_SECTION. + * binutils.texi: Document new switch. + * NEWS: Mention new switch. + +2001-07-30 Nick Clifton + + * README: Rename bug-gnu-utils@gcc.org to bug-binutils@gcc.org. + * MAINTAINERS: Rename bug-gnu-utils@gcc.org to + bug-binutils@gcc.org. + +2001-07-28 Matthias Kramm + + * bucomm.c (list_supported_architectures): New function. + * bucomm.h (list_supported_architectures): Declare. + * objdump.c (usage): Call the above. + 2001-07-25 Dave Brolley * objdump.c (SKIP_ZEROES): Only define it if it is not already defined. @@ -34,10 +125,10 @@ (parse_args): Handle "-w[mM]" to mean display macro info. (process_section_headers): Handle debug_macinfo. (debug_displays): Replace unsupported function with macinfo - function for .debug_macinfo display. + function for .debug_macinfo display. * doc/binutils.texi: Document new command line switch. * NEWS: Document new feature of readelf. - + 2001-07-05 H.J. Lu * objcopy.c (filter_symbols): Don't turn undefined symbols diff -Nupr binutils-2.11.90.0.25/binutils/MAINTAINERS binutils-2.11.90.0.27/binutils/MAINTAINERS --- binutils-2.11.90.0.25/binutils/MAINTAINERS Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/MAINTAINERS Sat Aug 4 19:52:15 2001 @@ -14,7 +14,7 @@ The home page for binutils is: and patches should be sent to: - bug-gnu-utils@gnu.org + bug-binutils@gnu.org with "[Patch]" as part of the subject line. Note - patches to the top level configure.in and config.sub scripts should be sent to: diff -Nupr binutils-2.11.90.0.25/binutils/NEWS binutils-2.11.90.0.27/binutils/NEWS --- binutils-2.11.90.0.25/binutils/NEWS Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/binutils/NEWS Sat Aug 4 19:52:15 2001 @@ -1,5 +1,7 @@ -*- text -*- +* objcopy: Add --rename-section to change section names. + * readelf: Support added for DWARF 2.1 extensions. Support added for displaying the contents of .debug.macinfo sections. diff -Nupr binutils-2.11.90.0.25/binutils/README binutils-2.11.90.0.27/binutils/README --- binutils-2.11.90.0.25/binutils/README Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/README Sat Aug 4 19:52:15 2001 @@ -125,7 +125,7 @@ Reporting bugs Send bug reports and patches to: - bug-gnu-utils@gnu.org. + bug-binutils@gnu.org. Always mention the version number you are running; this is printed by running any of the binutils with the --version option. We appreciate diff -Nupr binutils-2.11.90.0.25/binutils/bucomm.c binutils-2.11.90.0.27/binutils/bucomm.c --- binutils-2.11.90.0.25/binutils/bucomm.c Thu Mar 15 14:51:44 2001 +++ binutils-2.11.90.0.27/binutils/bucomm.c Sat Aug 4 19:52:15 2001 @@ -168,6 +168,25 @@ list_supported_targets (name, f) fprintf (f, " %s", bfd_target_vector[t]->name); fprintf (f, "\n"); } + +/* List the supported architectures. */ + +void +list_supported_architectures (name, f) + const char *name; + FILE *f; +{ + const char** arch; + + if (name == NULL) + fprintf (f, _("Supported architectures:")); + else + fprintf (f, _("%s: supported architectures:"), name); + + for (arch = bfd_arch_list (); *arch; arch++) + fprintf (f, " %s", *arch); + fprintf (f, "\n"); +} /* Display the archive header for an element as if it were an ls -l listing: diff -Nupr binutils-2.11.90.0.25/binutils/bucomm.h binutils-2.11.90.0.27/binutils/bucomm.h --- binutils-2.11.90.0.25/binutils/bucomm.h Thu Mar 15 14:51:44 2001 +++ binutils-2.11.90.0.27/binutils/bucomm.h Sat Aug 4 19:52:15 2001 @@ -164,6 +164,8 @@ void list_matching_formats PARAMS ((char void list_supported_targets PARAMS ((const char *, FILE *)); +void list_supported_architectures PARAMS ((const char *, FILE *)); + void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose)); char *make_tempname PARAMS ((char *)); diff -Nupr binutils-2.11.90.0.25/binutils/configure binutils-2.11.90.0.27/binutils/configure --- binutils-2.11.90.0.25/binutils/configure Tue Jun 19 11:57:46 2001 +++ binutils-2.11.90.0.27/binutils/configure Fri Aug 10 14:08:01 2001 @@ -2165,7 +2165,7 @@ if test "${enable_commonbfdlib+set}" = s esac fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -5575,6 +5575,10 @@ do esac fi done + +if test "${with_windres+set}" = set; then + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' +fi diff -Nupr binutils-2.11.90.0.25/binutils/configure.in binutils-2.11.90.0.27/binutils/configure.in --- binutils-2.11.90.0.25/binutils/configure.in Tue Jun 19 11:57:46 2001 +++ binutils-2.11.90.0.27/binutils/configure.in Fri Aug 10 14:08:01 2001 @@ -29,7 +29,7 @@ AC_ARG_ENABLE(commonbfdlib, *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; esac])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -276,6 +276,10 @@ changequote([,])dnl esac fi done + +if test "${with_windres+set}" = set; then + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' +fi AC_SUBST(NLMCONV_DEFS) AC_SUBST(BUILD_NLMCONV) diff -Nupr binutils-2.11.90.0.25/binutils/doc/Makefile.am binutils-2.11.90.0.27/binutils/doc/Makefile.am --- binutils-2.11.90.0.25/binutils/doc/Makefile.am Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/binutils/doc/Makefile.am Sat Aug 4 19:52:15 2001 @@ -10,7 +10,8 @@ MANCONF = -Dman TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl -POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1 +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 # List of man pages generated from binutils.texi man_MANS = \ diff -Nupr binutils-2.11.90.0.25/binutils/doc/binutils.texi binutils-2.11.90.0.27/binutils/doc/binutils.texi --- binutils-2.11.90.0.25/binutils/doc/binutils.texi Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/binutils/doc/binutils.texi Fri Aug 10 14:08:01 2001 @@ -185,7 +185,7 @@ ar -M [ }), and continues executing even after errors. If you redirect standard input to a script file, no prompts are -issued, and @code{ar} abandons execution (with a nonzero exit code) +issued, and @command{ar} abandons execution (with a nonzero exit code) on any error. -The @code{ar} command language is @emph{not} designed to be equivalent +The @command{ar} command language is @emph{not} designed to be equivalent to the command-line options; in fact, it provides somewhat less control over archives. The only purpose of the command language is to ease the -transition to @sc{gnu} @code{ar} for developers who already have scripts +transition to @sc{gnu} @command{ar} for developers who already have scripts written for the MRI ``librarian'' program. -The syntax for the @code{ar} command language is straightforward: +The syntax for the @command{ar} command language is straightforward: @itemize @bullet @item commands are recognized in upper or lower case; for example, @code{LIST} @@ -519,7 +519,7 @@ comments are allowed; text after either or @samp{;} is ignored. @item -Whenever you use a list of names as part of the argument to an @code{ar} +Whenever you use a list of names as part of the argument to an @command{ar} command, you can separate the individual names with either commas or blanks. Commas are shown in the explanations below, for clarity. @@ -529,8 +529,8 @@ at the end of a line, the text on the fo of the current command. @end itemize -Here are the commands you can use in @code{ar} scripts, or when using -@code{ar} interactively. Three of them have special significance: +Here are the commands you can use in @command{ar} scripts, or when using +@command{ar} interactively. Three of them have special significance: @code{OPEN} or @code{CREATE} specify a @dfn{current archive}, which is a temporary file required for most of the other commands. @@ -581,11 +581,11 @@ output is off, output is like that of @s @samp{ar -tv @var{archive} @var{module}@dots{}}. Output normally goes to the standard output stream; however, if you -specify @var{outputfile} as a final argument, @code{ar} directs the +specify @var{outputfile} as a final argument, @command{ar} directs the output to that file. @item END -Exit from @code{ar}, with a @code{0} exit code to indicate successful +Exit from @command{ar}, with a @code{0} exit code to indicate successful completion. This command does not save the output file; if you have changed the current archive since the last @code{SAVE} command, those changes are lost. @@ -607,7 +607,7 @@ Requires prior use of @code{OPEN} or @co @item LIST Display full contents of the current archive, in ``verbose'' style regardless of the state of @code{VERBOSE}. The effect is like @samp{ar -tv @var{archive}}. (This single command is a @sc{gnu} @code{ar} +tv @var{archive}}. (This single command is a @sc{gnu} @command{ar} enhancement, rather than present for MRI compatibility.) Requires prior use of @code{OPEN} or @code{CREATE}. @@ -644,7 +644,7 @@ Requires prior use of @code{OPEN} or @co @chapter ld @cindex linker @kindex ld -The @sc{gnu} linker @code{ld} is now described in a separate manual. +The @sc{gnu} linker @command{ld} is now described in a separate manual. @xref{Top,, Overview,, Using LD: the @sc{gnu} linker}. @end iftex @@ -657,24 +657,24 @@ The @sc{gnu} linker @code{ld} is now des @smallexample @c man begin SYNOPSIS nm -nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle[=@var{style}] ] [ -D | --dynamic ] - [ -s | --print-armap ] [ -A | -o | --print-file-name ] - [ -n | -v | --numeric-sort ] [ -p | --no-sort ] - [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] - [ -t @var{radix} | --radix=@var{radix} ] [ -P | --portability ] - [ --target=@var{bfdname} ] [ -f @var{format} | --format=@var{format} ] - [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] - [ -V | --version ] [ -X 32_64 ] [ --help ] [ @var{objfile}@dots{} ] +nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}] + [@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}] + [@option{-s}|@option{--print-armap}] [@option{-A}|@option{-o}|@option{--print-file-name}] + [@option{-n}|@option{-v}|@option{--numeric-sort}] [@option{-p}|@option{--no-sort}] + [@option{-r}|@option{--reverse-sort}] [@option{--size-sort}] [@option{-u}|@option{--undefined-only}] + [@option{-t} @var{radix}|@option{--radix=}@var{radix}] [@option{-P}|@option{--portability}] + [@option{--target=}@var{bfdname}] [@option{-f}@var{format}|@option{--format=}@var{format}] + [@option{--defined-only}] [@option{-l}|@option{--line-numbers}] [@option{--no-demangle}] + [@option{-V}|@option{--version}] [@option{-X 32_64}] [@option{--help}] [@var{objfile}@dots{}] @c man end @end smallexample @c man begin DESCRIPTION nm -@sc{gnu} @code{nm} lists the symbols from object files @var{objfile}@dots{}. -If no object files are listed as arguments, @code{nm} assumes the file +@sc{gnu} @command{nm} lists the symbols from object files @var{objfile}@dots{}. +If no object files are listed as arguments, @command{nm} assumes the file @file{a.out}. -For each symbol, @code{nm} shows: +For each symbol, @command{nm} shows: @itemize @bullet @item @@ -749,9 +749,11 @@ the value of the weak symbol becomes zer @item - The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and -the stab type. Stabs symbols are used to hold debugging information; -for more information, see @ref{Top,Stabs,Stabs Overview,stabs.info, The +the stab type. Stabs symbols are used to hold debugging information. +@ifclear man +For more information, see @ref{Top,Stabs,Stabs Overview,stabs.info, The ``stabs'' debug format}. +@end ifclear @item ? The symbol type is unknown, or object file format specific. @@ -767,7 +769,7 @@ The symbol name. The long and short forms of options, shown here as alternatives, are equivalent. -@table @code +@table @env @item -A @itemx -o @itemx --print-file-name @@ -785,9 +787,9 @@ Display all symbols, even debugger-only listed. @item -B -@cindex @code{nm} format -@cindex @code{nm} compatibility -The same as @samp{--format=bsd} (for compatibility with the MIPS @code{nm}). +@cindex @command{nm} format +@cindex @command{nm} compatibility +The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}). @item -C @itemx --demangle[=@var{style}] @@ -811,8 +813,8 @@ libraries. @item -f @var{format} @itemx --format=@var{format} -@cindex @code{nm} format -@cindex @code{nm} compatibility +@cindex @command{nm} format +@cindex @command{nm} compatibility Use the output format @var{format}, which can be @code{bsd}, @code{sysv}, or @code{posix}. The default is @code{bsd}. Only the first character of @var{format} is significant; it can be @@ -853,7 +855,7 @@ Equivalent to @samp{-f posix}. @itemx --print-armap @cindex symbol index, listing When listing symbols from archive members, include the index: a mapping -(stored in the archive by @code{ar} or @code{ranlib}) of which modules +(stored in the archive by @command{ar} or @command{ranlib}) of which modules contain definitions for which names. @item -r @@ -889,16 +891,16 @@ Display only defined symbols for each ob @item -V @itemx --version -Show the version number of @code{nm} and exit. +Show the version number of @command{nm} and exit. @item -X This option is ignored for compatibility with the AIX version of -@code{nm}. It takes one parameter which must be the string -@code{32_64}. The default mode of AIX @code{nm} corresponds -to @code{-X 32}, which is not supported by @sc{gnu} @code{nm}. +@command{nm}. It takes one parameter which must be the string +@option{32_64}. The default mode of AIX @command{nm} corresponds +to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}. @item --help -Show a summary of the options to @code{nm} and exit. +Show a summary of the options to @command{nm} and exit. @end table @c man end @@ -916,93 +918,98 @@ ar(1), objdump(1), ranlib(1), and the In @smallexample @c man begin SYNOPSIS objcopy -objcopy [ -F @var{bfdname} | --target=@var{bfdname} ] - [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -B @var{bfdarch} | --binary-architecture=@var{bfdarch} ] - [ -S | --strip-all ] [ -g | --strip-debug ] - [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ] - [ -N @var{symbolname} | --strip-symbol=@var{symbolname} ] - [ -G @var{symbolname} | --keep-global-symbol=@var{symbolname}] - [ -L @var{symbolname} | --localize-symbol=@var{symbolname} ] - [ -W @var{symbolname} | --weaken-symbol=@var{symbolname} ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -b @var{byte} | --byte=@var{byte} ] - [ -i @var{interleave} | --interleave=@var{interleave} ] - [ -j @var{sectionname} | --only-section=@var{sectionname} ] - [ -R @var{sectionname} | --remove-section=@var{sectionname} ] - [ -p | --preserve-dates ] [ --debugging ] - [ --gap-fill=@var{val} ] [ --pad-to=@var{address} ] - [ --set-start=@var{val} ] [ --adjust-start=@var{incr} ] - [ --change-addresses=@var{incr} ] - [ --change-section-address @var{section}@{=,+,-@}@var{val} ] - [ --change-section-lma @var{section}@{=,+,-@}@var{val} ] - [ --change-section-vma @var{section}@{=,+,-@}@var{val} ] - [ --change-warnings ] [ --no-change-warnings ] - [ --set-section-flags @var{section}=@var{flags} ] - [ --add-section @var{sectionname}=@var{filename} ] - [ --change-leading-char ] [ --remove-leading-char ] - [ --srec-len=@var{ival} ] [ --srec-forceS3 ] - [ --redefine-sym @var{old}=@var{new} ] [ --weaken ] - [ --keep-symbols=@var{filename} ] - [ --strip-symbols=@var{filename} ] - [ --keep-global-symbols=@var{filename} ] - [ --localize-symbols=@var{filename} ] - [ --weaken-symbols=@var{filename} ] - [ -v | --verbose ] [ -V | --version ] [ --help ] +objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] + [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] + [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] + [@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}] + [@option{-S}|@option{--strip-all}] [@option{-g}|@option{--strip-debug}] + [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}] + [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] + [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] + [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] + [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] + [@option{-x}|@option{--discard-all}] [@option{-X}|@option{--discard-locals}] + [@option{-b} @var{byte}|@option{--byte=}@var{byte}] + [@option{-i} @var{interleave}|@option{--interleave=}@var{interleave}] + [@option{-j} @var{sectionname}|@option{--only-section=}@var{sectionname}] + [@option{-R} @var{sectionname}|@option{--remove-section=}@var{sectionname}] + [@option{-p}|@option{--preserve-dates}] + [@option{--debugging}] + [@option{--gap-fill=}@var{val}] [@option{--pad-to=}@var{address}] + [@option{--set-start=}@var{val}] [@option{--adjust-start=}@var{incr}] + [@option{--change-addresses=}@var{incr}] + [@option{--change-section-address} @var{section}@{=,+,-@}@var{val}] + [@option{--change-section-lma} @var{section}@{=,+,-@}@var{val}] + [@option{--change-section-vma} @var{section}@{=,+,-@}@var{val}] + [@option{--change-warnings}] [@option{--no-change-warnings}] + [@option{--set-section-flags} @var{section}=@var{flags}] + [@option{--add-section} @var{sectionname}=@var{filename}] + [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] + [@option{--change-leading-char} ] [@option{--remove-leading-char}] + [@option{--srec-len=}@var{ival} ] [@option{--srec-forceS3}] + [@option{--redefine-sym} @var{old}=@var{new} ] + [@option{--weaken}] + [@option{--keep-symbols=}@var{filename}] + [@option{--strip-symbols=}@var{filename}] + [@option{--keep-global-symbols=}@var{filename}] + [@option{--localize-symbols=}@var{filename}] + [@option{--weaken-symbols=}@var{filename}] + [@option{-v}|@option{--verbose}] + [@option{-V}|@option{--version}] + [@option{--help}] @var{infile} [@var{outfile}] @c man end @end smallexample @c man begin DESCRIPTION objcopy -The @sc{gnu} @code{objcopy} utility copies the contents of an object -file to another. @code{objcopy} uses the @sc{gnu} @sc{bfd} Library to +The @sc{gnu} @command{objcopy} utility copies the contents of an object +file to another. @command{objcopy} uses the @sc{gnu} @sc{bfd} Library to read and write the object files. It can write the destination object file in a format different from that of the source object file. The -exact behavior of @code{objcopy} is controlled by command-line options. -Note that @code{objcopy} should be able to copy a fully linked file +exact behavior of @command{objcopy} is controlled by command-line options. +Note that @command{objcopy} should be able to copy a fully linked file between any two formats. However, copying a relocatable object file between any two formats may not work as expected. -@code{objcopy} creates temporary files to do its translations and -deletes them afterward. @code{objcopy} uses @sc{bfd} to do all its +@command{objcopy} creates temporary files to do its translations and +deletes them afterward. @command{objcopy} uses @sc{bfd} to do all its translation work; it has access to all the formats described in @sc{bfd} and thus is able to recognize most formats without being told explicitly. @xref{BFD,,BFD,ld.info,Using LD}. -@code{objcopy} can be used to generate S-records by using an output +@command{objcopy} can be used to generate S-records by using an output target of @samp{srec} (e.g., use @samp{-O srec}). -@code{objcopy} can be used to generate a raw binary file by using an -output target of @samp{binary} (e.g., use @samp{-O binary}). When -@code{objcopy} generates a raw binary file, it will essentially produce +@command{objcopy} can be used to generate a raw binary file by using an +output target of @samp{binary} (e.g., use @option{-O binary}). When +@command{objcopy} generates a raw binary file, it will essentially produce a memory dump of the contents of the input object file. All symbols and relocation information will be discarded. The memory dump will start at the load address of the lowest section copied into the output file. When generating an S-record or a raw binary file, it may be helpful to -use @samp{-S} to remove sections containing debugging information. In -some cases @samp{-R} will be useful to remove sections which contain +use @option{-S} to remove sections containing debugging information. In +some cases @option{-R} will be useful to remove sections which contain information that is not needed by the binary file. -Note - @code{objcopy} is not able to change the endianness of its input +Note - @command{objcopy} is not able to change the endianness of its input files. If the input format has an endianness, (some formats do not), -@code{objcopy} can only copy the inputs into file formats that have the +@command{objcopy} can only copy the inputs into file formats that have the same endianness or which have no endianness (eg @samp{srec}). @c man end @c man begin OPTIONS objcopy -@table @code +@table @env @item @var{infile} @itemx @var{outfile} The input and output files, respectively. -If you do not specify @var{outfile}, @code{objcopy} creates a +If you do not specify @var{outfile}, @command{objcopy} creates a temporary file and destructively renames the result with the name of @var{infile}. -@item -I @var{bfdname} +@item -I @var{bfdname} @itemx --input-target=@var{bfdname} Consider the source file's object format to be @var{bfdname}, rather than attempting to deduce it. @xref{Target Selection}, for more information. @@ -1091,7 +1098,7 @@ Do not copy compiler-generated local sym @itemx --byte=@var{byte} Keep only every @var{byte}th byte of the input file (header data is not affected). @var{byte} can be in the range from 0 to @var{interleave}-1, -where @var{interleave} is given by the @samp{-i} or @samp{--interleave} +where @var{interleave} is given by the @option{-i} or @option{--interleave} option, or the default of 4. This option is useful for creating files to program @sc{rom}. It is typically used with an @code{srec} output target. @@ -1099,9 +1106,9 @@ target. @item -i @var{interleave} @itemx --interleave=@var{interleave} Only copy one out of every @var{interleave} bytes. Select which byte to -copy with the @var{-b} or @samp{--byte} option. The default is 4. -@code{objcopy} ignores this option if you do not specify either @samp{-b} or -@samp{--byte}. +copy with the @option{-b} or @option{--byte} option. The default is 4. +@command{objcopy} ignores this option if you do not specify either @option{-b} or +@option{--byte}. @item -p @itemx --preserve-dates @@ -1122,7 +1129,7 @@ space created with @var{val}. @item --pad-to @var{address} Pad the output file up to the load address @var{address}. This is done by increasing the size of the last section. The extra space is -filled in with the value specified by @samp{--gap-fill} (default zero). +filled in with the value specified by @option{--gap-fill} (default zero). @item --set-start @var{val} Set the start address of the new file to @var{val}. Not all object file @@ -1150,9 +1157,9 @@ that they are loaded at a different addr Set or change both the VMA address and the LMA address of the named @var{section}. If @samp{=} is used, the section address is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the -section address. See the comments under @samp{--change-addresses}, +section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning will -be issued, unless @samp{--no-change-warnings} is used. +be issued, unless @option{--no-change-warnings} is used. @item --change-section-lma @var{section}@{=,+,-@}@var{val} @cindex changing section LMA @@ -1163,9 +1170,9 @@ is the address of the section at program especially those where a program is held in ROM, the two can be different. If @samp{=} is used, the section address is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the -section address. See the comments under @samp{--change-addresses}, +section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning -will be issued, unless @samp{--no-change-warnings} is used. +will be issued, unless @option{--no-change-warnings} is used. @item --change-section-vma @var{section}@{=,+,-@}@var{val} @cindex changing section VMA @@ -1177,20 +1184,20 @@ memory, but on some systems, especially ROM, the two can be different. If @samp{=} is used, the section address is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the section address. See the comments under -@samp{--change-addresses}, above. If @var{section} does not exist in +@option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning will be issued, unless -@samp{--no-change-warnings} is used. +@option{--no-change-warnings} is used. @item --change-warnings @itemx --adjust-warnings -If @samp{--change-section-address} or @samp{--change-section-lma} or -@samp{--change-section-vma} is used, and the named section does not +If @option{--change-section-address} or @option{--change-section-lma} or +@option{--change-section-vma} is used, and the named section does not exist, issue a warning. This is the default. @item --no-change-warnings @itemx --no-adjust-warnings -Do not issue a warning if @samp{--change-section-address} or -@samp{--adjust-section-lma} or @samp{--adjust-section-vma} is used, even +Do not issue a warning if @option{--change-section-address} or +@option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even if the named section does not exist. @item --set-section-flags @var{section}=@var{flags} @@ -1210,10 +1217,28 @@ contents of the new section are taken fr size of the section will be the size of the file. This option only works on file formats which can support sections with arbitrary names. +@item --rename-section @var{oldname}=@var{newname}[,@var{flags}] +Rename a section from @var{oldname} to @var{newname}, optionally +changing the section's flags to @var{flags} in the process. This has +the advantage over usng a linker script to perform the rename in that +the output stays as an object file and does not become a linked +executable. + +This option is particularly helpful when the input format is binary, +since this will always create a section called .data. If for example, +you wanted instead to create a section called .rodata containing binary +data you could use the following command line to achieve it: + +@smallexample + objcopy -I binary -O -B \ + --rename-section .data=.rodata,alloc,load,readonly,data,contents \ + +@end smallexample + @item --change-leading-char Some object file formats use special characters at the start of symbols. The most common such character is underscore, which compilers -often add before every symbol. This option tells @code{objcopy} to +often add before every symbol. This option tells @command{objcopy} to change the leading character of every symbol when it converts between object file formats. If the object file formats use the same leading character, this option has no effect. Otherwise, it will add a @@ -1227,7 +1252,7 @@ most common symbol leading character is remove a leading underscore from all global symbols. This can be useful if you want to link together objects of different file formats with different conventions for symbol names. This is different from -@code{--change-leading-char} because it always changes the symbol name +@option{--change-leading-char} because it always changes the symbol name when appropriate, regardless of the object file format of the output file. @@ -1248,42 +1273,42 @@ source, and there are name collisions. @item --weaken Change all global symbols in the file to be weak. This can be useful when building an object which will be linked against other objects using -the @code{-R} option to the linker. This option is only effective when +the @option{-R} option to the linker. This option is only effective when using an object file format which supports weak symbols. @item --keep-symbols=@var{filename} -Apply @samp{--keep-symbol} option to each symbol listed in the file +Apply @option{--keep-symbol} option to each symbol listed in the file @var{filename}. @var{filename} is simply a flat file, with one symbol name per line. Line comments may be introduced by the hash character. This option may be given more than once. @item --strip-symbols=@var{filename} -Apply @samp{--strip-symbol} option to each symbol listed in the file +Apply @option{--strip-symbol} option to each symbol listed in the file @var{filename}. @var{filename} is simply a flat file, with one symbol name per line. Line comments may be introduced by the hash character. This option may be given more than once. @item --keep-global-symbols=@var{filename} -Apply @samp{--keep-global-symbol} option to each symbol listed in the +Apply @option{--keep-global-symbol} option to each symbol listed in the file @var{filename}. @var{filename} is simply a flat file, with one symbol name per line. Line comments may be introduced by the hash character. This option may be given more than once. @item --localize-symbols=@var{filename} -Apply @samp{--localize-symbol} option to each symbol listed in the file +Apply @option{--localize-symbol} option to each symbol listed in the file @var{filename}. @var{filename} is simply a flat file, with one symbol name per line. Line comments may be introduced by the hash character. This option may be given more than once. @item --weaken-symbols=@var{filename} -Apply @samp{--weaken-symbol} option to each symbol listed in the file +Apply @option{--weaken-symbol} option to each symbol listed in the file @var{filename}. @var{filename} is simply a flat file, with one symbol name per line. Line comments may be introduced by the hash character. This option may be given more than once. @item -V @itemx --version -Show the version number of @code{objcopy}. +Show the version number of @command{objcopy}. @item -v @itemx --verbose @@ -1291,7 +1316,7 @@ Verbose output: list all object files mo archives, @samp{objcopy -V} lists all members of the archive. @item --help -Show a summary of the options to @code{objcopy}. +Show a summary of the options to @command{objcopy}. @end table @c man end @@ -1312,53 +1337,53 @@ ld(1), objdump(1), and the Info entries @smallexample @c man begin SYNOPSIS objdump -objdump [ -a | --archive-headers ] - [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle[=@var{style}] ] - [ -d | --disassemble ] - [ -D | --disassemble-all ] - [ -z | --disassemble-zeroes ] - [ -EB | -EL | --endian=@{big | little @} ] - [ -f | --file-headers ] - [ --file-start-context ] - [ -g | --debugging ] - [ -h | --section-headers | --headers ] - [ -i | --info ] - [ -j @var{section} | --section=@var{section} ] - [ -l | --line-numbers ] - [ -S | --source ] - [ -m @var{machine} | --architecture=@var{machine} ] - [ -M @var{options} | --disassembler-options=@var{options}] - [ -p | --private-headers ] - [ -r | --reloc ] - [ -R | --dynamic-reloc ] - [ -s | --full-contents ] - [ -G | --stabs ] - [ -t | --syms ] - [ -T | --dynamic-syms ] - [ -x | --all-headers ] - [ -w | --wide ] - [ --start-address=@var{address} ] - [ --stop-address=@var{address} ] - [ --prefix-addresses] - [ --[no-]show-raw-insn ] - [ --adjust-vma=@var{offset} ] - [ -V | --version ] - [ -H | --help ] +objdump [@option{-a}|@option{--archive-headers}] + [@option{-b} @var{bfdname}|@option{--target=@var{bfdname}}] + [@option{-C}|@option{--demangle}[=@var{style}] ] + [@option{-d}|@option{--disassemble}] + [@option{-D}|@option{--disassemble-all}] + [@option{-z}|@option{--disassemble-zeroes}] + [@option{-EB}|@option{-EL}|@option{--endian=}@{big | little @}] + [@option{-f}|@option{--file-headers}] + [@option{--file-start-context}] + [@option{-g}|@option{--debugging}] + [@option{-h}|@option{--section-headers}|@option{--headers}] + [@option{-i}|@option{--info}] + [@option{-j} @var{section}|@option{--section=}@var{section}] + [@option{-l}|@option{--line-numbers}] + [@option{-S}|@option{--source}] + [@option{-m} @var{machine}|@option{--architecture=}@var{machine}] + [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}] + [@option{-p}|@option{--private-headers}] + [@option{-r}|@option{--reloc}] + [@option{-R}|@option{--dynamic-reloc}] + [@option{-s}|@option{--full-contents}] + [@option{-G}|@option{--stabs}] + [@option{-t}|@option{--syms}] + [@option{-T}|@option{--dynamic-syms}] + [@option{-x}|@option{--all-headers}] + [@option{-w}|@option{--wide}] + [@option{--start-address=}@var{address}] + [@option{--stop-address=}@var{address}] + [@option{--prefix-addresses}] + [@option{--[no-]show-raw-insn}] + [@option{--adjust-vma=}@var{offset}] + [@option{-V}|@option{--version}] + [@option{-H}|@option{--help}] @var{objfile}@dots{} @c man end @end smallexample @c man begin DESCRIPTION objdump -@code{objdump} displays information about one or more object files. +@command{objdump} displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work. @var{objfile}@dots{} are the object files to be examined. When you -specify archives, @code{objdump} shows information on each of the member +specify archives, @command{objdump} shows information on each of the member object files. @c man end @@ -1367,9 +1392,9 @@ object files. The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list -@samp{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given. +@option{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given. -@table @code +@table @env @item -a @itemx --archive-header @cindex archive headers @@ -1399,10 +1424,10 @@ For example, objdump -b oasys -m vax -h fu.o @end example @noindent -displays summary information from the section headers (@samp{-h}) of -@file{fu.o}, which is explicitly identified (@samp{-m}) as a VAX object +displays summary information from the section headers (@option{-h}) of +@file{fu.o}, which is explicitly identified (@option{-m}) as a VAX object file in the format produced by Oasys compilers. You can list the -formats available with the @samp{-i} option. +formats available with the @option{-i} option. @xref{Target Selection}, for more information. @item -C @@ -1431,7 +1456,7 @@ expected to contain instructions. @item -D @itemx --disassemble-all -Like @samp{-d}, but disassemble the contents of all sections, not just +Like @option{-d}, but disassemble the contents of all sections, not just those expected to contain instructions. @item --prefix-addresses @@ -1461,7 +1486,7 @@ each of the @var{objfile} files. @item --file-start-context @cindex source code context Specify that when displaying interlisted source code/disassembly -(assumes '-S') from a file that has not yet been displayed, extend the +(assumes @option{-S}) from a file that has not yet been displayed, extend the context to the start of the file. @item -h @@ -1472,23 +1497,23 @@ Display summary information from the sec object file. File segments may be relocated to nonstandard addresses, for example by -using the @samp{-Ttext}, @samp{-Tdata}, or @samp{-Tbss} options to -@code{ld}. However, some object file formats, such as a.out, do not +using the @option{-Ttext}, @option{-Tdata}, or @option{-Tbss} options to +@command{ld}. However, some object file formats, such as a.out, do not store the starting address of the file segments. In those situations, -although @code{ld} relocates the sections correctly, using @samp{objdump +although @command{ld} relocates the sections correctly, using @samp{objdump -h} to list the file section headers cannot show the correct addresses. Instead, it shows the usual addresses, which are implicit for the target. @item --help -Print a summary of the options to @code{objdump} and exit. +Print a summary of the options to @command{objdump} and exit. @item -i @itemx --info @cindex architectures available @cindex object formats available Display a list showing all architectures and object formats available -for specification with @samp{-b} or @samp{-m}. +for specification with @option{-b} or @option{-m}. @item -j @var{name} @itemx --section=@var{name} @@ -1500,7 +1525,7 @@ Display information only for section @va @cindex source filenames for object files Label the display (using debugging information) with the filename and source line numbers corresponding to the object code or relocs shown. -Only useful with @samp{-d}, @samp{-D}, or @samp{-r}. +Only useful with @option{-d}, @option{-D}, or @option{-r}. @item -m @var{machine} @itemx --architecture=@var{machine} @@ -1509,7 +1534,7 @@ Only useful with @samp{-d}, @samp{-D}, o Specify the architecture to use when disassembling object files. This can be useful when disassembling object files which do not describe architecture information, such as S-records. You can list the available -architectures with the @samp{-i} option. +architectures with the @option{-i} option. @item -M @var{options} @itemx --disassembler-options=@var{options} @@ -1518,21 +1543,21 @@ some targets. If the target is an ARM architecture then this switch can be used to select which register name set is used during disassembler. Specifying -@samp{-M reg-name-std} (the default) will select the register names as +@option{-M reg-name-std} (the default) will select the register names as used in ARM's instruction set documentation, but with register 13 called 'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -@samp{-M reg-names-apcs} will select the name set used by the ARM -Procedure Call Standard, whilst specifying @samp{-M reg-names-raw} will +@option{-M reg-names-apcs} will select the name set used by the ARM +Procedure Call Standard, whilst specifying @option{-M reg-names-raw} will just use @samp{r} followed by the register number. There are also two variants on the APCS register naming scheme enabled -by @samp{-M reg-names-atpcs} and @samp{-M reg-names-special-atpcs} which -use the ARM/Thumb Procedure Call Standard naming conventions. (Eiuther -with the normal register name sor the special register names). +by @option{-M reg-names-atpcs} and @option{-M reg-names-special-atpcs} which +use the ARM/Thumb Procedure Call Standard naming conventions. (Either +with the normal register name or the special register names). This option can also be used for ARM architectures to force the -disassembler to interpret all instructions as THUMB instructions by -using the switch @samp{--disassembler-options=force-thumb}. This can be +disassembler to interpret all instructions as Thumb instructions by +using the switch @option{--disassembler-options=force-thumb}. This can be useful when attempting to disassemble thumb code produced by other compilers. @@ -1545,8 +1570,8 @@ object file formats, no additional infor @item -r @itemx --reloc @cindex relocation entries, in object file -Print the relocation entries of the file. If used with @samp{-d} or -@samp{-D}, the relocations are printed interspersed with the +Print the relocation entries of the file. If used with @option{-d} or +@option{-D}, the relocations are printed interspersed with the disassembly. @item -R @@ -1567,16 +1592,16 @@ Display the full contents of any section @cindex source disassembly @cindex disassembly, with source Display source code intermixed with disassembly, if possible. Implies -@samp{-d}. +@option{-d}. @item --show-raw-insn When disassembling instructions, print the instruction in hex as well as in symbolic form. This is the default except when -@code{--prefix-addresses} is used. +@option{--prefix-addresses} is used. @item --no-show-raw-insn When disassembling instructions, do not print the instruction bytes. -This is the default when @code{--prefix-addresses} is used. +This is the default when @option{--prefix-addresses} is used. @item -G @item --stabs @@ -1589,7 +1614,7 @@ contents of the .stab and .stab.index an ELF file. This is only useful on systems (such as Solaris 2.0) in which @code{.stab} debugging symbol-table entries are carried in an ELF section. In most other file formats, debugging symbol-table entries are -interleaved with linkage symbols, and are visible in the @samp{--syms} +interleaved with linkage symbols, and are visible in the @option{--syms} output. @ifclear man For more information on stabs symbols, see @ref{Top,Stabs,Stabs @@ -1599,12 +1624,12 @@ Overview,stabs.info, The ``stabs'' debug @item --start-address=@var{address} @cindex start-address Start displaying data at the specified address. This affects the output -of the @code{-d}, @code{-r} and @code{-s} options. +of the @option{-d}, @option{-r} and @option{-s} options. @item --stop-address=@var{address} @cindex stop-address Stop displaying data at the specified address. This affects the output -of the @code{-d}, @code{-r} and @code{-s} options. +of the @option{-d}, @option{-r} and @option{-s} options. @item -t @itemx --syms @@ -1618,18 +1643,18 @@ This is similar to the information provi Print the dynamic symbol table entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the @samp{nm} -program when given the @samp{-D} (@samp{--dynamic}) option. +program when given the @option{-D} (@option{--dynamic}) option. @item --version -Print the version number of @code{objdump} and exit. +Print the version number of @command{objdump} and exit. @item -x @itemx --all-header @cindex all header information, object file @cindex header information, all Display all available header information, including the symbol table and -relocation entries. Using @samp{-x} is equivalent to specifying all of -@samp{-a -f -h -r -t}. +relocation entries. Using @option{-x} is equivalent to specifying all of +@option{-a -f -h -r -t}. @item -w @itemx --wide @@ -1656,13 +1681,13 @@ nm(1), readelf(1), and the Info entries @smallexample @c man begin SYNOPSIS ranlib -ranlib [-vV] @var{archive} +ranlib [@option{-vV}] @var{archive} @c man end @end smallexample @c man begin DESCRIPTION ranlib -@code{ranlib} generates an index to the contents of an archive and +@command{ranlib} generates an index to the contents of an archive and stores it in the archive. The index lists each symbol defined by a member of an archive that is a relocatable object file. @@ -1672,19 +1697,19 @@ An archive with such an index speeds up allows routines in the library to call each other without regard to their placement in the archive. -The @sc{gnu} @code{ranlib} program is another form of @sc{gnu} @code{ar}; running -@code{ranlib} is completely equivalent to executing @samp{ar -s}. +The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar}; running +@command{ranlib} is completely equivalent to executing @samp{ar -s}. @xref{ar}. @c man end @c man begin OPTIONS ranlib -@table @code +@table @env @item -v @itemx -V @itemx --version -Show the version number of @code{ranlib}. +Show the version number of @command{ranlib}. @end table @c man end @@ -1705,16 +1730,16 @@ ar(1), nm(1), and the Info entries for @ @smallexample @c man begin SYNOPSIS size -size [ -A | -B | --format=@var{compatibility} ] - [ --help ] [ -d | -o | -x | --radix=@var{number} ] - [ --target=@var{bfdname} ] [ -V | --version ] - [ @var{objfile}@dots{} ] +size [@option{-A}|@option{-B}|@option{--format=}@var{compatibility}] + [@option{--help}] [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] + [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] + [@var{objfile}@dots{}] @c man end @end smallexample @c man begin DESCRIPTION size -The @sc{gnu} @code{size} utility lists the section sizes---and the total +The @sc{gnu} @command{size} utility lists the section sizes---and the total size---for each of the object or archive files @var{objfile} in its argument list. By default, one line of output is generated for each object file or each module in an archive. @@ -1728,22 +1753,22 @@ If none are specified, the file @code{a. The command line options have the following meanings: -@table @code +@table @env @item -A @itemx -B @itemx --format=@var{compatibility} -@cindex @code{size} display format +@cindex @command{size} display format Using one of these options, you can choose whether the output from @sc{gnu} -@code{size} resembles output from System V @code{size} (using @samp{-A}, -or @samp{--format=sysv}), or Berkeley @code{size} (using @samp{-B}, or -@samp{--format=berkeley}). The default is the one-line format similar to +@command{size} resembles output from System V @command{size} (using @option{-A}, +or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or +@option{--format=berkeley}). The default is the one-line format similar to Berkeley's. @c Bonus for doc-source readers: you can also say --format=strange (or @c anything else that starts with 's') for sysv, and --format=boring (or @c anything else that starts with 'b') for Berkeley. Here is an example of the Berkeley (default) format of output from -@code{size}: +@command{size}: @smallexample $ size --format=Berkeley ranlib size text data bss dec hex filename @@ -1779,26 +1804,26 @@ Show a summary of acceptable arguments a @itemx -o @itemx -x @itemx --radix=@var{number} -@cindex @code{size} number format +@cindex @command{size} number format @cindex radix for section sizes Using one of these options, you can control whether the size of each -section is given in decimal (@samp{-d}, or @samp{--radix=10}); octal -(@samp{-o}, or @samp{--radix=8}); or hexadecimal (@samp{-x}, or -@samp{--radix=16}). In @samp{--radix=@var{number}}, only the three +section is given in decimal (@option{-d}, or @option{--radix=10}); octal +(@option{-o}, or @option{--radix=8}); or hexadecimal (@option{-x}, or +@option{--radix=16}). In @option{--radix=@var{number}}, only the three values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for @samp{-d} or @samp{-x} output, or -octal and hexadecimal if you're using @samp{-o}. +radices; decimal and hexadecimal for @option{-d} or @option{-x} output, or +octal and hexadecimal if you're using @option{-o}. @item --target=@var{bfdname} @cindex object code format Specify that the object-code format for @var{objfile} is -@var{bfdname}. This option may not be necessary; @code{size} can +@var{bfdname}. This option may not be necessary; @command{size} can automatically recognize many formats. @xref{Target Selection}, for more information. @item -V @itemx --version -Display the version number of @code{size}. +Display the version number of @command{size}. @end table @c man end @@ -1820,30 +1845,30 @@ ar(1), objdump(1), readelf(1), and the I @smallexample @c man begin SYNOPSIS strings -strings [-afov] [-@var{min-len}] [-n @var{min-len}] [-t @var{radix}] [-] - [--all] [--print-file-name] [--bytes=@var{min-len}] - [--radix=@var{radix}] [--target=@var{bfdname}] - [--help] [--version] @var{file}@dots{} +strings [@option{-afov}] [@option{-}@var{min-len}] [@option{-n} @var{min-len}] [@option{-t} @var{radix}] [@option{-}] + [@option{--all}] [@option{--print-file-name}] [@option{--bytes=}@var{min-len}] + [@option{--radix=}@var{radix}] [@option{--target=}@var{bfdname}] + [@option{--help}] [@option{--version}] @var{file}@dots{} @c man end @end smallexample @c man begin DESCRIPTION strings -For each @var{file} given, @sc{gnu} @code{strings} prints the printable +For each @var{file} given, @sc{gnu} @command{strings} prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files; for other types of files, it prints the strings from the whole file. -@code{strings} is mainly useful for determining the contents of non-text +@command{strings} is mainly useful for determining the contents of non-text files. @c man end @c man begin OPTIONS strings -@table @code +@table @env @item -a @itemx --all @itemx - @@ -1864,7 +1889,7 @@ Print sequences of characters that are a long, instead of the default 4. @item -o -Like @samp{-t o}. Some other versions of @code{strings} have @samp{-o} +Like @samp{-t o}. Some other versions of @command{strings} have @option{-o} act like @samp{-t d} instead. Since we can not be compatible with both ways, we simply chose one. @@ -1905,34 +1930,34 @@ and the Info entries for @file{binutils} @smallexample @c man begin SYNOPSIS strip -strip [ -F @var{bfdname} | --target=@var{bfdname} ] - [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -s | --strip-all ] [ -S | -g | --strip-debug ] - [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ] - [ -N @var{symbolname} | --strip-symbol=@var{symbolname} ] - [ -x | --discard-all ] [ -X | --discard-locals ] - [ -R @var{sectionname} | --remove-section=@var{sectionname} ] - [ -o @var{file} ] [ -p | --preserve-dates ] - [ -v | --verbose ] [ -V | --version ] [ --help ] +strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname} ] + [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname} ] + [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname} ] + [@option{-s}|@option{--strip-all}] [@option{-S}|@option{-g}|@option{--strip-debug}] + [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname} ] + [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname} ] + [@option{-x}|@option{--discard-all} ] [@option{-X} |@option{--discard-locals}] + [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname} ] + [@option{-o} @var{file} ] [@option{-p}|@option{--preserve-dates}] + [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] [@option{--help}] @var{objfile}@dots{} @c man end @end smallexample @c man begin DESCRIPTION strip -@sc{gnu} @code{strip} discards all symbols from object files +@sc{gnu} @command{strip} discards all symbols from object files @var{objfile}. The list of object files may include archives. At least one object file must be given. -@code{strip} modifies the files named in its argument, +@command{strip} modifies the files named in its argument, rather than writing modified copies under different names. @c man end @c man begin OPTIONS strip -@table @code +@table @env @item -F @var{bfdname} @itemx --target=@var{bfdname} Treat the original @var{objfile} as a file with the object @@ -1940,7 +1965,7 @@ code format @var{bfdname}, and rewrite i @xref{Target Selection}, for more information. @item --help -Show a summary of the options to @code{strip} and exit. +Show a summary of the options to @command{strip} and exit. @item -I @var{bfdname} @itemx --input-target=@var{bfdname} @@ -1980,7 +2005,7 @@ be given more than once. @itemx --strip-symbol=@var{symbolname} Remove symbol @var{symbolname} from the source file. This option may be given more than once, and may be combined with strip options other than -@code{-K}. +@option{-K}. @item -o @var{file} Put the stripped output in @var{file}, rather than replacing the @@ -2002,7 +2027,7 @@ Remove compiler-generated local symbols. @item -V @itemx --version -Show the version number for @code{strip}. +Show the version number for @command{strip}. @item -v @itemx --verbose @@ -2028,11 +2053,11 @@ the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS cxxfilt -c++filt [ -_ | --strip-underscores ] - [ -j | --java ] - [ -n | --no-strip-underscores ] - [ -s @var{format} | --format=@var{format} ] - [ --help ] [ --version ] [ @var{symbol}@dots{} ] +c++filt [@option{-_}|@option{--strip-underscores}] + [@option{-j}|@option{--java}] + [@option{-n}|@option{--no-strip-underscores}] + [@option{-s} @var{format}|@option{--format=}@var{format}] + [@option{--help}] [@option{--version}] [@var{symbol}@dots{}] @c man end @end smallexample @@ -2043,9 +2068,9 @@ The C++ and Java languages provides func that you can write many functions with the same name (providing each takes parameters of different types). All C++ and Java function names are encoded into a low-level assembly label (this process is known as -@dfn{mangling}). The @code{c++filt} +@dfn{mangling}). The @command{c++filt} @footnote{MS-DOS does not allow @kbd{+} characters in file names, so on -MS-DOS this program is named @code{cxxfilt}.} +MS-DOS this program is named @command{cxxfilt}.} program does the inverse mapping: it decodes (@dfn{demangles}) low-level names into user-level names so that the linker can keep these overloaded functions from clashing. @@ -2055,13 +2080,13 @@ dollars, or periods) seen in the input i label decodes into a C++ name, the C++ name replaces the low-level name in the output. -You can use @code{c++filt} to decipher individual symbols: +You can use @command{c++filt} to decipher individual symbols: @example c++filt @var{symbol} @end example -If no @var{symbol} arguments are given, @code{c++filt} reads symbol +If no @var{symbol} arguments are given, @command{c++filt} reads symbol names from the standard input and writes the demangled names to the standard output. All results are printed on the standard output. @@ -2069,13 +2094,13 @@ standard output. All results are printe @c man begin OPTIONS cxxfilt -@table @code +@table @env @item -_ @itemx --strip-underscores On some systems, both the C and C++ compilers put an underscore in front of every name. For example, the C name @code{foo} gets the low-level name @code{_foo}. This option removes the initial underscore. Whether -@code{c++filt} removes the underscore by default is target dependent. +@command{c++filt} removes the underscore by default is target dependent. @item -j @itemx --java @@ -2088,7 +2113,7 @@ Do not remove the initial underscore. @item -s @var{format} @itemx --format=@var{format} -@sc{gnu} @code{nm} can decode three different methods of mangling, used by +@sc{gnu} @command{nm} can decode three different methods of mangling, used by different C++ compilers. The argument to this option selects which method it uses: @@ -2108,10 +2133,10 @@ the one used by the @sc{gnu} compiler wi @end table @item --help -Print a summary of the options to @code{c++filt} and exit. +Print a summary of the options to @command{c++filt} and exit. @item --version -Print the version number of @code{c++filt} and exit. +Print the version number of @command{c++filt} and exit. @end table @c man end @@ -2123,7 +2148,7 @@ the Info entries for @file{binutils}. @end ignore @quotation -@emph{Warning:} @code{c++filt} is a new utility, and the details of its +@emph{Warning:} @command{c++filt} is a new utility, and the details of its user interface are subject to change in future releases. In particular, a command-line option may be required in the the future to decode a name passed as an argument on the command line; in other words, @@ -2150,45 +2175,45 @@ c++filt @var{option} @var{symbol} @smallexample @c man begin SYNOPSIS addr2line -addr2line [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle[=@var{style} ] - [ -e @var{filename} | --exe=@var{filename} ] - [ -f | --functions ] [ -s | --basename ] - [ -H | --help ] [ -V | --version ] - [ addr addr ... ] +addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}] + [@option{-C}|@option{--demangle}[=@var{style}] + [@option{-e} @var{filename}|@option{--exe=}@var{filename}] + [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] + [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] + [addr addr @dots{}] @c man end @end smallexample @c man begin DESCRIPTION addr2line -@code{addr2line} translates program addresses into file names and line +@command{addr2line} translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address. -The executable to use is specified with the @code{-e} option. The +The executable to use is specified with the @option{-e} option. The default is the file @file{a.out}. -@code{addr2line} has two modes of operation. +@command{addr2line} has two modes of operation. In the first, hexadecimal addresses are specified on the command line, -and @code{addr2line} displays the file name and line number for each +and @command{addr2line} displays the file name and line number for each address. -In the second, @code{addr2line} reads hexadecimal addresses from +In the second, @command{addr2line} reads hexadecimal addresses from standard input, and prints the file name and line number for each -address on standard output. In this mode, @code{addr2line} may be used +address on standard output. In this mode, @command{addr2line} may be used in a pipe to convert dynamically chosen addresses. The format of the output is @samp{FILENAME:LINENO}. The file name and line number for each address is printed on a separate line. If the -@code{-f} option is used, then each @samp{FILENAME:LINENO} line is +@command{-f} option is used, then each @samp{FILENAME:LINENO} line is preceded by a @samp{FUNCTIONNAME} line which is the name of the function containing the address. If the file name or function name can not be determined, -@code{addr2line} will print two question marks in their place. If the -line number can not be determined, @code{addr2line} will print 0. +@command{addr2line} will print two question marks in their place. If the +line number can not be determined, @command{addr2line} will print 0. @c man end @@ -2197,7 +2222,7 @@ line number can not be determined, @code The long and short forms of options, shown here as alternatives, are equivalent. -@table @code +@table @env @item -b @var{bfdname} @itemx --target=@var{bfdname} @cindex object code format @@ -2239,20 +2264,20 @@ Info entries for @file{binutils}. @node nlmconv @chapter nlmconv -@code{nlmconv} converts a relocatable object file into a NetWare +@command{nlmconv} converts a relocatable object file into a NetWare Loadable Module. @ignore -@code{nlmconv} currently works with @samp{i386} object +@command{nlmconv} currently works with @samp{i386} object files in @code{coff}, @sc{elf}, or @code{a.out} format, and @sc{SPARC} object files in @sc{elf}, or @code{a.out} format@footnote{ -@code{nlmconv} should work with any @samp{i386} or @sc{sparc} object +@command{nlmconv} should work with any @samp{i386} or @sc{sparc} object format in the Binary File Descriptor library. It has only been tested with the above formats.}. @end ignore @quotation -@emph{Warning:} @code{nlmconv} is not always built as part of the binary +@emph{Warning:} @command{nlmconv} is not always built as part of the binary utilities, since it is only useful for NLM targets. @end quotation @@ -2260,49 +2285,49 @@ utilities, since it is only useful for N @smallexample @c man begin SYNOPSIS nlmconv -nlmconv [ -I @var{bfdname} | --input-target=@var{bfdname} ] - [ -O @var{bfdname} | --output-target=@var{bfdname} ] - [ -T @var{headerfile} | --header-file=@var{headerfile} ] - [ -d | --debug] [ -l @var{linker} | --linker=@var{linker} ] - [ -h | --help ] [ -V | --version ] +nlmconv [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] + [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] + [@option{-T} @var{headerfile}|@option{--header-file=}@var{headerfile}] + [@option{-d}|@option{--debug}] [@option{-l} @var{linker}|@option{--linker=}@var{linker}] + [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] @var{infile} @var{outfile} @c man end @end smallexample @c man begin DESCRIPTION nlmconv -@code{nlmconv} converts the relocatable @samp{i386} object file +@command{nlmconv} converts the relocatable @samp{i386} object file @var{infile} into the NetWare Loadable Module @var{outfile}, optionally reading @var{headerfile} for NLM header information. For instructions on writing the NLM command file language used in header files, see the @samp{linkers} section, @samp{NLMLINK} in particular, of the @cite{NLM Development and Tools Overview}, which is part of the NLM Software Developer's Kit (``NLM SDK''), available from Novell, Inc. -@code{nlmconv} uses the @sc{gnu} Binary File Descriptor library to read +@command{nlmconv} uses the @sc{gnu} Binary File Descriptor library to read @var{infile}; @ifclear man see @ref{BFD,,BFD,ld.info,Using LD}, for more information. @end ifclear -@code{nlmconv} can perform a link step. In other words, you can list +@command{nlmconv} can perform a link step. In other words, you can list more than one object file for input if you list them in the definitions file (rather than simply specifying one input file on the command line). -In this case, @code{nlmconv} calls the linker for you. +In this case, @command{nlmconv} calls the linker for you. @c man end @c man begin OPTIONS nlmconv -@table @code +@table @env @item -I @var{bfdname} @itemx --input-target=@var{bfdname} -Object format of the input file. @code{nlmconv} can usually determine +Object format of the input file. @command{nlmconv} can usually determine the format of a given file (so no default is necessary). @xref{Target Selection}, for more information. @item -O @var{bfdname} @itemx --output-target=@var{bfdname} -Object format of the output file. @code{nlmconv} infers the output +Object format of the output file. @command{nlmconv} infers the output format based on the input format, e.g. for a @samp{i386} input file the output format is @samp{nlm32-i386}. @xref{Target Selection}, for more information. @@ -2317,7 +2342,7 @@ from Novell, Inc. @item -d @itemx --debug -Displays (on standard error) the linker command line used by @code{nlmconv}. +Displays (on standard error) the linker command line used by @command{nlmconv}. @item -l @var{linker} @itemx --linker=@var{linker} @@ -2330,7 +2355,7 @@ Prints a usage summary. @item -V @itemx --version -Prints the version number for @code{nlmconv}. +Prints the version number for @command{nlmconv}. @end table @c man end @@ -2344,10 +2369,10 @@ the Info entries for @file{binutils}. @node windres @chapter windres -@code{windres} may be used to manipulate Windows resources. +@command{windres} may be used to manipulate Windows resources. @quotation -@emph{Warning:} @code{windres} is not always built as part of the binary +@emph{Warning:} @command{windres} is not always built as part of the binary utilities, since it is only useful for Windows targets. @end quotation @@ -2361,7 +2386,7 @@ windres [options] [input-file] [output-f @c man begin DESCRIPTION windres -@code{windres} reads resources from an input file and copies them into +@command{windres} reads resources from an input file and copies them into an output file. Either file may be in one of three formats: @table @code @@ -2378,27 +2403,27 @@ A COFF object or executable. The exact description of these different formats is available in documentation from Microsoft. -When @code{windres} converts from the @code{rc} format to the @code{res} +When @command{windres} converts from the @code{rc} format to the @code{res} format, it is acting like the Windows Resource Compiler. When -@code{windres} converts from the @code{res} format to the @code{coff} +@command{windres} converts from the @code{res} format to the @code{coff} format, it is acting like the Windows @code{CVTRES} program. -When @code{windres} generates an @code{rc} file, the output is similar +When @command{windres} generates an @code{rc} file, the output is similar but not identical to the format expected for the input. When an input @code{rc} file refers to an external filename, an output @code{rc} file will instead include the file contents. -If the input or output format is not specified, @code{windres} will +If the input or output format is not specified, @command{windres} will guess based on the file name, or, for the input file, the file contents. A file with an extension of @file{.rc} will be treated as an @code{rc} file, a file with an extension of @file{.res} will be treated as a @code{res} file, and a file with an extension of @file{.o} or @file{.exe} will be treated as a @code{coff} file. -If no output file is specified, @code{windres} will print the resources +If no output file is specified, @command{windres} will print the resources in @code{rc} format to standard output. -The normal use is for you to write an @code{rc} file, use @code{windres} +The normal use is for you to write an @code{rc} file, use @command{windres} to convert it to a COFF object file, and then link the COFF file into your application. This will make the resources described in the @code{rc} file available to Windows. @@ -2407,58 +2432,60 @@ your application. This will make the re @c man begin OPTIONS windres -@table @code +@table @env @item -i @var{filename} @itemx --input @var{filename} The name of the input file. If this option is not used, then -@code{windres} will use the first non-option argument as the input file -name. If there are no non-option arguments, then @code{windres} will -read from standard input. @code{windres} can not read a COFF file from +@command{windres} will use the first non-option argument as the input file +name. If there are no non-option arguments, then @command{windres} will +read from standard input. @command{windres} can not read a COFF file from standard input. @item -o @var{filename} @itemx --output @var{filename} The name of the output file. If this option is not used, then -@code{windres} will use the first non-option argument, after any used +@command{windres} will use the first non-option argument, after any used for the input file name, as the output file name. If there is no -non-option argument, then @code{windres} will write to standard output. -@code{windres} can not write a COFF file to standard output. +non-option argument, then @command{windres} will write to standard output. +@command{windres} can not write a COFF file to standard output. @item -I @var{format} @itemx --input-format @var{format} The input format to read. @var{format} may be @samp{res}, @samp{rc}, or -@samp{coff}. If no input format is specified, @code{windres} will +@samp{coff}. If no input format is specified, @command{windres} will guess, as described above. @item -O @var{format} @itemx --output-format @var{format} The output format to generate. @var{format} may be @samp{res}, @samp{rc}, or @samp{coff}. If no output format is specified, -@code{windres} will guess, as described above. +@command{windres} will guess, as described above. @item -F @var{target} @itemx --target @var{target} Specify the BFD format to use for a COFF file as input or output. This -is a BFD target name; you can use the @code{--help} option to see a list -of supported targets. Normally @code{windres} will use the default -format, which is the first one listed by the @code{--help} option. +is a BFD target name; you can use the @option{--help} option to see a list +of supported targets. Normally @command{windres} will use the default +format, which is the first one listed by the @option{--help} option. +@ifclear man @ref{Target Selection}. +@end ifclear @item --preprocessor @var{program} -When @code{windres} reads an @code{rc} file, it runs it through the C +When @command{windres} reads an @code{rc} file, it runs it through the C preprocessor first. This option may be used to specify the preprocessor to use, including any leading arguments. The default preprocessor argument is @code{gcc -E -xc-header -DRC_INVOKED}. @item --include-dir @var{directory} Specify an include directory to use when reading an @code{rc} file. -@code{windres} will pass this to the preprocessor as an @code{-I} -option. @code{windres} will also search this directory when looking for +@command{windres} will pass this to the preprocessor as an @option{-I} +option. @command{windres} will also search this directory when looking for files named in the @code{rc} file. @item -D @var{target} @itemx --define @var{sym}[=@var{val}] -Specify a @code{-D} option to pass to the preprocessor when reading an +Specify a @option{-D} option to pass to the preprocessor when reading an @code{rc} file. @item -v @@ -2485,10 +2512,10 @@ This is the default behaviour. Prints a usage summary. @item --version -Prints the version number for @code{windres}. +Prints the version number for @command{windres}. @item --yydebug -If @code{windres} is compiled with @code{YYDEBUG} defined as @code{1}, +If @command{windres} is compiled with @code{YYDEBUG} defined as @code{1}, this will turn on parser debugging. @end table @@ -2505,11 +2532,11 @@ the Info entries for @file{binutils}. @cindex DLL @kindex dlltool -@code{dlltool} may be used to create the files needed to build and use +@command{dlltool} may be used to create the files needed to build and use dynamic link libraries (DLLs). @quotation -@emph{Warning:} @code{dlltool} is not always built as part of the binary +@emph{Warning:} @command{dlltool} is not always built as part of the binary utilities, since it is only useful for those targets which support DLLs. @end quotation @@ -2517,48 +2544,50 @@ utilities, since it is only useful for t @smallexample @c man begin SYNOPSIS dlltool -dlltool [-d|--input-def @var{def-file-name}] - [-b|--base-file @var{base-file-name}] - [-e|--output-exp @var{exports-file-name}] - [-z|--output-def @var{def-file-name}] - [-l|--output-lib @var{library-file-name}] - [--export-all-symbols] [--no-export-all-symbols] - [--exclude-symbols @var{list}] - [--no-default-excludes] - [-S|--as @var{path-to-assembler}] [-f|--as-flags @var{options}] - [-D|--dllname @var{name}] [-m|--machine @var{machine}] - [-a|--add-indirect] [-U|--add-underscore] [-k|--kill-at] - [-A|--add-stdcall-alias] - [-x|--no-idata4] [-c|--no-idata5] [-i|--interwork] - [-n|--nodelete] [-v|--verbose] [-h|--help] [-V|--version] +dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] + [@option{-b}|@option{--base-file} @var{base-file-name}] + [@option{-e}|@option{--output-exp} @var{exports-file-name}] + [@option{-z}|@option{--output-def} @var{def-file-name}] + [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] + [@option{--exclude-symbols} @var{list}] + [@option{--no-default-excludes}] + [@option{-S}|@option{--as} @var{path-to-assembler}] [@option{-f}|@option{--as-flags} @var{options}] + [@option{-D}|@option{--dllname} @var{name}] [@option{-m}|@option{--machine} @var{machine}] + [@option{-a}|@option{--add-indirect}] [@option{-U}|@option{--add-underscore}] [@option{-k}|@option{--kill-at}] + [@option{-A}|@option{--add-stdcall-alias}] + [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] + [@option{-n}|@option{--nodelete}] [@option{-v}|@option{--verbose}] + [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] [object-file @dots{}] @c man end @end smallexample @c man begin DESCRIPTION dlltool -@code{dlltool} reads its inputs, which can come from the @samp{-d} and -@samp{-b} options as well as object files specified on the command -line. It then processes these inputs and if the @samp{-e} option has -been specified it creates a exports file. If the @samp{-l} option -has been specified it creates a library file and if the @samp{-z} option -has been specified it creates a def file. Any or all of the -e, -l -and -z options can be present in one invocation of dlltool. +@command{dlltool} reads its inputs, which can come from the @option{-d} and +@option{-b} options as well as object files specified on the command +line. It then processes these inputs and if the @option{-e} option has +been specified it creates a exports file. If the @option{-l} option +has been specified it creates a library file and if the @option{-z} option +has been specified it creates a def file. Any or all of the @option{-e}, +@option{-l} and @option{-z} options can be present in one invocation of +dlltool. When creating a DLL, along with the source for the DLL, it is necessary -to have three other files. @code{dlltool} can help with the creation of +to have three other files. @command{dlltool} can help with the creation of these files. The first file is a @samp{.def} file which specifies which functions are exported from the DLL, which functions the DLL imports, and so on. This -is a text file and can be created by hand, or @code{dlltool} can be used -to create it using the @samp{-z} option. In this case @code{dlltool} +is a text file and can be created by hand, or @command{dlltool} can be used +to create it using the @option{-z} option. In this case @command{dlltool} will scan the object files specified on its command line looking for those functions which have been specially marked as being exported and put entries for them in the .def file it creates. In order to mark a function as being exported from a DLL, it needs to -have an @samp{-export:} entry in the @samp{.drectve} +have an @option{-export:} entry in the @samp{.drectve} section of the object file. This can be done in C by using the asm() operator: @@ -2572,21 +2601,21 @@ asm() operator: The second file needed for DLL creation is an exports file. This file is linked with the object files that make up the body of the DLL and it handles the interface between the DLL and the outside world. This is a -binary file and it can be created by giving the @samp{-e} option to -@code{dlltool} when it is creating or reading in a .def file. +binary file and it can be created by giving the @option{-e} option to +@command{dlltool} when it is creating or reading in a .def file. The third file needed for DLL creation is the library file that programs will link with in order to access the functions in the DLL. This file -can be created by giving the @samp{-l} option to dlltool when it +can be created by giving the @option{-l} option to dlltool when it is creating or reading in a .def file. -@code{dlltool} builds the library file by hand, but it builds the +@command{dlltool} builds the library file by hand, but it builds the exports file by creating temporary files containing assembler statements -and then assembling these. The @samp{-S} command line option can be +and then assembling these. The @option{-S} command line option can be used to specify the path to the assembler that dlltool will use, -and the @samp{-f} option can be used to pass specific flags to that -assembler. The @samp{-n} can be used to prevent dlltool from deleting -these temporary assembler files when it is done, and if @samp{-n} is +and the @option{-f} option can be used to pass specific flags to that +assembler. The @option{-n} can be used to prevent dlltool from deleting +these temporary assembler files when it is done, and if @option{-n} is specified twice then this will prevent dlltool from deleting the temporary object files it used to build the library. @@ -2607,7 +2636,7 @@ that uses that DLL: The command line options have the following meanings: -@table @code +@table @env @item -d @var{filename} @itemx --input-def @var{filename} @@ -2636,9 +2665,9 @@ Specifies the name of the library file t @item --export-all-symbols Treat all global and weak defined symbols found in the input object files as symbols to be exported. There is a small list of symbols which -are not exported by default; see the @code{--no-default-excludes} +are not exported by default; see the @option{--no-default-excludes} option. You may add to the list of symbols to not export by using the -@code{--exclude-symbols} option. +@option{--exclude-symbols} option. @item --no-export-all-symbols Only export symbols explicitly listed in an input .def file or in @@ -2650,15 +2679,15 @@ attributes in the source code. Do not export the symbols in @var{list}. This is a list of symbol names separated by comma or colon characters. The symbol names should not contain a leading underscore. This is only meaningful when -@code{--export-all-symbols} is used. +@option{--export-all-symbols} is used. @item --no-default-excludes -When @code{--export-all-symbols} is used, it will by default avoid +When @option{--export-all-symbols} is used, it will by default avoid exporting certain special symbols. The current list of symbols to avoid exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0}, -@samp{impure_ptr}. You may use the @code{--no-default-excludes} option +@samp{impure_ptr}. You may use the @option{--no-default-excludes} option to go ahead and export these special symbols. This is only meaningful -when @code{--export-all-symbols} is used. +when @option{--export-all-symbols} is used. @item -S @var{path} @itemx --as @var{path} @@ -2669,7 +2698,7 @@ to create the exports file. @itemx --as-flags @var{switches} Specifies any specific command line switches to be passed to the assembler when building the exports file. This option will work even if -the @samp{-S} option is not used. This option only takes one argument, +the @option{-S} option is not used. This option only takes one argument, and if it occurs more than once on the command line, then later occurrences will override earlier occurrences. So if it is necessary to pass multiple switches to the assembler they should be enclosed in @@ -2678,64 +2707,64 @@ double quotes. @item -D @var{name} @itemx --dll-name @var{name} Specifies the name to be stored in the .def file as the name of the DLL -when the @samp{-e} option is used. If this option is not present, then -the filename given to the @samp{-e} option will be used as the name of +when the @option{-e} option is used. If this option is not present, then +the filename given to the @option{-e} option will be used as the name of the DLL. @item -m @var{machine} @itemx -machine @var{machine} Specifies the type of machine for which the library file should be -built. @code{dlltool} has a built in default type, depending upon how +built. @command{dlltool} has a built in default type, depending upon how it was created, but this option can be used to override that. This is normally only useful when creating DLLs for an ARM processor, when the -contents of the DLL are actually encode using THUMB instructions. +contents of the DLL are actually encode using Thumb instructions. @item -a @itemx --add-indirect -Specifies that when @code{dlltool} is creating the exports file it +Specifies that when @command{dlltool} is creating the exports file it should add a section which allows the exported functions to be referenced without using the import library. Whatever the hell that means! @item -U @itemx --add-underscore -Specifies that when @code{dlltool} is creating the exports file it +Specifies that when @command{dlltool} is creating the exports file it should prepend an underscore to the names of the exported functions. @item -k @itemx --kill-at -Specifies that when @code{dlltool} is creating the exports file it +Specifies that when @command{dlltool} is creating the exports file it should not append the string @samp{@@ }. These numbers are called ordinal numbers and they represent another way of accessing the function in a DLL, other than by name. @item -A @itemx --add-stdcall-alias -Specifies that when @code{dlltool} is creating the exports file it +Specifies that when @command{dlltool} is creating the exports file it should add aliases for stdcall symbols without @samp{@@ } in addition to the symbols with @samp{@@ }. @item -x @itemx --no-idata4 -Specifies that when @code{dlltool} is creating the exports and library -files it should omit the .idata4 section. This is for compatibility +Specifies that when @command{dlltool} is creating the exports and library +files it should omit the @code{.idata4} section. This is for compatibility with certain operating systems. @item -c @itemx --no-idata5 -Specifies that when @code{dlltool} is creating the exports and library -files it should omit the .idata5 section. This is for compatibility +Specifies that when @command{dlltool} is creating the exports and library +files it should omit the @code{.idata5} section. This is for compatibility with certain operating systems. @item -i @itemx --interwork -Specifies that @code{dlltool} should mark the objects in the library +Specifies that @command{dlltool} should mark the objects in the library file and exports file that it produces as supporting interworking -between ARM and THUMB code. +between ARM and Thumb code. @item -n @itemx --nodelete -Makes @code{dlltool} preserve the temporary assembler files it used to +Makes @command{dlltool} preserve the temporary assembler files it used to create the exports file. If this option is repeated then dlltool will also preserve the temporary object files it uses to create the library file. @@ -2772,34 +2801,34 @@ the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS readelf -readelf [ -a | --all ] - [ -h | --file-header] - [ -l | --program-headers | --segments] - [ -S | --section-headers | --sections] - [ -e | --headers] - [ -s | --syms | --symbols] - [ -n | --notes] - [ -r | --relocs] - [ -u | --unwind] - [ -d | --dynamic] - [ -V | --version-info] - [ -D | --use-dynamic] - [ -x | --hex-dump=] - [ -w[liaprmf] | --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames]] - [ --histogram] - [ -v | --version] - [ -H | --help] +readelf [@option{-a}|@option{--all}] + [@option{-h}|@option{--file-header}] + [@option{-l}|@option{--program-headers}|@option{--segments}] + [@option{-S}|@option{--section-headers}|@option{--sections}] + [@option{-e}|@option{--headers}] + [@option{-s}|@option{--syms}|@option{--symbols}] + [@option{-n}|@option{--notes}] + [@option{-r}|@option{--relocs}] + [@option{-u}|@option{--unwind}] + [@option{-d}|@option{--dynamic}] + [@option{-V}|@option{--version-info}] + [@option{-D}|@option{--use-dynamic}] + [@option{-x} |@option{--hex-dump=}] + [@option{-w[liaprmf]}|@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames]] + [@option{-histogram}] + [@option{-v}|@option{--version}] + [@option{-H}|@option{--help}] @var{elffile}@dots{} @c man end @end smallexample @c man begin DESCRIPTION readelf -@code{readelf} displays information about one or more ELF format object +@command{readelf} displays information about one or more ELF format object files. The options control what particular information to display. @var{elffile}@dots{} are the object files to be examined. At the -moment, @code{readelf} does not support examining archives, nor does it +moment, @command{readelf} does not support examining archives, nor does it support examing 64 bit ELF files. @c man end @@ -2810,13 +2839,13 @@ The long and short forms of options, sho equivalent. At least one option besides @samp{-v} or @samp{-H} must be given. -@table @code +@table @env @item -a @itemx --all -Equivalent to specifiying @samp{--file-header}, -@samp{--program-headers}, @samp{--sections}, @samp{--symbols}, -@samp{--relocs}, @samp{--dynamic}, @samp{--notes} and -@samp{--version-info}. +Equivalent to specifiying @option{--file-header}, +@option{--program-headers}, @option{--sections}, @option{--symbols}, +@option{--relocs}, @option{--dynamic}, @option{--notes} and +@option{--version-info}. @item -h @itemx --file-header @@ -2847,7 +2876,7 @@ Displays the entries in symbol table sec @item -e @itemx --headers -Display all the headers in the file. Equivalent to @samp{-h -l -S}. +Display all the headers in the file. Equivalent to @option{-h -l -S}. @item -n @itemx --notes @@ -2878,7 +2907,7 @@ exist. @item -D @itemx --use-dynamic -When displaying symbols, this option makes @code{readelf} use the +When displaying symbols, this option makes @command{readelf} use the symbol table in the file's dynamic section, rather than the one in the symbols section. @@ -2902,7 +2931,7 @@ Display the version number of readelf. @item -H @itemx --help -Display the command line options understood by @code{readelf}. +Display the command line options understood by @command{readelf}. @end table @@ -2937,7 +2966,7 @@ listed later. The commands to list valid values only list the values for which the programs you are running were configured. If they were configured with -@samp{--enable-targets=all}, the commands list most of the available +@option{--enable-targets=all}, the commands list most of the available values, but a few are left out; not all targets can be configured in at once because some of them can only be configured @dfn{native} (on hosts with the same type as the target system). @@ -2972,13 +3001,13 @@ sources. Some sample configuration triplets are: @samp{m68k-hp-bsd}, @samp{mips-dec-ultrix}, @samp{sparc-sun-sunos}. -@subheading @code{objdump} Target +@subheading @command{objdump} Target Ways to specify: @enumerate @item -command line option: @samp{-b} or @samp{--target} +command line option: @option{-b} or @option{--target} @item environment variable @code{GNUTARGET} @@ -2987,13 +3016,13 @@ environment variable @code{GNUTARGET} deduced from the input file @end enumerate -@subheading @code{objcopy} and @code{strip} Input Target +@subheading @command{objcopy} and @command{strip} Input Target Ways to specify: @enumerate @item -command line options: @samp{-I} or @samp{--input-target}, or @samp{-F} or @samp{--target} +command line options: @option{-I} or @option{--input-target}, or @option{-F} or @option{--target} @item environment variable @code{GNUTARGET} @@ -3002,16 +3031,16 @@ environment variable @code{GNUTARGET} deduced from the input file @end enumerate -@subheading @code{objcopy} and @code{strip} Output Target +@subheading @command{objcopy} and @command{strip} Output Target Ways to specify: @enumerate @item -command line options: @samp{-O} or @samp{--output-target}, or @samp{-F} or @samp{--target} +command line options: @option{-O} or @option{--output-target}, or @option{-F} or @option{--target} @item -the input target (see ``@code{objcopy} and @code{strip} Input Target'' above) +the input target (see ``@command{objcopy} and @command{strip} Input Target'' above) @item environment variable @code{GNUTARGET} @@ -3020,13 +3049,13 @@ environment variable @code{GNUTARGET} deduced from the input file @end enumerate -@subheading @code{nm}, @code{size}, and @code{strings} Target +@subheading @command{nm}, @command{size}, and @command{strings} Target Ways to specify: @enumerate @item -command line option: @samp{--target} +command line option: @option{--target} @item environment variable @code{GNUTARGET} @@ -3041,7 +3070,7 @@ Ways to specify: @enumerate @item -command line option: @samp{-b} or @samp{--format} +command line option: @option{-b} or @option{--format} (@pxref{Options,,Options,ld.info,Using LD}) @item @@ -3063,7 +3092,7 @@ Ways to specify: @enumerate @item -command line option: @samp{-oformat} +command line option: @option{-oformat} (@pxref{Options,,Options,ld.info,Using LD}) @item @@ -3086,19 +3115,19 @@ second column contains the relevant info Sample values: @samp{m68k:68020}, @samp{mips:3000}, @samp{sparc}. -@subheading @code{objdump} Architecture +@subheading @command{objdump} Architecture Ways to specify: @enumerate @item -command line option: @samp{-m} or @samp{--architecture} +command line option: @option{-m} or @option{--architecture} @item deduced from the input file @end enumerate -@subheading @code{objcopy}, @code{nm}, @code{size}, @code{strings} Architecture +@subheading @command{objcopy}, @command{nm}, @command{size}, @command{strings} Architecture Ways to specify: @@ -3157,7 +3186,7 @@ Ways to specify: @enumerate @item -command line option: @samp{-m} +command line option: @option{-m} (@pxref{Options,,Options,ld.info,Using LD}) @item @@ -3258,7 +3287,7 @@ To enable us to fix the bug, you should @itemize @bullet @item The version of the utility. Each utility announces it if you start it -with the @samp{--version} argument. +with the @option{--version} argument. Without this, we will not know whether there is any point in looking for the bug in the current version of the binary utilities. @@ -3293,11 +3322,11 @@ sending very large files to it. Making anonymous FTP is OK. If the source files were produced exclusively using @sc{gnu} programs -(e.g., @code{gcc}, @code{gas}, and/or the @sc{gnu} @code{ld}), then it +(e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it may be OK to send the source files rather than the object files. In -this case, be sure to say exactly what version of @code{gcc}, or +this case, be sure to say exactly what version of @command{gcc}, or whatever, was used to produce the object files. Also say how -@code{gcc}, or whatever, was configured. +@command{gcc}, or whatever, was configured. @item A description of what behavior you observe that you believe is @@ -3319,9 +3348,9 @@ to draw any conclusion from our observat @item If you wish to suggest changes to the source, send us context diffs, as -generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p} +generated by @command{diff} with the @option{-u}, @option{-c}, or @option{-p} option. Always send diffs from the old file to the new file. If you -wish to discuss something in the @code{ld} source, refer to it by +wish to discuss something in the @command{ld} source, refer to it by context, not by line number. The line numbers in our development sources will not match those in your diff -Nupr binutils-2.11.90.0.25/binutils/nm.c binutils-2.11.90.0.27/binutils/nm.c --- binutils-2.11.90.0.25/binutils/nm.c Fri Apr 13 11:47:25 2001 +++ binutils-2.11.90.0.27/binutils/nm.c Fri Aug 10 14:08:01 2001 @@ -152,7 +152,7 @@ print_symbol_filename_posix PARAMS ((bfd static void -print_value PARAMS ((bfd_vma)); +print_value PARAMS ((bfd *, bfd_vma)); static void print_symbol_info_bsd PARAMS ((symbol_info * info, bfd * abfd)); @@ -1438,7 +1438,8 @@ print_symbol_filename_posix (archive_bfd /* Print a symbol value. */ static void -print_value (val) +print_value (abfd, val) + bfd *abfd; bfd_vma val; { #if ! defined (BFD64) || BFD_HOST_64BIT_LONG @@ -1446,7 +1447,7 @@ print_value (val) #else /* We have a 64 bit value to print, but the host is only 32 bit. */ if (print_radix == 16) - fprintf_vma (stdout, val); + bfd_fprintf_vma (abfd, stdout, val); else { char buf[30]; @@ -1481,7 +1482,7 @@ print_symbol_info_bsd (info, abfd) printf (" "); } else - print_value (info->value); + print_value (abfd, info->value); printf (" %c", info->type); if (info->type == '-') { @@ -1504,7 +1505,7 @@ print_symbol_info_sysv (info, abfd) if (bfd_is_undefined_symclass (info->type)) printf (" "); /* Value */ else - print_value (info->value); + print_value (abfd, info->value); printf ("| %c |", info->type); /* Class */ if (info->type == '-') { @@ -1527,7 +1528,7 @@ print_symbol_info_posix (info, abfd) if (bfd_is_undefined_symclass (info->type)) printf (" "); else - print_value (info->value); + print_value (abfd, info->value); /* POSIX.2 wants the symbol size printed here, when applicable; BFD currently doesn't provide it, so we take the easy way out by considering it to never be applicable. */ diff -Nupr binutils-2.11.90.0.25/binutils/objcopy.c binutils-2.11.90.0.27/binutils/objcopy.c --- binutils-2.11.90.0.25/binutils/objcopy.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/binutils/objcopy.c Sat Aug 4 19:52:15 2001 @@ -48,6 +48,18 @@ struct redefine_node struct redefine_node *next; }; +typedef struct section_rename +{ + const char * old_name; + const char * new_name; + flagword flags; + struct section_rename * next; +} +section_rename; + +/* List of sections to be renamed. */ +static section_rename * section_rename_list; + static void copy_usage PARAMS ((FILE *, int)); static void strip_usage PARAMS ((FILE *, int)); static flagword parse_flags PARAMS ((const char *)); @@ -73,6 +85,8 @@ static int strip_main PARAMS ((int, char static int copy_main PARAMS ((int, char **)); static const char *lookup_sym_redefinition PARAMS((const char *)); static void redefine_list_append PARAMS ((const char *, const char *)); +static const char * find_section_rename PARAMS ((bfd *, sec_ptr, flagword *)); +static void add_section_rename PARAMS ((const char *, const char *, flagword)); #define RETURN_NONFATAL(s) {bfd_nonfatal (s); status = 1; return;} @@ -134,7 +148,11 @@ struct section_list }; static struct section_list *change_sections; + +/* True if some sections are to be removed. */ static boolean sections_removed; + +/* True if only some sections are to be copied. */ static boolean sections_copied; /* Changes to the start address. */ @@ -154,7 +172,6 @@ static boolean pad_to_set = false; static bfd_vma pad_to; /* List of sections to add. */ - struct section_add { /* Next section to add. */ @@ -171,23 +188,20 @@ struct section_add asection *section; }; +/* List of sections to add to the output BFD. */ static struct section_add *add_sections; /* Whether to convert debugging information. */ - static boolean convert_debugging = false; /* Whether to change the leading character in symbol names. */ - static boolean change_leading_char = false; /* Whether to remove the leading character from global symbol names. */ - static boolean remove_leading_char = false; /* List of symbols to strip, keep, localize, keep-global, weaken, or redefine. */ - static struct symlist *strip_specific_list = NULL; static struct symlist *keep_specific_list = NULL; static struct symlist *localize_specific_list = NULL; @@ -196,7 +210,6 @@ static struct symlist *weaken_specific_l static struct redefine_node *redefine_sym_list = NULL; /* If this is true, we weaken global symbols (set BSF_WEAK). */ - static boolean weaken = false; /* 150 isn't special; it's just an arbitrary non-ASCII char value. */ @@ -226,6 +239,7 @@ static boolean weaken = false; #define OPTION_LOCALIZE_SYMBOLS (OPTION_KEEP_SYMBOLS + 1) #define OPTION_KEEPGLOBAL_SYMBOLS (OPTION_LOCALIZE_SYMBOLS + 1) #define OPTION_WEAKEN_SYMBOLS (OPTION_KEEPGLOBAL_SYMBOLS + 1) +#define OPTION_RENAME_SECTION (OPTION_WEAKEN_SYMBOLS + 1) /* Options to handle if running as "strip". */ @@ -292,6 +306,7 @@ static struct option copy_options[] = {"keep-global-symbol", required_argument, 0, 'G'}, {"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR}, {"remove-section", required_argument, 0, 'R'}, + {"rename-section", required_argument, 0, OPTION_RENAME_SECTION}, {"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS}, {"set-start", required_argument, 0, OPTION_SET_START}, {"strip-all", no_argument, 0, 'S'}, @@ -334,6 +349,7 @@ extern boolean S3Forced; /* Defined in bfd/binary.c. Used to set architecture of input binary files. */ extern enum bfd_architecture bfd_external_binary_architecture; + static void copy_usage (stream, exit_status) FILE *stream; @@ -381,6 +397,7 @@ copy_usage (stream, exit_status) --set-section-flags =\n\ Set section 's properties to \n\ --add-section = Add section found in to output\n\ + --rename-section =[,] Rename section to \n\ --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ --redefine-sym = Redefine symbol name to \n\ @@ -666,10 +683,9 @@ is_specified_symbol (name, list) struct symlist *tmp_list; for (tmp_list = list; tmp_list; tmp_list = tmp_list->next) - { - if (strcmp (name, tmp_list->name) == 0) - return true; - } + if (strcmp (name, tmp_list->name) == 0) + return true; + return false; } @@ -832,27 +848,22 @@ filter_symbols (abfd, obfd, osyms, isyms return dst_count; } +/* Find the redefined name of symbol SOURCE. */ + static const char * lookup_sym_redefinition (source) const char *source; { - const char *result; struct redefine_node *list; - result = source; - for (list = redefine_sym_list; list != NULL; list = list->next) - { - if (strcmp (source, list->source) == 0) - { - result = list->target; - break; - } - } - return result; + if (strcmp (source, list->source) == 0) + return list->target; + + return source; } -/* Add a node to a symbol redefine list */ +/* Add a node to a symbol redefine list. */ static void redefine_list_append (source, target) @@ -866,18 +877,14 @@ redefine_list_append (source, target) for (p = &redefine_sym_list; (list = *p) != NULL; p = &list->next) { if (strcmp (source, list->source) == 0) - { - fatal (_("%s: Multiple redefinition of symbol \"%s\""), - "--redefine-sym", - source); - } + fatal (_("%s: Multiple redefinition of symbol \"%s\""), + "--redefine-sym", + source); if (strcmp (target, list->target) == 0) - { - fatal (_("%s: Symbol \"%s\" is target of more than one redefinition"), - "--redefine-sym", - target); - } + fatal (_("%s: Symbol \"%s\" is target of more than one redefinition"), + "--redefine-sym", + target); } new_node = (struct redefine_node *) xmalloc (sizeof (struct redefine_node)); @@ -889,7 +896,6 @@ redefine_list_append (source, target) *p = new_node; } - /* Keep only every `copy_byte'th byte in MEMHUNK, which is *SIZE bytes long. Adjust *SIZE. */ @@ -902,6 +908,7 @@ filter_bytes (memhunk, size) for (; from < end; from += interleave) *to++ = *from; + if (*size % interleave > (bfd_size_type) copy_byte) *size = (*size / interleave) + 1; else @@ -951,7 +958,7 @@ copy_object (ibfd, obfd) & bfd_applicable_file_flags (obfd)))) RETURN_NONFATAL (bfd_get_filename (ibfd)); - /* Copy architecture of input file to output file */ + /* Copy architecture of input file to output file. */ if (!bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd))) non_fatal (_("Warning: Output file cannot represent architecture %s"), @@ -1107,8 +1114,8 @@ copy_object (ibfd, obfd) } } - /* Symbol filtering must happen after the output sections have - been created, but before their contents are set. */ + /* Symbol filtering must happen after the output sections + have been created, but before their contents are set. */ dhandle = NULL; symsize = bfd_get_symtab_upper_bound (ibfd); if (symsize < 0) @@ -1189,7 +1196,6 @@ copy_object (ibfd, obfd) int c, i; /* Fill in the gaps. */ - if (max_gap > 8192) max_gap = 8192; buf = (bfd_byte *) xmalloc (max_gap); @@ -1205,6 +1211,7 @@ copy_object (ibfd, obfd) left = gaps[i]; off = bfd_section_size (obfd, osections[i]) - left; + while (left > 0) { bfd_size_type now; @@ -1229,7 +1236,7 @@ copy_object (ibfd, obfd) from the input BFD to the output BFD. This is done last to permit the routine to look at the filtered symbol table, which is important for the ECOFF code at least. */ - if (!bfd_copy_private_bfd_data (ibfd, obfd)) + if (! bfd_copy_private_bfd_data (ibfd, obfd)) { non_fatal (_("%s: error copying private BFD data: %s"), bfd_get_filename (obfd), @@ -1273,6 +1280,7 @@ copy_archive (ibfd, obfd, output_target) list = NULL; this_element = bfd_openr_next_archived_file (ibfd, NULL); + while (!status && this_element != (bfd *) NULL) { /* Create an output file for this member. */ @@ -1286,6 +1294,7 @@ copy_archive (ibfd, obfd, output_target) if (preserve_dates) { stat_status = bfd_stat_arch_elt (this_element, &buf); + if (stat_status != 0) non_fatal (_("internal stat error on %s"), bfd_get_filename (this_element)); @@ -1360,7 +1369,6 @@ copy_file (input_filename, output_filena /* To allow us to do "strip *" without dying on the first non-object file, failures are nonfatal. */ - ibfd = bfd_openr (input_filename, input_target); if (ibfd == NULL) RETURN_NONFATAL (input_filename); @@ -1415,8 +1423,68 @@ copy_file (input_filename, output_filena } } -/* Create a section in OBFD with the same name and attributes - as ISECTION in IBFD. */ +/* Add a name to the section renaming list. */ + +static void +add_section_rename (old_name, new_name, flags) + const char * old_name; + const char * new_name; + flagword flags; +{ + section_rename * rename; + + /* Check for conflicts first. */ + for (rename = section_rename_list; rename != NULL; rename = rename->next) + if (strcmp (rename->old_name, old_name) == 0) + { + /* Silently ignore duplicate definitions. */ + if (strcmp (rename->new_name, new_name) == 0 + && rename->flags == flags) + return; + + fatal (_("Multiple renames of section %s"), old_name); + } + + rename = (section_rename *) xmalloc (sizeof (* rename)); + + rename->old_name = old_name; + rename->new_name = new_name; + rename->flags = flags; + rename->next = section_rename_list; + + section_rename_list = rename; +} + +/* Check the section rename list for a new name of the input section + ISECTION. Return the new name if one is found. + Also set RETURNED_FLAGS to the flags to be used for this section. */ + +static const char * +find_section_rename (ibfd, isection, returned_flags) + bfd * ibfd ATTRIBUTE_UNUSED; + sec_ptr isection; + flagword * returned_flags; +{ + const char * old_name = bfd_section_name (ibfd, isection); + section_rename * rename; + + /* Default to using the flags of the input section. */ + * returned_flags = bfd_get_section_flags (ibfd, isection); + + for (rename = section_rename_list; rename != NULL; rename = rename->next) + if (strcmp (rename->old_name, old_name) == 0) + { + if (rename->flags != (flagword) -1) + * returned_flags = rename->flags; + + return rename->new_name; + } + + return old_name; +} + +/* Create a section in OBFD with the same + name and attributes as ISECTION in IBFD. */ static void setup_section (ibfd, isection, obfdarg) @@ -1432,7 +1500,8 @@ setup_section (ibfd, isection, obfdarg) bfd_vma lma; flagword flags; const char *err; - + const char * name; + if ((bfd_get_section_flags (ibfd, isection) & SEC_DEBUGGING) != 0 && (strip_symbols == STRIP_DEBUG || strip_symbols == STRIP_UNNEEDED @@ -1450,7 +1519,10 @@ setup_section (ibfd, isection, obfdarg) if (sections_copied && (p == NULL || ! p->copy)) return; - osection = bfd_make_section_anyway (obfd, bfd_section_name (ibfd, isection)); + /* Get the, possibly new, name of the output section. */ + name = find_section_rename (ibfd, isection, & flags); + + osection = bfd_make_section_anyway (obfd, name); if (osection == NULL) { @@ -1507,7 +1579,6 @@ setup_section (ibfd, isection, obfdarg) goto loser; } - flags = bfd_get_section_flags (ibfd, isection); if (p != NULL && p->set_flags) flags = p->flags | (flags & SEC_HAS_CONTENTS); if (!bfd_set_section_flags (obfd, osection, flags)) @@ -1530,7 +1601,7 @@ setup_section (ibfd, isection, obfdarg) goto loser; } - /* All went well */ + /* All went well. */ return; loser: @@ -1559,8 +1630,8 @@ copy_section (ibfd, isection, obfdarg) bfd_size_type size; long relsize; - /* If we have already failed earlier on, do not keep on generating - complaints now. */ + /* If we have already failed earlier on, + do not keep on generating complaints now. */ if (status != 0) return; @@ -1901,7 +1972,8 @@ strip_main (argc, argv) show_version = true; break; case 0: - break; /* we've been given a long option */ + /* We've been given a long option. */ + break; case 'h': strip_usage (stdout, 0); default: @@ -2268,9 +2340,7 @@ copy_main (argc, argv) s = strchr (optarg, '='); if (s == NULL) - { - fatal (_("bad format for %s"), "--redefine-sym"); - } + fatal (_("bad format for %s"), "--redefine-sym"); len = s - optarg; source = (char *) xmalloc (len + 1); @@ -2311,6 +2381,54 @@ copy_main (argc, argv) } break; + case OPTION_RENAME_SECTION: + { + flagword flags; + const char * s; + char * old_name; + char * new_name; + unsigned int len; + + s = strchr (optarg, '='); + if (s == NULL) + fatal (_("bad format for %s"), "--rename-section"); + + len = s - optarg; + if (len == 0) + fatal (_("no old name is %s"), "--rename-section"); + + old_name = (char *) xmalloc (len + 1); + strncpy (old_name, optarg, len); + old_name[len] = 0; + + s = strchr (optarg + len, ','); + if (s) + { + unsigned int new_len; + + flags = parse_flags (s + 1); + new_len = s - (optarg + len); + if (new_len == 0) + fatal (_("no new name in %s"), "--rename-section"); + new_name = (char *) xmalloc (new_len + 1); + strncpy (new_name, optarg + len, new_len); + new_name [new_len] = 0; + } + else + { + s = optarg + len; + len = strlen (s); + if (len == 0) + fatal (_("no new name in %s"), "--rename-section"); + new_name = (char *) xmalloc (len + 1); + strcpy (new_name, s); + flags = -1; + } + + add_section_rename (old_name, new_name, flags); + } + break; + case OPTION_SET_START: set_start = parse_vma (optarg, "--set-start"); set_start_set = true; @@ -2419,6 +2537,7 @@ copy_main (argc, argv) else { copy_file (input_filename, output_filename, input_target, output_target); + if (status == 0 && preserve_dates) set_times (output_filename, &statbuf); } diff -Nupr binutils-2.11.90.0.25/binutils/objdump.c binutils-2.11.90.0.27/binutils/objdump.c --- binutils-2.11.90.0.25/binutils/objdump.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/objdump.c Fri Aug 10 14:08:01 2001 @@ -108,113 +108,53 @@ static long dynsymcount = 0; /* Static declarations. */ -static void -usage PARAMS ((FILE *, int)); - -static void -nonfatal PARAMS ((const char *)); - -static void -display_file PARAMS ((char *filename, char *target)); - -static void -dump_section_header PARAMS ((bfd *, asection *, PTR)); - -static void -dump_headers PARAMS ((bfd *)); - -static void -dump_data PARAMS ((bfd *abfd)); - -static void -dump_relocs PARAMS ((bfd *abfd)); - -static void -dump_dynamic_relocs PARAMS ((bfd * abfd)); - -static void -dump_reloc_set PARAMS ((bfd *, asection *, arelent **, long)); - -static void -dump_symbols PARAMS ((bfd *abfd, boolean dynamic)); - -static void -dump_bfd_header PARAMS ((bfd *)); - -static void -dump_bfd_private_header PARAMS ((bfd *)); - -static void -display_bfd PARAMS ((bfd *abfd)); - -static void -display_target_list PARAMS ((void)); - -static void -display_info_table PARAMS ((int, int)); - -static void -display_target_tables PARAMS ((void)); - -static void -display_info PARAMS ((void)); - -static void -objdump_print_value PARAMS ((bfd_vma, struct disassemble_info *, boolean)); - -static void -objdump_print_symname PARAMS ((bfd *, struct disassemble_info *, asymbol *)); - -static asymbol * -find_symbol_for_address PARAMS ((bfd *, asection *, bfd_vma, boolean, long *)); - -static void -objdump_print_addr_with_sym PARAMS ((bfd *, asection *, asymbol *, bfd_vma, - struct disassemble_info *, boolean)); - -static void -objdump_print_addr PARAMS ((bfd_vma, struct disassemble_info *, boolean)); - -static void -objdump_print_address PARAMS ((bfd_vma, struct disassemble_info *)); - -static void -show_line PARAMS ((bfd *, asection *, bfd_vma)); - -static void -disassemble_bytes PARAMS ((struct disassemble_info *, disassembler_ftype, - boolean, bfd_byte *, bfd_vma, bfd_vma, - arelent ***, arelent **)); - -static void -disassemble_data PARAMS ((bfd *)); - -static const char * -endian_string PARAMS ((enum bfd_endian)); - -static asymbol ** -slurp_symtab PARAMS ((bfd *)); - -static asymbol ** -slurp_dynamic_symtab PARAMS ((bfd *)); - -static long -remove_useless_symbols PARAMS ((asymbol **, long)); - -static int -compare_symbols PARAMS ((const PTR, const PTR)); - -static int -compare_relocs PARAMS ((const PTR, const PTR)); - -static void -dump_stabs PARAMS ((bfd *)); - -static boolean -read_section_stabs PARAMS ((bfd *, const char *, const char *)); - -static void -print_section_stabs PARAMS ((bfd *, const char *, const char *)); +static void usage PARAMS ((FILE *, int)); +static void nonfatal PARAMS ((const char *)); +static void display_file PARAMS ((char *filename, char *target)); +static void dump_section_header PARAMS ((bfd *, asection *, PTR)); +static void dump_headers PARAMS ((bfd *)); +static void dump_data PARAMS ((bfd *abfd)); +static void dump_relocs PARAMS ((bfd *abfd)); +static void dump_dynamic_relocs PARAMS ((bfd * abfd)); +static void dump_reloc_set PARAMS ((bfd *, asection *, arelent **, long)); +static void dump_symbols PARAMS ((bfd *abfd, boolean dynamic)); +static void dump_bfd_header PARAMS ((bfd *)); +static void dump_bfd_private_header PARAMS ((bfd *)); +static void dump_bfd PARAMS ((bfd *)); +static void display_bfd PARAMS ((bfd *abfd)); +static void display_target_list PARAMS ((void)); +static void display_info_table PARAMS ((int, int)); +static void display_target_tables PARAMS ((void)); +static void display_info PARAMS ((void)); +static void objdump_print_value + PARAMS ((bfd_vma, struct disassemble_info *, boolean)); +static void objdump_print_symname + PARAMS ((bfd *, struct disassemble_info *, asymbol *)); +static asymbol *find_symbol_for_address + PARAMS ((bfd *, asection *, bfd_vma, boolean, long *)); +static void objdump_print_addr_with_sym + PARAMS ((bfd *, asection *, asymbol *, bfd_vma, + struct disassemble_info *, boolean)); +static void objdump_print_addr + PARAMS ((bfd_vma, struct disassemble_info *, boolean)); +static void objdump_print_address + PARAMS ((bfd_vma, struct disassemble_info *)); +static int objdump_symbol_at_address + PARAMS ((bfd_vma, struct disassemble_info *)); +static void show_line PARAMS ((bfd *, asection *, bfd_vma)); +static void disassemble_bytes + PARAMS ((struct disassemble_info *, disassembler_ftype, boolean, + bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **)); +static void disassemble_data PARAMS ((bfd *)); +static const char *endian_string PARAMS ((enum bfd_endian)); +static asymbol ** slurp_symtab PARAMS ((bfd *)); +static asymbol ** slurp_dynamic_symtab PARAMS ((bfd *)); +static long remove_useless_symbols PARAMS ((asymbol **, long)); +static int compare_symbols PARAMS ((const PTR, const PTR)); +static int compare_relocs PARAMS ((const PTR, const PTR)); +static void dump_stabs PARAMS ((bfd *)); +static boolean read_section_stabs PARAMS ((bfd *, const char *, const char *)); +static void print_section_stabs PARAMS ((bfd *, const char *, const char *)); static void usage (stream, status) @@ -268,6 +208,7 @@ usage (stream, status) --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\ \n"), get_demangler_list ()); list_supported_targets (program_name, stream); + list_supported_architectures (program_name, stream); disassembler_usage (stream); } @@ -345,9 +286,9 @@ dump_section_header (abfd, section, igno printf ("%3d %-13s %08lx ", section->index, bfd_get_section_name (abfd, section), (unsigned long) bfd_section_size (abfd, section) / opb); - printf_vma (bfd_get_section_vma (abfd, section)); + bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section)); printf (" "); - printf_vma (section->lma); + bfd_printf_vma (abfd, section->lma); printf (" %08lx 2**%u", section->filepos, bfd_get_section_alignment (abfd, section)); if (! wide_output) @@ -669,8 +610,10 @@ objdump_print_value (vma, info, skip_zer { char buf[30]; char *p; + struct objdump_disasm_info *aux + = (struct objdump_disasm_info *) info->application_data; - sprintf_vma (buf, vma); + bfd_sprintf_vma (aux->abfd, buf, vma); if (! skip_zeroes) p = buf; else @@ -1280,8 +1223,10 @@ disassemble_bytes (info, disassemble_fn, char buf[30]; char *s; - sprintf_vma (buf, section->vma + - bfd_section_size (section->owner, section) / opb); + bfd_sprintf_vma + (aux->abfd, buf, + (section->vma + + bfd_section_size (section->owner, section) / opb)); s = buf; while (s[0] == '0' && s[1] == '0' && s[2] == '0' && s[3] == '0' && s[4] == '0') @@ -1343,7 +1288,7 @@ disassemble_bytes (info, disassemble_fn, { char *s; - sprintf_vma (buf, section->vma + addr_offset); + bfd_sprintf_vma (aux->abfd, buf, section->vma + addr_offset); for (s = buf + skip_addr_chars; *s == '0'; s++) *s = ' '; if (*s == '\0') @@ -1480,7 +1425,7 @@ disassemble_bytes (info, disassemble_fn, putchar ('\n'); j = addr_offset * opb + pb; - sprintf_vma (buf, section->vma + j / opb); + bfd_sprintf_vma (aux->abfd, buf, section->vma + j / opb); for (s = buf + skip_addr_chars; *s == '0'; s++) *s = ' '; if (*s == '\0') @@ -1737,6 +1682,7 @@ disassemble_data (abfd) disasm_info.buffer = data; disasm_info.buffer_vma = section->vma; disasm_info.buffer_length = datasize; + disasm_info.section = section; if (start_address == (bfd_vma) -1 || start_address < disasm_info.buffer_vma) addr_offset = 0; @@ -2006,7 +1952,7 @@ print_section_stabs (abfd, stabsect_name else printf ("%-6d", type); printf (" %-6d %-6d ", other, desc); - printf_vma (value); + bfd_printf_vma (abfd, value); printf (" %-6lu", strx); /* Symbols with type == 0 (N_UNDF) specify the length of the @@ -2090,7 +2036,7 @@ dump_bfd_header (abfd) PF (D_PAGED, "D_PAGED"); PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE"); printf (_("\nstart address 0x")); - printf_vma (abfd->start_address); + bfd_printf_vma (abfd, abfd->start_address); printf ("\n"); } @@ -2539,7 +2485,7 @@ dump_reloc_set (abfd, sec, relpp, relcou if (width == 0) { char buf[30]; - sprintf_vma (buf, (bfd_vma) -1); + bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); width = strlen (buf) - 7; } printf ("OFFSET %*s TYPE %*s VALUE \n", width, "", 12, ""); @@ -2607,7 +2553,7 @@ dump_reloc_set (abfd, sec, relpp, relcou } if (sym_name) { - printf_vma (q->address); + bfd_printf_vma (abfd, q->address); if (q->howto->name) printf (" %-16s ", q->howto->name); else @@ -2619,7 +2565,7 @@ dump_reloc_set (abfd, sec, relpp, relcou { if (section_name == (CONST char *) NULL) section_name = "*unknown*"; - printf_vma (q->address); + bfd_printf_vma (abfd, q->address); printf (" %-16s [%s]", q->howto->name, section_name); @@ -2627,7 +2573,7 @@ dump_reloc_set (abfd, sec, relpp, relcou if (q->addend) { printf ("+0x"); - printf_vma (q->addend); + bfd_printf_vma (abfd, q->addend); } printf ("\n"); } diff -Nupr binutils-2.11.90.0.25/binutils/readelf.c binutils-2.11.90.0.27/binutils/readelf.c --- binutils-2.11.90.0.25/binutils/readelf.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/binutils/readelf.c Fri Aug 10 14:08:01 2001 @@ -184,8 +184,11 @@ static void dynamic_segmen static void dynamic_segment_parisc_val PARAMS ((Elf_Internal_Dyn *)); static int process_dynamic_segment PARAMS ((FILE *)); static int process_symbol_table PARAMS ((FILE *)); +static int process_syminfo PARAMS ((FILE *)); static int process_section_contents PARAMS ((FILE *)); -static void process_file PARAMS ((char *)); +static void process_mips_fpe_exception PARAMS ((int)); +static int process_mips_specific PARAMS ((FILE *)); +static int process_file PARAMS ((char *)); static int process_relocs PARAMS ((FILE *)); static int process_version_sections PARAMS ((FILE *)); static char * get_ver_flags PARAMS ((unsigned int)); @@ -207,7 +210,9 @@ static int dump_section static int display_debug_section PARAMS ((Elf32_Internal_Shdr *, FILE *)); static int display_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_not_supported PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int prescan_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_lines PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); +static int display_debug_pubnames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_abbrev PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_aranges PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); static int display_debug_frames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); @@ -235,6 +240,7 @@ static int process_note PAR static int process_corefile_note_segment PARAMS ((FILE *, bfd_vma, bfd_vma)); static int process_corefile_note_segments PARAMS ((FILE *)); static int process_corefile_contents PARAMS ((FILE *)); +static int process_arch_specific PARAMS ((FILE *)); typedef int Elf32_Word; @@ -7026,6 +7032,7 @@ display_debug_info (section, start, file { DWARF2_External_CompUnit * external; DWARF2_Internal_CompUnit compunit; + Elf32_Internal_Shdr * relsec; unsigned char * tags; int i; int level; @@ -7038,6 +7045,68 @@ display_debug_info (section, start, file compunit.cu_abbrev_offset = BYTE_GET (external->cu_abbrev_offset); compunit.cu_pointer_size = BYTE_GET (external->cu_pointer_size); + /* Check for RELA relocations in the abbrev_offset address, and + apply them. */ + for (relsec = section_headers; + relsec < section_headers + elf_header.e_shnum; + ++relsec) + { + unsigned long nrelas, nsyms; + Elf_Internal_Rela *rela, *rp; + Elf32_Internal_Shdr *symsec; + Elf_Internal_Sym *symtab; + Elf_Internal_Sym *sym; + + if (relsec->sh_type != SHT_RELA + || section_headers + relsec->sh_info != section) + continue; + + if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size, + & rela, & nrelas)) + return 0; + + symsec = section_headers + relsec->sh_link; + nsyms = symsec->sh_size / symsec->sh_entsize; + symtab = GET_ELF_SYMBOLS (file, symsec->sh_offset, nsyms); + + for (rp = rela; rp < rela + nrelas; ++rp) + { + if (rp->r_offset + != (bfd_vma) ((unsigned char *) &external->cu_abbrev_offset + - section_begin)) + continue; + + if (is_32bit_elf) + { + sym = symtab + ELF32_R_SYM (rp->r_info); + + if (ELF32_ST_TYPE (sym->st_info) != STT_SECTION) + { + warn (_("Skipping unexpected symbol type %u"), + ELF32_ST_TYPE (sym->st_info)); + continue; + } + } + else + { + sym = symtab + ELF64_R_SYM (rp->r_info); + + if (ELF64_ST_TYPE (sym->st_info) != STT_SECTION) + { + warn (_("Skipping unexpected symbol type %u"), + ELF64_ST_TYPE (sym->st_info)); + continue; + } + } + + compunit.cu_abbrev_offset += rp->r_addend; + break; + } + + free (rela); + break; + } + tags = start + sizeof (* external); cu_offset = start - section_begin; start += compunit.cu_length + sizeof (external->cu_length); @@ -7238,6 +7307,10 @@ Frame_Chunk; in the frame info. */ #define DW_CFA_unreferenced (-1) +static void frame_need_space PARAMS ((Frame_Chunk *, int)); +static void frame_display_row PARAMS ((Frame_Chunk *, int *, int *)); +static int size_of_encoded_value PARAMS ((int)); + static void frame_need_space (fc, reg) Frame_Chunk * fc; @@ -8734,7 +8807,7 @@ get_file_header (file) return 1; } -static void +static int process_file (file_name) char * file_name; { @@ -8745,21 +8818,21 @@ process_file (file_name) if (stat (file_name, & statbuf) < 0) { error (_("Cannot stat input file %s.\n"), file_name); - return; + return 1; } file = fopen (file_name, "rb"); if (file == NULL) { error (_("Input file %s not found.\n"), file_name); - return; + return 1; } if (! get_file_header (file)) { error (_("%s: Failed to read file header\n"), file_name); fclose (file); - return; + return 1; } /* Initialise per file variables. */ @@ -8776,7 +8849,7 @@ process_file (file_name) if (! process_file_header ()) { fclose (file); - return; + return 1; } process_section_headers (file); @@ -8834,6 +8907,8 @@ process_file (file_name) free (dynamic_syminfo); dynamic_syminfo = NULL; } + + return 0; } #ifdef SUPPORT_DISASSEMBLY @@ -8860,6 +8935,8 @@ main (argc, argv) int argc; char ** argv; { + int err; + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif @@ -8871,11 +8948,12 @@ main (argc, argv) if (optind < (argc - 1)) show_name = 1; + err = 0; while (optind < argc) - process_file (argv [optind ++]); + err |= process_file (argv [optind ++]); if (dump_sects != NULL) free (dump_sects); - return 0; + return err; } diff -Nupr binutils-2.11.90.0.25/binutils/testsuite/ChangeLog binutils-2.11.90.0.27/binutils/testsuite/ChangeLog --- binutils-2.11.90.0.25/binutils/testsuite/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/testsuite/ChangeLog Sat Aug 4 19:52:15 2001 @@ -1,3 +1,8 @@ +2001-07-27 H.J. Lu + + * binutils-all/windres/windres.exp: Don't set xfail for + bmpalign (compare) on none-ix86/pe targets. + 2001-07-24 H.J. Lu * binutils-all/windres/windres.exp: Set xfail on none-ix86/pe diff -Nupr binutils-2.11.90.0.25/binutils/testsuite/ChangeLog.linux binutils-2.11.90.0.27/binutils/testsuite/ChangeLog.linux --- binutils-2.11.90.0.25/binutils/testsuite/ChangeLog.linux Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/testsuite/ChangeLog.linux Sat Aug 4 19:52:15 2001 @@ -1,3 +1,10 @@ +2001-08-04 H.J. Lu + + * binutils-all/windres/bmp1.bmp.uu: Removed. + + * binutils-all/windres/windres.exp: Don't run on any + none-ix86/pe targets. + 2001-07-25 H.J. Lu * binutils-all/windres/bmp1.bmp.uu: New. Uunecoded from Binary files binutils-2.11.90.0.25/binutils/testsuite/binutils-all/windres/bmp1.bmp and binutils-2.11.90.0.27/binutils/testsuite/binutils-all/windres/bmp1.bmp differ diff -Nupr binutils-2.11.90.0.25/binutils/testsuite/binutils-all/windres/bmp1.bmp.uu binutils-2.11.90.0.27/binutils/testsuite/binutils-all/windres/bmp1.bmp.uu --- binutils-2.11.90.0.25/binutils/testsuite/binutils-all/windres/bmp1.bmp.uu Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/testsuite/binutils-all/windres/bmp1.bmp.uu Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -begin 644 bmp1.bmp -M0DUZ`````````'8````H`````0````$````!``0```````0````````````` -M````````````````````@```@````("``(````"``(``@(```,#`P`"`@(`` -@``#_``#_````__\`_P```/\`_P#__P``____`)`````` -` -end diff -Nupr binutils-2.11.90.0.25/binutils/testsuite/binutils-all/windres/windres.exp binutils-2.11.90.0.27/binutils/testsuite/binutils-all/windres/windres.exp --- binutils-2.11.90.0.25/binutils/testsuite/binutils-all/windres/windres.exp Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils/testsuite/binutils-all/windres/windres.exp Sat Aug 4 19:52:15 2001 @@ -26,6 +26,7 @@ if {![istarget "i*86-*-*"]} { if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ && ![istarget "i*86-*-mingw32*"] } { + return set target_xfail "yes" } else { set target_xfail "no" @@ -39,10 +40,6 @@ if {[which $WINDRES] == 0} then { return } -if {![info exists $srcdir/$subdir/bmp1.bmp]} then { - exec uudecode -o $srcdir/$subdir/bmp1.bmp $srcdir/$subdir/bmp1.bmp.uu -} - set wr "$WINDRES --include-dir $srcdir/$subdir" if [file exists "$srcdir/../../winsup/w32api/include"] { @@ -115,7 +112,7 @@ foreach res $res_list { continue; } - if { "$target_xfail" == "yes" } { + if { "$broot" != "bmpalign" && "$target_xfail" == "yes" } { setup_xfail *-* } diff -Nupr binutils-2.11.90.0.25/binutils.spec binutils-2.11.90.0.27/binutils.spec --- binutils-2.11.90.0.25/binutils.spec Thu Jul 26 18:03:32 2001 +++ binutils-2.11.90.0.27/binutils.spec Fri Aug 10 13:55:09 2001 @@ -9,7 +9,7 @@ Summary: A GNU collection of binary utilities. Name: binutils -Version: 2.11.90.0.25 +Version: 2.11.90.0.27 Release: 1 Copyright: GPL Group: Development/Tools @@ -38,8 +38,7 @@ binary files. Most programmers will wan %ifarch mips mipsel patch -p1 -b --suffix .mips64 < mips/binutils-mips64.patch \ -&& patch -p0 -b --suffix .mips < mips/gas-mips.patch \ -&& patch -p0 -b --suffix .dwarf2 < mips/gas-mips-dwarf2.patch +&& patch -p0 -b --suffix .mips < mips/gas-mips.patch find -name "*.rej" | grep rej && exit 1 %endif diff -Nupr binutils-2.11.90.0.25/binutils.spec.in binutils-2.11.90.0.27/binutils.spec.in --- binutils-2.11.90.0.25/binutils.spec.in Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/binutils.spec.in Sat Aug 4 19:52:15 2001 @@ -38,8 +38,7 @@ binary files. Most programmers will wan %ifarch mips mipsel patch -p1 -b --suffix .mips64 < mips/binutils-mips64.patch \ -&& patch -p0 -b --suffix .mips < mips/gas-mips.patch \ -&& patch -p0 -b --suffix .dwarf2 < mips/gas-mips-dwarf2.patch +&& patch -p0 -b --suffix .mips < mips/gas-mips.patch find -name "*.rej" | grep rej && exit 1 %endif diff -Nupr binutils-2.11.90.0.25/gas/ChangeLog binutils-2.11.90.0.27/gas/ChangeLog --- binutils-2.11.90.0.25/gas/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,199 @@ +2001-08-10 Richard Sandiford + + * config/tc-mips.c (move_register): New function. + (macro_build): Remove OPCODE_IS_MEMBER's gp32 argument. + (mips_ip): Likewise. + (macro2): Use move_register rather than macro_build for moves. + (mips16_macro): Likewise. + (macro): Likewise. Handle M_MOVE. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * as.h (alloca): Don't declare if __GNUC__. Remove an old comment. + Comment indentation of #pragma. + * macro.c (alloca): Likewise. + + * config/tc-ppc.c: Revert 2001-08-08. + +2001-08-09 Alan Modra + + * symbols.c: Add missing prototypes. + * config/e-i386elf.c: Likewise. + * config/e-i386coff.c: Likewise. + * config/e-i386aout.c: Likewise. + * config/obj-coff.c: Likewise. + (def_symbol_in_progress, stack): Move definition. + * config/obj-elf.c: Add missing prototypes. + (obj_elf_change_section): Make static. + (obj_elf_parse_section_letters): Likewise. + (obj_elf_section_word): Likewise. + (obj_elf_section_type): Likewise. + +2001-08-08 Alan Modra + + From 1999-10-25 Torbjorn Granlund + * config/tc-ppc.c (md_apply_fix3): Replace haphazard code for + determining reloc type with code reading operands->reloc field. + +2001-08-08 Alan Modra + + * config/obj-elf.c (elf_copy_symbol_attributes): Make it a global + function, and expand old obj-elf.h OBJ_COPY_SYMBOL_ATTRIBUTES here. + * config/obj-elf.h (elf_copy_symbol_attributes): Declare. + (OBJ_COPY_SYMBOL_ATTRIBUTES): Call elf_copy_symbol_attributes. + + * output-file.c (output_file_create): Don't try to open a second + time as it's unnecessary. FOPEN_W was undefined too. + +2001-08-07 Thiemo Seufer + + * tc-mips.c (macro_build): Replace magic constants by defines. + (mips_ip): Likewise. Typo. + +2001-08-04 Thiemo Seufer + + * tc-mips.c (mips_abi_string): Initialize with NULL instead of 0. + (RELAX_ENCODE): Replace bfd_vma by valueT. + (load_address): Formatting. + (macro): Likewise. Code cleanup. Typo. + (macro2): Formatting. + (md_parse_option): Typo. + (s_mipsset): Reorder cases to look nicer. + (md_estimate_size_before_relax): Formatting. Code cleanup. + (mips_elf_final_processing): Check against NULL instead of 0. + (md_obj_end): Remove ugly `' in message string. + (s_mips_ent): Remove ugly `' in message string. + +2001-07-30 Thiemo Seufer + + * config/tc-mips.c (md_begin): Take -mcpu value into account even when + -mipsX is specified. Make both -mcpu/-march and -mcpu/-mtune pairs + mutually exclusive (if they are different). + (md_parse_option): Warn if an -march/-mtune/-mcpu/-m option is + set more than once. + +2001-08-03 Richard Sandiford + + * config/tc-mips.c (md_apply_fix): Don't subtract the symbol value + from GPREL addends. + +2001-08-02 Richard Sandiford + + * doc/c-mips.tex (-mgp32, -mfp32): Added -mfp32, unified with -mgp32. + * config/tc-mips.c (mips_fp32, mips_32bit_abi): New static variables. + (md_long_opts): Add -mfp32 option. + (md_parse_option): Handle it. Set mips_32bit_abi given -mabi=32. + (md_show_usage): Show usage for -mfp32 and -mgp32. + (HAVE_32BIT_GPRS, HAVE_32BIT_FPRS): New macros. + (HAVE_64BIT_GPRS, HAVE_64BIT_FPRS): New macros, inverse of the above. + (HAVE_32BIT_ADDRESSES): New macro. + (load_register): Use HAVE_32BIT_GPRS to determine the register width. + (load_address): Use HAVE_32BIT_ADDRESSES to determine the address size. + (s_cprestore, s_cpadd): Likewise. + (macro): Use HAVE_32BIT_GPRS to determine the width of registers + used in branch and M_LI_D macros. Use HAVE_64BIT_FPRS to determine + the width registers used in M_LI_DD macros. Use HAVE_32BIT_ADDRESSES + to determine the width of addresses in load, store and jump macros. + (macro2): Use HAVE_32BIT_GPRS to determine the width of registers + used in set instructions; do not check the address size for them. + Use HAVE_32BIT_ADDRESSES to determine the width of addresses in + unaligned load and store macros. + (mips_ip): Use the new macros to check the width of a register when + processing float constants. Force a constant into memory if it is + destined for an FPR and the FPRs are wider than the GPRs. Warn about + odd FPR numbers if HAVE_32BIT_FPRS. Use HAVE_32BIT_GPRS rather + than mips_gp32 to select synthetic instructions. + (macro_build): Use HAVE_32BIT_GPRS rather than mips_gp32 to select + synthetic instructions. + +2001-08-01 Christian Groessler + + * config/tc-z8k.c (parse_reg): If a string starts with "r", "rl", + "rh", "rr", "rq", or "sp" then don't automatically assume + it's a register name. Check whether there is a number + following. + +2001-08-01 Alan Modra + + * config/tc-i386.c (lex_got): Match lower case relocation tokens. + Don't allocate more space than necessary for the input line copy. + +2001-08-01 Alan Modra + + * read.c: Standardize error/warning messages - don't capitalise, no + final period or newline, don't say "ignored" or "zero assumed" for + as_bad messages. In some cases, change the wording to that used + elsewhere for similar messages. + * app.c: Likewise. + * as.c: Likewise. + * atof-generic.c: Likewise. + * cgen.c: Likewise. + * cond.c: Likewise. + * depend.c: Likewise. + * dwarf2dbg.c: Likewise. + * ecoff.c: Likewise. + * expr.c: Likewise. + * frags.c: Likewise. + * input-file.c: Likewise. + * input-scrub.c: Likewise. + * listing.c: Likewise. + * output-file.c: Likewise. + * stabs.c: Likewise. + * subsegs.c: Likewise. + * symbols.c: Likewise. + * write.c: Likewise. + * ecoff.c (ecoff_directive_end): Test for missing name by + comparing input line pointers rather than reading string. + (ecoff_directive_ent): Likewise. + * read.c (s_set): Likewise. + (s_align): Report a warning rather than an error for + alignment too large. + (s_comm): Check for missing symbol name. + (s_lcomm_internal): Likewise. + (s_lsym): Likewise. + (s_globl): Use is_end_of_line instead of looking for '\n'. + (s_lcomm_internal): Likewise. + (ignore_rest_of_line): Report a warning rather than an error. + +2001-07-31 Geoffrey Keating + + * config/tc-ppc.c (ppc_elf_validate_fix): It's OK to have + any kind of relocation against a not-loaded section. + +2001-07-30 Alan Modra + + * config/obj-elf.c (obj_elf_symver): Temporarily modify lex_type + to include '@' in symbol names when parsing versioned symbols + rather than calling get_symbol_end multiple times. + * config/tc-i370.c (register_name): Format fixes. Don't call + get_symbol_end after parsing number. + * config/tc-mn10200.c (data_register_name): Format fixes. Hoist + code out of conditional. + (address_register_name): Likewise. + (other_register_name): Likewise. + * config/tc-mn10300.c (r_register_name): Likewise. + (xr_register_name): Likewise. + (data_register_name): Likewise. + (address_register_name): Likewise. + (other_register_name): Likewise. + * config/tc-ppc.c (register_name): Likewise. + * config/tc-s390.c (register_name): Likewise. + +2001-07-27 Stephane Carrez + + * config/tc-m68hc11.c (md_estimate_size_before_relax): Fix bsr + and bra relax: update fragP->fr_fix after the fixup. + +2001-07-27 Tracy Kuhrt + + * read.c (s_set): Check for missing symbol name. + 2001-07-26 Alan Modra * write.c (relax_segment ): Account for fr_fix. @@ -119,11 +315,6 @@ * configure.in (i386-*-netbsdelf*): New target. * configure: Regenerate. -2001-07-11 Jakub Jelinek - - * testsuite/gas/sparc/unalign.s: Remove .uaxword test. - * testsuite/gas/sparc/unalign.d: Adjust accordingly. - 2001-07-10 Mark Elbrecht * config/obj-coff.c (coff_frob_symbol): Don't merge if the storage @@ -409,7 +600,7 @@ 2001-06-12 Peter Jakubek - * gas/config/tc-m68k.c (parse_mri_control_operand): Fix handling + * config/tc-m68k.c (parse_mri_control_operand): Fix handling of AND/OR. (swap_mri_condition): Add HS (alias fo CC) and LO (alias for CS). (reverse_mri_condition): Likewise. @@ -423,7 +614,7 @@ (s_mri_for): Likewise. (s_mri_if): Fix handling comment ('*') in mri mode. (s_mri_while): Likewise. - * gas/macro.c (macro_expand): Allow macro invocation with empty + * macro.c (macro_expand): Allow macro invocation with empty extension. 2001-06-12 Nick Clifton @@ -520,7 +711,7 @@ 2001-06-06 Peter Jakubek - * gas/config/tc-m68k.c (md_show_usage): Add all supported ColdFire + * config/tc-m68k.c (md_show_usage): Add all supported ColdFire options to list (e.g. m5206e, m5307, m5407). 2001-06-06 Martin Schwidefsky @@ -2614,9 +2805,9 @@ Mon Dec 11 14:35:42 MET 2000 Jan hubick 2000-11-07 Peter Targett - * gas/config/tc-arc.h: Avoid warnings for LITTLE_ENDIAN and + * config/tc-arc.h: Avoid warnings for LITTLE_ENDIAN and BIG_ENDIAN macros. - * gas/config/tc-arc.c: Use S_IS_LOCAL to test local symbols. + * config/tc-arc.c: Use S_IS_LOCAL to test local symbols. Fix compile time warning messages. 2000-11-07 Nick Clifton @@ -4798,7 +4989,7 @@ Thu May 18 10:52:14 2000 Jeffrey A Law 2000-05-03 Mark Elbrecht - * gas/config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 + * config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 for the .bss section too. 2000-05-02 Alan Modra diff -Nupr binutils-2.11.90.0.25/gas/app.c binutils-2.11.90.0.27/gas/app.c --- binutils-2.11.90.0.25/gas/app.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/app.c Sat Aug 4 19:52:15 2001 @@ -566,7 +566,7 @@ do_scrub_chars (get, tostart, tolen) ch = GET (); if (ch == EOF) { - as_warn (_("end of file in string: inserted '\"'")); + as_warn (_("end of file in string; inserted '\"'")); state = old_state; UNGET ('\n'); PUT ('"'); @@ -632,7 +632,7 @@ do_scrub_chars (get, tostart, tolen) break; #if defined(IGNORE_NONSTANDARD_ESCAPES) | defined(ONLY_STANDARD_ESCAPES) default: - as_warn (_("Unknown escape '\\%c' in string: Ignored"), ch); + as_warn (_("unknown escape '\\%c' in string; ignored"), ch); break; #else /* ONLY_STANDARD_ESCAPES */ default: @@ -641,7 +641,7 @@ do_scrub_chars (get, tostart, tolen) #endif /* ONLY_STANDARD_ESCAPES */ case EOF: - as_warn (_("End of file in string: '\"' inserted")); + as_warn (_("end of file in string; '\"' inserted")); PUT ('"'); continue; } @@ -1004,7 +1004,7 @@ do_scrub_chars (get, tostart, tolen) if ((ch = GET ()) != '\'') { #ifdef REQUIRE_CHAR_CLOSE_QUOTE - as_warn (_("Missing close quote: (assumed)")); + as_warn (_("missing close quote; (assumed)")); #else if (ch != EOF) UNGET (ch); @@ -1136,7 +1136,7 @@ do_scrub_chars (get, tostart, tolen) while (ch != EOF && !IS_NEWLINE (ch)) ch = GET (); if (ch == EOF) - as_warn (_("EOF in Comment: Newline inserted")); + as_warn (_("end of file in comment; newline inserted")); state = 0; PUT ('\n'); break; diff -Nupr binutils-2.11.90.0.25/gas/as.c binutils-2.11.90.0.27/gas/as.c --- binutils-2.11.90.0.25/gas/as.c Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/as.c Sat Aug 4 19:52:15 2001 @@ -587,7 +587,7 @@ the GNU General Public License. This pr if (optarg == NULL) { - as_warn (_("No file name following -t option\n")); + as_warn (_("no file name following -t option")); break; } @@ -602,11 +602,8 @@ the GNU General Public License. This pr internal table. */ itbl_files->name = xstrdup (optarg); if (itbl_parse (itbl_files->name) != 0) - { - fprintf (stderr, _("Failed to read instruction table %s\n"), - itbl_files->name); - exit (EXIT_SUCCESS); - } + as_fatal (_("failed to read instruction table %s\n"), + itbl_files->name); } break; diff -Nupr binutils-2.11.90.0.25/gas/as.h binutils-2.11.90.0.27/gas/as.h --- binutils-2.11.90.0.25/gas/as.h Fri Mar 9 11:38:12 2001 +++ binutils-2.11.90.0.27/gas/as.h Fri Aug 10 14:08:01 2001 @@ -43,28 +43,19 @@ /* This is the code recommended in the autoconf documentation, almost verbatim. If it doesn't work for you, let me know, and notify djm@gnu.ai.mit.edu as well. */ -/* Added #undef for DJ Delorie. The right fix is to ensure that as.h - is included first, before even any system header files, in all files - that use it. KR 1994.11.03 */ /* Added void* version for STDC case. This is to be compatible with the declaration in bison.simple, used for m68k operand parsing. --KR 1995.08.08 */ /* Force void* decl for hpux. This is what Bison uses. --KR 1995.08.16 */ -/* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -# ifndef alloca -# ifdef __STDC__ -extern void *alloca (); -# else -extern char *alloca (); -# endif -# endif -#else +#ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ @@ -76,7 +67,7 @@ extern void *alloca (); # endif /* alloca */ # endif /* _AIX */ # endif /* HAVE_ALLOCA_H */ -#endif +#endif /* __GNUC__ */ /* Now, tend to the rest of the configuration. */ diff -Nupr binutils-2.11.90.0.25/gas/atof-generic.c binutils-2.11.90.0.27/gas/atof-generic.c --- binutils-2.11.90.0.25/gas/atof-generic.c Fri Mar 9 11:16:34 2001 +++ binutils-2.11.90.0.27/gas/atof-generic.c Sat Aug 4 19:52:15 2001 @@ -434,7 +434,7 @@ atof_generic (address_of_string_pointer, * We have a GROSS internal error. * This should never happen. */ - as_fatal (_("failed sanity check.")); + as_fatal (_("failed sanity check")); } } else diff -Nupr binutils-2.11.90.0.25/gas/cgen.c binutils-2.11.90.0.27/gas/cgen.c --- binutils-2.11.90.0.25/gas/cgen.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/cgen.c Sat Aug 4 19:52:15 2001 @@ -148,7 +148,7 @@ gas_cgen_save_fixups (int i) { if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) { - as_fatal("Index into stored_fixups[] out of bounds."); + as_fatal("index into stored_fixups[] out of bounds"); return; } stored_fixups[i].num_fixups_in_chain = num_fixups; @@ -162,7 +162,7 @@ gas_cgen_restore_fixups (int i) { if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) { - as_fatal("Index into stored_fixups[] out of bounds."); + as_fatal("index into stored_fixups[] out of bounds"); return; } num_fixups = stored_fixups[i].num_fixups_in_chain; @@ -179,7 +179,7 @@ gas_cgen_swap_fixups (int i) if (i < 0 || i >= MAX_SAVED_FIXUP_CHAINS) { - as_fatal("Index into stored_fixups[] out of bounds."); + as_fatal("index into stored_fixups[] out of bounds"); return; } diff -Nupr binutils-2.11.90.0.25/gas/cond.c binutils-2.11.90.0.27/gas/cond.c --- binutils-2.11.90.0.25/gas/cond.c Sat Mar 31 19:48:14 2001 +++ binutils-2.11.90.0.27/gas/cond.c Sat Aug 4 19:52:15 2001 @@ -257,11 +257,11 @@ s_elseif (arg) { if (current_cframe == NULL) { - as_bad (_("\".elseif\" without matching \".if\" - ignored")); + as_bad (_("\".elseif\" without matching \".if\"")); } else if (current_cframe->else_seen) { - as_bad (_("\".elseif\" after \".else\" - ignored")); + as_bad (_("\".elseif\" after \".else\"")); as_bad_where (current_cframe->else_file_line.file, current_cframe->else_file_line.line, _("here is the previous \"else\"")); @@ -365,11 +365,11 @@ s_else (arg) { if (current_cframe == NULL) { - as_bad (_(".else without matching .if - ignored")); + as_bad (_("\".else\" without matching \".if\"")); } else if (current_cframe->else_seen) { - as_bad (_("duplicate \"else\" - ignored")); + as_bad (_("duplicate \"else\"")); as_bad_where (current_cframe->else_file_line.file, current_cframe->else_file_line.line, _("here is the previous \"else\"")); diff -Nupr binutils-2.11.90.0.25/gas/config/e-i386aout.c binutils-2.11.90.0.27/gas/config/e-i386aout.c --- binutils-2.11.90.0.25/gas/config/e-i386aout.c Fri Jan 28 08:33:40 2000 +++ binutils-2.11.90.0.27/gas/config/e-i386aout.c Fri Aug 10 14:08:01 2001 @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386aout_bfd_name PARAMS ((void)); + static const char * i386aout_bfd_name () { diff -Nupr binutils-2.11.90.0.25/gas/config/e-i386coff.c binutils-2.11.90.0.27/gas/config/e-i386coff.c --- binutils-2.11.90.0.25/gas/config/e-i386coff.c Thu Jun 3 11:02:00 1999 +++ binutils-2.11.90.0.27/gas/config/e-i386coff.c Fri Aug 10 14:08:01 2001 @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386coff_bfd_name PARAMS ((void)); + static const char * i386coff_bfd_name () { diff -Nupr binutils-2.11.90.0.25/gas/config/e-i386elf.c binutils-2.11.90.0.27/gas/config/e-i386elf.c --- binutils-2.11.90.0.25/gas/config/e-i386elf.c Thu Jun 3 11:02:00 1999 +++ binutils-2.11.90.0.27/gas/config/e-i386elf.c Fri Aug 10 14:08:01 2001 @@ -1,6 +1,8 @@ #include "as.h" #include "emul.h" +static const char *i386elf_bfd_name PARAMS ((void)); + static const char * i386elf_bfd_name () { diff -Nupr binutils-2.11.90.0.25/gas/config/obj-coff.c binutils-2.11.90.0.27/gas/config/obj-coff.c --- binutils-2.11.90.0.25/gas/config/obj-coff.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/config/obj-coff.c Fri Aug 10 14:08:01 2001 @@ -38,7 +38,29 @@ #define TC_COFF_SECTION_DEFAULT_ATTRIBUTES (SEC_LOAD | SEC_DATA) #endif +/* This is used to hold the symbol built by a sequence of pseudo-ops + from .def and .endef. */ +static symbolS *def_symbol_in_progress; + +typedef struct + { + unsigned long chunk_size; + unsigned long element_size; + unsigned long size; + char *data; + unsigned long pointer; + } +stack; + +static stack *stack_init PARAMS ((unsigned long, unsigned long)); +static char *stack_push PARAMS ((stack *, char *)); +static char *stack_pop PARAMS ((stack *)); +static void tag_init PARAMS ((void)); +static void tag_insert PARAMS ((const char *, symbolS *)); +static symbolS *tag_find PARAMS ((char *)); +static symbolS *tag_find_or_make PARAMS ((char *)); static void obj_coff_bss PARAMS ((int)); +static void obj_coff_weak PARAMS ((int)); const char *s_get_name PARAMS ((symbolS * s)); static void obj_coff_ln PARAMS ((int)); static void obj_coff_def PARAMS ((int)); @@ -54,21 +76,8 @@ static void obj_coff_ident PARAMS ((int) #ifdef BFD_ASSEMBLER static void obj_coff_loc PARAMS((int)); #endif - -/* This is used to hold the symbol built by a sequence of pseudo-ops - from .def and .endef. */ -static symbolS *def_symbol_in_progress; /* stack stuff */ -typedef struct - { - unsigned long chunk_size; - unsigned long element_size; - unsigned long size; - char *data; - unsigned long pointer; - } -stack; static stack * stack_init (chunk_size, element_size) @@ -246,7 +255,11 @@ obj_coff_weak (ignore) #ifdef BFD_ASSEMBLER +static segT fetch_coff_debug_section PARAMS ((void)); static void SA_SET_SYM_TAGNDX PARAMS ((symbolS *, symbolS *)); +static int S_GET_DATA_TYPE PARAMS ((symbolS *)); +void c_symbol_merge PARAMS ((symbolS *, symbolS *)); +static void add_lineno PARAMS ((fragS *, addressT, int)); #define GET_FILENAME_STRING(X) \ ((char*) (&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1]) diff -Nupr binutils-2.11.90.0.25/gas/config/obj-elf.c binutils-2.11.90.0.27/gas/config/obj-elf.c --- binutils-2.11.90.0.25/gas/config/obj-elf.c Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/gas/config/obj-elf.c Fri Aug 10 14:08:01 2001 @@ -1,5 +1,5 @@ /* ELF object file format - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -55,7 +55,6 @@ static void elf_s_set_size PARAMS ((symb static bfd_vma elf_s_get_align PARAMS ((symbolS *)); static void elf_s_set_align PARAMS ((symbolS *, bfd_vma)); static void elf_s_set_other PARAMS ((symbolS *, int)); -static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); static int elf_sec_sym_ok_for_reloc PARAMS ((asection *)); static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR)); static int elf_separate_stab_sections PARAMS ((void)); @@ -74,6 +73,10 @@ static void obj_elf_ident PARAMS ((int)) static void obj_elf_weak PARAMS ((int)); static void obj_elf_local PARAMS ((int)); static void obj_elf_visibility PARAMS ((int)); +static void obj_elf_change_section PARAMS ((char *, int, int, int, int)); +static int obj_elf_parse_section_letters PARAMS ((char *, size_t)); +static int obj_elf_section_word PARAMS ((char *, size_t)); +static int obj_elf_section_type PARAMS ((char *, size_t)); static void obj_elf_symver PARAMS ((int)); static void obj_elf_subsection PARAMS ((int)); static void obj_elf_popsection PARAMS ((int)); @@ -242,13 +245,6 @@ elf_s_set_other (sym, other) S_SET_OTHER (sym, other); } -static void -elf_copy_symbol_attributes (dest, src) - symbolS *dest, *src; -{ - OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src); -} - static int elf_sec_sym_ok_for_reloc (sec) asection *sec; @@ -619,7 +615,7 @@ static struct special_section const spec { NULL, 0, 0 } }; -void +static void obj_elf_change_section (name, type, attr, entsize, push) char *name; int type, attr, entsize, push; @@ -734,7 +730,7 @@ obj_elf_change_section (name, type, attr #endif } -int +static int obj_elf_parse_section_letters (str, len) char *str; size_t len; @@ -782,7 +778,7 @@ obj_elf_parse_section_letters (str, len) return attr; } -int +static int obj_elf_section_word (str, len) char *str; size_t len; @@ -806,7 +802,7 @@ obj_elf_section_word (str, len) return 0; } -int +static int obj_elf_section_type (str, len) char *str; size_t len; @@ -1132,6 +1128,7 @@ obj_elf_symver (ignore) { char *name; char c; + char old_lexat; symbolS *sym; name = input_line_pointer; @@ -1151,13 +1148,12 @@ obj_elf_symver (ignore) ++input_line_pointer; name = input_line_pointer; - while (1) - { - c = get_symbol_end (); - if (c != ELF_VER_CHR) - break; - *input_line_pointer++ = c; - } + + /* Temporarily include '@' in symbol names. */ + old_lexat = lex_type[(unsigned char) '@']; + lex_type[(unsigned char) '@'] |= LEX_NAME; + c = get_symbol_end (); + lex_type[(unsigned char) '@'] = old_lexat; if (symbol_get_obj (sym)->versioned_name == NULL) { @@ -1328,6 +1324,33 @@ elf_obj_symbol_new_hook (symbolP) if (ECOFF_DEBUGGING) ecoff_symbol_new_hook (symbolP); #endif +} + +/* When setting one symbol equal to another, by default we probably + want them to have the same "size", whatever it means in the current + context. */ + +void +elf_copy_symbol_attributes (dest, src) + symbolS *dest, *src; +{ + struct elf_obj_sy *srcelf = symbol_get_obj (src); + struct elf_obj_sy *destelf = symbol_get_obj (dest); + if (srcelf->size) + { + if (destelf->size == NULL) + destelf->size = + (expressionS *) xmalloc (sizeof (expressionS)); + *destelf->size = *srcelf->size; + } + else + { + if (destelf->size != NULL) + free (destelf->size); + destelf->size = NULL; + } + S_SET_SIZE (dest, S_GET_SIZE (src)); + S_SET_OTHER (dest, S_GET_OTHER (src)); } void diff -Nupr binutils-2.11.90.0.25/gas/config/obj-elf.h binutils-2.11.90.0.27/gas/config/obj-elf.h --- binutils-2.11.90.0.25/gas/config/obj-elf.h Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/gas/config/obj-elf.h Fri Aug 10 14:08:01 2001 @@ -182,32 +182,10 @@ void elf_obj_symbol_new_hook PARAMS ((sy #define obj_symbol_new_hook elf_obj_symbol_new_hook #endif -/* When setting one symbol equal to another, by default we probably - want them to have the same "size", whatever it means in the current - context. */ +void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES -#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \ -do \ - { \ - struct elf_obj_sy *srcelf = symbol_get_obj (SRC); \ - struct elf_obj_sy *destelf = symbol_get_obj (DEST); \ - if (srcelf->size) \ - { \ - if (destelf->size == NULL) \ - destelf->size = \ - (expressionS *) xmalloc (sizeof (expressionS)); \ - *destelf->size = *srcelf->size; \ - } \ - else \ - { \ - if (destelf->size != NULL) \ - free (destelf->size); \ - destelf->size = NULL; \ - } \ - S_SET_SIZE ((DEST), S_GET_SIZE (SRC)); \ - S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \ - } \ -while (0) +#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ + (elf_copy_symbol_attributes (DEST, SRC)) #endif #ifndef SEPARATE_STAB_SECTIONS diff -Nupr binutils-2.11.90.0.25/gas/config/tc-i370.c binutils-2.11.90.0.27/gas/config/tc-i370.c --- binutils-2.11.90.0.25/gas/config/tc-i370.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/config/tc-i370.c Sat Aug 4 19:52:15 2001 @@ -332,7 +332,7 @@ register_name (expressionP) char *start; char c; - /* Find the spelling of the operand */ + /* Find the spelling of the operand. */ start = name = input_line_pointer; if (name[0] == '%' && isalpha (name[1])) name = ++input_line_pointer; @@ -343,36 +343,36 @@ register_name (expressionP) while (' ' == *name) name = ++input_line_pointer; - /* if its a number, treat it as a number */ - /* if its alpha, look to see if it's in the register table */ + /* If it's a number, treat it as a number. If it's alpha, look to + see if it's in the register table. */ if (!isalpha (name[0])) { reg_number = get_single_number (); - c = get_symbol_end (); } else { c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); + + /* Put back the delimiting char. */ + *input_line_pointer = c; } - /* if numeric, make sure its not out of bounds */ + /* If numeric, make sure its not out of bounds. */ if ((0 <= reg_number) && (16 >= reg_number)) { expressionP->X_op = O_register; expressionP->X_add_number = reg_number; - /* make the rest nice */ + /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - *input_line_pointer = c; /* put back the delimiting char */ return true; } - /* reset the line as if we had not done anything */ - *input_line_pointer = c; /* put back the delimiting char */ - input_line_pointer = start; /* reset input_line pointer */ - return false; + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Local variables. */ diff -Nupr binutils-2.11.90.0.25/gas/config/tc-i386.c binutils-2.11.90.0.27/gas/config/tc-i386.c --- binutils-2.11.90.0.25/gas/config/tc-i386.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/config/tc-i386.c Sat Aug 4 19:52:15 2001 @@ -3181,27 +3181,41 @@ lex_got (reloc, adjust) int len; len = strlen (gotrel[j].str); - if (strncmp (cp + 1, gotrel[j].str, len) == 0) + if (strncasecmp (cp + 1, gotrel[j].str, len) == 0) { if (gotrel[j].rel[(unsigned int) flag_code] != 0) { - int first; - char *tmpbuf; + int first, second; + char *tmpbuf, *past_reloc; *reloc = gotrel[j].rel[(unsigned int) flag_code]; + if (adjust) + *adjust = len; if (GOT_symbol == NULL) GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME); /* Replace the relocation token with ' ', so that errors like foo@GOTOFF1 will be detected. */ + + /* The length of the first part of our input line. */ first = cp - input_line_pointer; - tmpbuf = xmalloc (strlen (input_line_pointer)); + + /* The second part goes from after the reloc token until + (and including) an end_of_line char. Don't use strlen + here as the end_of_line char may not be a NUL. */ + past_reloc = cp + 1 + len; + for (cp = past_reloc; !is_end_of_line[(unsigned char) *cp++]; ) + ; + second = cp - past_reloc; + + /* Allocate and copy string. The trailing NUL shouldn't + be necessary, but be safe. */ + tmpbuf = xmalloc (first + second + 2); memcpy (tmpbuf, input_line_pointer, first); tmpbuf[first] = ' '; - strcpy (tmpbuf + first + 1, cp + 1 + len); - if (adjust) - *adjust = len; + memcpy (tmpbuf + first + 1, past_reloc, second); + tmpbuf[first + second + 1] = '\0'; return tmpbuf; } diff -Nupr binutils-2.11.90.0.25/gas/config/tc-m68hc11.c binutils-2.11.90.0.27/gas/config/tc-m68hc11.c --- binutils-2.11.90.0.25/gas/config/tc-m68hc11.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/config/tc-m68hc11.c Sat Aug 4 19:52:15 2001 @@ -2595,9 +2595,9 @@ md_estimate_size_before_relax (fragP, se necessary for the unresolved symbol address. */ fragP->fr_opcode[0] = convert_branch (fragP->fr_opcode[0]); - fragP->fr_fix++; - fix_new (fragP, old_fr_fix - 1, 2, fragP->fr_symbol, + fix_new (fragP, fragP->fr_fix - 1, 2, fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_16); + fragP->fr_fix++; break; case STATE_CONDITIONAL_BRANCH: diff -Nupr binutils-2.11.90.0.25/gas/config/tc-mips.c binutils-2.11.90.0.27/gas/config/tc-mips.c --- binutils-2.11.90.0.25/gas/config/tc-mips.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/config/tc-mips.c Fri Aug 10 14:08:01 2001 @@ -217,7 +217,7 @@ static int mips_arch = CPU_UNKNOWN; static int mips_tune = CPU_UNKNOWN; /* The argument of the -mabi= flag. */ -static char * mips_abi_string = 0; +static char * mips_abi_string = NULL; /* Whether we should mark the file EABI64 or EABI32. */ static int mips_eabi64 = 0; @@ -229,6 +229,12 @@ static int mips_32bitmode = 0; /* True if -mgp32 was passed. */ static int mips_gp32 = 0; +/* True if -mfp32 was passed. */ +static int mips_fp32 = 0; + +/* True if the selected ABI is defined for 32-bit registers only. */ +static int mips_32bit_abi = 0; + /* Some ISA's have delay slots for instructions which read or write from a coprocessor (eg. mips1-mips3); some don't (eg mips4). Return true if instructions marked INSN_LOAD_COPROC_DELAY, @@ -251,6 +257,23 @@ static int mips_gp32 = 0; || (ISA) == ISA_MIPS64 \ ) +#define HAVE_32BIT_GPRS \ + (mips_gp32 \ + || mips_32bit_abi \ + || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + +#define HAVE_32BIT_FPRS \ + (mips_fp32 \ + || mips_32bit_abi \ + || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + +#define HAVE_64BIT_GPRS (! HAVE_32BIT_GPRS) +#define HAVE_64BIT_FPRS (! HAVE_32BIT_FPRS) + +#define HAVE_32BIT_ADDRESSES \ + (HAVE_32BIT_GPRS \ + || bfd_arch_bits_per_address (stdoutput) == 32) + /* Whether the processor uses hardware interlocks to protect reads from the HI and LO registers, and thus does not require nops to be inserted. */ @@ -578,8 +601,8 @@ static const unsigned int mips16_to_32_r | ((warn) ? 1 : 0))) #define RELAX_OLD(i) (((i) >> 23) & 0x7f) #define RELAX_NEW(i) (((i) >> 16) & 0x7f) -#define RELAX_RELOC1(i) ((bfd_vma) (((i) >> 9) & 0x7f) - 64) -#define RELAX_RELOC2(i) ((bfd_vma) (((i) >> 2) & 0x7f) - 64) +#define RELAX_RELOC1(i) ((valueT) (((i) >> 9) & 0x7f) - 64) +#define RELAX_RELOC2(i) ((valueT) (((i) >> 2) & 0x7f) - 64) #define RELAX_RELOC3(i) (((i) >> 1) & 1) #define RELAX_WARN(i) ((i) & 1) @@ -662,6 +685,7 @@ static void check_absolute_expr PARAMS ( expressionS *)); static void load_register PARAMS ((int *, int, expressionS *, int)); static void load_address PARAMS ((int *counter, int reg, expressionS *ep)); +static void move_register PARAMS ((int *, int, int)); static void macro PARAMS ((struct mips_cl_insn * ip)); static void mips16_macro PARAMS ((struct mips_cl_insn * ip)); #ifdef LOSING_COMPILER @@ -939,6 +963,33 @@ md_begin () if (mips_opts.mips16 < 0) mips_opts.mips16 = target_cpu_had_mips16; + /* Backward compatibility for historic -mcpu= option. Check for + incompatible options, warn if -mcpu is used. */ + if (mips_cpu != CPU_UNKNOWN + && mips_arch != CPU_UNKNOWN + && mips_cpu != mips_arch) + { + as_fatal (_("The -mcpu option can't be used together with -march. " + "Use -mtune instead of -mcpu.")); + } + + if (mips_cpu != CPU_UNKNOWN + && mips_tune != CPU_UNKNOWN + && mips_cpu != mips_tune) + { + as_fatal (_("The -mcpu option can't be used together with -mtune. " + "Use -march instead of -mcpu.")); + } + + if (mips_arch == CPU_UNKNOWN && mips_cpu != CPU_UNKNOWN) + { + ci = mips_cpu_info_from_cpu (mips_cpu); + assert (ci != NULL); + mips_arch = ci->cpu; + as_warn (_("The -mcpu option is deprecated. Please use -march and " + "-mtune instead.")); + } + /* At this point, mips_arch will either be CPU_UNKNOWN if no ARCH was specified on the command line, or some other value if one was. Similarly, mips_opts.isa will be ISA_UNKNOWN if not specified on @@ -961,19 +1012,6 @@ md_begin () assert (ci != NULL); mips_arch = ci->cpu; } - else if (mips_arch == CPU_UNKNOWN - && mips_opts.isa == ISA_UNKNOWN - && mips_cpu != CPU_UNKNOWN) - { - /* Historic -mcpu= option. Warn. */ - ci = mips_cpu_info_from_cpu (mips_cpu); - assert (ci != NULL); - mips_arch = ci->cpu; - mips_tune = ci->cpu; - mips_opts.isa = ci->isa; - as_warn (_("The -mcpu option is deprecated. Please use -march and -mtune instead.")); - - } else { /* We need to set both ISA and ARCH from target cpu. */ @@ -2496,8 +2534,7 @@ macro_build (place, counter, ep, name, f { if (strcmp (fmt, insn.insn_mo->args) == 0 && insn.insn_mo->pinfo != INSN_MACRO - && OPCODE_IS_MEMBER (insn.insn_mo, mips_opts.isa, mips_arch, - mips_gp32) + && OPCODE_IS_MEMBER (insn.insn_mo, mips_opts.isa, mips_arch) && (mips_arch != CPU_R4650 || (insn.insn_mo->pinfo & FP_D) == 0)) break; @@ -2522,62 +2559,65 @@ macro_build (place, counter, ep, name, f case 't': case 'w': case 'E': - insn.insn_opcode |= va_arg (args, int) << 16; + insn.insn_opcode |= va_arg (args, int) << OP_SH_RT; continue; case 'c': + insn.insn_opcode |= va_arg (args, int) << OP_SH_CODE; + continue; + case 'T': case 'W': - insn.insn_opcode |= va_arg (args, int) << 16; + insn.insn_opcode |= va_arg (args, int) << OP_SH_FT; continue; case 'd': case 'G': - insn.insn_opcode |= va_arg (args, int) << 11; + insn.insn_opcode |= va_arg (args, int) << OP_SH_RD; continue; case 'U': { int tmp = va_arg (args, int); - insn.insn_opcode |= tmp << 16; - insn.insn_opcode |= tmp << 11; + insn.insn_opcode |= tmp << OP_SH_RT; + insn.insn_opcode |= tmp << OP_SH_RD; continue; } case 'V': case 'S': - insn.insn_opcode |= va_arg (args, int) << 11; + insn.insn_opcode |= va_arg (args, int) << OP_SH_FS; continue; case 'z': continue; case '<': - insn.insn_opcode |= va_arg (args, int) << 6; + insn.insn_opcode |= va_arg (args, int) << OP_SH_SHAMT; continue; case 'D': - insn.insn_opcode |= va_arg (args, int) << 6; + insn.insn_opcode |= va_arg (args, int) << OP_SH_FD; continue; case 'B': - insn.insn_opcode |= va_arg (args, int) << 6; + insn.insn_opcode |= va_arg (args, int) << OP_SH_CODE20; continue; case 'J': - insn.insn_opcode |= va_arg (args, int) << 6; + insn.insn_opcode |= va_arg (args, int) << OP_SH_CODE19; continue; case 'q': - insn.insn_opcode |= va_arg (args, int) << 6; + insn.insn_opcode |= va_arg (args, int) << OP_SH_CODE2; continue; case 'b': case 's': case 'r': case 'v': - insn.insn_opcode |= va_arg (args, int) << 21; + insn.insn_opcode |= va_arg (args, int) << OP_SH_RS; continue; case 'i': @@ -3008,9 +3048,9 @@ load_register (counter, reg, ep, dbl) || ! ep->X_unsigned || sizeof (ep->X_add_number) > 4 || (ep->X_add_number & 0x80000000) == 0)) - || ((! ISA_HAS_64BIT_REGS (mips_opts.isa) || ! dbl) + || ((HAVE_32BIT_GPRS || ! dbl) && (ep->X_add_number &~ (offsetT) 0xffffffff) == 0) - || (! ISA_HAS_64BIT_REGS (mips_opts.isa) + || (HAVE_32BIT_GPRS && ! dbl && ((ep->X_add_number &~ (offsetT) 0xffffffff) == ~ (offsetT) 0xffffffff))) @@ -3027,7 +3067,7 @@ load_register (counter, reg, ep, dbl) /* The value is larger than 32 bits. */ - if (! ISA_HAS_64BIT_REGS (mips_opts.isa)) + if (HAVE_32BIT_GPRS) { as_bad (_("Number larger than 32 bits")); macro_build ((char *) NULL, counter, ep, "addiu", "t,r,j", reg, 0, @@ -3269,9 +3309,7 @@ load_address (counter, reg, ep) { frag_grow (20); macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, GP, (int) BFD_RELOC_MIPS_GPREL); p = frag_var (rs_machine_dependent, 8, 0, RELAX_ENCODE (4, 8, 0, 4, 0, @@ -3282,9 +3320,7 @@ load_address (counter, reg, ep) if (p != NULL) p += 4; macro_build (p, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, reg, (int) BFD_RELOC_LO16); } else if (mips_pic == SVR4_PIC && ! mips_big_got) @@ -3302,18 +3338,14 @@ load_address (counter, reg, ep) ep->X_add_number = 0; frag_grow (20); macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, counter, (expressionS *) NULL, "nop", ""); p = frag_var (rs_machine_dependent, 4, 0, RELAX_ENCODE (0, 4, -8, 0, 0, mips_opts.warn_about_macros), ep->X_add_symbol, (offsetT) 0, (char *) NULL); macro_build (p, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, reg, (int) BFD_RELOC_LO16); if (ex.X_add_number != 0) { @@ -3321,9 +3353,7 @@ load_address (counter, reg, ep) as_bad (_("PIC code offset overflow (max 16 signed bits)")); ex.X_op = O_constant; macro_build ((char *) NULL, counter, &ex, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, reg, (int) BFD_RELOC_LO16); } } @@ -3352,14 +3382,10 @@ load_address (counter, reg, ep) macro_build ((char *) NULL, counter, ep, "lui", "t,u", reg, (int) BFD_RELOC_MIPS_GOT_HI16); macro_build ((char *) NULL, counter, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", reg, reg, GP); macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT_LO16, reg); p = frag_var (rs_machine_dependent, 12 + off, 0, RELAX_ENCODE (12, 12 + off, off, 8 + off, 0, @@ -3374,18 +3400,12 @@ load_address (counter, reg, ep) macro_build (p, counter, (expressionS *) NULL, "nop", ""); p += 4; } - macro_build (p, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + macro_build (p, counter, ep, HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; macro_build (p, counter, (expressionS *) NULL, "nop", ""); p += 4; - macro_build (p, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + macro_build (p, counter, ep, HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, reg, (int) BFD_RELOC_LO16); if (ex.X_add_number != 0) { @@ -3393,9 +3413,7 @@ load_address (counter, reg, ep) as_bad (_("PIC code offset overflow (max 16 signed bits)")); ex.X_op = O_constant; macro_build ((char *) NULL, counter, &ex, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, reg, (int) BFD_RELOC_LO16); } } @@ -3405,15 +3423,26 @@ load_address (counter, reg, ep) addiu $reg,$gp, (BFD_RELOC_MIPS_GPREL) */ macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", reg, GP, (int) BFD_RELOC_MIPS_GPREL); } else abort (); } +/* Move the contents of register SOURCE into register DEST. */ + +static void +move_register (counter, dest, source) + int *counter; + int dest; + int source; +{ + macro_build ((char *) NULL, counter, (expressionS *) NULL, + HAVE_32BIT_GPRS ? "addu" : "daddu", + "d,v,t", dest, source, 0); +} + /* * Build macros * This routine implements the seemingly endless macro or synthesized @@ -3487,10 +3516,9 @@ macro (ip) if (dreg == sreg) macro_build ((char *) NULL, &icnt, NULL, "nop", "", 0); else - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, sreg, 0); + move_register (&icnt, dreg, sreg); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dsub" : "sub", - "d,v,t", dreg, 0, sreg); + dbl ? "dsub" : "sub", "d,v,t", dreg, 0, sreg); --mips_opts.noreorder; return; @@ -3605,8 +3633,7 @@ macro (ip) } macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, sreg, treg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BGTL_I: @@ -3614,7 +3641,7 @@ macro (ip) case M_BGT_I: /* check for > max integer */ maxnum = 0x7fffffff; - if (ISA_HAS_64BIT_REGS (mips_opts.isa) && sizeof (maxnum) > 4) + if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4) { maxnum <<= 16; maxnum |= 0xffff; @@ -3623,7 +3650,7 @@ macro (ip) } if (imm_expr.X_op == O_constant && imm_expr.X_add_number >= maxnum - && (! ISA_HAS_64BIT_REGS (mips_opts.isa) || sizeof (maxnum) > 4)) + && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4)) { do_false: /* result is always false */ @@ -3655,19 +3682,17 @@ macro (ip) if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bgezl" : "bgez", - "s,p", sreg); + likely ? "bgezl" : "bgez", "s,p", sreg); return; } if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bgtzl" : "bgtz", - "s,p", sreg); + likely ? "bgtzl" : "bgtz", "s,p", sreg); return; } maxnum = 0x7fffffff; - if (ISA_HAS_64BIT_REGS (mips_opts.isa) && sizeof (maxnum) > 4) + if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4) { maxnum <<= 16; maxnum |= 0xffff; @@ -3677,7 +3702,7 @@ macro (ip) maxnum = - maxnum - 1; if (imm_expr.X_op == O_constant && imm_expr.X_add_number <= maxnum - && (! ISA_HAS_64BIT_REGS (mips_opts.isa) || sizeof (maxnum) > 4)) + && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4)) { do_true: /* result is always true */ @@ -3687,8 +3712,7 @@ macro (ip) } set_at (&icnt, sreg, 0); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BGEUL: @@ -3699,22 +3723,20 @@ macro (ip) if (sreg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", 0, treg); + likely ? "beql" : "beq", "s,t,p", 0, treg); return; } macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, sreg, treg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BGTUL_I: likely = 1; case M_BGTU_I: if (sreg == 0 - || (! ISA_HAS_64BIT_REGS (mips_opts.isa) + || (HAVE_32BIT_GPRS && imm_expr.X_op == O_constant && imm_expr.X_add_number == 0xffffffff)) goto do_false; @@ -3731,14 +3753,12 @@ macro (ip) if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", sreg, 0); + likely ? "bnel" : "bne", "s,t,p", sreg, 0); return; } set_at (&icnt, sreg, 1); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BGTL: @@ -3747,21 +3767,18 @@ macro (ip) if (treg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bgtzl" : "bgtz", - "s,p", sreg); + likely ? "bgtzl" : "bgtz", "s,p", sreg); return; } if (sreg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bltzl" : "bltz", - "s,p", treg); + likely ? "bltzl" : "bltz", "s,p", treg); return; } macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, treg, sreg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_BGTUL: @@ -3770,8 +3787,7 @@ macro (ip) if (treg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", sreg, 0); + likely ? "bnel" : "bne", "s,t,p", sreg, 0); return; } if (sreg == 0) @@ -3779,8 +3795,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, treg, sreg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_BLEL: @@ -3789,28 +3804,25 @@ macro (ip) if (treg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "blezl" : "blez", - "s,p", sreg); + likely ? "blezl" : "blez", "s,p", sreg); return; } if (sreg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bgezl" : "bgez", - "s,p", treg); + likely ? "bgezl" : "bgez", "s,p", treg); return; } macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, treg, sreg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BLEL_I: likely = 1; case M_BLE_I: maxnum = 0x7fffffff; - if (ISA_HAS_64BIT_REGS (mips_opts.isa) && sizeof (maxnum) > 4) + if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4) { maxnum <<= 16; maxnum |= 0xffff; @@ -3819,7 +3831,7 @@ macro (ip) } if (imm_expr.X_op == O_constant && imm_expr.X_add_number >= maxnum - && (! ISA_HAS_64BIT_REGS (mips_opts.isa) || sizeof (maxnum) > 4)) + && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4)) goto do_true; if (imm_expr.X_op != O_constant) as_bad (_("Unsupported large constant")); @@ -3832,21 +3844,18 @@ macro (ip) if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bltzl" : "bltz", - "s,p", sreg); + likely ? "bltzl" : "bltz", "s,p", sreg); return; } if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "blezl" : "blez", - "s,p", sreg); + likely ? "blezl" : "blez", "s,p", sreg); return; } set_at (&icnt, sreg, 0); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_BLEUL: @@ -3855,8 +3864,7 @@ macro (ip) if (treg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", sreg, 0); + likely ? "beql" : "beq", "s,t,p", sreg, 0); return; } if (sreg == 0) @@ -3864,15 +3872,14 @@ macro (ip) macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, treg, sreg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "beql" : "beq", - "s,t,p", AT, 0); + likely ? "beql" : "beq", "s,t,p", AT, 0); break; case M_BLEUL_I: likely = 1; case M_BLEU_I: if (sreg == 0 - || (! ISA_HAS_64BIT_REGS (mips_opts.isa) + || (HAVE_32BIT_GPRS && imm_expr.X_op == O_constant && imm_expr.X_add_number == 0xffffffff)) goto do_true; @@ -3895,8 +3902,7 @@ macro (ip) } set_at (&icnt, sreg, 1); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_BLTL: @@ -3905,21 +3911,18 @@ macro (ip) if (treg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bltzl" : "bltz", - "s,p", sreg); + likely ? "bltzl" : "bltz", "s,p", sreg); return; } if (sreg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bgtzl" : "bgtz", - "s,p", treg); + likely ? "bgtzl" : "bgtz", "s,p", treg); return; } macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, sreg, treg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_BLTUL: @@ -3930,15 +3933,13 @@ macro (ip) if (sreg == 0) { macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", 0, treg); + likely ? "bnel" : "bne", "s,t,p", 0, treg); return; } macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, sreg, treg); macro_build ((char *) NULL, &icnt, &offset_expr, - likely ? "bnel" : "bne", - "s,t,p", AT, 0); + likely ? "bnel" : "bne", "s,t,p", AT, 0); break; case M_DDIV_3: @@ -3968,16 +3969,14 @@ macro (ip) { macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "ddiv" : "div", - "z,s,t", sreg, treg); + dbl ? "ddiv" : "div", "z,s,t", sreg, treg); } else { expr1.X_add_number = 8; macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "ddiv" : "div", - "z,s,t", sreg, treg); + dbl ? "ddiv" : "div", "z,s,t", sreg, treg); macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7); } expr1.X_add_number = -1; @@ -4070,10 +4069,9 @@ macro (ip) if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1) { if (strcmp (s2, "mflo") == 0) - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, - sreg); + move_register (&icnt, dreg, sreg); else - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, 0); + move_register (&icnt, dreg, 0); return; } if (imm_expr.X_op == O_constant @@ -4082,15 +4080,11 @@ macro (ip) { if (strcmp (s2, "mflo") == 0) { - if (dbl) - macro_build ((char *) NULL, &icnt, NULL, "dneg", "d,w", dreg, - sreg); - else - macro_build ((char *) NULL, &icnt, NULL, "neg", "d,w", dreg, - sreg); + macro_build ((char *) NULL, &icnt, NULL, dbl ? "dneg" : "neg", + "d,w", dreg, sreg); } else - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, 0); + move_register (&icnt, dreg, 0); return; } @@ -4170,9 +4164,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", treg, (int) BFD_RELOC_PCREL_HI16_S); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", treg, treg, (int) BFD_RELOC_PCREL_LO16); return; } @@ -4213,9 +4205,7 @@ macro (ip) { frag_grow (20); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, GP, (int) BFD_RELOC_MIPS_GPREL); p = frag_var (rs_machine_dependent, 8, 0, RELAX_ENCODE (4, 8, 0, 4, 0, @@ -4227,9 +4217,7 @@ macro (ip) if (p != NULL) p += 4; macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); } else if (mips_pic == SVR4_PIC && ! mips_big_got) @@ -4300,9 +4288,7 @@ macro (ip) p += 4; } macro_build (p, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); /* FIXME: If breg == 0, and the next instruction uses $tempreg, then if this variant case is used an extra @@ -4314,9 +4300,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); (void) frag_var (rs_machine_dependent, 0, 0, RELAX_ENCODE (0, 0, -12, -4, 0, 0), @@ -4341,9 +4325,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", treg, AT, breg); breg = 0; tempreg = treg; @@ -4358,14 +4340,10 @@ macro (ip) mips_optimize = hold_mips_optimize; macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", AT, AT, (int) BFD_RELOC_LO16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, AT); (void) frag_var (rs_machine_dependent, 0, 0, RELAX_ENCODE (0, 0, -16 + off1, -8, 0, 0), @@ -4435,9 +4413,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", tempreg, lui_reloc_type); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, GP); macro_build ((char *) NULL, &icnt, &offset_expr, dbl ? "ld" : "lw", @@ -4473,9 +4449,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); p = frag_var (rs_machine_dependent, 12 + gpdel, 0, @@ -4508,9 +4482,7 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", treg, AT, breg); dreg = treg; adj = 8; @@ -4524,14 +4496,10 @@ macro (ip) mips_optimize = hold_mips_optimize; macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", AT, AT, (int) BFD_RELOC_LO16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", dreg, dreg, AT); p = frag_var (rs_machine_dependent, 16 + gpdel + adj, 0, @@ -4563,9 +4531,7 @@ macro (ip) macro_build (p, &icnt, (expressionS *) NULL, "nop", ""); p += 4; macro_build (p, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); /* FIXME: If add_number is 0, and there was no base register, the external symbol case ended with a load, @@ -4583,9 +4549,7 @@ macro (ip) macro_build (p, &icnt, (expressionS *) NULL, "nop", ""); p += 4; macro_build (p, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", treg, AT, breg); p += 4; tempreg = treg; @@ -4597,15 +4561,11 @@ macro (ip) macro_build_lui (p, &icnt, &expr1, AT); p += 4; macro_build (p, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", AT, AT, (int) BFD_RELOC_LO16); p += 4; macro_build (p, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, AT); p += 4; } @@ -4616,9 +4576,7 @@ macro (ip) addiu $tempreg,$gp, (BFD_RELOC_MIPS_GPREL) */ macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, GP, (int) BFD_RELOC_MIPS_GPREL); } else @@ -4626,9 +4584,7 @@ macro (ip) if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", treg, tempreg, breg); if (! used_at) @@ -4670,9 +4626,7 @@ macro (ip) { expr1.X_add_number = mips_cprestore_offset; macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", GP, (int) BFD_RELOC_LO16, mips_frame_reg); } } @@ -4713,9 +4667,7 @@ macro (ip) if (! mips_big_got) { macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, @@ -4736,14 +4688,10 @@ macro (ip) macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL_HI16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", PIC_CALL_REG, PIC_CALL_REG, GP); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL_LO16, PIC_CALL_REG); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, @@ -4759,9 +4707,7 @@ macro (ip) p += 4; } macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; @@ -4769,9 +4715,7 @@ macro (ip) p += 4; } macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", PIC_CALL_REG, PIC_CALL_REG, (int) BFD_RELOC_LO16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, @@ -4785,9 +4729,7 @@ macro (ip) "nop", ""); expr1.X_add_number = mips_cprestore_offset; macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", GP, (int) BFD_RELOC_LO16, mips_frame_reg); } @@ -5042,9 +4984,7 @@ macro (ip) { frag_grow (28); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, breg, GP); macro_build ((char *) NULL, &icnt, &offset_expr, s, fmt, treg, (int) BFD_RELOC_MIPS_GPREL, tempreg); @@ -5057,9 +4997,7 @@ macro (ip) if (p != NULL) p += 4; macro_build (p, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, breg); if (p != NULL) p += 4; @@ -5092,9 +5030,7 @@ macro (ip) as_bad (_("PIC code offset overflow (max 16 signed bits)")); frag_grow (20); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); p = frag_var (rs_machine_dependent, 4, 0, @@ -5102,15 +5038,11 @@ macro (ip) offset_expr.X_add_symbol, (offsetT) 0, (char *) NULL); macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, breg); macro_build ((char *) NULL, &icnt, &expr1, s, fmt, treg, (int) BFD_RELOC_LO16, tempreg); @@ -5149,14 +5081,10 @@ macro (ip) macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", tempreg, (int) BFD_RELOC_MIPS_GOT_HI16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, GP); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT_LO16, tempreg); p = frag_var (rs_machine_dependent, 12 + gpdel, 0, @@ -5168,23 +5096,17 @@ macro (ip) p += 4; } macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; macro_build (p, &icnt, (expressionS *) NULL, "nop", ""); p += 4; macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, tempreg, breg); macro_build ((char *) NULL, &icnt, &expr1, s, fmt, treg, (int) BFD_RELOC_LO16, tempreg); @@ -5207,9 +5129,7 @@ macro (ip) else { macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", tempreg, breg, GP); macro_build ((char *) NULL, &icnt, &offset_expr, s, fmt, treg, (int) BFD_RELOC_MIPS_GPREL, tempreg); @@ -5253,13 +5173,13 @@ macro (ip) } case M_LI_D: - /* If we have a constant in IMM_EXPR, then in mips3 mode it is - the entire value, and in mips1 mode it is the high order 32 - bits of the value and the low order 32 bits are either zero - or in offset_expr. */ + /* Check if we have a constant in IMM_EXPR. If the GPRs are 64 bits + wide, IMM_EXPR is the entire value. Otherwise IMM_EXPR is the high + order 32 bits of the value and the low order 32 bits are either + zero or in OFFSET_EXPR. */ if (imm_expr.X_op == O_constant || imm_expr.X_op == O_big) { - if (ISA_HAS_64BIT_REGS (mips_opts.isa)) + if (HAVE_64BIT_GPRS) load_register (&icnt, treg, &imm_expr, 1); else { @@ -5281,8 +5201,7 @@ macro (ip) if (lreg <= 31) { if (offset_expr.X_op == O_absent) - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", - lreg, 0); + move_register (&icnt, lreg, 0); else { assert (offset_expr.X_op == O_constant); @@ -5303,9 +5222,7 @@ macro (ip) else if (mips_pic == SVR4_PIC) { macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT16, GP); } else if (mips_pic == EMBEDDED_PIC) @@ -5313,9 +5230,7 @@ macro (ip) /* For embedded PIC we pick up the entire address off $gp in a single instruction. */ macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", "t,r,j", AT, GP, (int) BFD_RELOC_MIPS_GPREL); offset_expr.X_op = O_constant; offset_expr.X_add_number = 0; @@ -5324,7 +5239,7 @@ macro (ip) abort (); /* Now we load the register(s). */ - if (ISA_HAS_64BIT_REGS (mips_opts.isa)) + if (HAVE_64BIT_GPRS) macro_build ((char *) NULL, &icnt, &offset_expr, "ld", "t,o(b)", treg, (int) BFD_RELOC_LO16, AT); else @@ -5349,16 +5264,20 @@ macro (ip) break; case M_LI_DD: - /* If we have a constant in IMM_EXPR, then in mips3 mode it is - the entire value, and in mips1 mode it is the high order 32 - bits of the value and the low order 32 bits are either zero - or in offset_expr. */ + /* Check if we have a constant in IMM_EXPR. If the FPRs are 64 bits + wide, IMM_EXPR is the entire value and the GPRs are known to be 64 + bits wide as well. Otherwise IMM_EXPR is the high order 32 bits of + the value and the low order 32 bits are either zero or in + OFFSET_EXPR. */ if (imm_expr.X_op == O_constant || imm_expr.X_op == O_big) { - load_register (&icnt, AT, &imm_expr, ISA_HAS_64BIT_REGS (mips_opts.isa)); - if (ISA_HAS_64BIT_REGS (mips_opts.isa)) - macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - "dmtc1", "t,S", AT, treg); + load_register (&icnt, AT, &imm_expr, HAVE_64BIT_FPRS); + if (HAVE_64BIT_FPRS) + { + assert (HAVE_64BIT_GPRS); + macro_build ((char *) NULL, &icnt, (expressionS *) NULL, + "dmtc1", "t,S", AT, treg); + } else { macro_build ((char *) NULL, &icnt, (expressionS *) NULL, @@ -5397,9 +5316,7 @@ macro (ip) assert (strcmp (s, RDATA_SECTION_NAME) == 0); if (mips_pic == SVR4_PIC) macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT16, GP); else { @@ -5503,7 +5420,7 @@ macro (ip) goto ldd_std; case M_LD_AB: - if (ISA_HAS_64BIT_REGS (mips_opts.isa)) + if (HAVE_64BIT_GPRS) { s = "ld"; goto ld; @@ -5514,7 +5431,7 @@ macro (ip) goto ldd_std; case M_SD_AB: - if (ISA_HAS_64BIT_REGS (mips_opts.isa)) + if (HAVE_64BIT_GPRS) { s = "sd"; goto st; @@ -5576,9 +5493,7 @@ macro (ip) { frag_grow (36); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, GP); tempreg = AT; off = 4; @@ -5634,9 +5549,7 @@ macro (ip) if (breg != 0) { macro_build (p, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, AT); if (p != NULL) p += 4; @@ -5683,16 +5596,12 @@ macro (ip) off = 4; frag_grow (24 + off); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, AT); /* Itbl support may require additional care here. */ macro_build ((char *) NULL, &icnt, &expr1, s, fmt, @@ -5752,21 +5661,15 @@ macro (ip) macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", AT, (int) BFD_RELOC_MIPS_GOT_HI16); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, AT, GP); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT_LO16, AT); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, AT); /* Itbl support may require additional care here. */ macro_build ((char *) NULL, &icnt, &expr1, s, fmt, @@ -5796,9 +5699,7 @@ macro (ip) p += 4; } macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "lw" : "ld"), + HAVE_32BIT_ADDRESSES ? "lw" : "ld", "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; macro_build (p, &icnt, (expressionS *) NULL, "nop", ""); @@ -5806,9 +5707,7 @@ macro (ip) if (breg != 0) { macro_build (p, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, AT); p += 4; } @@ -5847,9 +5746,7 @@ macro (ip) else { macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, breg, GP); tempreg = AT; used_at = 1; @@ -5879,8 +5776,7 @@ macro (ip) case M_SD_OB: s = "sw"; sd_ob: - assert (bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)); + assert (HAVE_32BIT_ADDRESSES); macro_build ((char *) NULL, &icnt, &offset_expr, s, "t,o(b)", treg, (int) BFD_RELOC_LO16, breg); offset_expr.X_add_number += 4; @@ -5893,7 +5789,7 @@ macro (ip) R4000 uses interlocks to handle coproc delays. Other chips (like the R3000) require nops to be inserted for delays. - FIXME: Currently, we require that the user handle delays. + FIXME: Currently, we require that the user handles delays. In order to fill delay slots for non-interlocked chips, we must have a way to specify delays based on the coprocessor. Eg. 4 cycles if load coproc reg from memory, 1 if in cache, etc. @@ -5923,6 +5819,10 @@ macro (ip) ip->insn_opcode); return; + case M_MOVE: + move_register (&icnt, dreg, sreg); + return; + #ifdef LOSING_COMPILER default: /* Try and see if this is a new itbl instruction. @@ -6003,8 +5903,7 @@ macro2 (ip) anyway. */ load_register (&icnt, AT, &imm_expr, dbl); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dmult" : "mult", - "s,t", sreg, AT); + dbl ? "dmult" : "mult", "s,t", sreg, AT); macro_build ((char *) NULL, &icnt, NULL, "mflo", "d", dreg); break; @@ -6024,12 +5923,10 @@ macro2 (ip) if (imm) load_register (&icnt, AT, &imm_expr, dbl); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dmult" : "mult", - "s,t", sreg, imm ? AT : treg); + dbl ? "dmult" : "mult", "s,t", sreg, imm ? AT : treg); macro_build ((char *) NULL, &icnt, NULL, "mflo", "d", dreg); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dsra32" : "sra", - "d,w,<", dreg, dreg, 31); + dbl ? "dsra32" : "sra", "d,w,<", dreg, dreg, 31); macro_build ((char *) NULL, &icnt, NULL, "mfhi", "d", AT); if (mips_trap) macro_build ((char *) NULL, &icnt, NULL, "tne", "s,t", dreg, AT); @@ -6157,7 +6054,7 @@ macro2 (ip) { as_warn (_("Instruction %s: result is always false"), ip->insn_mo->name); - macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, 0); + move_register (&icnt, dreg, 0); return; } if (imm_expr.X_op == O_constant @@ -6174,9 +6071,7 @@ macro2 (ip) { imm_expr.X_add_number = -imm_expr.X_add_number; macro_build ((char *) NULL, &icnt, &imm_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_GPRS ? "addiu" : "daddiu", "t,r,j", dreg, sreg, (int) BFD_RELOC_LO16); used_at = 0; @@ -6327,9 +6222,7 @@ macro2 (ip) as_warn (_("Instruction %s: result is always true"), ip->insn_mo->name); macro_build ((char *) NULL, &icnt, &expr1, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_GPRS ? "addiu" : "daddiu", "t,r,j", dreg, 0, (int) BFD_RELOC_LO16); return; } @@ -6347,9 +6240,7 @@ macro2 (ip) { imm_expr.X_add_number = -imm_expr.X_add_number; macro_build ((char *) NULL, &icnt, &imm_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), + HAVE_32BIT_GPRS ? "addiu" : "daddiu", "t,r,j", dreg, sreg, (int) BFD_RELOC_LO16); used_at = 0; } @@ -6380,8 +6271,7 @@ macro2 (ip) } load_register (&icnt, AT, &imm_expr, dbl); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dsub" : "sub", - "d,v,t", dreg, sreg, AT); + dbl ? "dsub" : "sub", "d,v,t", dreg, sreg, AT); break; case M_DSUBU_I: @@ -6399,8 +6289,7 @@ macro2 (ip) } load_register (&icnt, AT, &imm_expr, dbl); macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dsubu" : "subu", - "d,v,t", dreg, sreg, AT); + dbl ? "dsubu" : "subu", "d,v,t", dreg, sreg, AT); break; case M_TEQ_I: @@ -6516,9 +6405,7 @@ macro2 (ip) load_address (&icnt, AT, &offset_expr); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, AT, breg); if (! target_big_endian) expr1.X_add_number = off; @@ -6539,9 +6426,7 @@ macro2 (ip) load_address (&icnt, AT, &offset_expr); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, AT, breg); if (target_big_endian) expr1.X_add_number = 0; @@ -6613,9 +6498,7 @@ macro2 (ip) load_address (&icnt, AT, &offset_expr); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, AT, breg); if (! target_big_endian) expr1.X_add_number = off; @@ -6635,9 +6518,7 @@ macro2 (ip) load_address (&icnt, AT, &offset_expr); if (breg != 0) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", AT, AT, breg); if (! target_big_endian) expr1.X_add_number = 0; @@ -6765,8 +6646,7 @@ mips16_macro (ip) dbl = 1; case M_MUL: macro_build ((char *) NULL, &icnt, NULL, - dbl ? "dmultu" : "multu", - "x,y", xreg, yreg); + dbl ? "dmultu" : "multu", "x,y", xreg, yreg); macro_build ((char *) NULL, &icnt, NULL, "mflo", "x", zreg); return; @@ -6779,8 +6659,7 @@ mips16_macro (ip) as_bad (_("Unsupported large constant")); imm_expr.X_add_number = -imm_expr.X_add_number; macro_build ((char *) NULL, &icnt, &imm_expr, - dbl ? "daddiu" : "addiu", - "y,x,4", yreg, xreg); + dbl ? "daddiu" : "addiu", "y,x,4", yreg, xreg); break; case M_SUBU_I_2: @@ -6914,8 +6793,7 @@ mips16_macro (ip) expr1.X_add_number = 0; macro_build ((char *) NULL, &icnt, &expr1, "slti", "x,8", yreg); if (xreg != yreg) - macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - "move", "y,X", xreg, yreg); + move_register (&icnt, xreg, yreg); expr1.X_add_number = 2; macro_build ((char *) NULL, &icnt, &expr1, "bteqz", "p"); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, @@ -7084,7 +6962,7 @@ mips_ip (str, ip) assert (strcmp (insn->name, str) == 0); - if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_arch, mips_gp32)) + if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_arch)) ok = true; else ok = false; @@ -7143,16 +7021,19 @@ mips_ip (str, ip) { case 'r': case 'v': - ip->insn_opcode |= lastregno << 21; + ip->insn_opcode |= lastregno << OP_SH_RS; continue; case 'w': + ip->insn_opcode |= lastregno << OP_SH_RT; + continue; + case 'W': - ip->insn_opcode |= lastregno << 16; + ip->insn_opcode |= lastregno << OP_SH_FT; continue; case 'V': - ip->insn_opcode |= lastregno << 11; + ip->insn_opcode |= lastregno << OP_SH_FS; continue; } break; @@ -7186,9 +7067,9 @@ mips_ip (str, ip) { as_warn (_("Improper shift amount (%ld)"), (long) imm_expr.X_add_number); - imm_expr.X_add_number = imm_expr.X_add_number & 0x1f; + imm_expr.X_add_number &= OP_MASK_SHAMT; } - ip->insn_opcode |= imm_expr.X_add_number << 6; + ip->insn_opcode |= imm_expr.X_add_number << OP_SH_SHAMT; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7199,7 +7080,7 @@ mips_ip (str, ip) if ((unsigned long) imm_expr.X_add_number < 32 || (unsigned long) imm_expr.X_add_number > 63) break; - ip->insn_opcode |= (imm_expr.X_add_number - 32) << 6; + ip->insn_opcode |= (imm_expr.X_add_number - 32) << OP_SH_SHAMT; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7230,9 +7111,9 @@ mips_ip (str, ip) { as_warn (_("Illegal break code (%ld)"), (long) imm_expr.X_add_number); - imm_expr.X_add_number &= 0x3ff; + imm_expr.X_add_number &= OP_MASK_CODE; } - ip->insn_opcode |= imm_expr.X_add_number << 16; + ip->insn_opcode |= imm_expr.X_add_number << OP_SH_CODE; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7244,9 +7125,9 @@ mips_ip (str, ip) { as_warn (_("Illegal lower break code (%ld)"), (long) imm_expr.X_add_number); - imm_expr.X_add_number &= 0x3ff; + imm_expr.X_add_number &= OP_MASK_CODE2; } - ip->insn_opcode |= imm_expr.X_add_number << 6; + ip->insn_opcode |= imm_expr.X_add_number << OP_SH_CODE2; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7254,10 +7135,10 @@ mips_ip (str, ip) case 'B': /* 20-bit syscall/break code. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned) imm_expr.X_add_number > 0xfffff) + if ((unsigned) imm_expr.X_add_number > OP_MASK_CODE20) as_warn (_("Illegal 20-bit code (%ld)"), (long) imm_expr.X_add_number); - ip->insn_opcode |= imm_expr.X_add_number << 6; + ip->insn_opcode |= imm_expr.X_add_number << OP_SH_CODE20; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7279,10 +7160,10 @@ mips_ip (str, ip) case 'J': /* 19-bit wait code. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned) imm_expr.X_add_number > 0x7ffff) + if ((unsigned) imm_expr.X_add_number > OP_MASK_CODE19) as_warn (_("Illegal 19-bit code (%ld)"), (long) imm_expr.X_add_number); - ip->insn_opcode |= imm_expr.X_add_number << 6; + ip->insn_opcode |= imm_expr.X_add_number << OP_SH_CODE19; imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7292,11 +7173,11 @@ mips_ip (str, ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number != 0 && imm_expr.X_add_number != 1) { - as_warn (_("Invalidate performance regster (%ld)"), + as_warn (_("Invalid performance register (%ld)"), (long) imm_expr.X_add_number); - imm_expr.X_add_number &= 1; + imm_expr.X_add_number &= OP_MASK_PERFREG; } - ip->insn_opcode |= (imm_expr.X_add_number << 1); + ip->insn_opcode |= (imm_expr.X_add_number << OP_SH_PERFREG); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -7421,20 +7302,20 @@ mips_ip (str, ip) case 's': case 'v': case 'b': - ip->insn_opcode |= regno << 21; + ip->insn_opcode |= regno << OP_SH_RS; break; case 'd': case 'G': - ip->insn_opcode |= regno << 11; + ip->insn_opcode |= regno << OP_SH_RD; break; case 'U': - ip->insn_opcode |= regno << 11; - ip->insn_opcode |= regno << 16; + ip->insn_opcode |= regno << OP_SH_RD; + ip->insn_opcode |= regno << OP_SH_RT; break; case 'w': case 't': case 'E': - ip->insn_opcode |= regno << 16; + ip->insn_opcode |= regno << OP_SH_RT; break; case 'x': /* This case exists because on the r3000 trunc @@ -7465,10 +7346,10 @@ mips_ip (str, ip) { case 'r': case 'v': - ip->insn_opcode |= lastregno << 21; + ip->insn_opcode |= lastregno << OP_SH_RS; continue; case 'w': - ip->insn_opcode |= lastregno << 16; + ip->insn_opcode |= lastregno << OP_SH_RT; continue; } break; @@ -7496,7 +7377,7 @@ mips_ip (str, ip) as_bad (_("Invalid float register number (%d)"), regno); if ((regno & 1) != 0 - && ! ISA_HAS_64BIT_REGS (mips_opts.isa) + && HAVE_32BIT_FPRS && ! (strcmp (str, "mtc1") == 0 || strcmp (str, "mfc1") == 0 || strcmp (str, "lwc1") == 0 @@ -7521,18 +7402,18 @@ mips_ip (str, ip) switch (c) { case 'D': - ip->insn_opcode |= regno << 6; + ip->insn_opcode |= regno << OP_SH_FD; break; case 'V': case 'S': - ip->insn_opcode |= regno << 11; + ip->insn_opcode |= regno << OP_SH_FS; break; case 'W': case 'T': - ip->insn_opcode |= regno << 16; + ip->insn_opcode |= regno << OP_SH_FT; break; case 'R': - ip->insn_opcode |= regno << 21; + ip->insn_opcode |= regno << OP_SH_FR; break; } lastregno = regno; @@ -7542,10 +7423,10 @@ mips_ip (str, ip) switch (*args++) { case 'V': - ip->insn_opcode |= lastregno << 11; + ip->insn_opcode |= lastregno << OP_SH_FS; continue; case 'W': - ip->insn_opcode |= lastregno << 16; + ip->insn_opcode |= lastregno << OP_SH_FT; continue; } break; @@ -7570,6 +7451,7 @@ mips_ip (str, ip) case 'l': { int f64; + int using_gprs; char *save_in; char *err; unsigned char temp[8]; @@ -7603,9 +7485,15 @@ mips_ip (str, ip) .lit4 inline easily; we need to put .lit8 somewhere in the data segment, and using .lit8 permits the linker to eventually combine identical - .lit8 entries). */ + .lit8 entries). + + The code below needs to know whether the target register + is 32 or 64 bits wide. It relies on the fact 'f' and + 'F' are used with GPR-based instructions and 'l' and + 'L' are used with FPR-based instructions. */ f64 = *args == 'F' || *args == 'L'; + using_gprs = *args == 'F' || *args == 'f'; save_in = input_line_pointer; input_line_pointer = s; @@ -7638,18 +7526,24 @@ mips_ip (str, ip) } else if (length > 4 && ! mips_disable_float_construction + /* Constants can only be constructed in GPRs and + copied to FPRs if the GPRs are at least as wide + as the FPRs. Force the constant into memory if + we are using 64-bit FPRs but the GPRs are only + 32 bits wide. */ + && (using_gprs + || ! (HAVE_64BIT_FPRS && HAVE_32BIT_GPRS)) && ((temp[0] == 0 && temp[1] == 0) || (temp[2] == 0 && temp[3] == 0)) && ((temp[4] == 0 && temp[5] == 0) || (temp[6] == 0 && temp[7] == 0))) { - /* The value is simple enough to load with a - couple of instructions. In mips1 mode, set - imm_expr to the high order 32 bits and - offset_expr to the low order 32 bits. - Otherwise, set imm_expr to the entire 64 bit - constant. */ - if (! ISA_HAS_64BIT_REGS (mips_opts.isa)) + /* The value is simple enough to load with a couple of + instructions. If using 32-bit registers, set + imm_expr to the high order 32 bits and offset_expr to + the low order 32 bits. Otherwise, set imm_expr to + the entire 64 bit constant. */ + if (using_gprs ? HAVE_32BIT_GPRS : HAVE_32BIT_FPRS) { imm_expr.X_op = O_constant; offset_expr.X_op = O_constant; @@ -7820,7 +7714,7 @@ mips_ip (str, ip) && imm_expr.X_op == O_constant) || (more && imm_expr.X_add_number < 0 - && ISA_HAS_64BIT_REGS (mips_opts.isa) + && HAVE_64BIT_GPRS && imm_expr.X_unsigned && sizeof (imm_expr.X_add_number) <= 4)) { @@ -8945,6 +8839,8 @@ struct option md_longopts[] = {"march", required_argument, NULL, OPTION_MARCH}, #define OPTION_MTUNE (OPTION_MD_BASE + 32) {"mtune", required_argument, NULL, OPTION_MTUNE}, +#define OPTION_FP32 (OPTION_MD_BASE + 33) + {"mfp32", no_argument, NULL, OPTION_FP32}, #ifdef OBJ_ELF #define OPTION_ELF_BASE (OPTION_MD_BASE + 35) #define OPTION_CALL_SHARED (OPTION_ELF_BASE + 0) @@ -9080,18 +8976,31 @@ md_parse_option (c, arg) switch (c) { case OPTION_MTUNE: + if (mips_tune != CPU_UNKNOWN && mips_tune != cpu) + as_warn(_("A different -mtune= was already specified, is now " + "-mtune=%s"), arg); mips_tune = cpu; break; case OPTION_MARCH: + if (mips_arch != CPU_UNKNOWN && mips_arch != cpu) + as_warn(_("A different -march= was already specified, is now " + "-march=%s"), arg); mips_arch = cpu; break; case OPTION_MCPU: + if (mips_cpu != CPU_UNKNOWN && mips_cpu != cpu) + as_warn(_("A different -mcpu= was already specified, is now " + "-mcpu=%s"), arg); mips_cpu = cpu; } } break; case OPTION_M4650: + if ((mips_arch != CPU_UNKNOWN && mips_arch != CPU_R4650) + || (mips_tune != CPU_UNKNOWN && mips_tune != CPU_R4650)) + as_warn(_("A different -march= or -mtune= was already specified, " + "is now -m4650")); mips_arch = CPU_R4650; mips_tune = CPU_R4650; break; @@ -9100,6 +9009,10 @@ md_parse_option (c, arg) break; case OPTION_M4010: + if ((mips_arch != CPU_UNKNOWN && mips_arch != CPU_R4010) + || (mips_tune != CPU_UNKNOWN && mips_tune != CPU_R4010)) + as_warn(_("A different -march= or -mtune= was already specified, " + "is now -m4010")); mips_arch = CPU_R4010; mips_tune = CPU_R4010; break; @@ -9108,6 +9021,10 @@ md_parse_option (c, arg) break; case OPTION_M4100: + if ((mips_arch != CPU_UNKNOWN && mips_arch != CPU_VR4100) + || (mips_tune != CPU_UNKNOWN && mips_tune != CPU_VR4100)) + as_warn(_("A different -march= or -mtune= was already specified, " + "is now -m4100")); mips_arch = CPU_VR4100; mips_tune = CPU_VR4100; break; @@ -9116,6 +9033,10 @@ md_parse_option (c, arg) break; case OPTION_M3900: + if ((mips_arch != CPU_UNKNOWN && mips_arch != CPU_R3900) + || (mips_tune != CPU_UNKNOWN && mips_tune != CPU_R3900)) + as_warn(_("A different -march= or -mtune= was already specified, " + "is now -m3900")); mips_arch = CPU_R3900; mips_tune = CPU_R3900; break; @@ -9247,13 +9168,20 @@ md_parse_option (c, arg) #endif break; + case OPTION_FP32: + mips_fp32 = 1; + break; + case OPTION_MABI: if (strcmp (arg, "32") == 0 || strcmp (arg, "n32") == 0 || strcmp (arg, "64") == 0 || strcmp (arg, "o64") == 0 || strcmp (arg, "eabi") == 0) - mips_abi_string = arg; + { + mips_abi_string = arg; + mips_32bit_abi = (strcmp (arg, "32") == 0); + } break; case OPTION_M7000_HILO_FIX: @@ -9312,7 +9240,7 @@ MIPS options:\n\ -membedded-pic generate embedded position independent code\n\ -EB generate big endian output\n\ -EL generate little endian output\n\ --g, -g2 do not remove uneeded NOPs or swap branches\n\ +-g, -g2 do not remove unneeded NOPs or swap branches\n\ -G NUM allow referencing objects up to NUM bytes\n\ implicitly with the gp register [default 8]\n")); fprintf (stream, _("\ @@ -9369,6 +9297,8 @@ MIPS options:\n\ -mips16 generate mips16 instructions\n\ -no-mips16 do not generate mips16 instructions\n")); fprintf (stream, _("\ +-mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\ +-mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\ -O0 remove unneeded NOPs, do not swap branches\n\ -O remove unneeded NOPs and swap branches\n\ -n warn about NOPs generated from macros\n\ @@ -9613,7 +9543,9 @@ md_apply_fix (fixP, valueP) { valueT symval = S_GET_VALUE (fixP->fx_addsy); value -= symval; - if (value != 0 && ! fixP->fx_pcrel) + if (value != 0 + && ! fixP->fx_pcrel + && fixP->fx_r_type != BFD_RELOC_MIPS_GPREL) { /* In this case, the bfd_install_relocation routine will incorrectly add the symbol value back in. We just want @@ -10400,8 +10332,8 @@ s_mipsset (x) case 1: mips_opts.isa = ISA_MIPS1; break; case 2: mips_opts.isa = ISA_MIPS2; break; case 3: mips_opts.isa = ISA_MIPS3; break; - case 5: mips_opts.isa = ISA_MIPS5; break; case 4: mips_opts.isa = ISA_MIPS4; break; + case 5: mips_opts.isa = ISA_MIPS5; break; case 32: mips_opts.isa = ISA_MIPS32; break; case 64: mips_opts.isa = ISA_MIPS64; break; default: as_bad (_("unknown ISA level")); break; @@ -10546,9 +10478,7 @@ s_cprestore (ignore) ex.X_add_number = mips_cprestore_offset; macro_build ((char *) NULL, &icnt, &ex, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "sw" : "sd"), + HAVE_32BIT_ADDRESSES ? "sw" : "sd", "t,o(b)", GP, (int) BFD_RELOC_LO16, SP); demand_empty_rest_of_line (); @@ -10614,9 +10544,7 @@ s_cpadd (ignore) /* Add $gp to the register named as an argument. */ reg = tc_get_register (0); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, - ((bfd_arch_bits_per_address (stdoutput) == 32 - || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addu" : "daddu"), + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", reg, reg, GP); demand_empty_rest_of_line (); @@ -11142,13 +11070,13 @@ md_estimate_size_before_relax (fragp, se + RELAX_RELOC1 (fragp->fr_subtype)); /* FIXME: This really needs as_warn_where. */ if (RELAX_WARN (fragp->fr_subtype)) - as_warn (_("AT used after \".set noat\" or macro used after \".set nomacro\"")); + as_warn (_("AT used after \".set noat\" or macro used after " + "\".set nomacro\"")); + + return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype); } - if (! change) - return 0; - else - return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype); + return 0; } /* This is called to see whether a reloc against a defined symbol @@ -11646,7 +11574,7 @@ mips_elf_final_processing () elf_elfheader (stdoutput)->e_flags |= EF_MIPS_PIC; /* Set the MIPS ELF ABI flags. */ - if (mips_abi_string == 0) + if (mips_abi_string == NULL) ; else if (strcmp (mips_abi_string, "32") == 0) elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32; @@ -11724,7 +11652,7 @@ md_obj_end () { /* check for premature end, nesting errors, etc */ if (cur_proc_ptr) - as_warn (_("missing `.end' at end of assembly")); + as_warn (_("missing .end at end of assembly")); } static long @@ -11913,7 +11841,7 @@ s_mips_ent (aent) as_warn (_(".ent or .aent not in text section.")); if (!aent && cur_proc_ptr) - as_warn (_("missing `.end'")); + as_warn (_("missing .end")); if (!aent) { diff -Nupr binutils-2.11.90.0.25/gas/config/tc-mn10200.c binutils-2.11.90.0.27/gas/config/tc-mn10200.c --- binutils-2.11.90.0.25/gas/config/tc-mn10200.c Thu Mar 29 17:36:12 2001 +++ binutils-2.11.90.0.27/gas/config/tc-mn10200.c Sat Aug 4 19:52:15 2001 @@ -197,6 +197,9 @@ data_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (data_registers, DATA_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -207,20 +210,12 @@ data_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -249,6 +244,9 @@ address_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (address_registers, ADDRESS_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -259,20 +257,12 @@ address_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -301,6 +291,9 @@ other_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (other_registers, OTHER_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -311,20 +304,12 @@ other_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } void diff -Nupr binutils-2.11.90.0.25/gas/config/tc-mn10300.c binutils-2.11.90.0.27/gas/config/tc-mn10300.c --- binutils-2.11.90.0.25/gas/config/tc-mn10300.c Mon May 21 10:36:15 2001 +++ binutils-2.11.90.0.27/gas/config/tc-mn10300.c Sat Aug 4 19:52:15 2001 @@ -302,6 +302,9 @@ r_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (r_registers, R_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -312,20 +315,12 @@ r_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -354,6 +349,9 @@ xr_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (xr_registers, XR_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -364,20 +362,12 @@ xr_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -406,6 +396,9 @@ data_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (data_registers, DATA_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -416,20 +409,12 @@ data_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -458,6 +443,9 @@ address_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (address_registers, ADDRESS_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -468,21 +456,12 @@ address_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Summary of register_name(). @@ -511,6 +490,9 @@ other_register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (other_registers, OTHER_REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -521,20 +503,12 @@ other_register_name (expressionP) expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - /* Put back the delimiting char. */ - *input_line_pointer = c; - - /* Reset input_line pointer. */ - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } void diff -Nupr binutils-2.11.90.0.25/gas/config/tc-ppc.c binutils-2.11.90.0.27/gas/config/tc-ppc.c --- binutils-2.11.90.0.25/gas/config/tc-ppc.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/config/tc-ppc.c Sat Aug 4 19:52:15 2001 @@ -586,6 +586,9 @@ register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); + /* Put back the delimiting char. */ + *input_line_pointer = c; + /* Look to see if it's in the register table. */ if (reg_number >= 0) { @@ -595,17 +598,12 @@ register_name (expressionP) /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - /* Put back the delimiting char. */ - *input_line_pointer = c; return true; } - else - { - /* Reset the line as if we had not done anything. */ - *input_line_pointer = c; - input_line_pointer = start; - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* This function is called for each symbol seen in an expression. It @@ -1578,11 +1576,11 @@ ppc_elf_validate_fix (fixp, seg) && fixp->fx_r_type != BFD_RELOC_LO16_BASEREL && fixp->fx_r_type != BFD_RELOC_HI16_BASEREL && fixp->fx_r_type != BFD_RELOC_HI16_S_BASEREL + && (seg->flags & SEC_LOAD) != 0 && strcmp (segment_name (seg), ".got2") != 0 && strcmp (segment_name (seg), ".dtors") != 0 && strcmp (segment_name (seg), ".ctors") != 0 && strcmp (segment_name (seg), ".fixup") != 0 - && strcmp (segment_name (seg), ".stab") != 0 && strcmp (segment_name (seg), ".gcc_except_table") != 0 && strcmp (segment_name (seg), ".eh_frame") != 0 && strcmp (segment_name (seg), ".ex_shared") != 0) diff -Nupr binutils-2.11.90.0.25/gas/config/tc-s390.c binutils-2.11.90.0.27/gas/config/tc-s390.c --- binutils-2.11.90.0.25/gas/config/tc-s390.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/config/tc-s390.c Sat Aug 4 19:52:15 2001 @@ -251,7 +251,7 @@ register_name (expressionP) char *start; char c; - /* Find the spelling of the operand */ + /* Find the spelling of the operand. */ start = name = input_line_pointer; if (name[0] == '%' && isalpha (name[1])) name = ++input_line_pointer; @@ -261,25 +261,24 @@ register_name (expressionP) c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); - /* look to see if it's in the register table */ + /* Put back the delimiting char. */ + *input_line_pointer = c; + + /* Look to see if it's in the register table. */ if (reg_number >= 0) { expressionP->X_op = O_register; expressionP->X_add_number = reg_number; - /* make the rest nice */ + /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - *input_line_pointer = c; /* put back the delimiting char */ return true; } - else - { - /* reset the line as if we had not done anything */ - *input_line_pointer = c; /* put back the delimiting char */ - input_line_pointer = start; /* reset input_line pointer */ - return false; - } + + /* Reset the line as if we had not done anything. */ + input_line_pointer = start; + return false; } /* Local variables. */ diff -Nupr binutils-2.11.90.0.25/gas/config/tc-z8k.c binutils-2.11.90.0.27/gas/config/tc-z8k.c --- binutils-2.11.90.0.25/gas/config/tc-z8k.c Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/config/tc-z8k.c Sat Aug 4 19:52:15 2001 @@ -259,7 +259,7 @@ parse_reg (src, mode, reg) char *res = 0; char regno; - if (src[0] == 's' && src[1] == 'p') + if (src[0] == 's' && src[1] == 'p' && (src[2] == 0 || src[2] == ',')) { if (segmented_mode) { @@ -277,6 +277,8 @@ parse_reg (src, mode, reg) { if (src[1] == 'r') { + if (src[2] < '0' || src[2] > '9') + return res; /* Assume no register name but a label starting with 'rr'. */ *mode = CLASS_REG_LONG; res = whatreg (reg, src + 2); regno = *reg; @@ -285,6 +287,8 @@ parse_reg (src, mode, reg) } else if (src[1] == 'h') { + if (src[2] < '0' || src[2] > '9') + return res; /* Assume no register name but a label starting with 'rh'. */ *mode = CLASS_REG_BYTE; res = whatreg (reg, src + 2); regno = *reg; @@ -293,6 +297,8 @@ parse_reg (src, mode, reg) } else if (src[1] == 'l') { + if (src[2] < '0' || src[2] > '9') + return res; /* Assume no register name but a label starting with 'rl'. */ *mode = CLASS_REG_BYTE; res = whatreg (reg, src + 2); regno = *reg; @@ -302,6 +308,8 @@ parse_reg (src, mode, reg) } else if (src[1] == 'q') { + if (src[2] < '0' || src[2] > '9') + return res; /* Assume no register name but a label starting with 'rq'. */ *mode = CLASS_REG_QUAD; res = whatreg (reg, src + 2); regno = *reg; @@ -310,6 +318,8 @@ parse_reg (src, mode, reg) } else { + if (src[1] < '0' || src[1] > '9') + return res; /* Assume no register name but a label starting with 'r'. */ *mode = CLASS_REG_WORD; res = whatreg (reg, src + 1); regno = *reg; diff -Nupr binutils-2.11.90.0.25/gas/configure binutils-2.11.90.0.27/gas/configure --- binutils-2.11.90.0.25/gas/configure Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/configure Fri Aug 10 14:08:01 2001 @@ -2157,7 +2157,7 @@ fi using_cgen=no -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2366,8 +2366,8 @@ for this_target in $target $canon_target i386-*-beospe*) fmt=coff em=pe bfd_gas=yes ;; i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; i386-*-bsd*) fmt=aout em=386bsd ;; - i386-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; i386-*-netbsd0.8) fmt=aout em=386bsd ;; + i386-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;; i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;; @@ -3098,7 +3098,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3101: checking for $ac_word" >&5 +echo "configure:3102: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3128,7 +3128,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3131: checking for $ac_word" >&5 +echo "configure:3132: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3179,7 +3179,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3182: checking for $ac_word" >&5 +echo "configure:3183: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3211,7 +3211,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3214: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:3215: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -3222,12 +3222,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 3225 "configure" +#line 3226 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:3230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -3253,12 +3253,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:3256: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:3257: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:3261: checking whether we are using GNU C" >&5 +echo "configure:3262: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3267,7 +3267,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -3286,7 +3286,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:3289: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:3290: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3323,7 +3323,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3326: checking for $ac_word" >&5 +echo "configure:3327: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3354,7 +3354,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3357: checking how to run the C preprocessor" >&5 +echo "configure:3358: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3369,13 +3369,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3386,13 +3386,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3403,13 +3403,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3439,7 +3439,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3442: checking for $ac_word" >&5 +echo "configure:3443: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3472,7 +3472,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3475: checking for $ac_word" >&5 +echo "configure:3476: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3506,7 +3506,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3509: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3510: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3514,7 +3514,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3548,7 +3548,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3551: checking lex output file root" >&5 +echo "configure:3552: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3569,7 +3569,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3572: checking whether yytext is a pointer" >&5 +echo "configure:3573: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3581,14 +3581,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3614,7 +3614,7 @@ ALL_LINGUAS= # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3617: checking for $ac_word" >&5 +echo "configure:3618: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3642,12 +3642,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3645: checking for ANSI C header files" >&5 +echo "configure:3646: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3655,7 +3655,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3672,7 +3672,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3690,7 +3690,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3711,7 +3711,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3722,7 +3722,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:3725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3746,12 +3746,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3749: checking for working const" >&5 +echo "configure:3750: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3821,21 +3821,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3824: checking for inline" >&5 +echo "configure:3825: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3861,12 +3861,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3864: checking for off_t" >&5 +echo "configure:3865: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3894,12 +3894,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3897: checking for size_t" >&5 +echo "configure:3898: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3929,19 +3929,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3932: checking for working alloca.h" >&5 +echo "configure:3933: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3962,12 +3962,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3965: checking for alloca" >&5 +echo "configure:3966: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4027,12 +4027,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4030: checking whether alloca needs Cray hooks" >&5 +echo "configure:4031: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4060: checking for $ac_func" >&5 +echo "configure:4061: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4112,7 +4112,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4115: checking stack direction for C alloca" >&5 +echo "configure:4116: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4120,7 +4120,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4164,17 +4164,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4167: checking for $ac_hdr" >&5 +echo "configure:4168: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4203,12 +4203,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4206: checking for $ac_func" >&5 +echo "configure:4207: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4256,7 +4256,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4259: checking for working mmap" >&5 +echo "configure:4260: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4264,7 +4264,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4432,17 +4432,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4435: checking for $ac_hdr" >&5 +echo "configure:4436: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4472,12 +4472,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4475: checking for $ac_func" >&5 +echo "configure:4476: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4529,12 +4529,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4532: checking for $ac_func" >&5 +echo "configure:4533: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4591,19 +4591,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4594: checking for LC_MESSAGES" >&5 +echo "configure:4595: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4624,7 +4624,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4627: checking whether NLS is requested" >&5 +echo "configure:4628: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4644,7 +4644,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4647: checking whether included gettext is requested" >&5 +echo "configure:4648: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4663,17 +4663,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4666: checking for libintl.h" >&5 +echo "configure:4667: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4690,19 +4690,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4693: checking for gettext in libc" >&5 +echo "configure:4694: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4718,7 +4718,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4721: checking for bindtextdomain in -lintl" >&5 +echo "configure:4722: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4726,7 +4726,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4753,19 +4753,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4756: checking for gettext in libintl" >&5 +echo "configure:4757: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4793,7 +4793,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4796: checking for $ac_word" >&5 +echo "configure:4797: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4827,12 +4827,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4830: checking for $ac_func" >&5 +echo "configure:4831: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4882,7 +4882,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4885: checking for $ac_word" >&5 +echo "configure:4886: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4918,7 +4918,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4921: checking for $ac_word" >&5 +echo "configure:4922: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4950,7 +4950,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4990,7 +4990,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4993: checking for $ac_word" >&5 +echo "configure:4994: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5024,7 +5024,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5027: checking for $ac_word" >&5 +echo "configure:5028: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5060,7 +5060,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5063: checking for $ac_word" >&5 +echo "configure:5064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5150,7 +5150,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5153: checking for catalogs to be installed" >&5 +echo "configure:5154: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5178,17 +5178,17 @@ echo "configure:5153: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5181: checking for linux/version.h" >&5 +echo "configure:5182: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5251,7 +5251,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5254: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:5255: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -5276,7 +5276,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5279: checking for executable suffix" >&5 +echo "configure:5280: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5286,7 +5286,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:5289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -5311,17 +5311,17 @@ for ac_hdr in string.h stdlib.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5314: checking for $ac_hdr" >&5 +echo "configure:5315: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5351,7 +5351,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5354: checking whether compiling a cross-assembler" >&5 +echo "configure:5355: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -5366,19 +5366,19 @@ echo "$ac_t""$cross_gas" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5369: checking for working alloca.h" >&5 +echo "configure:5370: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5399,12 +5399,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5402: checking for alloca" >&5 +echo "configure:5403: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5464,12 +5464,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5467: checking whether alloca needs Cray hooks" >&5 +echo "configure:5468: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5497: checking for $ac_func" >&5 +echo "configure:5498: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5549,7 +5549,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5552: checking stack direction for C alloca" >&5 +echo "configure:5553: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5557,7 +5557,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5598,21 +5598,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5601: checking for inline" >&5 +echo "configure:5602: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5642,12 +5642,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5645: checking for $ac_func" >&5 +echo "configure:5646: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5699,12 +5699,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5702: checking for $ac_func" >&5 +echo "configure:5703: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5762,7 +5762,7 @@ case $host in ;; *-ncr-sysv4.3*) echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5765: checking for _mwvalidcheckl in -lmw" >&5 +echo "configure:5766: checking for _mwvalidcheckl in -lmw" >&5 ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5770,7 +5770,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5802,7 +5802,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5805: checking for main in -lm" >&5 +echo "configure:5806: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5810,14 +5810,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5840,7 +5840,7 @@ fi ;; *) echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5843: checking for main in -lm" >&5 +echo "configure:5844: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5848,14 +5848,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5886,12 +5886,12 @@ esac # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5889: checking for working assert macro" >&5 +echo "configure:5890: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5907,7 +5907,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5948,12 +5948,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5951: checking whether declaration is required for strstr" >&5 +echo "configure:5952: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -5985,12 +5985,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5988: checking whether declaration is required for malloc" >&5 +echo "configure:5989: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -6022,12 +6022,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6025: checking whether declaration is required for free" >&5 +echo "configure:6026: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -6059,12 +6059,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6062: checking whether declaration is required for sbrk" >&5 +echo "configure:6063: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -6096,12 +6096,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6099: checking whether declaration is required for environ" >&5 +echo "configure:6100: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -6136,12 +6136,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6139: checking whether declaration is required for errno" >&5 +echo "configure:6140: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff -Nupr binutils-2.11.90.0.25/gas/configure.in binutils-2.11.90.0.27/gas/configure.in --- binutils-2.11.90.0.25/gas/configure.in Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/configure.in Fri Aug 10 14:08:01 2001 @@ -44,7 +44,7 @@ esac])dnl using_cgen=no -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff -Nupr binutils-2.11.90.0.25/gas/depend.c binutils-2.11.90.0.27/gas/depend.c --- binutils-2.11.90.0.25/gas/depend.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/depend.c Sat Aug 4 19:52:15 2001 @@ -197,7 +197,7 @@ print_dependencies () f = fopen (dep_file, FOPEN_WT); if (f == NULL) { - as_warn (_("Can't open `%s' for writing"), dep_file); + as_warn (_("can't open `%s' for writing"), dep_file); return; } @@ -209,5 +209,5 @@ print_dependencies () putc ('\n', f); if (fclose (f)) - as_warn (_("Can't close `%s'"), dep_file); + as_warn (_("can't close `%s'"), dep_file); } diff -Nupr binutils-2.11.90.0.25/gas/doc/c-mips.texi binutils-2.11.90.0.27/gas/doc/c-mips.texi --- binutils-2.11.90.0.25/gas/doc/c-mips.texi Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/doc/c-mips.texi Sat Aug 4 19:52:15 2001 @@ -75,13 +75,17 @@ instruction sets during the assembly; se override the ISA level}. @item -mgp32 -Assume that 32-bit general purpose registers are available. This -affects synthetic instructions such as @code{move}, which will assemble -to a 32-bit or a 64-bit instruction depending on this flag. On some -MIPS variants there is a 32-bit mode flag; when this flag is set, -64-bit instructions generate a trap. Also, some 32-bit OSes only save -the 32-bit registers on a context switch, so it is essential never to -use the 64-bit registers. +@itemx -mfp32 +Some macros have different expansions for 32-bit and 64-bit registers. +The register sizes are normally inferred from the ISA and ABI, but these +flags force a certain group of registers to be treated as 32 bits wide at +all times. @samp{-mgp32} controls the size of general-purpose registers +and @samp{-mfp32} controls the size of floating-point registers. + +On some MIPS variants there is a 32-bit mode flag; when this flag is +set, 64-bit instructions generate a trap. Also, some 32-bit OSes only +save the 32-bit registers on a context switch, so it is essential never +to use the 64-bit registers. @item -mgp64 Assume that 64-bit general purpose registers are available. This is diff -Nupr binutils-2.11.90.0.25/gas/dwarf2dbg.c binutils-2.11.90.0.27/gas/dwarf2dbg.c --- binutils-2.11.90.0.25/gas/dwarf2dbg.c Tue Jun 19 11:57:57 2001 +++ binutils-2.11.90.0.27/gas/dwarf2dbg.c Sat Aug 4 19:52:15 2001 @@ -341,13 +341,13 @@ dwarf2_directive_file (dummy) if (num < 1) { - as_bad (_("File number less than one")); + as_bad (_("file number less than one")); return; } if (num < files_in_use && files[num].filename != 0) { - as_bad (_("File number %ld already allocated"), (long) num); + as_bad (_("file number %ld already allocated"), (long) num); return; } @@ -383,12 +383,12 @@ dwarf2_directive_loc (dummy) if (filenum < 1) { - as_bad (_("File number less than one")); + as_bad (_("file number less than one")); return; } if (filenum >= (int) files_in_use || files[filenum].filename == 0) { - as_bad (_("Unassigned file number %ld"), (long) filenum); + as_bad (_("unassigned file number %ld"), (long) filenum); return; } @@ -933,7 +933,7 @@ out_file_list () { if (files[i].filename == NULL) { - as_bad (_("Unassigned file number %u"), i); + as_bad (_("unassigned file number %ld"), (long) i); continue; } diff -Nupr binutils-2.11.90.0.25/gas/ecoff.c binutils-2.11.90.0.27/gas/ecoff.c --- binutils-2.11.90.0.25/gas/ecoff.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/ecoff.c Sat Aug 4 19:52:15 2001 @@ -1553,7 +1553,7 @@ add_string (vp, hash_tbl, str, ret_hash) register shash_t *hash_ptr; if (len >= PAGE_USIZE) - as_fatal (_("String too big (%lu bytes)"), len); + as_fatal (_("string too big (%lu bytes)"), len); hash_ptr = (shash_t *) hash_find (hash_tbl, str); if (hash_ptr == (shash_t *) NULL) @@ -1579,7 +1579,7 @@ add_string (vp, hash_tbl, str, ret_hash) err = hash_insert (hash_tbl, str, (char *) hash_ptr); if (err) - as_fatal (_("Inserting \"%s\" into string hash table: %s"), + as_fatal (_("inserting \"%s\" into string hash table: %s"), str, err); } @@ -2042,7 +2042,7 @@ get_tag (tag, sym, basic_type) hash_ptr = allocate_shash (); err = hash_insert (tag_hash, perm, (char *) hash_ptr); if (err) - as_fatal (_("Inserting \"%s\" into tag hash table: %s"), + as_fatal (_("inserting \"%s\" into tag hash table: %s"), tag, err); hash_ptr->string = perm; } @@ -2298,7 +2298,7 @@ add_file (file_name, indx, fake) (shash_t **)0); if (strlen (file_name) > PAGE_USIZE - 2) - as_fatal (_("Filename goes over one page boundary.")); + as_fatal (_("filename goes over one page boundary")); /* Push the start of the filename. We assume that the filename will be stored at string offset 1. */ @@ -2538,7 +2538,7 @@ ecoff_directive_def (ignore) if (coff_sym_name != (char *) NULL) as_warn (_(".def pseudo-op used inside of .def/.endef; ignored")); else if (*name == '\0') - as_warn (_("Empty symbol name in .def; ignored")); + as_warn (_("empty symbol name in .def; ignored")); else { if (coff_sym_name != (char *) NULL) @@ -2591,7 +2591,7 @@ ecoff_directive_dim (ignore) { if (*input_line_pointer != '\n' && *input_line_pointer != ';') - as_warn (_("Badly formed .dim directive")); + as_warn (_("badly formed .dim directive")); break; } } @@ -2604,7 +2604,7 @@ ecoff_directive_dim (ignore) { if (coff_type.num_dims >= N_TQ) { - as_warn (_("Too many .dim entries")); + as_warn (_("too many .dim entries")); break; } coff_type.dimensions[coff_type.num_dims] = dimens[i]; @@ -2666,7 +2666,7 @@ ecoff_directive_size (ignore) { if (*input_line_pointer != '\n' && *input_line_pointer != ';') - as_warn (_("Badly formed .size directive")); + as_warn (_("badly formed .size directive")); break; } } @@ -2679,7 +2679,7 @@ ecoff_directive_size (ignore) { if (coff_type.num_sizes >= N_TQ) { - as_warn (_("Too many .size entries")); + as_warn (_("too many .size entries")); break; } coff_type.sizes[coff_type.num_sizes] = sizes[i]; @@ -2720,7 +2720,7 @@ ecoff_directive_type (ignore) /* FIXME: We could handle this by setting the continued bit. There would still be a limit: the .type argument can not be infinite. */ - as_warn (_("The type of %s is too complex; it will be simplified"), + as_warn (_("the type of %s is too complex; it will be simplified"), coff_sym_name); break; } @@ -2862,7 +2862,7 @@ ecoff_directive_endef (ignore) if (coff_type.num_sizes != 1 || diff < 0) { - as_warn (_("Bad COFF debugging info")); + as_warn (_("bad COFF debugging information")); return; } @@ -2911,7 +2911,7 @@ ecoff_directive_endef (ignore) { if (coff_tag == (char *) NULL) { - as_warn (_("No tag specified for %s"), name); + as_warn (_("no tag specified for %s"), name); return; } @@ -2943,7 +2943,7 @@ ecoff_directive_endef (ignore) if (coff_type.num_sizes - coff_type.num_dims - coff_type.extra_sizes != 1) { - as_warn (_("Bad COFF debugging information")); + as_warn (_("bad COFF debugging information")); return; } else @@ -3010,7 +3010,6 @@ ecoff_directive_end (ignore) { char *name; char name_end; - register int ch; symbolS *ent; if (cur_file_ptr == (efdr_t *) NULL) @@ -3030,8 +3029,7 @@ ecoff_directive_end (ignore) name = input_line_pointer; name_end = get_symbol_end (); - ch = *name; - if (! is_name_beginner (ch)) + if (name == input_line_pointer) { as_warn (_(".end directive has no name")); *input_line_pointer = name_end; @@ -3067,7 +3065,6 @@ ecoff_directive_ent (ignore) { char *name; char name_end; - register int ch; if (cur_file_ptr == (efdr_t *) NULL) add_file ((const char *) NULL, 0, 1); @@ -3082,8 +3079,7 @@ ecoff_directive_ent (ignore) name = input_line_pointer; name_end = get_symbol_end (); - ch = *name; - if (! is_name_beginner (ch)) + if (name == input_line_pointer) { as_warn (_(".ent directive has no name")); *input_line_pointer = name_end; @@ -3149,7 +3145,7 @@ ecoff_directive_file (ignore) if (cur_proc_ptr != (proc_t *) NULL) { - as_warn (_("No way to handle .file within .ent/.end section")); + as_warn (_("no way to handle .file within .ent/.end section")); demand_empty_rest_of_line (); return; } @@ -3181,7 +3177,7 @@ ecoff_directive_fmask (ignore) if (get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .fmask directive")); + as_warn (_("bad .fmask directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3214,7 +3210,7 @@ ecoff_directive_frame (ignore) if (*input_line_pointer++ != ',' || get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .frame directive")); + as_warn (_("bad .frame directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3251,7 +3247,7 @@ ecoff_directive_mask (ignore) if (get_absolute_expression_and_terminator (&val) != ',') { - as_warn (_("Bad .mask directive")); + as_warn (_("bad .mask directive")); --input_line_pointer; demand_empty_rest_of_line (); return; @@ -3400,7 +3396,7 @@ ecoff_directive_weakext (ignore) { if (S_IS_DEFINED (symbolP)) { - as_bad (_("Ignoring attempt to redefine symbol `%s'."), + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); ignore_rest_of_line (); return; @@ -3526,7 +3522,7 @@ ecoff_stab (sec, what, string, type, oth dummy_symr.index = desc; if (dummy_symr.index != desc) { - as_warn (_("Line number (%d) for .stab%c directive cannot fit in index field (20 bits)"), + as_warn (_("line number (%d) for .stab%c directive cannot fit in index field (20 bits)"), desc, what); return; } @@ -3562,7 +3558,7 @@ ecoff_stab (sec, what, string, type, oth } else if (! is_name_beginner ((unsigned char) *input_line_pointer)) { - as_warn (_("Illegal .stab%c directive, bad character"), what); + as_warn (_("illegal .stab%c directive, bad character"), what); return; } else @@ -3645,7 +3641,7 @@ ecoff_frob_symbol (sym) if (S_IS_WEAK (sym)) { if (S_IS_COMMON (sym)) - as_bad (_("Symbol `%s' can not be both weak and common"), + as_bad (_("symbol `%s' can not be both weak and common"), S_GET_NAME (sym)); } } @@ -4740,7 +4736,7 @@ ecoff_build_debug (hdr, bufp, backend) cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev; if (! end_warning && ! cur_file_ptr->fake) { - as_warn (_("Missing .end or .bend at end of file")); + as_warn (_("missing .end or .bend at end of file")); end_warning = 1; } } diff -Nupr binutils-2.11.90.0.25/gas/expr.c binutils-2.11.90.0.27/gas/expr.c --- binutils-2.11.90.0.25/gas/expr.c Tue Jun 19 11:57:57 2001 +++ binutils-2.11.90.0.27/gas/expr.c Sat Aug 4 19:52:15 2001 @@ -81,9 +81,9 @@ make_expr_symbol (expressionP) generic_floating_point_number or generic_bignum, and we are going to lose it if we haven't already. */ if (expressionP->X_add_number > 0) - as_bad (_("bignum invalid; zero assumed")); + as_bad (_("bignum invalid")); else - as_bad (_("floating point number invalid; zero assumed")); + as_bad (_("floating point number invalid")); zero.X_op = O_constant; zero.X_add_number = 0; zero.X_unsigned = 0; @@ -243,11 +243,12 @@ floating_constant (expressionP) { if (error_code == ERROR_EXPONENT_OVERFLOW) { - as_bad (_("bad floating-point constant: exponent overflow, probably assembling junk")); + as_bad (_("bad floating-point constant: exponent overflow")); } else { - as_bad (_("bad floating-point constant: unknown error code=%d."), error_code); + as_bad (_("bad floating-point constant: unknown error code=%d"), + error_code); } } expressionP->X_op = O_big; @@ -427,7 +428,7 @@ integer_constant (radix, expressionP) /* Check for 8 digit per word max. */ if (ndigit > 8) - as_bad (_("A bignum with underscores may not have more than 8 hex digits in any word.")); + as_bad (_("a bignum with underscores may not have more than 8 hex digits in any word")); /* Add this chunk to the bignum. Shift things down 2 little digits. */ @@ -450,7 +451,7 @@ integer_constant (radix, expressionP) assert (num_little_digits >= 4); if (num_little_digits != 8) - as_bad (_("A bignum with underscores must have exactly 4 words.")); + as_bad (_("a bignum with underscores must have exactly 4 words")); /* We might have some leading zeros. These can be trimmed to give us a change to fit this constant into a small number. */ @@ -573,7 +574,7 @@ integer_constant (radix, expressionP) /* Either not seen or not defined. */ /* @@ Should print out the original string instead of the parsed number. */ - as_bad (_("backw. ref to unknown label \"%d:\", 0 assumed."), + as_bad (_("backward ref to unknown label \"%d:\""), (int) number); expressionP->X_op = O_constant; } @@ -696,7 +697,7 @@ mri_char_constant (expressionP) if (i < 0) { - as_bad (_("Character constant too large")); + as_bad (_("character constant too large")); i = 0; } @@ -1010,7 +1011,7 @@ operand (expressionP) #ifdef RELAX_PAREN_GROUPING if (c != '(') #endif - as_bad (_("Missing '%c' assumed"), c == '(' ? ')' : ']'); + as_bad (_("missing '%c'"), c == '(' ? ')' : ']'); } else input_line_pointer++; @@ -1312,7 +1313,7 @@ operand (expressionP) if (expressionP->X_op == O_absent) { ++input_line_pointer; - as_bad (_("Bad expression")); + as_bad (_("bad expression")); expressionP->X_op = O_constant; expressionP->X_add_number = 0; } diff -Nupr binutils-2.11.90.0.25/gas/frags.c binutils-2.11.90.0.27/gas/frags.c --- binutils-2.11.90.0.25/gas/frags.c Fri Mar 9 11:16:42 2001 +++ binutils-2.11.90.0.27/gas/frags.c Sat Aug 4 19:52:15 2001 @@ -84,7 +84,7 @@ frag_grow (nchars) frchain_now->frch_obstack.chunk_size = oldc; } if (obstack_room (&frchain_now->frch_obstack) < nchars) - as_fatal (_("Can't extend frag %d. chars"), nchars); + as_fatal (_("can't extend frag %u chars"), nchars); } /* Call this to close off a completed frag, and start up a new (empty) diff -Nupr binutils-2.11.90.0.25/gas/input-file.c binutils-2.11.90.0.27/gas/input-file.c --- binutils-2.11.90.0.25/gas/input-file.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/input-file.c Sat Aug 4 19:52:15 2001 @@ -146,7 +146,7 @@ input_file_open (filename, pre) } if (f_in == (FILE *) 0) { - as_bad (_("Can't open %s for reading."), file_name); + as_bad (_("can't open %s for reading"), file_name); as_perror ("%s", file_name); return; } diff -Nupr binutils-2.11.90.0.25/gas/input-scrub.c binutils-2.11.90.0.27/gas/input-scrub.c --- binutils-2.11.90.0.25/gas/input-scrub.c Fri Mar 9 11:16:42 2001 +++ binutils-2.11.90.0.27/gas/input-scrub.c Sat Aug 4 19:52:15 2001 @@ -394,7 +394,7 @@ input_scrub_next_buffer (bufp) partial_where = 0; if (partial_size > 0) { - as_warn (_("Partial line at end of file ignored")); + as_warn (_("partial line at end of file ignored")); } /* Tell the listing we've finished the file. */ diff -Nupr binutils-2.11.90.0.25/gas/listing.c binutils-2.11.90.0.27/gas/listing.c --- binutils-2.11.90.0.25/gas/listing.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/listing.c Sat Aug 4 19:52:15 2001 @@ -1295,7 +1295,7 @@ listing_title (depth) } else if (*input_line_pointer == '\n') { - as_bad (_("New line in title")); + as_bad (_("new line in title")); demand_empty_rest_of_line (); return; } diff -Nupr binutils-2.11.90.0.25/gas/macro.c binutils-2.11.90.0.27/gas/macro.c --- binutils-2.11.90.0.25/gas/macro.c Tue Jun 19 11:57:57 2001 +++ binutils-2.11.90.0.27/gas/macro.c Fri Aug 10 14:08:01 2001 @@ -24,20 +24,14 @@ #include "config.h" -/* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -# ifndef alloca -# ifdef __STDC__ -extern void *alloca (); -# else -extern char *alloca (); -# endif -# endif -#else +#ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ @@ -49,7 +43,7 @@ extern void *alloca (); # endif /* alloca */ # endif /* _AIX */ # endif /* HAVE_ALLOCA_H */ -#endif +#endif /* __GNUC__ */ #include #ifdef HAVE_STRING_H diff -Nupr binutils-2.11.90.0.25/gas/output-file.c binutils-2.11.90.0.27/gas/output-file.c --- binutils-2.11.90.0.25/gas/output-file.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/output-file.c Fri Aug 10 14:08:01 2001 @@ -45,11 +45,11 @@ output_file_create (name) char *name; { if (name[0] == '-' && name[1] == '\0') - as_fatal (_("Can't open a bfd on stdout %s "), name); + as_fatal (_("can't open a bfd on stdout %s"), name); else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT))) { - as_perror (_("FATAL: Can't create %s"), name); + as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } @@ -70,14 +70,14 @@ output_file_close (filename) if (bfd_close (stdoutput) == 0) { bfd_perror (filename); - as_perror (_("FATAL: Can't close %s\n"), filename); + as_perror (_("FATAL: can't close %s\n"), filename); exit (EXIT_FAILURE); } #else /* Close the bfd without getting bfd to write out anything by itself. */ if (bfd_close_all_done (stdoutput) == 0) { - as_perror (_("FATAL: Can't close %s\n"), filename); + as_perror (_("FATAL: can't close %s\n"), filename); exit (EXIT_FAILURE); } #endif @@ -110,15 +110,9 @@ output_file_create (name) } stdoutput = fopen (name, FOPEN_WB); - - /* Some systems don't grok "b" in fopen modes. */ - /* XXX - is this still necessary now that we use FOPEN_WB ? */ - if (stdoutput == NULL) - stdoutput = fopen (name, FOPEN_W); - if (stdoutput == NULL) { - as_perror (_("FATAL: Can't create %s"), name); + as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } } @@ -129,7 +123,7 @@ output_file_close (filename) { if (EOF == fclose (stdoutput)) { - as_perror (_("FATAL: Can't close %s"), filename); + as_perror (_("FATAL: can't close %s"), filename); exit (EXIT_FAILURE); } @@ -151,7 +145,7 @@ output_file_append (where, length, filen /* if ( EOF == (putc( *where, stdoutput )) ) */ { as_perror (_("Failed to emit an object byte"), filename); - as_fatal (_("Can't continue")); + as_fatal (_("can't continue")); } } } diff -Nupr binutils-2.11.90.0.25/gas/read.c binutils-2.11.90.0.27/gas/read.c --- binutils-2.11.90.0.25/gas/read.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/read.c Sat Aug 4 19:52:15 2001 @@ -800,7 +800,7 @@ read_a_source_file (name) /* Print the error msg now, while we still can. */ if (pop == NULL) { - as_bad (_("Unknown pseudo-op: `%s'"), s); + as_bad (_("unknown pseudo-op: `%s'"), s); *input_line_pointer = c; s_ignore (0); continue; @@ -1053,8 +1053,8 @@ read_a_source_file (name) if (tc_unrecognized_line (c)) continue; #endif - /* as_warn (_("Junk character %d."),c); Now done by ignore_rest. */ - input_line_pointer--; /* Report unknown char as ignored. */ + input_line_pointer--; + /* Report unknown char as ignored. */ ignore_rest_of_line (); } @@ -1236,7 +1236,7 @@ s_align (arg, bytes_p) for (i = 0; (align & 1) == 0; align >>= 1, ++i) ; if (align != 1) - as_bad (_("Alignment not a power of 2")); + as_bad (_("alignment not a power of 2")); align = i; } @@ -1245,7 +1245,7 @@ s_align (arg, bytes_p) if (align > 15) { align = 15; - as_bad (_("Alignment too large: %u assumed"), align); + as_warn (_("alignment too large: %u assumed"), align); } if (*input_line_pointer != ',') @@ -1352,11 +1352,21 @@ s_comm (ignore) /* Just after name is now '\0'. */ p = input_line_pointer; *p = c; + + if (name == p) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { - as_bad (_("Expected comma after symbol-name: rest of line ignored.")); + *p = 0; + as_bad (_("expected comma after \"%s\""), name); + *p = c; ignore_rest_of_line (); if (flag_mri) mri_comment_end (stop, stopc); @@ -1367,7 +1377,7 @@ s_comm (ignore) if ((temp = get_absolute_expression ()) < 0) { - as_warn (_(".COMMon length (%ld.) <0! Ignored."), (long) temp); + as_warn (_(".COMMon length (%ld) < 0 ignored"), (long) temp); ignore_rest_of_line (); if (flag_mri) mri_comment_end (stop, stopc); @@ -1380,7 +1390,7 @@ s_comm (ignore) if (S_IS_DEFINED (symbolP) && !S_IS_COMMON (symbolP)) { - as_bad (_("Ignoring attempt to re-define symbol `%s'."), + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); ignore_rest_of_line (); if (flag_mri) @@ -1391,7 +1401,7 @@ s_comm (ignore) if (S_GET_VALUE (symbolP)) { if (S_GET_VALUE (symbolP) != (valueT) temp) - as_bad (_("Length of .comm \"%s\" is already %ld. Not changed to %ld."), + as_bad (_("length of .comm \"%s\" is already %ld; not changing to %ld"), S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), (long) temp); @@ -1481,7 +1491,7 @@ s_mri_common (small) if (S_IS_DEFINED (sym) && !S_IS_COMMON (sym)) { - as_bad (_("attempt to re-define symbol `%s'"), S_GET_NAME (sym)); + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (sym)); ignore_rest_of_line (); mri_comment_end (stop, stopc); return; @@ -1605,7 +1615,7 @@ s_app_line (ignore) if (l < 0) /* Some of the back ends can't deal with non-positive line numbers. Besides, it's silly. */ - as_warn (_("Line numbers must be positive; line number %d rejected."), + as_warn (_("line numbers must be positive; line number %d rejected"), l + 1); else { @@ -1701,18 +1711,18 @@ s_fill (ignore) #define BSD_FILL_SIZE_CROCK_8 (8) if (size > BSD_FILL_SIZE_CROCK_8) { - as_warn (_(".fill size clamped to %d."), BSD_FILL_SIZE_CROCK_8); + as_warn (_(".fill size clamped to %d"), BSD_FILL_SIZE_CROCK_8); size = BSD_FILL_SIZE_CROCK_8; } if (size < 0) { - as_warn (_("Size negative: .fill ignored.")); + as_warn (_("size negative; .fill ignored")); size = 0; } else if (rep_exp.X_op == O_constant && rep_exp.X_add_number <= 0) { if (rep_exp.X_add_number < 0) - as_warn (_("Repeat < 0, .fill ignored")); + as_warn (_("repeat < 0; .fill ignored")); size = 0; } @@ -1798,7 +1808,7 @@ s_globl (ignore) { input_line_pointer++; SKIP_WHITESPACE (); - if (*input_line_pointer == '\n') + if (is_end_of_line[(unsigned char) *input_line_pointer]) c = '\n'; } } @@ -1942,6 +1952,14 @@ s_lcomm_internal (needs_align, bytes_p) c = get_symbol_end (); p = input_line_pointer; *p = c; + + if (name == p) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + SKIP_WHITESPACE (); /* Accept an optional comma after the name. The comma used to be @@ -1952,15 +1970,15 @@ s_lcomm_internal (needs_align, bytes_p) SKIP_WHITESPACE (); } - if (*input_line_pointer == '\n') + if (is_end_of_line[(unsigned char) *input_line_pointer]) { - as_bad (_("Missing size expression")); + as_bad (_("missing size expression")); return; } if ((temp = get_absolute_expression ()) < 0) { - as_warn (_("BSS length (%d.) <0! Ignored."), temp); + as_warn (_("BSS length (%d) < 0 ignored"), temp); ignore_rest_of_line (); return; } @@ -1999,7 +2017,7 @@ s_lcomm_internal (needs_align, bytes_p) if (*input_line_pointer != ',') { - as_bad (_("Expected comma after size")); + as_bad (_("expected comma after size")); ignore_rest_of_line (); return; } @@ -2007,9 +2025,9 @@ s_lcomm_internal (needs_align, bytes_p) input_line_pointer++; SKIP_WHITESPACE (); - if (*input_line_pointer == '\n') + if (is_end_of_line[(unsigned char) *input_line_pointer]) { - as_bad (_("Missing alignment")); + as_bad (_("missing alignment")); return; } @@ -2025,7 +2043,7 @@ s_lcomm_internal (needs_align, bytes_p) for (i = 0; (align & 1) == 0; align >>= 1, ++i) ; if (align != 1) - as_bad (_("Alignment not a power of 2")); + as_bad (_("alignment not a power of 2")); align = i; } } @@ -2033,12 +2051,12 @@ s_lcomm_internal (needs_align, bytes_p) if (align > max_alignment) { align = max_alignment; - as_warn (_("Alignment too large: %d. assumed."), align); + as_warn (_("alignment too large; %d assumed"), align); } else if (align < 0) { align = 0; - as_warn (_("Alignment negative. 0 assumed.")); + as_warn (_("alignment negative; 0 assumed")); } record_alignment (bss_seg, align); @@ -2106,8 +2124,7 @@ s_lcomm_internal (needs_align, bytes_p) #endif } else - as_bad (_("Ignoring attempt to re-define symbol `%s'."), - S_GET_NAME (symbolP)); + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); subseg_set (current_seg, current_subseg); @@ -2143,12 +2160,20 @@ s_lsym (ignore) c = get_symbol_end (); p = input_line_pointer; *p = c; + + if (name == p) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; - as_bad (_("Expected comma after name \"%s\""), name); + as_bad (_("expected comma after \"%s\""), name); *p = c; ignore_rest_of_line (); return; @@ -2188,7 +2213,7 @@ s_lsym (ignore) } else { - as_bad (_("Symbol %s already defined"), name); + as_bad (_("symbol `%s' is already defined"), name); } *p = c; @@ -2363,8 +2388,7 @@ do_org (segment, exp, fill) int fill; { if (segment != now_seg && segment != absolute_section) - as_bad (_("invalid segment \"%s\"; segment \"%s\" assumed"), - segment_name (segment), segment_name (now_seg)); + as_bad (_("invalid segment \"%s\""), segment_name (segment)); if (now_seg == absolute_section) { @@ -2738,12 +2762,20 @@ s_set (equiv) delim = get_symbol_end (); end_name = input_line_pointer; *end_name = delim; + + if (name == end_name) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *end_name = 0; - as_bad (_("Expected comma after name \"%s\""), name); + as_bad (_("expected comma after \"%s\""), name); *end_name = delim; ignore_rest_of_line (); return; @@ -2801,7 +2833,7 @@ s_set (equiv) if (equiv && S_IS_DEFINED (symbolP) && S_GET_SEGMENT (symbolP) != reg_section) - as_bad (_("symbol `%s' already defined"), S_GET_NAME (symbolP)); + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); pseudo_set (symbolP); demand_empty_rest_of_line (); @@ -2887,7 +2919,7 @@ s_space (mult) || (mult != 0 && mult != 1 && val.X_add_number != 0)) { if (exp.X_op != O_constant) - as_bad (_("Unsupported variable size or fill value")); + as_bad (_("unsupported variable size or fill value")); else { offsetT i; @@ -3037,7 +3069,7 @@ s_float_space (float_type) know (flen > 0); if (err) { - as_bad (_("Bad floating literal: %s"), err); + as_bad (_("bad floating literal: %s"), err); ignore_rest_of_line (); if (flag_mri) mri_comment_end (stop, stopc); @@ -3110,11 +3142,11 @@ ignore_rest_of_line () if (!is_end_of_line[(unsigned char) *input_line_pointer]) { if (isprint ((unsigned char) *input_line_pointer)) - as_bad (_("Rest of line ignored. First ignored character is `%c'."), - *input_line_pointer); + as_warn (_("rest of line ignored; first ignored character is `%c'"), + *input_line_pointer); else - as_bad (_("Rest of line ignored. First ignored character valued 0x%x."), - *input_line_pointer); + as_warn (_("rest of line ignored; first ignored character valued 0x%x"), + *input_line_pointer); while (input_line_pointer < buffer_limit && !is_end_of_line[(unsigned char) *input_line_pointer]) @@ -3164,15 +3196,15 @@ pseudo_set (symbolP) (void) expression (&exp); if (exp.X_op == O_illegal) - as_bad (_("illegal expression; zero assumed")); + as_bad (_("illegal expression")); else if (exp.X_op == O_absent) - as_bad (_("missing expression; zero assumed")); + as_bad (_("missing expression")); else if (exp.X_op == O_big) { if (exp.X_add_number > 0) - as_bad (_("bignum invalid; zero assumed")); + as_bad (_("bignum invalid")); else - as_bad (_("floating point number invalid; zero assumed")); + as_bad (_("floating point number invalid")); } else if (exp.X_op == O_subtract && (S_GET_SEGMENT (exp.X_add_symbol) @@ -3217,7 +3249,7 @@ pseudo_set (symbolP) || exp.X_add_number != 0) symbol_set_value_expression (symbolP, &exp); else if (symbol_section_p (symbolP)) - as_bad ("invalid attempt to set value of section symbol"); + as_bad ("attempt to set value of section symbol"); else { symbolS *s = exp.X_add_symbol; @@ -3505,7 +3537,7 @@ emit_expr (exp, nbytes) } else if (op == O_big && exp->X_add_number <= 0) { - as_bad (_("floating point number invalid; zero assumed")); + as_bad (_("floating point number invalid")); exp->X_add_number = 0; op = O_constant; } @@ -3601,7 +3633,7 @@ emit_expr (exp, nbytes) && ((get & mask) != mask || (get & hibit) == 0)) { /* Leading bits contain both 0s & 1s. */ - as_warn (_("Value 0x%lx truncated to 0x%lx."), + as_warn (_("value 0x%lx truncated to 0x%lx"), (unsigned long) get, (unsigned long) use); } /* Put bytes in right order. */ @@ -3617,7 +3649,7 @@ emit_expr (exp, nbytes) size = exp->X_add_number * CHARS_PER_LITTLENUM; if (nbytes < size) { - as_warn (_("Bignum truncated to %d bytes"), nbytes); + as_warn (_("bignum truncated to %d bytes"), nbytes); size = nbytes; } @@ -3948,7 +3980,7 @@ parse_repeat_cons (exp, nbytes) if (count.X_op != O_constant || count.X_add_number <= 0) { - as_warn (_("Unresolvable or nonpositive repeat count; using 1")); + as_warn (_("unresolvable or nonpositive repeat count; using 1")); return; } @@ -3999,7 +4031,7 @@ hex_float (float_type, bytes) break; default: - as_bad (_("Unknown floating type type '%c'"), float_type); + as_bad (_("unknown floating type type '%c'"), float_type); return -1; } @@ -4021,7 +4053,7 @@ hex_float (float_type, bytes) if (i >= length) { - as_warn (_("Floating point constant too large")); + as_warn (_("floating point constant too large")); return -1; } d = hex_value (*input_line_pointer) << 4; @@ -4120,7 +4152,7 @@ float_cons (float_type) know (length > 0); if (err) { - as_bad (_("Bad floating literal: %s"), err); + as_bad (_("bad floating literal: %s"), err); ignore_rest_of_line (); return; } @@ -4404,7 +4436,7 @@ emit_leb128_expr (exp, sign) } else if (op == O_big && exp->X_add_number <= 0) { - as_bad (_("floating point number invalid; zero assumed")); + as_bad (_("floating point number invalid")); exp->X_add_number = 0; op = O_constant; } @@ -4552,7 +4584,7 @@ stringer (append_zero) /* Worker to do FRAG_APPEND_1_CHAR (c); if (*input_line_pointer != '>') { - as_bad (_("Expected ")); + as_bad (_("expected ")); } input_line_pointer++; break; @@ -4585,7 +4617,7 @@ next_char_of_string () break; case '\n': - as_warn (_("Unterminated string: Newline inserted.")); + as_warn (_("unterminated string; newline inserted")); bump_line_counters (); break; @@ -4671,7 +4703,7 @@ next_char_of_string () case '\n': /* To be compatible with BSD 4.2 as: give the luser a linefeed!! */ - as_warn (_("Unterminated string: Newline inserted.")); + as_warn (_("unterminated string; newline inserted")); c = '\n'; bump_line_counters (); break; @@ -4679,7 +4711,7 @@ next_char_of_string () default: #ifdef ONLY_STANDARD_ESCAPES - as_bad (_("Bad escaped character in string, '?' assumed")); + as_bad (_("bad escaped character in string")); c = '?'; #endif /* ONLY_STANDARD_ESCAPES */ @@ -4705,7 +4737,7 @@ get_segmented_expression (expP) || expP->X_op == O_absent || expP->X_op == O_big) { - as_bad (_("expected address expression; zero assumed")); + as_bad (_("expected address expression")); expP->X_op = O_constant; expP->X_add_number = 0; retval = absolute_section; @@ -4746,7 +4778,7 @@ get_absolute_expression () if (exp.X_op != O_constant) { if (exp.X_op != O_absent) - as_bad (_("bad or irreducible absolute expression; zero assumed")); + as_bad (_("bad or irreducible absolute expression")); exp.X_add_number = 0; } return exp.X_add_number; @@ -4781,7 +4813,7 @@ demand_copy_C_string (len_pointer) s = 0; len = 1; *len_pointer = 0; - as_bad (_("This string may not contain \'\\0\'")); + as_bad (_("this string may not contain \'\\0\'")); } } } @@ -4818,7 +4850,7 @@ demand_copy_string (lenP) } else { - as_warn (_("Missing string")); + as_warn (_("missing string")); retval = NULL; ignore_rest_of_line (); } @@ -4882,7 +4914,7 @@ equals (sym_name, reassign) if (!reassign && S_IS_DEFINED (symbolP) && S_GET_SEGMENT (symbolP) != reg_section) - as_bad (_("symbol `%s' already defined"), S_GET_NAME (symbolP)); + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); #ifdef OBJ_COFF /* "set" symbols are local unless otherwise specified. */ diff -Nupr binutils-2.11.90.0.25/gas/stabs.c binutils-2.11.90.0.27/gas/stabs.c --- binutils-2.11.90.0.25/gas/stabs.c Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/stabs.c Sat Aug 4 19:52:15 2001 @@ -217,7 +217,7 @@ s_stab_generic (what, stab_secname, stab input_line_pointer++; else { - as_warn (_(".stabs: Missing comma")); + as_warn (_(".stab%c: missing comma"), what); ignore_rest_of_line (); return; } @@ -225,7 +225,7 @@ s_stab_generic (what, stab_secname, stab if (get_absolute_expression_and_terminator (&longint) != ',') { - as_warn (_(".stab%c: Missing comma"), what); + as_warn (_(".stab%c: missing comma"), what); ignore_rest_of_line (); return; } @@ -233,7 +233,7 @@ s_stab_generic (what, stab_secname, stab if (get_absolute_expression_and_terminator (&longint) != ',') { - as_warn (_(".stab%c: Missing comma"), what); + as_warn (_(".stab%c: missing comma"), what); ignore_rest_of_line (); return; } @@ -244,7 +244,7 @@ s_stab_generic (what, stab_secname, stab { if (*input_line_pointer != ',') { - as_warn (_(".stab%c: Missing comma"), what); + as_warn (_(".stab%c: missing comma"), what); ignore_rest_of_line (); return; } @@ -469,7 +469,7 @@ s_desc (ignore) if (*input_line_pointer != ',') { *p = 0; - as_bad (_("Expected comma after name \"%s\""), name); + as_bad (_("expected comma after \"%s\""), name); *p = c; ignore_rest_of_line (); } diff -Nupr binutils-2.11.90.0.25/gas/subsegs.c binutils-2.11.90.0.27/gas/subsegs.c --- binutils-2.11.90.0.25/gas/subsegs.c Fri Mar 9 11:38:13 2001 +++ binutils-2.11.90.0.27/gas/subsegs.c Sat Aug 4 19:52:15 2001 @@ -374,7 +374,7 @@ subseg_new (segname, subseg) return new_seg; } #else - as_bad (_("Attempt to switch to nonexistent segment \"%s\""), segname); + as_bad (_("attempt to switch to nonexistent segment \"%s\""), segname); return now_seg; #endif } diff -Nupr binutils-2.11.90.0.25/gas/symbols.c binutils-2.11.90.0.27/gas/symbols.c --- binutils-2.11.90.0.25/gas/symbols.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/symbols.c Fri Aug 10 14:08:01 2001 @@ -61,6 +61,7 @@ symbolS abs_symbol; struct obstack notes; +static char *save_symbol_name PARAMS ((const char *)); static void fb_label_init PARAMS ((void)); static long dollar_label_instance PARAMS ((long)); static long fb_label_instance PARAMS ((long)); @@ -359,7 +360,7 @@ colon (sym_name) /* Just seen "x:" - ra || locsym->lsy_section != now_seg || locsym->lsy_value != frag_now_fix ())) { - as_bad (_("Symbol %s already defined."), sym_name); + as_bad (_("symbol `%s' is already defined"), sym_name); return symbolP; } @@ -444,7 +445,7 @@ colon (sym_name) /* Just seen "x:" - ra S_GET_OTHER (symbolP), S_GET_DESC (symbolP)); #endif - as_bad (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."), + as_bad (_("symbol `%s' is already defined as \"%s\"/%s%ld"), sym_name, segment_name (S_GET_SEGMENT (symbolP)), od_buf, @@ -458,7 +459,7 @@ colon (sym_name) /* Just seen "x:" - ra if (!(frag_now == symbolP->sy_frag && S_GET_VALUE (symbolP) == frag_now_fix () && S_GET_SEGMENT (symbolP) == now_seg)) - as_bad (_("Symbol %s already defined."), sym_name); + as_bad (_("symbol `%s' is already defined"), sym_name); } } @@ -521,14 +522,14 @@ symbol_table_insert (symbolP) error_string = hash_jam (local_hash, S_GET_NAME (symbolP), (PTR) symbolP); if (error_string != NULL) - as_fatal (_("Inserting \"%s\" into symbol table failed: %s"), + as_fatal (_("inserting \"%s\" into symbol table failed: %s"), S_GET_NAME (symbolP), error_string); return; } if ((error_string = hash_jam (sy_hash, S_GET_NAME (symbolP), (PTR) symbolP))) { - as_fatal (_("Inserting \"%s\" into symbol table failed: %s"), + as_fatal (_("inserting \"%s\" into symbol table failed: %s"), S_GET_NAME (symbolP), error_string); } /* on error */ } @@ -873,7 +874,7 @@ resolve_symbol_value (symp) if (symp->sy_resolving) { if (finalize_syms) - as_bad (_("Symbol definition loop encountered at %s"), + as_bad (_("symbol definition loop encountered at `%s'"), S_GET_NAME (symp)); final_val = 0; resolved = 1; @@ -1052,11 +1053,11 @@ resolve_symbol_value (symp) { if (seg_left == undefined_section) as_bad_where (file, line, - _("undefined symbol %s in operation"), + _("undefined symbol `%s' in operation"), S_GET_NAME (symp->sy_value.X_add_symbol)); if (seg_right == undefined_section) as_bad_where (file, line, - _("undefined symbol %s in operation"), + _("undefined symbol `%s' in operation"), S_GET_NAME (symp->sy_value.X_op_symbol)); if (seg_left != undefined_section && seg_right != undefined_section) @@ -1066,16 +1067,16 @@ resolve_symbol_value (symp) else { if (seg_left == undefined_section) - as_bad (_("undefined symbol %s in operation setting %s"), + as_bad (_("undefined symbol `%s' in operation setting `%s'"), S_GET_NAME (symp->sy_value.X_add_symbol), S_GET_NAME (symp)); if (seg_right == undefined_section) - as_bad (_("undefined symbol %s in operation setting %s"), + as_bad (_("undefined symbol `%s' in operation setting `%s'"), S_GET_NAME (symp->sy_value.X_op_symbol), S_GET_NAME (symp)); if (seg_left != undefined_section && seg_right != undefined_section) - as_bad (_("invalid section for operation setting %s"), + as_bad (_("invalid section for operation setting `%s'"), S_GET_NAME (symp)); } } @@ -1093,7 +1094,7 @@ resolve_symbol_value (symp) if (expr_symbol_where (symp, &file, &line)) as_bad_where (file, line, _("division by zero")); else - as_bad (_("division by zero when setting %s"), + as_bad (_("division by zero when setting `%s'"), S_GET_NAME (symp)); } @@ -1165,7 +1166,7 @@ exit_dont_set_value: symp->sy_resolved = 1; else if (S_GET_SEGMENT (symp) != expr_section) { - as_bad (_("can't resolve value for symbol \"%s\""), + as_bad (_("can't resolve value for symbol `%s'"), S_GET_NAME (symp)); symp->sy_resolved = 1; } @@ -1596,7 +1597,7 @@ S_GET_VALUE (s) if (! s->sy_resolved || s->sy_value.X_op != O_symbol || (S_IS_DEFINED (s) && ! S_IS_COMMON (s))) - as_bad (_("Attempt to get value of unresolved symbol %s"), + as_bad (_("attempt to get value of unresolved symbol `%s'"), S_GET_NAME (s)); recur = NULL; } @@ -1832,7 +1833,7 @@ S_SET_EXTERNAL (s) /* Do not reassign section symbols. */ as_where (& file, & line); as_warn_where (file, line, - _("Section symbols are already global")); + _("section symbols are already global")); return; } s->bsym->flags |= BSF_GLOBAL; diff -Nupr binutils-2.11.90.0.25/gas/testsuite/ChangeLog binutils-2.11.90.0.27/gas/testsuite/ChangeLog --- binutils-2.11.90.0.25/gas/testsuite/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/testsuite/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,126 @@ +2001-08-10 H.J. Lu + + * gas/mips/e32-rel2.d: Updated for the objdump output change. + * gas/mips/e32el-rel2.d: Likewise. + * gas/mips/elf-rel.d: Likewise. + * gas/mips/elf-rel2.d: Likewise. + * gas/mips/elf-rel3.d: Likewise. + * gas/mips/elf_e_flags1.d: Likewise. + * gas/mips/elf_e_flags2.d: Likewise. + * gas/mips/elf_e_flags3.d: Likewise. + * gas/mips/elf_e_flags4.d: Likewise. + * gas/mips/elfel-rel.d: Likewise. + * gas/mips/elfel-rel2.d: Likewise. + * gas/mips/elfel-rel3.d: Likewise. + * gas/mips/empic.d: Likewise. + * gas/mips/mips16-e.d: Likewise. + * gas/mips/mips16-f.d: Likewise. + * gas/mips/mipsel16-f.d: Likewise. + * gas/mips/telempic.d: Likewise. + * gas/mips/tempic.d: Likewise. + * gas/mips/tmips16-e.d: Likewise. + * gas/mips/tmipsel16-e.d: Likewise. + + * gas/mips/mips16-f.d: Fix the symbol table output. + + * gas/mips/mipsel16-f.d: Fix the endian. + + * gas/mips/mips.exp; Don't xfail mips16-f/mipsel16-f. + +2001-08-10 Richard Sandiford + + * gas/mips/mips-gp32-fp32.d: Expect addu rather than or for moves. + * gas/mips/mips-gp32-fp64.d: Likewise. + * gas/mips/mips-abi32.d: Likewise. + * gas/mips/mips-gp32-fp32-pic.d: Likewise. + * gas/mips/mips-gp32-fp64-pic.d: Likewise. + * gas/mips/mips-abi32-pic.d: Likewise. + +2001-07-21 Thiemo Seufer + + * mips/lb.d: Reflect disassembler output fixes. + * mips/mips32.d: Likewise. + * mips/mips64.d: Likewise. Typo. + * mips/sb.d: Likewise. + * mips/trunc.d: Likewise. + +2001-08-04 H.J. Lu + + * gas/cris/operand-err-1.s: Updated. + +2001-08-04 H.J. Lu + Chris G. Demetriou + + * gas/mips/e32-rel4.s: Removed. + + * gas/mips/e32-rel4.d: Use elf-rel4.s. + + * gas/mips/mips.exp: Use the same rel4 test for litte endian. + + * gas/mips/mips-abi32-pic.d: Add lines for objdump. + * gas/mips/mips-abi32.d: Likewise. + * gas/mips/mips-gp32-fp32-pic.d: Likewise. + * gas/mips/mips-gp32-fp32.d: Likewise. + * gas/mips/mips-gp32-fp64-pic.d: Likewise. + * gas/mips/mips-gp32-fp64.d: Likewise. + * gas/mips/mips-gp64-fp32-pic.d: Likewise. + * gas/mips/mips-gp64-fp32.d: Likewise. + * gas/mips/mips-gp64-fp64-pic.d: Likewise. + * gas/mips/mips-gp64-fp64.d: Likewise. + + * gas/mips/mips-abi32-pic.s: Add space for objdump. + * gas/mips/mips-abi32.s: Likewise. + * gas/mips/mips-gp32-fp32-pic.s: Likewise. + * gas/mips/mips-gp32-fp32.s: Likewise. + * gas/mips/mips-gp32-fp64-pic.s: Likewise. + * gas/mips/mips-gp32-fp64.s: Likewise. + * gas/mips/mips-gp64-fp32-pic.s: Likewise. + * gas/mips/mips-gp64-fp32.s: Likewise. + * gas/mips/mips-gp64-fp64-pic.s: Likewise. + * gas/mips/mips-gp64-fp64.s: Likewise. + + * gas/mips/mips-abi32-pic.s: Add the missing .end. + * gas/mips/mips-gp32-fp32-pic.s: Likewise. + * gas/mips/mips-gp32-fp64-pic.s: Likewise. + * gas/mips/mips-gp64-fp32-pic.s: Likewise. + * gas/mips/mips-gp64-fp64-pic.s: Likewise. + +2001-08-03 Richard Sandiford + + * gas/mips/elf-rel4.s, gas/mips/elf-rel4.d: New test. + * gas/mips/e32-rel4.s, gas/mips/e32-rel4.s: New test. + + * gas/mips/mips.exp: Run new tests. + +2001-08-02 Richard Sandiford + + * gas/mips/mips-gp32-fp32, + * gas/mips/mips-gp32-fp64, + * gas/mips/mips-gp64-fp32, + * gas/mips/mips-gp64-fp64, + * gas/mips/mips-abi32, + * gas/mips/mips-gp32-fp32-pic, + * gas/mips/mips-gp32-fp64-pic, + * gas/mips/mips-gp64-fp32-pic, + * gas/mips/mips-gp64-fp64-pic, + * gas/mips/mips-abi32-pic: New testcases. + + * gas/mips/mips.exp: Run them. + +2001-08-01 Alan Modra + + * gas/elf/section2.l: Adjust warning message comparison. + +2001-07-31 Richard Sandiford + + * gas/mips/mips.exp (el): New variable. + Use it to pick ELF reloc tests. + +2001-07-26 Chris Demetriou + + * gas/mips/lif-empic.d: Add back dollar signs before floating + point register names. + 2001-07-26 Alan Modra * gas/i386/relax.s: Test rs_space. @@ -19,6 +142,11 @@ * gas/mips/abs.d: Pass -march=4000 to gas. * gas/mips/eld_rel2.d: Do not expect zeroes at end of dump. * gas/mips/elf_e_flags1.d: Pass -march=4000 to gas. + +2001-07-11 Jakub Jelinek + + * gas/sparc/unalign.s: Remove .uaxword test. + * gas/sparc/unalign.d: Adjust accordingly. 2001-07-08 Anders Norlander diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/cris/operand-err-1.s binutils-2.11.90.0.27/gas/testsuite/gas/cris/operand-err-1.s --- binutils-2.11.90.0.25/gas/testsuite/gas/cris/operand-err-1.s Thu Jul 20 19:21:16 2000 +++ binutils-2.11.90.0.27/gas/testsuite/gas/cris/operand-err-1.s Sat Aug 4 19:52:15 2001 @@ -29,8 +29,8 @@ start: test.d [r3=r2+[r4]] ; { dg-error "(Illegal|Invalid) operands" } test.d [r3=r2+[r4].w ; { dg-error "(Illegal|Invalid) operands" } test.d [r3=r2] ; { dg-error "(Illegal|Invalid) operands" } - test.d [r3=r2+] ; { dg-error "(Illegal|Invalid) operands|Bad expression" } - test.d [r3++] ; { dg-error "(Illegal|Invalid) operands|Bad expression" } + test.d [r3=r2+] ; { dg-error "(Illegal|Invalid) operands|(B|b)ad expression" } + test.d [r3++] ; { dg-error "(Illegal|Invalid) operands|(B|b)ad expression" } ; I think these should be valid; a dip with "postincrement" on ; the insn that follows. diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/elf/section2.l binutils-2.11.90.0.27/gas/testsuite/gas/elf/section2.l --- binutils-2.11.90.0.25/gas/testsuite/gas/elf/section2.l Tue Jun 19 11:57:57 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/elf/section2.l Sat Aug 4 19:52:15 2001 @@ -1,5 +1,5 @@ .*: Assembler messages: -.*:2: Warning: Section symbols are already global +.*:2: Warning: .* .*GAS.* diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32-rel2.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32-rel2.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32-rel2.d Sat Oct 9 09:13:45 1999 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32-rel2.d Fri Aug 10 14:08:01 2001 @@ -9,7 +9,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32-rel4.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32-rel4.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32-rel4.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32-rel4.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,15 @@ +#objdump: --prefix-addresses -dr +#name: MIPS ELF reloc 4 +#source: elf-rel4.s + +.*: +file format.* + +Disassembly of section .text: +0+000 <[^>]*> addiu a0,gp,0 + 0: R_MIPS_GPREL16 a +0+004 <[^>]*> addiu a0,gp,4 + 4: R_MIPS_GPREL16 a +0+008 <[^>]*> addiu a0,gp,8 + 8: R_MIPS_GPREL16 a +0+00c <[^>]*> addiu a0,gp,12 + c: R_MIPS_GPREL16 a diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32el-rel2.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32el-rel2.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/e32el-rel2.d Fri May 25 12:07:03 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/e32el-rel2.d Fri Aug 10 14:08:01 2001 @@ -9,7 +9,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel.d Fri May 25 12:06:57 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel.d Fri Aug 10 14:08:01 2001 @@ -6,7 +6,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_HI16 \.text 0+0000018 R_MIPS_LO16 \.text 0+000000c R_MIPS_HI16 \.text diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel2.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel2.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel2.d Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel2.d Fri Aug 10 14:08:01 2001 @@ -8,7 +8,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel3.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel3.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel3.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel3.d Fri Aug 10 14:08:01 2001 @@ -4,7 +4,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.data\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_32 b 0+0000008 R_MIPS_32 .data diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel4.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel4.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel4.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel4.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,14 @@ +#objdump: --prefix-addresses -dr +#name: MIPS ELF reloc 4 + +.*: +file format.* + +Disassembly of section .text: +0+000 <[^>]*> daddiu a0,gp,0 + 0: R_MIPS_GPREL16 a +0+004 <[^>]*> daddiu a0,gp,4 + 4: R_MIPS_GPREL16 a +0+008 <[^>]*> daddiu a0,gp,8 + 8: R_MIPS_GPREL16 a +0+00c <[^>]*> daddiu a0,gp,12 + c: R_MIPS_GPREL16 a diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel4.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel4.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf-rel4.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf-rel4.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,12 @@ + + .section .sdata + .global a + .4byte 1 +a: .4byte 2 + + .section .text + la $4,a + la $4,a+4 + la $4,a+8 + la $4,a+12 + diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags1.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags1.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags1.d Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags1.d Fri Aug 10 14:08:01 2001 @@ -6,17 +6,17 @@ .*:.*file format.*mips.* architecture: mips:.*, flags 0x00000011: HAS_RELOC, HAS_SYMS -start address 0x0000000000000000 +start address 0x0+00 Disassembly of section .text: -0000000000000000 : +0+00 : 0: 00850019 multu a0,a1 4: 00001012 mflo v0 8: 03e00008 jr ra c: 24420001 addiu v0,v0,1 -0000000000000010
: +0+10
: 10: 27bdffd8 addiu sp,sp,-40 14: afbf0020 sw ra,32\(sp\) 18: 0c000000 jal 0 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags2.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags2.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags2.d Mon May 21 10:37:00 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags2.d Fri Aug 10 14:08:01 2001 @@ -6,16 +6,16 @@ .*:.*file format.*mips.* architecture: mips:4650, flags 0x00000011: HAS_RELOC, HAS_SYMS -start address 0x0000000000000000 +start address 0x0+00 Disassembly of section .text: -0000000000000000 : +0+00 : 0: 70851002 mul v0,a0,a1 4: 03e00008 jr ra 8: 24420001 addiu v0,v0,1 -000000000000000c
: +0+0c
: c: 27bdffd8 addiu sp,sp,-40 10: afbf0020 sw ra,32\(sp\) 14: 0c000000 jal 0 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags3.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags3.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags3.d Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags3.d Fri Aug 10 14:08:01 2001 @@ -6,16 +6,16 @@ .*:.*file format.*mips.* architecture: mips:4650, flags 0x00000011: HAS_RELOC, HAS_SYMS -start address 0x0000000000000000 +start address 0x0+00 Disassembly of section .text: -0000000000000000 : +0+00 : 0: 70851002 mul v0,a0,a1 4: 03e00008 jr ra 8: 24420001 addiu v0,v0,1 -000000000000000c
: +0+0c
: c: 27bdffd8 addiu sp,sp,-40 10: afbf0020 sw ra,32\(sp\) 14: 0c000000 jal 0 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags4.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags4.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elf_e_flags4.d Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elf_e_flags4.d Fri Aug 10 14:08:01 2001 @@ -6,16 +6,16 @@ .*:.*file format.*mips.* architecture: mips:4650, flags 0x00000011: HAS_RELOC, HAS_SYMS -start address 0x0000000000000000 +start address 0x0+00 Disassembly of section .text: -0000000000000000 : +0+00 : 0: 70851002 mul v0,a0,a1 4: 03e00008 jr ra 8: 24420001 addiu v0,v0,1 -000000000000000c
: +0+0c
: c: 27bdffd8 addiu sp,sp,-40 10: afbf0020 sw ra,32\(sp\) 14: 0c000000 jal 0 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel.d Fri May 25 12:07:03 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel.d Fri Aug 10 14:08:01 2001 @@ -7,7 +7,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_HI16 \.text 0+0000018 R_MIPS_LO16 \.text 0+000000c R_MIPS_HI16 \.text diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel2.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel2.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel2.d Fri May 25 12:07:03 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel2.d Fri Aug 10 14:08:01 2001 @@ -9,7 +9,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000 0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel3.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel3.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/elfel-rel3.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/elfel-rel3.d Fri Aug 10 14:08:01 2001 @@ -5,7 +5,7 @@ .*: file format elf.*mips RELOCATION RECORDS FOR \[\.data\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_32 b 0+0000008 R_MIPS_32 .data diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/empic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/empic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/empic.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/empic.d Fri Aug 10 14:08:01 2001 @@ -23,7 +23,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL16_S2 g1 0+000000c R_MIPS_GNU_REL16_S2 g2 0+0000014 R_MIPS_GNU_REL16_S2 g2 @@ -60,7 +60,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR \[\.foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL_HI16 g1 0+0000008 R_MIPS_GNU_REL_LO16 g1 0+000000c R_MIPS_GNU_REL_HI16 \.foo diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/lb.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/lb.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/lb.d Mon May 21 10:37:02 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/lb.d Fri Aug 10 14:08:01 2001 @@ -388,8 +388,8 @@ Disassembly of section .text: 0+0378 <[^>]*> lw a0,0\(zero\) 0+037c <[^>]*> lwl a0,0\(zero\) 0+0380 <[^>]*> lwr a0,0\(zero\) -0+0384 <[^>]*> lwc0 a0,0\(zero\) +0+0384 <[^>]*> lwc0 \$4,0\(zero\) 0+0388 <[^>]*> lwc1 \$f4,0\(zero\) -0+038c <[^>]*> lwc2 a0,0\(zero\) -0+0390 <[^>]*> lwc3 a0,0\(zero\) +0+038c <[^>]*> lwc2 \$4,0\(zero\) +0+0390 <[^>]*> lwc3 \$4,0\(zero\) ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/lif-empic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/lif-empic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/lif-empic.d Mon May 21 10:37:03 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/lif-empic.d Sat Aug 4 19:52:15 2001 @@ -12,13 +12,13 @@ Disassembly of section .text: [ ]*0: [A-Z0-9_]*GPREL[A-Z0-9_]* .rdata.* 0+0004 <[^>]*> lw a0,0\(at\) 0+0008 <[^>]*> lw a1,4\(at\) -0+000c <[^>]*> lwc1 f[45],-16368\(gp\) +0+000c <[^>]*> lwc1 \$f[45],-16368\(gp\) [ ]*c: [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.* -0+0010 <[^>]*> lwc1 f[45],-16364\(gp\) +0+0010 <[^>]*> lwc1 \$f[45],-16364\(gp\) [ ]*10: [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.* 0+0014 <[^>]*> lui a0,0x3f8f 0+0018 <[^>]*> ori a0,a0,0xcd36 0+001c <[^>]*> lui at,0x3f8f 0+0020 <[^>]*> ori at,at,0xcd36 -0+0024 <[^>]*> mtc1 at,f4 +0+0024 <[^>]*> mtc1 at,\$f4 ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32-pic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32-pic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32-pic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32-pic.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,117 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mabi=32 -KPIC +#name: MIPS -mabi=32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002821 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 3c013ff0 lui at,0x3ff0 + 180: 44810800 mtc1 at,\$f1 + 184: 44800000 mtc1 zero,\$f0 + 188: 8f810000 lw at,0\(gp\) + 18c: d4200008 ldc1 \$f0,8\(at\) + 190: 24a40064 addiu a0,a1,100 + 194: 2c840001 sltiu a0,a0,1 + 198: 24a40064 addiu a0,a1,100 + 19c: 0004202b sltu a0,zero,a0 + 1a0: 00a02021 move a0,a1 + +0+01a4 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32-pic.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32-pic.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32-pic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32-pic.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,145 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lui at,0x3ff0 + # 0180 mtc1 at,$f1 + # 0184 mtc1 zero,$f0 + li.d $f0, 1.9 # 0188 lw at,got(.rodata)(gp) + # 018c ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 0190 addiu a0,a1,100 + # 0194 sltiu a0,a0,1 + sne $4, $5, -100 # 0198 addiu a0,a1,100 + # 019c sltu a0,zero,a0 + move $4, $5 # 01a0 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + + .end func + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,78 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mabi=32 +#name: MIPS -mabi=32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840108 addiu a0,a0,264 + 1c: 08000042 j 108 <[^>]*> + 20: 0c000042 jal 108 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840108 lw a0,264\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240108 lw a0,264\(at\) + 54: 8c25010c lw a1,268\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002821 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: 3c013ff0 lui at,0x3ff0 + e8: 44810800 mtc1 at,\$f1 + ec: 44800000 mtc1 zero,\$f0 + f0: d780c000 ldc1 \$f0,-16384\(gp\) + f4: 24a40064 addiu a0,a1,100 + f8: 2c840001 sltiu a0,a0,1 + fc: 24a40064 addiu a0,a1,100 + 100: 0004202b sltu a0,zero,a0 + 104: 00a02021 move a0,a1 + +0+0108 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-abi32.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-abi32.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,102 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text +func: + .set noreorder + .set mips4 + li $4, 0x12345678 # 0000 lui a0,0x1234 + # 0004 ori a0,a0,0x5678 + la $4, shared # 0008 addiu a0,gp,shared + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 lui at,0x3ff0 + # 00e8 mtc1 at,$f1 + # 00ec mtc1 zero,$f0 + li.d $f0, 1.9 # 00f0 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltiu a0,a0,1 + sne $4, $5, -100 # 00fc addiu a0,a1,100 + # 0100 sltu a0,zero,a0 + move $4, $5 # 0104 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32-pic.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,117 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -mfp32 -KPIC +#name: MIPS -mgp32 -mfp32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002821 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 3c013ff0 lui at,0x3ff0 + 180: 44810800 mtc1 at,\$f1 + 184: 44800000 mtc1 zero,\$f0 + 188: 8f810000 lw at,0\(gp\) + 18c: d4200008 ldc1 \$f0,8\(at\) + 190: 24a40064 addiu a0,a1,100 + 194: 2c840001 sltiu a0,a0,1 + 198: 24a40064 addiu a0,a1,100 + 19c: 0004202b sltu a0,zero,a0 + 1a0: 00a02021 move a0,a1 + +0+01a4 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32-pic.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,145 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lui at,0x3ff0 + # 0180 mtc1 at,$f1 + # 0184 mtc1 zero,$f0 + li.d $f0, 1.9 # 0188 lw at,got(.rodata)(gp) + # 018c ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 0190 addiu a0,a1,100 + # 0194 sltiu a0,a0,1 + sne $4, $5, -100 # 0198 addiu a0,a1,100 + # 019c sltu a0,zero,a0 + move $4, $5 # 01a0 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + + .end func + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,78 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -mfp32 +#name: MIPS -mgp32 -mfp32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840108 addiu a0,a0,264 + 1c: 08000042 j 108 <[^>]*> + 20: 0c000042 jal 108 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840108 lw a0,264\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240108 lw a0,264\(at\) + 54: 8c25010c lw a1,268\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002821 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: 3c013ff0 lui at,0x3ff0 + e8: 44810800 mtc1 at,\$f1 + ec: 44800000 mtc1 zero,\$f0 + f0: d780c000 ldc1 \$f0,-16384\(gp\) + f4: 24a40064 addiu a0,a1,100 + f8: 2c840001 sltiu a0,a0,1 + fc: 24a40064 addiu a0,a1,100 + 100: 0004202b sltu a0,zero,a0 + 104: 00a02021 move a0,a1 + +0+0108 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp32.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp32.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,102 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text +func: + .set noreorder + .set mips4 + li $4, 0x12345678 # 0000 lui a0,0x1234 + # 0004 ori a0,a0,0x5678 + la $4, shared # 0008 addiu a0,gp,shared + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 lui at,0x3ff0 + # 00e8 mtc1 at,$f1 + # 00ec mtc1 zero,$f0 + li.d $f0, 1.9 # 00f0 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltiu a0,a0,1 + sne $4, $5, -100 # 00fc addiu a0,a1,100 + # 0100 sltu a0,zero,a0 + move $4, $5 # 0104 move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64-pic.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,117 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 -KPIC +#name: MIPS -mgp32 -mfp64 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: afbc0008 sw gp,8\(sp\) + 10: 009c2021 addu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 24840000 addiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 24840000 addiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 248401a4 addiu a0,a0,420 + 40: 10000058 b 1a4 <[^>]*> + 44: 00000000 nop + 48: 8f990000 lw t9,0\(gp\) + 4c: 00000000 nop + 50: 273901a4 addiu t9,t9,420 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: 8fbc0008 lw gp,8\(sp\) + 60: 8f840000 lw a0,0\(gp\) + 64: 00000000 nop + 68: 24840000 addiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: 8f840000 lw a0,0\(gp\) + 74: 00000000 nop + 78: 24840000 addiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: 8f840000 lw a0,0\(gp\) + 84: 00000000 nop + 88: 248401a4 addiu a0,a0,420 + 8c: 8c840000 lw a0,0\(a0\) + 90: 8f810000 lw at,0\(gp\) + 94: 00000000 nop + 98: 8c240000 lw a0,0\(at\) + 9c: 8c250004 lw a1,4\(at\) + a0: 8f810000 lw at,0\(gp\) + a4: 00000000 nop + a8: 8c240000 lw a0,0\(at\) + ac: 8c250004 lw a1,4\(at\) + b0: 8f810000 lw at,0\(gp\) + b4: 00000000 nop + b8: 8c2401a4 lw a0,420\(at\) + bc: 8c2501a8 lw a1,424\(at\) + c0: 8f810000 lw at,0\(gp\) + c4: 00000000 nop + c8: 24210000 addiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: 8f810000 lw at,0\(gp\) + d4: 00000000 nop + d8: 24210000 addiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: 8f810000 lw at,0\(gp\) + e4: 00000000 nop + e8: ac240000 sw a0,0\(at\) + ec: ac250004 sw a1,4\(at\) + f0: 8f810000 lw at,0\(gp\) + f4: 00000000 nop + f8: ac240000 sw a0,0\(at\) + fc: ac250004 sw a1,4\(at\) + 100: 8f810000 lw at,0\(gp\) + 104: 00000000 nop + 108: 24210000 addiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: 8f810000 lw at,0\(gp\) + 120: 00000000 nop + 124: 24210000 addiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: 8f810000 lw at,0\(gp\) + 144: 00000000 nop + 148: 24210000 addiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: 8f810000 lw at,0\(gp\) + 158: 00000000 nop + 15c: 24210000 addiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3c043ff0 lui a0,0x3ff0 + 16c: 00002821 move a1,zero + 170: 8f810000 lw at,0\(gp\) + 174: 8c240000 lw a0,0\(at\) + 178: 8c250004 lw a1,4\(at\) + 17c: 8f810000 lw at,0\(gp\) + 180: d4200008 ldc1 \$f0,8\(at\) + 184: 8f810000 lw at,0\(gp\) + 188: d4200010 ldc1 \$f0,16\(at\) + 18c: 24a40064 addiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 24a40064 addiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a02021 move a0,a1 + 1a0: 46231040 add.d \$f1,\$f2,\$f3 + +0+01a4 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64-pic.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,143 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sw gp,8(sp) + .cpadd $4 # 0010 addu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 addiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 addiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c addiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 lw t9,got(.text)(gp) + # 004c nop + # 0050 addiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c lw gp,8(sp) + lw $4, shared # 0060 lw a0,got(.sdata)(gp) + # 0064 nop + # 0068 addiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 lw a0,got(.data)(gp) + # 0074 nop + # 0078 addiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 lw a0,got(.text)(gp) + # 0084 nop + # 0088 addiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 lw at,got(.sdata)(gp) + # 0094 nop + # 0098 lw a0,lo(shared)(at) + # 009c lw a1,lo(shared)+4(at) + ld $4, unshared # 00a0 lw at,got(.data)(gp) + # 00a4 nop + # 00a8 lw a0,lo(unshared)(at) + # 00ac lw a1,lo(unshared)+4(at) + ld $4, end # 00b0 lw at,got(.text)(gp) + # 00b4 nop + # 00b8 lw a0,lo(end)(at) + # 00bc lw a1,lo(end)+4(at) + sw $4, shared # 00c0 lw at,got(.sdata)(gp) + # 00c4 nop + # 00c8 addiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 lw at,got(.data)(gp) + # 00d4 nop + # 00d8 addiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 lw at,got(.sdata)(gp) + # 00e4 nop + # 00e8 sw a0,lo(shared)(at) + # 00ec sw a1,lo(shared)+4(at) + sd $4, unshared # 00f0 lw at,got(.data)(gp) + # 00f4 nop + # 00f8 sw a0,lo(unshared)(at) + # 00fc sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0100 lw at,got(.data)(gp) + # 0104 nop + # 0108 addiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c lw at,got(.data)(gp) + # 0120 nop + # 0124 addiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 lw at,got(.data)(gp) + # 0144 nop + # 0148 addiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 lw at,got(.data)(gp) + # 0158 nop + # 015c addiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 lui a0,0x3ff0 + # 016c move a1,zero + li.d $4, 1.9 # 0170 lw at,got(.rodata)(gp) + # 0174 lw a0,lo(F1.9)(at) + # 0178 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 017c lw at,got(.rodata)(gp) + # 0180 ldc1 $f0,lo(L1.0)(at) + li.d $f0, 1.9 # 0184 lw at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c addiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 addiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + +# Should produce warnings given -mfp32 + add.d $f1, $f2, $f3 # 01a0 add.d $f1,$f2,$f3 + + .end func +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64.d Fri Aug 10 14:08:01 2001 @@ -0,0 +1,77 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mgp32 +#name: MIPS -mgp32 -mfp64 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 2784c000 addiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 24840000 addiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 24840104 addiu a0,a0,260 + 1c: 08000041 j 104 <[^>]*> + 20: 0c000041 jal 104 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840104 lw a0,260\(a0\) + 38: 8f84c000 lw a0,-16384\(gp\) + 3c: 8f85c004 lw a1,-16380\(gp\) + 40: 3c010000 lui at,0x0 + 44: 8c240000 lw a0,0\(at\) + 48: 8c250004 lw a1,4\(at\) + 4c: 3c010000 lui at,0x0 + 50: 8c240104 lw a0,260\(at\) + 54: 8c250108 lw a1,264\(at\) + 58: af84c000 sw a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: ac240000 sw a0,0\(at\) + 64: af84c000 sw a0,-16384\(gp\) + 68: af85c004 sw a1,-16380\(gp\) + 6c: 3c010000 lui at,0x0 + 70: ac240000 sw a0,0\(at\) + 74: ac250004 sw a1,4\(at\) + 78: 3c010000 lui at,0x0 + 7c: 24210000 addiu at,at,0 + 80: 80240000 lb a0,0\(at\) + 84: 90210001 lbu at,1\(at\) + 88: 00042200 sll a0,a0,0x8 + 8c: 00812025 or a0,a0,at + 90: 3c010000 lui at,0x0 + 94: 24210000 addiu at,at,0 + 98: a0240001 sb a0,1\(at\) + 9c: 00042202 srl a0,a0,0x8 + a0: a0240000 sb a0,0\(at\) + a4: 90210001 lbu at,1\(at\) + a8: 00042200 sll a0,a0,0x8 + ac: 00812025 or a0,a0,at + b0: 3c010000 lui at,0x0 + b4: 24210000 addiu at,at,0 + b8: 88240000 lwl a0,0\(at\) + bc: 98240003 lwr a0,3\(at\) + c0: 3c010000 lui at,0x0 + c4: 24210000 addiu at,at,0 + c8: a8240000 swl a0,0\(at\) + cc: b8240003 swr a0,3\(at\) + d0: 3c043ff0 lui a0,0x3ff0 + d4: 00002821 move a1,zero + d8: 3c010000 lui at,0x0 + dc: 8c240000 lw a0,0\(at\) + e0: 8c250004 lw a1,4\(at\) + e4: d780c000 ldc1 \$f0,-16384\(gp\) + e8: d780c008 ldc1 \$f0,-16376\(gp\) + ec: 24a40064 addiu a0,a1,100 + f0: 2c840001 sltiu a0,a0,1 + f4: 24a40064 addiu a0,a1,100 + f8: 0004202b sltu a0,zero,a0 + fc: 00a02021 move a0,a1 + 100: 46231040 add.d \$f1,\$f2,\$f3 + +0+0104 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp32-fp64.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp32-fp64.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,99 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text +func: + .set noreorder + .set mips4 + li $4, 0x12345678 # 0000 lui a0,0x1234 + # 0004 ori a0,a0,0x5678 + la $4, shared # 0008 addiu a0,gp,shared + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 addiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 addiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 lw a0,shared(gp) + # 003c lw a1,shared+4(gp) + ld $4, unshared # 0040 lui at,hi(unshared) + # 0044 lw a0,lo(unshared)(at) + # 0048 lw a1,lo(unshared)+4(at) + ld $4, end # 004c lui at,hi(end) + # 0050 lw a0,lo(end)(at) + # 0054 lw a1,lo(end)+4(at) + sw $4, shared # 0058 sw a0,shared(gp) + sw $4, unshared # 005c lui at,hi(unshared) + # 0060 sw a0,lo(unshared)(at) + sd $4, shared # 0064 sw a0,shared(gp) + # 0068 sw a1,shared+4(gp) + sd $4, unshared # 006c lui at,hi(unshared) + # 0070 sw a0,lo(unshared)(at) + # 0074 sw a1,lo(unshared)+4(at) + ulh $4, unshared # 0078 lui at,hi(unshared) + # 007c addiu at,at,lo(unshared) + # 0080 lb a0,0(at) + # 0084 lbu at,1(at) + # 0088 sll a0,a0,8 + # 008c or a0,a0,at + ush $4, unshared # 0090 lui at,hi(unshared) + # 0094 addiu at,at,lo(unshared) + # 0098 sb a0,1(at) + # 009c srl a0,a0,8 + # 00a0 sb a0,0(at) + # 00a4 lbu at,1(at) + # 00a8 sll a0,a0,8 + # 00ac or a0,a0,at + ulw $4, unshared # 00b0 lui at,hi(unshared) + # 00b4 addiu at,at,lo(unshared) + # 00b8 lwl a0,0(at) + # 00bc lwr a0,3(at) + usw $4, unshared # 00c0 lui at,hi(unshared) + # 00c4 addiu at,at,lo(unshared) + # 00c8 swl a0,0(at) + # 00cc swr a0,3(at) + li.d $4, 1.0 # 00d0 lui a0,0x3ff0 + # 00d4 move a1,zero + li.d $4, 1.9 # 00d8 lui at,hi(F1.9) + # 00dc lw a0,lo(F1.9)(at) + # 00e0 lw a1,lo(F1.9)+4(at) + li.d $f0, 1.0 # 00e4 ldc1 $f0,L1.0(gp) + li.d $f0, 1.9 # 00e8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00ec addiu a0,a1,100 + # 00f0 sltiu a0,a0,1 + sne $4, $5, -100 # 00f4 addiu a0,a1,100 + # 00f8 sltu a0,zero,a0 + move $4, $5 # 00fc move a0,a1 + +# Not available in 32-bit mode +# dla $4, shared +# dla $4, unshared +# uld $4, unshared +# usd $4, unshared + +# Should produce warnings given -mgp32 +# bgt $4, 0x7fffffff, end +# bgtu $4, 0xffffffff, end +# ble $4, 0x7fffffff, end +# bleu $4, 0xffffffff, end + + add.d $f1, $f2, $f3 # 0100 add.d $f1,$f2,$f3 + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32-pic.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,150 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mfp32 -KPIC +#name: MIPS -mgp64 -mfp32 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: ffbc0008 sd gp,8\(sp\) + 10: 009c202d daddu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 64840000 daddiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 64840000 daddiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 64840228 daddiu a0,a0,552 + 40: 10000079 b 228 <[^>]*> + 44: 00000000 nop + 48: df990000 ld t9,0\(gp\) + 4c: 00000000 nop + 50: 67390228 daddiu t9,t9,552 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: dfbc0008 ld gp,8\(sp\) + 60: df840000 ld a0,0\(gp\) + 64: 00000000 nop + 68: 64840000 daddiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: df840000 ld a0,0\(gp\) + 74: 00000000 nop + 78: 64840000 daddiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: df840000 ld a0,0\(gp\) + 84: 00000000 nop + 88: 64840228 daddiu a0,a0,552 + 8c: 8c840000 lw a0,0\(a0\) + 90: df840000 ld a0,0\(gp\) + 94: 00000000 nop + 98: 64840000 daddiu a0,a0,0 + 9c: dc840000 ld a0,0\(a0\) + a0: df840000 ld a0,0\(gp\) + a4: 00000000 nop + a8: 64840000 daddiu a0,a0,0 + ac: dc840000 ld a0,0\(a0\) + b0: df840000 ld a0,0\(gp\) + b4: 00000000 nop + b8: 64840228 daddiu a0,a0,552 + bc: dc840000 ld a0,0\(a0\) + c0: df810000 ld at,0\(gp\) + c4: 00000000 nop + c8: 64210000 daddiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: df810000 ld at,0\(gp\) + d4: 00000000 nop + d8: 64210000 daddiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: df810000 ld at,0\(gp\) + e4: 00000000 nop + e8: 64210000 daddiu at,at,0 + ec: fc240000 sd a0,0\(at\) + f0: df810000 ld at,0\(gp\) + f4: 00000000 nop + f8: 64210000 daddiu at,at,0 + fc: fc240000 sd a0,0\(at\) + 100: df810000 ld at,0\(gp\) + 104: 00000000 nop + 108: 64210000 daddiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: df810000 ld at,0\(gp\) + 120: 00000000 nop + 124: 64210000 daddiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: df810000 ld at,0\(gp\) + 144: 00000000 nop + 148: 64210000 daddiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: df810000 ld at,0\(gp\) + 158: 00000000 nop + 15c: 64210000 daddiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3404ffc0 li a0,0xffc0 + 16c: 000423bc dsll32 a0,a0,0xe + 170: df810000 ld at,0\(gp\) + 174: dc240000 ld a0,0\(at\) + 178: 3c013ff0 lui at,0x3ff0 + 17c: 44810800 mtc1 at,\$f1 + 180: 44800000 mtc1 zero,\$f0 + 184: df810000 ld at,0\(gp\) + 188: d4200008 ldc1 \$f0,8\(at\) + 18c: 64a40064 daddiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 64a40064 daddiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a0202d move a0,a1 + 1a0: df840000 ld a0,0\(gp\) + 1a4: 00000000 nop + 1a8: 64840000 daddiu a0,a0,0 + 1ac: df840000 ld a0,0\(gp\) + 1b0: 00000000 nop + 1b4: 64840000 daddiu a0,a0,0 + 1b8: df810000 ld at,0\(gp\) + 1bc: 00000000 nop + 1c0: 64210000 daddiu at,at,0 + 1c4: 68240000 ldl a0,0\(at\) + 1c8: 6c240007 ldr a0,7\(at\) + 1cc: df810000 ld at,0\(gp\) + 1d0: 00000000 nop + 1d4: 64210000 daddiu at,at,0 + 1d8: b0240000 sdl a0,0\(at\) + 1dc: b4240007 sdr a0,7\(at\) + 1e0: 3c018000 lui at,0x8000 + 1e4: 0081082a slt at,a0,at + 1e8: 1020000f beqz at,228 <[^>]*> + 1ec: 00000000 nop + 1f0: 34018000 li at,0x8000 + 1f4: 00010c78 dsll at,at,0x11 + 1f8: 0081082b sltu at,a0,at + 1fc: 1020000a beqz at,228 <[^>]*> + 200: 00000000 nop + 204: 3c018000 lui at,0x8000 + 208: 0081082a slt at,a0,at + 20c: 14200006 bnez at,228 <[^>]*> + 210: 00000000 nop + 214: 34018000 li at,0x8000 + 218: 00010c78 dsll at,at,0x11 + 21c: 0081082b sltu at,a0,at + 220: 14200001 bnez at,228 <[^>]*> + 224: 00000000 nop + +0+0228 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32-pic.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,167 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sd gp,8(sp) + .cpadd $4 # 0010 daddu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 daddiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 daddiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c daddiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 ld t9,got(.text)(gp) + # 004c nop + # 0050 daddiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c ld gp,8(sp) + lw $4, shared # 0060 ld a0,got(.sdata)(gp) + # 0064 nop + # 0068 daddiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 ld a0,got(.data)(gp) + # 0074 nop + # 0078 daddiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 ld a0,got(.text)(gp) + # 0084 nop + # 0088 daddiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 ld a0,got(.sdata)(gp) + # 0094 nop + # 0098 daddiu a0,a0,lo(shared) + # 009c ld a0,(a0) + ld $4, unshared # 00a0 ld a0,got(.data)(gp) + # 00a4 nop + # 00a8 daddiu a0,a0,lo(unshared) + # 00ac ld a0,(a0) + ld $4, end # 00b0 ld a0,got(.text)(gp) + # 00b4 nop + # 00b8 daddiu a0,a0,lo(end) + # 00bc ld a0,(a0) + sw $4, shared # 00c0 ld at,got(.sdata)(gp) + # 00c4 nop + # 00c8 daddiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 ld at,got(.data)(gp) + # 00d4 nop + # 00d8 daddiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 ld at,got(.sdata)(gp) + # 00e4 nop + # 00e8 daddiu at,at,lo(shared) + # 00ec sd a0,(at) + sd $4, unshared # 00f0 ld at,got(.data)(gp) + # 00f4 nop + # 00f8 daddiu at,at,lo(unshared) + # 00fc sd a0,(at) + ulh $4, unshared # 0100 ld at,got(.data)(gp) + # 0104 nop + # 0108 daddiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c ld at,got(.data)(gp) + # 0120 nop + # 0124 daddiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 ld at,got(.data)(gp) + # 0144 nop + # 0148 daddiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 ld at,got(.data)(gp) + # 0158 nop + # 015c daddiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 li a0,0xffc0 + # 016c dsll32 a0,a0,14 + li.d $4, 1.9 # 0170 ld at,got(.rodata)(gp) + # 0174 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 0178 lui at,0x3ff0 + # 017c mtc1 at,$f1 + # 0180 mtc1 zero,$f0 + li.d $f0, 1.9 # 0184 ld at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c daddiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 daddiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + + dla $4, shared # 01a0 ld a0,got(.sdata)(gp) + # 01a4 nop + # 01a8 daddiu a0,a0,lo(shared) + dla $4, unshared # 01ac ld a0,got(.data)(gp) + # 01b0 nop + # 01b4 daddiu a0,a0,lo(unshared) + uld $4, unshared # 01b8 ld at,got(.data)(gp) + # 01bc nop + # 01c0 daddiu at,at,lo(unshared) + # 01c4 ldl a0,0(at) + # 01c8 ldr a0,7(at) + usd $4, unshared # 01cc ld at,got(.data)(gp) + # 01d0 nop + # 01d4 daddiu at,at,lo(unshared) + # 01d8 sdl a0,0(at) + # 01dc sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 01e0 lui at,0x8000 + # 01e4 slt at,a0,at + # 01e8 beqz at,end + # 01ec nop + bgtu $4, 0xffffffff, end # 01f0 li at,0x8000 + # 01f4 dsll at,at,17 + # 01f8 sltu at,a0,at + # 01fc beqz at,end + # 0200 nop + ble $4, 0x7fffffff, end # 0204 lui at,0x8000 + # 0208 slt at,a0,at + # 020c bnez at,end + # 0210 nop + bleu $4, 0xffffffff, end # 0214 li at,0x8000 + # 0218 dsll at,at,17 + # 021c sltu at,a0,at + # 0220 bnez at,end + # 0224 nop + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + + .end func +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,97 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -mfp32 +#name: MIPS -mgp64 -mfp32 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 6784c000 daddiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 64840000 daddiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 64840154 daddiu a0,a0,340 + 1c: 08000055 j 154 <[^>]*> + 20: 0c000055 jal 154 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840154 lw a0,340\(a0\) + 38: df84c000 ld a0,-16384\(gp\) + 3c: 3c040000 lui a0,0x0 + 40: dc840000 ld a0,0\(a0\) + 44: 3c040000 lui a0,0x0 + 48: dc840154 ld a0,340\(a0\) + 4c: af84c000 sw a0,-16384\(gp\) + 50: 3c010000 lui at,0x0 + 54: ac240000 sw a0,0\(at\) + 58: ff84c000 sd a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: fc240000 sd a0,0\(at\) + 64: 3c010000 lui at,0x0 + 68: 64210000 daddiu at,at,0 + 6c: 80240000 lb a0,0\(at\) + 70: 90210001 lbu at,1\(at\) + 74: 00042200 sll a0,a0,0x8 + 78: 00812025 or a0,a0,at + 7c: 3c010000 lui at,0x0 + 80: 64210000 daddiu at,at,0 + 84: a0240001 sb a0,1\(at\) + 88: 00042202 srl a0,a0,0x8 + 8c: a0240000 sb a0,0\(at\) + 90: 90210001 lbu at,1\(at\) + 94: 00042200 sll a0,a0,0x8 + 98: 00812025 or a0,a0,at + 9c: 3c010000 lui at,0x0 + a0: 64210000 daddiu at,at,0 + a4: 88240000 lwl a0,0\(at\) + a8: 98240003 lwr a0,3\(at\) + ac: 3c010000 lui at,0x0 + b0: 64210000 daddiu at,at,0 + b4: a8240000 swl a0,0\(at\) + b8: b8240003 swr a0,3\(at\) + bc: 3404ffc0 li a0,0xffc0 + c0: 000423bc dsll32 a0,a0,0xe + c4: 3c010000 lui at,0x0 + c8: dc240000 ld a0,0\(at\) + cc: 3c013ff0 lui at,0x3ff0 + d0: 44810800 mtc1 at,\$f1 + d4: 44800000 mtc1 zero,\$f0 + d8: d780c000 ldc1 \$f0,-16384\(gp\) + dc: 64a40064 daddiu a0,a1,100 + e0: 2c840001 sltiu a0,a0,1 + e4: 64a40064 daddiu a0,a1,100 + e8: 0004202b sltu a0,zero,a0 + ec: 00a0202d move a0,a1 + f0: 6784c000 daddiu a0,gp,-16384 + f4: 3c040000 lui a0,0x0 + f8: 64840000 daddiu a0,a0,0 + fc: 3c010000 lui at,0x0 + 100: 64210000 daddiu at,at,0 + 104: 68240000 ldl a0,0\(at\) + 108: 6c240007 ldr a0,7\(at\) + 10c: 3c010000 lui at,0x0 + 110: 64210000 daddiu at,at,0 + 114: b0240000 sdl a0,0\(at\) + 118: b4240007 sdr a0,7\(at\) + 11c: 3c018000 lui at,0x8000 + 120: 0081082a slt at,a0,at + 124: 1020000b beqz at,154 <[^>]*> + 128: 34018000 li at,0x8000 + 12c: 00010c78 dsll at,at,0x11 + 130: 0081082b sltu at,a0,at + 134: 10200007 beqz at,154 <[^>]*> + 138: 3c018000 lui at,0x8000 + 13c: 0081082a slt at,a0,at + 140: 14200004 bnez at,154 <[^>]*> + 144: 34018000 li at,0x8000 + 148: 00010c78 dsll at,at,0x11 + 14c: 0081082b sltu at,a0,at + 150: 14200000 bnez at,154 <[^>]*> + +0+0154 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp32.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp32.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,111 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text +func: + .set noreorder + .set mips4 + li $4, 0x12345678 # 0000 lui a0,0x1234 + # 0004 ori a0,a0,0x5678 + la $4, shared # 0008 daddiu a0,gp,shared + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 daddiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 daddiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 ld a0,shared(gp) + ld $4, unshared # 003c lui a0,hi(unshared) + # 0040 ld a0,lo(unshared)(a0) + ld $4, end # 0044 lui a0,hi(end) + # 0048 ld a0,lo(end)(a0) + sw $4, shared # 004c sw a0,shared(gp) + sw $4, unshared # 0050 lui at,hi(unshared) + # 0054 sw a0,lo(unshared)(at) + sd $4, shared # 0058 sd a0,shared(gp) + sd $4, unshared # 005c lui at,hi(unshared) + # 0060 sd a0,lo(unshared)(at) + ulh $4, unshared # 0064 lui at,hi(unshared) + # 0068 daddiu at,at,lo(unshared) + # 006c lb a0,0(at) + # 0070 lbu at,1(at) + # 0074 sll a0,a0,8 + # 0078 or a0,a0,at + ush $4, unshared # 007c lui at,hi(unshared) + # 0080 daddiu at,at,lo(unshared) + # 0084 sb a0,1(at) + # 0088 srl a0,a0,8 + # 008c sb a0,0(at) + # 0090 lbu at,1(at) + # 0094 sll a0,a0,8 + # 0098 or a0,a0,at + ulw $4, unshared # 009c lui at,hi(unshared) + # 00a0 daddiu at,at,lo(unshared) + # 00a4 lwl a0,0(at) + # 00a8 lwr a0,3(at) + usw $4, unshared # 00ac lui at,hi(unshared) + # 00b0 daddiu at,at,lo(unshared) + # 00b4 swl a0,0(at) + # 00b8 swr a0,3(at) + li.d $4, 1.0 # 00bc li a0,0xffc0 + # 00c0 dsll32 a0,a0,14 # giving 0x3ff00000... + li.d $4, 1.9 # 00c4 lui at,hi(F1.9) + # 00c8 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 00cc lui at,0x3ff0 + # 00d0 mtc1 at,$f1 + # 00d4 mtc1 zero,$f0 + li.d $f0, 1.9 # 00d8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00dc daddiu a0,a1,100 + # 00e0 sltiu a0,a0,1 + sne $4, $5, -100 # 00e4 daddiu a0,a1,100 + # 00e8 sltu a0,zero,a0 + move $4, $5 # 00ec move a0,a1 + + dla $4, shared # 00f0 daddiu a0,gp,shared + dla $4, unshared # 00f4 lui a0,hi(unshared) + # 00f8 daddiu a0,a0,lo(unshared) + uld $4, unshared # 00fc lui at,hi(unshared) + # 0100 daddiu at,at,lo(unshared) + # 0104 ldl a0,0(at) + # 0108 ldr a0,7(at) + usd $4, unshared # 010c lui at,hi(unshared) + # 0110 daddiu at,at,lo(unshared) + # 0114 sdl a0,0(at) + # 0118 sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 011c lui at,0x8000 + # 0120 slt at,a0,at + # 0124 beqz at,end + bgtu $4, 0xffffffff, end # 0128 li at,0x8000 + # 012c dsll at,at,17 + # 0130 sltu at,a0,at + # 0134 beqz at,end + ble $4, 0x7fffffff, end # 0138 lui at,0x8000 + # 013c slt at,a0,at + # 0140 bnez at,end + bleu $4, 0xffffffff, end # 0144 li at,0x8000 + # 0148 dsll at,at,17 + # 014c sltu at,a0,at + # 0150 bnez at,end + +# Should produce warnings given -mfp32 +# add.d $f1, $f2, $f3 + +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64-pic.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,151 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB -KPIC +#name: MIPS -mgp64 -mfp64 (SVR4 PIC) + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c1c0000 lui gp,0x0 + 4: 279c0000 addiu gp,gp,0 + 8: 0399e021 addu gp,gp,t9 + c: ffbc0008 sd gp,8\(sp\) + 10: 009c202d daddu a0,a0,gp + 14: 3c041234 lui a0,0x1234 + 18: 34845678 ori a0,a0,0x5678 + 1c: 8f840000 lw a0,0\(gp\) + 20: 00000000 nop + 24: 64840000 daddiu a0,a0,0 + 28: 8f840000 lw a0,0\(gp\) + 2c: 00000000 nop + 30: 64840000 daddiu a0,a0,0 + 34: 8f840000 lw a0,0\(gp\) + 38: 00000000 nop + 3c: 6484022c daddiu a0,a0,556 + 40: 1000007a b 22c <[^>]*> + 44: 00000000 nop + 48: df990000 ld t9,0\(gp\) + 4c: 00000000 nop + 50: 6739022c daddiu t9,t9,556 + 54: 0320f809 jalr t9 + 58: 00000000 nop + 5c: dfbc0008 ld gp,8\(sp\) + 60: df840000 ld a0,0\(gp\) + 64: 00000000 nop + 68: 64840000 daddiu a0,a0,0 + 6c: 8c840000 lw a0,0\(a0\) + 70: df840000 ld a0,0\(gp\) + 74: 00000000 nop + 78: 64840000 daddiu a0,a0,0 + 7c: 8c840000 lw a0,0\(a0\) + 80: df840000 ld a0,0\(gp\) + 84: 00000000 nop + 88: 6484022c daddiu a0,a0,556 + 8c: 8c840000 lw a0,0\(a0\) + 90: df840000 ld a0,0\(gp\) + 94: 00000000 nop + 98: 64840000 daddiu a0,a0,0 + 9c: dc840000 ld a0,0\(a0\) + a0: df840000 ld a0,0\(gp\) + a4: 00000000 nop + a8: 64840000 daddiu a0,a0,0 + ac: dc840000 ld a0,0\(a0\) + b0: df840000 ld a0,0\(gp\) + b4: 00000000 nop + b8: 6484022c daddiu a0,a0,556 + bc: dc840000 ld a0,0\(a0\) + c0: df810000 ld at,0\(gp\) + c4: 00000000 nop + c8: 64210000 daddiu at,at,0 + cc: ac240000 sw a0,0\(at\) + d0: df810000 ld at,0\(gp\) + d4: 00000000 nop + d8: 64210000 daddiu at,at,0 + dc: ac240000 sw a0,0\(at\) + e0: df810000 ld at,0\(gp\) + e4: 00000000 nop + e8: 64210000 daddiu at,at,0 + ec: fc240000 sd a0,0\(at\) + f0: df810000 ld at,0\(gp\) + f4: 00000000 nop + f8: 64210000 daddiu at,at,0 + fc: fc240000 sd a0,0\(at\) + 100: df810000 ld at,0\(gp\) + 104: 00000000 nop + 108: 64210000 daddiu at,at,0 + 10c: 80240000 lb a0,0\(at\) + 110: 90210001 lbu at,1\(at\) + 114: 00042200 sll a0,a0,0x8 + 118: 00812025 or a0,a0,at + 11c: df810000 ld at,0\(gp\) + 120: 00000000 nop + 124: 64210000 daddiu at,at,0 + 128: a0240001 sb a0,1\(at\) + 12c: 00042202 srl a0,a0,0x8 + 130: a0240000 sb a0,0\(at\) + 134: 90210001 lbu at,1\(at\) + 138: 00042200 sll a0,a0,0x8 + 13c: 00812025 or a0,a0,at + 140: df810000 ld at,0\(gp\) + 144: 00000000 nop + 148: 64210000 daddiu at,at,0 + 14c: 88240000 lwl a0,0\(at\) + 150: 98240003 lwr a0,3\(at\) + 154: df810000 ld at,0\(gp\) + 158: 00000000 nop + 15c: 64210000 daddiu at,at,0 + 160: a8240000 swl a0,0\(at\) + 164: b8240003 swr a0,3\(at\) + 168: 3404ffc0 li a0,0xffc0 + 16c: 000423bc dsll32 a0,a0,0xe + 170: df810000 ld at,0\(gp\) + 174: dc240000 ld a0,0\(at\) + 178: 3401ffc0 li at,0xffc0 + 17c: 00010bbc dsll32 at,at,0xe + 180: 44a10000 dmtc1 at,\$f0 + 184: df810000 ld at,0\(gp\) + 188: d4200008 ldc1 \$f0,8\(at\) + 18c: 64a40064 daddiu a0,a1,100 + 190: 2c840001 sltiu a0,a0,1 + 194: 64a40064 daddiu a0,a1,100 + 198: 0004202b sltu a0,zero,a0 + 19c: 00a0202d move a0,a1 + 1a0: df840000 ld a0,0\(gp\) + 1a4: 00000000 nop + 1a8: 64840000 daddiu a0,a0,0 + 1ac: df840000 ld a0,0\(gp\) + 1b0: 00000000 nop + 1b4: 64840000 daddiu a0,a0,0 + 1b8: df810000 ld at,0\(gp\) + 1bc: 00000000 nop + 1c0: 64210000 daddiu at,at,0 + 1c4: 68240000 ldl a0,0\(at\) + 1c8: 6c240007 ldr a0,7\(at\) + 1cc: df810000 ld at,0\(gp\) + 1d0: 00000000 nop + 1d4: 64210000 daddiu at,at,0 + 1d8: b0240000 sdl a0,0\(at\) + 1dc: b4240007 sdr a0,7\(at\) + 1e0: 3c018000 lui at,0x8000 + 1e4: 0081082a slt at,a0,at + 1e8: 10200010 beqz at,22c <[^>]*> + 1ec: 00000000 nop + 1f0: 34018000 li at,0x8000 + 1f4: 00010c78 dsll at,at,0x11 + 1f8: 0081082b sltu at,a0,at + 1fc: 1020000b beqz at,22c <[^>]*> + 200: 00000000 nop + 204: 3c018000 lui at,0x8000 + 208: 0081082a slt at,a0,at + 20c: 14200007 bnez at,22c <[^>]*> + 210: 00000000 nop + 214: 34018000 li at,0x8000 + 218: 00010c78 dsll at,at,0x11 + 21c: 0081082b sltu at,a0,at + 220: 14200002 bnez at,22c <[^>]*> + 224: 00000000 nop + 228: 46231040 add.d \$f1,\$f2,\$f3 + +0+022c <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64-pic.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,166 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text + .ent func +func: + .set mips4 + .set noreorder + .cpload $25 # 0000 lui gp,hi(_gp_disp) + # 0004 addiu gp,gp,lo(_gp_disp) + # 0008 addu gp,gp,t9 + .set reorder + .cprestore 8 # 000c sd gp,8(sp) + .cpadd $4 # 0010 daddu a0,a0,gp + li $4, 0x12345678 # 0014 lui a0,0x1234 + # 0018 ori a0,a0,0x5678 + la $4, shared # 001c lw a0,got(.sdata)(gp) + # 0020 nop + # 0024 daddiu a0,a0,lo(shared) + la $4, unshared # 0028 lw a0,got(.data)(gp) + # 002c nop + # 0030 daddiu a0,a0,lo(unshared) + la $4, end # 0034 lw a0,got(.text)(gp) + # 0038 nop + # 003c daddiu a0,a0,lo(end) + j end # 0040 b end + # 0044 nop + jal end # 0048 ld t9,got(.text)(gp) + # 004c nop + # 0050 daddiu t9,t9,lo(end) + # 0054 jalr t9 + # 0058 nop + # 005c ld gp,8(sp) + lw $4, shared # 0060 ld a0,got(.sdata)(gp) + # 0064 nop + # 0068 daddiu a0,a0,lo(shared) + # 006c lw a0,(a0) + lw $4, unshared # 0070 ld a0,got(.data)(gp) + # 0074 nop + # 0078 daddiu a0,a0,lo(unshared) + # 007c lw a0,(a0) + lw $4, end # 0080 ld a0,got(.text)(gp) + # 0084 nop + # 0088 daddiu a0,a0,lo(end) + # 008c lw a0,(a0) + ld $4, shared # 0090 ld a0,got(.sdata)(gp) + # 0094 nop + # 0098 daddiu a0,a0,lo(shared) + # 009c ld a0,(a0) + ld $4, unshared # 00a0 ld a0,got(.data)(gp) + # 00a4 nop + # 00a8 daddiu a0,a0,lo(unshared) + # 00ac ld a0,(a0) + ld $4, end # 00b0 ld a0,got(.text)(gp) + # 00b4 nop + # 00b8 daddiu a0,a0,lo(end) + # 00bc ld a0,(a0) + sw $4, shared # 00c0 ld at,got(.sdata)(gp) + # 00c4 nop + # 00c8 daddiu at,at,lo(shared) + # 00cc sw a0,0(at) + sw $4, unshared # 00d0 ld at,got(.data)(gp) + # 00d4 nop + # 00d8 daddiu at,at,lo(unshared) + # 00dc sw a0,0(at) + sd $4, shared # 00e0 ld at,got(.sdata)(gp) + # 00e4 nop + # 00e8 daddiu at,at,lo(shared) + # 00ec sd a0,(at) + sd $4, unshared # 00f0 ld at,got(.data)(gp) + # 00f4 nop + # 00f8 daddiu at,at,lo(unshared) + # 00fc sd a0,(at) + ulh $4, unshared # 0100 ld at,got(.data)(gp) + # 0104 nop + # 0108 daddiu at,at,lo(unshared) + # 010c lb a0,0(at) + # 0110 lbu at,1(at) + # 0114 sll a0,a0,8 + # 0118 or a0,a0,at + ush $4, unshared # 011c ld at,got(.data)(gp) + # 0120 nop + # 0124 daddiu at,at,lo(unshared) + # 0128 sb a0,0(at) + # 012c srl a0,a0,8 + # 0130 sb a0,1(at) + # 0134 lbu at,0(at) + # 0138 sll a0,a0,8 + # 013c or a0,a0,at + ulw $4, unshared # 0140 ld at,got(.data)(gp) + # 0144 nop + # 0148 daddiu at,at,lo(unshared) + # 014c lwl a0,0(at) + # 0150 lwr a0,3(at) + usw $4, unshared # 0154 ld at,got(.data)(gp) + # 0158 nop + # 015c daddiu at,at,lo(unshared) + # 0160 swl a0,0(at) + # 0164 swr a0,3(at) + li.d $4, 1.0 # 0168 li a0,0xffc0 + # 016c dsll32 a0,a0,14 + li.d $4, 1.9 # 0170 ld at,got(.rodata)(gp) + # 0174 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 0178 li at,0xffc0 + # 017c dsll32 at,at,14 + # 0180 dmtc1 at,$f0 + li.d $f0, 1.9 # 0184 ld at,got(.rodata)(gp) + # 0188 ldc1 $f0,lo(L1.9)(at) + seq $4, $5, -100 # 018c daddiu a0,a1,100 + # 0190 sltiu a0,a0,1 + sne $4, $5, -100 # 0194 daddiu a0,a1,100 + # 0198 sltu a0,zero,a0 + move $4, $5 # 019c move a0,a1 + + dla $4, shared # 01a0 ld a0,got(.sdata)(gp) + # 01a4 nop + # 01a8 daddiu a0,a0,lo(shared) + dla $4, unshared # 01ac ld a0,got(.data)(gp) + # 01b0 nop + # 01b4 daddiu a0,a0,lo(unshared) + uld $4, unshared # 01b8 ld at,got(.data)(gp) + # 01bc nop + # 01c0 daddiu at,at,lo(unshared) + # 01c4 ldl a0,0(at) + # 01c8 ldr a0,7(at) + usd $4, unshared # 01cc ld at,got(.data)(gp) + # 01d0 nop + # 01d4 daddiu at,at,lo(unshared) + # 01d8 sdl a0,0(at) + # 01dc sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 01e0 lui at,0x8000 + # 01e4 slt at,a0,at + # 01e8 beqz at,end + # 01ec nop + bgtu $4, 0xffffffff, end # 01f0 li at,0x8000 + # 01f4 dsll at,at,17 + # 01f8 sltu at,a0,at + # 01fc beqz at,end + # 0200 nop + ble $4, 0x7fffffff, end # 0204 lui at,0x8000 + # 0208 slt at,a0,at + # 020c bnez at,end + # 0210 nop + bleu $4, 0xffffffff, end # 0214 li at,0x8000 + # 0218 dsll at,at,17 + # 021c sltu at,a0,at + # 0220 bnez at,end + # 0224 nop + + add.d $f1, $f2, $f3 # 0228 add.d $f1,$f2,$f3 + + .end func +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64.d Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64.d Sat Aug 4 19:52:15 2001 @@ -0,0 +1,98 @@ +#objdump: -d -mmips:8000 +#as: -march=8000 -EB +#name: MIPS -mgp64 -mfp64 + +.*: +file format.* + +Disassembly of section .text: + +0+000 <[^>]*>: + 0: 3c041234 lui a0,0x1234 + 4: 34845678 ori a0,a0,0x5678 + 8: 6784c000 daddiu a0,gp,-16384 + c: 3c040000 lui a0,0x0 + 10: 64840000 daddiu a0,a0,0 + 14: 3c040000 lui a0,0x0 + 18: 64840158 daddiu a0,a0,344 + 1c: 08000056 j 158 <[^>]*> + 20: 0c000056 jal 158 <[^>]*> + 24: 8f84c000 lw a0,-16384\(gp\) + 28: 3c040000 lui a0,0x0 + 2c: 8c840000 lw a0,0\(a0\) + 30: 3c040000 lui a0,0x0 + 34: 8c840158 lw a0,344\(a0\) + 38: df84c000 ld a0,-16384\(gp\) + 3c: 3c040000 lui a0,0x0 + 40: dc840000 ld a0,0\(a0\) + 44: 3c040000 lui a0,0x0 + 48: dc840158 ld a0,344\(a0\) + 4c: af84c000 sw a0,-16384\(gp\) + 50: 3c010000 lui at,0x0 + 54: ac240000 sw a0,0\(at\) + 58: ff84c000 sd a0,-16384\(gp\) + 5c: 3c010000 lui at,0x0 + 60: fc240000 sd a0,0\(at\) + 64: 3c010000 lui at,0x0 + 68: 64210000 daddiu at,at,0 + 6c: 80240000 lb a0,0\(at\) + 70: 90210001 lbu at,1\(at\) + 74: 00042200 sll a0,a0,0x8 + 78: 00812025 or a0,a0,at + 7c: 3c010000 lui at,0x0 + 80: 64210000 daddiu at,at,0 + 84: a0240001 sb a0,1\(at\) + 88: 00042202 srl a0,a0,0x8 + 8c: a0240000 sb a0,0\(at\) + 90: 90210001 lbu at,1\(at\) + 94: 00042200 sll a0,a0,0x8 + 98: 00812025 or a0,a0,at + 9c: 3c010000 lui at,0x0 + a0: 64210000 daddiu at,at,0 + a4: 88240000 lwl a0,0\(at\) + a8: 98240003 lwr a0,3\(at\) + ac: 3c010000 lui at,0x0 + b0: 64210000 daddiu at,at,0 + b4: a8240000 swl a0,0\(at\) + b8: b8240003 swr a0,3\(at\) + bc: 3404ffc0 li a0,0xffc0 + c0: 000423bc dsll32 a0,a0,0xe + c4: 3c010000 lui at,0x0 + c8: dc240000 ld a0,0\(at\) + cc: 3401ffc0 li at,0xffc0 + d0: 00010bbc dsll32 at,at,0xe + d4: 44a10000 dmtc1 at,\$f0 + d8: d780c000 ldc1 \$f0,-16384\(gp\) + dc: 64a40064 daddiu a0,a1,100 + e0: 2c840001 sltiu a0,a0,1 + e4: 64a40064 daddiu a0,a1,100 + e8: 0004202b sltu a0,zero,a0 + ec: 00a0202d move a0,a1 + f0: 6784c000 daddiu a0,gp,-16384 + f4: 3c040000 lui a0,0x0 + f8: 64840000 daddiu a0,a0,0 + fc: 3c010000 lui at,0x0 + 100: 64210000 daddiu at,at,0 + 104: 68240000 ldl a0,0\(at\) + 108: 6c240007 ldr a0,7\(at\) + 10c: 3c010000 lui at,0x0 + 110: 64210000 daddiu at,at,0 + 114: b0240000 sdl a0,0\(at\) + 118: b4240007 sdr a0,7\(at\) + 11c: 3c018000 lui at,0x8000 + 120: 0081082a slt at,a0,at + 124: 1020000c beqz at,158 <[^>]*> + 128: 34018000 li at,0x8000 + 12c: 00010c78 dsll at,at,0x11 + 130: 0081082b sltu at,a0,at + 134: 10200008 beqz at,158 <[^>]*> + 138: 3c018000 lui at,0x8000 + 13c: 0081082a slt at,a0,at + 140: 14200005 bnez at,158 <[^>]*> + 144: 34018000 li at,0x8000 + 148: 00010c78 dsll at,at,0x11 + 14c: 0081082b sltu at,a0,at + 150: 14200001 bnez at,158 <[^>]*> + 154: 46231040 add.d \$f1,\$f2,\$f3 + +0+0158 <[^>]*>: + ... diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64.s binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64.s --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips-gp64-fp64.s Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips-gp64-fp64.s Sat Aug 4 19:52:15 2001 @@ -0,0 +1,109 @@ + + .sdata +shared: .4byte 11 + + .data + .size unshared,16 +unshared: + .4byte 1 + .4byte 2 + .4byte 3 + .4byte 4 + + .text +func: + .set noreorder + .set mips4 + li $4, 0x12345678 # 0000 lui a0,0x1234 + # 0004 ori a0,a0,0x5678 + la $4, shared # 0008 daddiu a0,gp,shared + la $4, unshared # 000c lui a0,hi(unshared) + # 0010 daddiu a0,a0,lo(unshared) + la $4, end # 0014 lui a0,hi(end) + # 0018 daddiu a0,a0,lo(end) + j end # 001c j end + jal end # 0020 jal end + lw $4, shared # 0024 lw a0,shared(gp) + lw $4, unshared # 0028 lui a0,hi(unshared) + # 002c lw a0,lo(unshared)(a0) + lw $4, end # 0030 lui a0,hi(end) + # 0034 lw a0,lo(end)(a0) + ld $4, shared # 0038 ld a0,shared(gp) + ld $4, unshared # 003c lui a0,hi(unshared) + # 0040 ld a0,lo(unshared)(a0) + ld $4, end # 0044 lui a0,hi(end) + # 0048 ld a0,lo(end)(a0) + sw $4, shared # 004c sw a0,shared(gp) + sw $4, unshared # 0050 lui at,hi(unshared) + # 0054 sw a0,lo(unshared)(at) + sd $4, shared # 0058 sd a0,shared(gp) + sd $4, unshared # 005c lui at,hi(unshared) + # 0060 sd a0,lo(unshared)(at) + ulh $4, unshared # 0064 lui at,hi(unshared) + # 0068 daddiu at,at,lo(unshared) + # 006c lb a0,0(at) + # 0070 lbu at,1(at) + # 0074 sll a0,a0,8 + # 0078 or a0,a0,at + ush $4, unshared # 007c lui at,hi(unshared) + # 0080 daddiu at,at,lo(unshared) + # 0084 sb a0,1(at) + # 0088 srl a0,a0,8 + # 008c sb a0,0(at) + # 0090 lbu at,1(at) + # 0094 sll a0,a0,8 + # 0098 or a0,a0,at + ulw $4, unshared # 009c lui at,hi(unshared) + # 00a0 daddiu at,at,lo(unshared) + # 00a4 lwl a0,0(at) + # 00a8 lwr a0,3(at) + usw $4, unshared # 00ac lui at,hi(unshared) + # 00b0 daddiu at,at,lo(unshared) + # 00b4 swl a0,0(at) + # 00b8 swr a0,3(at) + li.d $4, 1.0 # 00bc li a0,0xffc0 + # 00c0 dsll32 a0,a0,14 # giving 0x3ff00000... + li.d $4, 1.9 # 00c4 lui at,hi(F1.9) + # 00c8 ld a0,lo(F1.9)(at) + li.d $f0, 1.0 # 00cc li at,0xffc0 + # 00d0 dsll32 at,at,14 + # 00d4 dmtc1 at,$f0 + li.d $f0, 1.9 # 00d8 ldc1 $f0,L1.9(gp) + seq $4, $5, -100 # 00dc daddiu a0,a1,100 + # 00e0 sltiu a0,a0,1 + sne $4, $5, -100 # 00e4 daddiu a0,a1,100 + # 00e8 sltu a0,zero,a0 + move $4, $5 # 00ec move a0,a1 + + dla $4, shared # 00f0 daddiu a0,gp,shared + dla $4, unshared # 00f4 lui a0,hi(unshared) + # 00f8 daddiu a0,a0,lo(unshared) + uld $4, unshared # 00fc lui at,hi(unshared) + # 0100 daddiu at,at,lo(unshared) + # 0104 ldl a0,0(at) + # 0108 ldr a0,7(at) + usd $4, unshared # 010c lui at,hi(unshared) + # 0110 daddiu at,at,lo(unshared) + # 0114 sdl a0,0(at) + # 0118 sdr a0,7(at) + + bgt $4, 0x7fffffff, end # 011c lui at,0x8000 + # 0120 slt at,a0,at + # 0124 beqz at,end + bgtu $4, 0xffffffff, end # 0128 li at,0x8000 + # 012c dsll at,at,17 + # 0130 sltu at,a0,at + # 0134 beqz at,end + ble $4, 0x7fffffff, end # 0138 lui at,0x8000 + # 013c slt at,a0,at + # 0140 bnez at,end + bleu $4, 0xffffffff, end # 0144 li at,0x8000 + # 0148 dsll at,at,17 + # 014c sltu at,a0,at + # 0150 bnez at,end + + add.d $f1, $f2, $f3 # 0154 add.d $f1,$f2,$f3 +end: + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips.exp binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips.exp --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips.exp Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips.exp Fri Aug 10 14:08:01 2001 @@ -29,6 +29,11 @@ if { [istarget mips*-*-*] } then { } else { set tmips "" } + if [istarget mips*el-*-*] { + set el el + } { + set el "" + } run_dump_test "abs" run_dump_test "add" @@ -119,6 +124,12 @@ if { [istarget mips*-*-*] } then { run_list_test "illegal" "" + run_dump_test "mips-gp32-fp32" + run_dump_test "mips-gp32-fp64" + run_dump_test "mips-gp64-fp32" + run_dump_test "mips-gp64-fp64" + run_dump_test "mips-abi32" + if $svr4pic { # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file # containing 4650-specific instructions with -m4650 and -mcpu=4650, @@ -131,50 +142,25 @@ if { [istarget mips*-*-*] } then { run_dump_test "elf_e_flags3" run_dump_test "elf_e_flags4" - if [istarget mips*el-*-*] { - run_dump_test "elfel-rel" - } { - run_dump_test "elf-rel" - } + run_dump_test "mips-gp32-fp32-pic" + run_dump_test "mips-gp32-fp64-pic" + run_dump_test "mips-gp64-fp32-pic" + run_dump_test "mips-gp64-fp64-pic" + run_dump_test "mips-abi32-pic" + run_dump_test "elf${el}-rel" if [istarget mips64*-*-*] { - if [istarget mips*el-*-*] { - run_dump_test "elfel-rel2" - } { - run_dump_test "elf-rel2" - } + run_dump_test "elf${el}-rel2" + run_dump_test "elf-rel4" } { - if [istarget mips*el-*-*] { - run_dump_test "e32el-rel2" - } { - run_dump_test "e32-rel2" - } + run_dump_test "e32${el}-rel2" + run_dump_test "e32-rel4" } - - if [istarget mips*el-*-*] { - run_dump_test "elfel-rel3" - } { - run_dump_test "elf-rel3" - } - - if [istarget mips*el-*-*] { - run_dump_test "${tmips}elempic" - } { - run_dump_test "${tmips}empic" - } - + run_dump_test "elf${el}-rel3" + run_dump_test "${tmips}${el}empic" if { !$no_mips16 } { - if [istarget mips*el-*-*] { - run_dump_test "${tmips}mipsel16-e" - } { - run_dump_test "${tmips}mips16-e" - } - setup_xfail "mips*-*-*" - if [istarget mips*el-*-*] { - run_dump_test "mipsel16-f" - } { - run_dump_test "mips16-f" - } + run_dump_test "${tmips}mips${el}16-e" + run_dump_test "mips${el}16-f" } } } diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips16-e.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-e.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips16-e.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-e.d Fri Aug 10 14:08:01 2001 @@ -19,7 +19,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_32 l1 0+0000004 R_MIPS_32 l1 0+0000008 R_MIPS_32 L1.1 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips16-f.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-f.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips16-f.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips16-f.d Fri Aug 10 14:08:01 2001 @@ -10,14 +10,14 @@ SYMBOL TABLE: 0+0000000 l d \.text 0+0000000 0+0000000 l d \.data 0+0000000 0+0000000 l d \.bss 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 0+0000000 l d foo 0+0000000 0+0000000 l d \.reginfo 0+0000000 0+0000000 l d \.(mdebug|pdr) 0+0000000 -0+0000002 l \.text 0+0000000 0xf0 l1 RELOCATION RECORDS FOR \[foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_32 l1 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips32.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips32.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips32.d Mon May 21 10:37:04 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips32.d Fri Aug 10 14:08:01 2001 @@ -26,15 +26,15 @@ Disassembly of section .text: 0+0040 <[^>]*> 00000000 nop 0+0044 <[^>]*> 4903ffee bc2tl 0+0000 0+0048 <[^>]*> 00000000 nop -0+004c <[^>]*> 48411000 cfc2 at,v0 +0+004c <[^>]*> 48411000 cfc2 at,\$2 0+0050 <[^>]*> 4b234567 c2 0x1234567 -0+0054 <[^>]*> 48c21800 ctc2 v0,v1 -0+0058 <[^>]*> 48032000 mfc2 v1,a0 -0+005c <[^>]*> 48042800 mfc2 a0,a1 -0+0060 <[^>]*> 48053007 mfc2 a1,a2,7 -0+0064 <[^>]*> 48863800 mtc2 a2,a3 -0+0068 <[^>]*> 48874000 mtc2 a3,t0 -0+006c <[^>]*> 48884807 mtc2 t0,t1,7 +0+0054 <[^>]*> 48c21800 ctc2 v0,\$3 +0+0058 <[^>]*> 48032000 mfc2 v1,\$4 +0+005c <[^>]*> 48042800 mfc2 a0,\$5 +0+0060 <[^>]*> 48053007 mfc2 a1,\$6,7 +0+0064 <[^>]*> 48863800 mtc2 a2,\$7 +0+0068 <[^>]*> 48874000 mtc2 a3,\$8 +0+006c <[^>]*> 48884807 mtc2 t0,\$9,7 0+0070 <[^>]*> bc250000 cache 0x5,0\(at\) 0+0074 <[^>]*> bc457fff cache 0x5,32767\(v0\) 0+0078 <[^>]*> bc658000 cache 0x5,-32768\(v1\) diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips64.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips64.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mips64.d Mon May 21 10:37:04 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mips64.d Fri Aug 10 14:08:01 2001 @@ -2,16 +2,16 @@ #name: MIPS MIPS64 instructions #as: -mips64 -# Check MIPS32 instruction assembly +# Check MIPS64 instruction assembly .*: +file format .*mips.* Disassembly of section .text: 0+0000 <[^>]*> 70410825 dclo at,v0 0+0004 <[^>]*> 70831824 dclz v1,a0 -0+0008 <[^>]*> 48232000 dmfc2 v1,a0 -0+000c <[^>]*> 48242800 dmfc2 a0,a1 -0+0010 <[^>]*> 48253007 dmfc2 a1,a2,7 -0+0014 <[^>]*> 48a63800 dmtc2 a2,a3 -0+0018 <[^>]*> 48a74000 dmtc2 a3,t0 -0+001c <[^>]*> 48a84807 dmtc2 t0,t1,7 +0+0008 <[^>]*> 48232000 dmfc2 v1,\$4 +0+000c <[^>]*> 48242800 dmfc2 a0,\$5 +0+0010 <[^>]*> 48253007 dmfc2 a1,\$6,7 +0+0014 <[^>]*> 48a63800 dmtc2 a2,\$7 +0+0018 <[^>]*> 48a74000 dmtc2 a3,\$8 +0+001c <[^>]*> 48a84807 dmtc2 t0,\$9,7 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/mipsel16-f.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-f.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/mipsel16-f.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/mipsel16-f.d Fri Aug 10 14:08:01 2001 @@ -18,7 +18,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_32 l1 @@ -31,4 +31,4 @@ Contents of section \.reginfo: Contents of section \.(mdebug|pdr): #... Contents of section foo: - 0000 00000003 00000000 00000000 00000000 .* + 0000 03000000 00000000 00000000 00000000 .* diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/sb.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/sb.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/sb.d Mon May 21 10:37:05 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/sb.d Fri Aug 10 14:08:01 2001 @@ -386,10 +386,10 @@ Disassembly of section .text: 0+0370 <[^>]*> sw a1,4\(zero\) 0+0374 <[^>]*> sh a0,0\(zero\) 0+0378 <[^>]*> sw a0,0\(zero\) -0+037c <[^>]*> swc0 a0,0\(zero\) +0+037c <[^>]*> swc0 \$4,0\(zero\) 0+0380 <[^>]*> swc1 \$f4,0\(zero\) -0+0384 <[^>]*> swc2 a0,0\(zero\) -0+0388 <[^>]*> swc3 a0,0\(zero\) +0+0384 <[^>]*> swc2 \$4,0\(zero\) +0+0388 <[^>]*> swc3 \$4,0\(zero\) 0+038c <[^>]*> swc1 \$f4,0\(zero\) 0+0390 <[^>]*> swl a0,0\(zero\) 0+0394 <[^>]*> swr a0,0\(zero\) diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/telempic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/telempic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/telempic.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/telempic.d Fri Aug 10 14:08:01 2001 @@ -24,7 +24,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL16_S2 g1 0+000000c R_MIPS_GNU_REL16_S2 g2 0+0000014 R_MIPS_GNU_REL16_S2 g2 @@ -61,7 +61,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR \[\.foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL_HI16 g1 0+0000008 R_MIPS_GNU_REL_LO16 g1 0+000000c R_MIPS_GNU_REL_HI16 \.foo diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/tempic.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/tempic.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/tempic.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/tempic.d Fri Aug 10 14:08:01 2001 @@ -24,7 +24,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[\.text\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL16_S2 g1 0+000000c R_MIPS_GNU_REL16_S2 g2 0+0000014 R_MIPS_GNU_REL16_S2 g2 @@ -61,7 +61,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR \[\.foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000004 R_MIPS_GNU_REL_HI16 g1 0+0000008 R_MIPS_GNU_REL_LO16 g1 0+000000c R_MIPS_GNU_REL_HI16 \.foo diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/tmips16-e.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmips16-e.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/tmips16-e.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmips16-e.d Fri Aug 10 14:08:01 2001 @@ -20,7 +20,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_32 l1 0+0000004 R_MIPS_32 l1 0+0000008 R_MIPS_32 L1.1 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/tmipsel16-e.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmipsel16-e.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/tmipsel16-e.d Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/tmipsel16-e.d Fri Aug 10 14:08:01 2001 @@ -20,7 +20,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR \[foo\]: -OFFSET TYPE VALUE +OFFSET [ ]+ TYPE VALUE 0+0000000 R_MIPS_32 l1 0+0000004 R_MIPS_32 l1 0+0000008 R_MIPS_32 L1.1 diff -Nupr binutils-2.11.90.0.25/gas/testsuite/gas/mips/trunc.d binutils-2.11.90.0.27/gas/testsuite/gas/mips/trunc.d --- binutils-2.11.90.0.25/gas/testsuite/gas/mips/trunc.d Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/gas/testsuite/gas/mips/trunc.d Fri Aug 10 14:08:01 2001 @@ -7,23 +7,23 @@ .*: +file format .*mips.* Disassembly of section .text: -0+0000 <[^>]*> cfc1 a0,ra -0+0004 <[^>]*> cfc1 a0,ra +0+0000 <[^>]*> cfc1 a0,\$31 +0+0004 <[^>]*> cfc1 a0,\$31 0+0008 <[^>]*> nop 0+000c <[^>]*> ori at,a0,0x3 0+0010 <[^>]*> xori at,at,0x2 -0+0014 <[^>]*> ctc1 at,ra +0+0014 <[^>]*> ctc1 at,\$31 0+0018 <[^>]*> nop 0+001c <[^>]*> cvt.w.d \$f4,\$f6 -0+0020 <[^>]*> ctc1 a0,ra +0+0020 <[^>]*> ctc1 a0,\$31 0+0024 <[^>]*> nop -0+0028 <[^>]*> cfc1 a0,ra -0+002c <[^>]*> cfc1 a0,ra +0+0028 <[^>]*> cfc1 a0,\$31 +0+002c <[^>]*> cfc1 a0,\$31 0+0030 <[^>]*> nop 0+0034 <[^>]*> ori at,a0,0x3 0+0038 <[^>]*> xori at,at,0x2 -0+003c <[^>]*> ctc1 at,ra +0+003c <[^>]*> ctc1 at,\$31 0+0040 <[^>]*> nop 0+0044 <[^>]*> cvt.w.s \$f4,\$f6 -0+0048 <[^>]*> ctc1 a0,ra +0+0048 <[^>]*> ctc1 a0,\$31 0+004c <[^>]*> nop diff -Nupr binutils-2.11.90.0.25/gas/write.c binutils-2.11.90.0.27/gas/write.c --- binutils-2.11.90.0.25/gas/write.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gas/write.c Sat Aug 4 19:52:15 2001 @@ -1234,7 +1234,7 @@ write_contents (abfd, sec, xxx) (stdoutput, sec, buf, (file_ptr) offset, (bfd_size_type) n_per_buf * fill_size); if (x != true) - as_fatal (_("Cannot write to output file.")); + as_fatal (_("cannot write to output file")); offset += n_per_buf * fill_size; } } @@ -1483,14 +1483,14 @@ write_object_file () if (flag_always_generate_output) { if (n_warns || n_errs) - as_warn (_("%d error%s, %d warning%s, generating bad object file.\n"), + as_warn (_("%d error%s, %d warning%s, generating bad object file"), n_errs, n_errs == 1 ? "" : "s", n_warns, n_warns == 1 ? "" : "s"); } else { if (n_errs) - as_fatal (_("%d error%s, %d warning%s, no object file generated.\n"), + as_fatal (_("%d error%s, %d warning%s, no object file generated"), n_errs, n_errs == 1 ? "" : "s", n_warns, n_warns == 1 ? "" : "s"); } @@ -1950,7 +1950,7 @@ write_object_file () /* They only differ if `name' is a fb or dollar local label name. */ if (name2 != name && ! S_IS_DEFINED (symp)) - as_bad (_("local label %s is not defined"), name2); + as_bad (_("local label `%s' is not defined"), name2); } /* Do it again, because adjust_reloc_syms might introduce @@ -2013,7 +2013,7 @@ write_object_file () /* Make sure we really got a value for the symbol. */ if (! symbol_resolved_p (symp)) { - as_bad (_("can't resolve value for symbol \"%s\""), + as_bad (_("can't resolve value for symbol `%s'"), S_GET_NAME (symp)); symbol_mark_resolved (symp); } @@ -2440,7 +2440,7 @@ relax_segment (segment_frag_root, segmen cannot have fewer than 0 chars. That is, we can't .org backwards. */ as_bad_where (fragP->fr_file, fragP->fr_line, - _("attempt to .org backwards ignored")); + _("attempt to .org backwards")); /* We've issued an error message. Change the frag to avoid cascading errors. */ @@ -2649,7 +2649,7 @@ fixup_segment (fixP, this_segment_type) else bad_sub_reloc: as_bad_where (fixP->fx_file, fixP->fx_line, - _("Negative of non-absolute symbol %s"), + _("negative of non-absolute symbol `%s'"), S_GET_NAME (sub_symbolP)); } else if (S_GET_SEGMENT (sub_symbolP) == add_symbol_segment @@ -2663,7 +2663,7 @@ fixup_segment (fixP, this_segment_type) as the target of a call instruction. */ if (fixP->fx_tcbit) as_bad_where (fixP->fx_file, fixP->fx_line, - _("callj to difference of 2 symbols")); + _("callj to difference of two symbols")); #endif /* TC_I960 */ add_number += (S_GET_VALUE (add_symbolP) - S_GET_VALUE (sub_symbolP)); @@ -2743,7 +2743,7 @@ fixup_segment (fixP, this_segment_type) char buf[50]; sprint_value (buf, fragP->fr_address + where); as_bad_where (fixP->fx_file, fixP->fx_line, - _("Subtraction of two symbols in different sections \"%s\" {%s section} - \"%s\" {%s section} at file address %s."), + _("subtraction of two symbols in different sections `%s' {%s section} - `%s' {%s section} at file address %s"), S_GET_NAME (add_symbolP), segment_name (S_GET_SEGMENT (add_symbolP)), S_GET_NAME (sub_symbolP), @@ -2897,7 +2897,7 @@ fixup_segment (fixP, this_segment_type) else sprintf (buf2, "%ld", (long) add_number); as_bad_where (fixP->fx_file, fixP->fx_line, - _("Value of %s too large for field of %d bytes at %s"), + _("value of %s too large for field of %d bytes at %s"), buf2, size, buf); } /* Generic error checking. */ } @@ -2909,7 +2909,7 @@ fixup_segment (fixP, this_segment_type) && size == 2 && add_number > 0x7fff) as_bad_where (fixP->fx_file, fixP->fx_line, - _("Signed .word overflow; switch may be too large; %ld at 0x%lx"), + _("signed .word overflow; switch may be too large; %ld at 0x%lx"), (long) add_number, (unsigned long) (fragP->fr_address + where)); #endif diff -Nupr binutils-2.11.90.0.25/gprof/ChangeLog binutils-2.11.90.0.27/gprof/ChangeLog --- binutils-2.11.90.0.25/gprof/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/gprof/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,12 @@ +2001-08-09 Alan Modra + + * alpha.c: Add missing prototypes. + * sparc.c: Likewise. + * tahoe.c: Likewise. + * vax.c: Likewise. + * i386.c: Likewise. + (i386_iscall): Don't use DEFUN. + 2001-07-19 Nick Clifton * NOTES: Rename to README for consistency with other binutils. diff -Nupr binutils-2.11.90.0.25/gprof/alpha.c binutils-2.11.90.0.27/gprof/alpha.c --- binutils-2.11.90.0.25/gprof/alpha.c Fri Jul 9 08:21:26 1999 +++ binutils-2.11.90.0.27/gprof/alpha.c Fri Aug 10 14:08:01 2001 @@ -62,6 +62,7 @@ alpha_Instruction; static Sym indirect_child; +void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); /* * On the Alpha we can only detect PC relative calls, which are diff -Nupr binutils-2.11.90.0.25/gprof/i386.c binutils-2.11.90.0.27/gprof/i386.c --- binutils-2.11.90.0.25/gprof/i386.c Sat Mar 17 12:48:06 2001 +++ binutils-2.11.90.0.27/gprof/i386.c Fri Aug 10 14:08:01 2001 @@ -22,9 +22,12 @@ #include "hist.h" #include "symtab.h" +int i386_iscall PARAMS ((unsigned char *)); +void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); int -DEFUN (i386_iscall, (ip), unsigned char *ip) +i386_iscall (ip) + unsigned char *ip; { if (*ip == 0xe8) return 1; diff -Nupr binutils-2.11.90.0.25/gprof/sparc.c binutils-2.11.90.0.27/gprof/sparc.c --- binutils-2.11.90.0.25/gprof/sparc.c Fri Jul 9 08:21:27 1999 +++ binutils-2.11.90.0.27/gprof/sparc.c Fri Aug 10 14:08:01 2001 @@ -27,6 +27,8 @@ */ #define CALL (0xc0000000) +void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); + void sparc_find_call (parent, p_lowpc, p_highpc) Sym *parent; diff -Nupr binutils-2.11.90.0.25/gprof/tahoe.c binutils-2.11.90.0.27/gprof/tahoe.c --- binutils-2.11.90.0.25/gprof/tahoe.c Sat Mar 17 12:48:06 2001 +++ binutils-2.11.90.0.27/gprof/tahoe.c Fri Aug 10 14:08:01 2001 @@ -46,6 +46,11 @@ typedef enum tahoe_opermodes tahoe_opera */ Sym indirectchild; +tahoe_operandenum tahoe_operandmode PARAMS ((unsigned char *)); +char *tahoe_operandname PARAMS ((tahoe_operandenum)); +long tahoe_operandlength PARAMS ((unsigned char *)); +bfd_vma tahoe_reladdr PARAMS ((char *)); +void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); tahoe_operandenum tahoe_operandmode (modep) diff -Nupr binutils-2.11.90.0.25/gprof/vax.c binutils-2.11.90.0.27/gprof/vax.c --- binutils-2.11.90.0.25/gprof/vax.c Sat Mar 17 12:48:06 2001 +++ binutils-2.11.90.0.27/gprof/vax.c Fri Aug 10 14:08:01 2001 @@ -53,6 +53,12 @@ struct modebyte Sym indirectchild; +static operandenum vax_operandmode PARAMS ((struct modebyte *)); +static char *vax_operandname PARAMS ((operandenum)); +static long vax_operandlength PARAMS ((struct modebyte *)); +static bfd_vma vax_reladdr PARAMS ((struct modebyte *)); +void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); + static operandenum vax_operandmode (modep) struct modebyte *modep; diff -Nupr binutils-2.11.90.0.25/include/ChangeLog binutils-2.11.90.0.27/include/ChangeLog --- binutils-2.11.90.0.25/include/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/include/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,24 @@ +2001-08-10 Richard Sandiford + + * opcode/mips.h (INSN_GP32): Remove. + (OPCODE_IS_MEMBER): Remove gp32 parameter. + (M_MOVE): New macro identifier. + +2001-08-02 Mark Kettenis + + * xregex.h (_REGEX_RE_COMP): Define. + (re_comp): Define to xre_comp. + (re_exec): Define to xre_exec. + +2001-08-02 Charles Wilson + + * bfdlink.h (struct bfd_link_info): add new boolean + field pei386_auto_import. + +2001-08-01 Aldy Hernandez + + * opcode/mips.h (INSN_ISA_MASK): Nuke bits 12-15. + 2001-07-18 Andreas Jaeger * xregex2.h: Place under LGPL version 2.1. diff -Nupr binutils-2.11.90.0.25/include/bfdlink.h binutils-2.11.90.0.27/include/bfdlink.h --- binutils-2.11.90.0.25/include/bfdlink.h Tue Jun 19 11:57:58 2001 +++ binutils-2.11.90.0.27/include/bfdlink.h Sat Aug 4 19:52:15 2001 @@ -274,6 +274,10 @@ struct bfd_link_info /* May be used to set DT_FLAGS_1 for ELF. */ bfd_vma flags_1; + + /* true if auto-import thunks for DATA items in pei386 DLLs + should be generated/linked against. */ + boolean pei386_auto_import; }; /* This structures holds a set of callback functions. These are diff -Nupr binutils-2.11.90.0.25/include/opcode/ChangeLog binutils-2.11.90.0.27/include/opcode/ChangeLog --- binutils-2.11.90.0.25/include/opcode/ChangeLog Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/include/opcode/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,12 @@ +2001-08-10 Alan Modra + + * ppc.h: Revert 2001-08-08. + +2001-08-08 Alan Modra + + 1999-10-25 Torbjorn Granlund + * ppc.h (struct powerpc_operand): New field `reloc'. + 2001-07-11 Frank Ch. Eigler * cgen.h (CGEN_MACH): Add insn_chunk_bitsize field. diff -Nupr binutils-2.11.90.0.25/include/opcode/mips.h binutils-2.11.90.0.27/include/opcode/mips.h --- binutils-2.11.90.0.25/include/opcode/mips.h Wed May 23 10:54:48 2001 +++ binutils-2.11.90.0.27/include/opcode/mips.h Fri Aug 10 14:08:01 2001 @@ -307,7 +307,7 @@ struct mips_opcode ORs of these bits, indicatingthat they support the instructions defined at the given level. */ -#define INSN_ISA_MASK 0x0000ffff +#define INSN_ISA_MASK 0x00000fff #define INSN_ISA1 0x00000010 #define INSN_ISA2 0x00000020 #define INSN_ISA3 0x00000040 @@ -326,8 +326,6 @@ struct mips_opcode #define INSN_4100 0x00040000 /* Toshiba R3900 instruction. */ #define INSN_3900 0x00080000 -/* 32-bit code running on a ISA3+ CPU. */ -#define INSN_GP32 0x00100000 /* MIPS ISA defines, use instead of hardcoding ISA level. */ @@ -369,15 +367,10 @@ struct mips_opcode /* Test for membership in an ISA including chip specific ISAs. INSN is pointer to an element of the opcode table; ISA is the specified ISA to test against; and CPU is the CPU specific ISA - to test, or zero if no CPU specific ISA test is desired. - The gp32 arg is set when you need to force 32-bit register usage on - a machine with 64-bit registers; see the documentation under -mgp32 - in the MIPS gas docs. */ - -#define OPCODE_IS_MEMBER(insn, isa, cpu, gp32) \ - ((((insn)->membership & isa) != 0 \ - && ((insn)->membership & INSN_GP32 ? gp32 : 1) \ - ) \ + to test, or zero if no CPU specific ISA test is desired. */ + +#define OPCODE_IS_MEMBER(insn, isa, cpu) \ + (((insn)->membership & isa) != 0 \ || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0) \ || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0) \ || ((cpu == CPU_VR4100 || cpu == CPU_R4111) \ @@ -508,6 +501,7 @@ enum M_LWR_A, M_LWR_AB, M_LWU_AB, + M_MOVE, M_MUL, M_MUL_I, M_MULO, diff -Nupr binutils-2.11.90.0.25/include/xregex.h binutils-2.11.90.0.27/include/xregex.h --- binutils-2.11.90.0.25/include/xregex.h Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/include/xregex.h Sat Aug 4 19:52:15 2001 @@ -19,6 +19,10 @@ # define re_syntax_options xre_syntax_options # define re_max_failures xre_max_failures +# define _REGEX_RE_COMP +# define re_comp xre_comp +# define re_exec xre_exec + #include "xregex2.h" #endif /* xregex.h */ diff -Nupr binutils-2.11.90.0.25/ld/ChangeLog binutils-2.11.90.0.27/ld/ChangeLog --- binutils-2.11.90.0.25/ld/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/ld/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,149 @@ +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-09 Alan Modra + + * emultempl/elf32.em (output_prev_sec_find): Add missing prototype. + + * scripttempl/elf.sc: Move non-text .dynamic section before + .plt/.got/.sdata* group. + (OTHER_GOT_SECTIONS): Move to immediately after .got. + (OTHER_SDATA_SECTIONS): Add. + * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than + OTHER_GOT_SECTIONS. + * emulparams/crislinux.sh: Likewise. + * emulparams/elf32b4300.sh: Likewise. + * emulparams/elf32bmip.sh: Likewise. + * emulparams/elf32bmipn32.sh: Likewise. + * emulparams/elf32bsmip.sh: Likewise. + * emulparams/elf32btsmip.sh: Likewise. + * emulparams/elf32ebmip.sh: Likewise. + * emulparams/elf32elmip.sh: Likewise. + * emulparams/elf32l4300.sh: Likewise. + * emulparams/elf32lmip.sh: Likewise. + * emulparams/elf32lsmip.sh: Likewise. + * emulparams/elf32ltsmip.sh: Likewise. + * emulparams/elf64bmip.sh: Likewise. + * emulparams/elf64btsmip.sh: Likewise. + * emulparams/elf64ltsmip.sh: Likewise. + +2001-08-08 Alan Modra + + * genscripts.sh: Source the emulparams script before each output + script is generated so that variables like `RELOCATING' may affect + variables defined in the emulparams script. + +2001-08-04 Alan Modra + + * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this + order. + + * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change, + ie. iterate over wild_statement.section_list. + (gld${EMULATION_NAME}_place_orphan): Likewise. + +2001-08-03 Stephane Carrez + + * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle + .fini[0-4] sections used by _exit + (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM. + (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*. + * scripttempl/elfm68hc11.sc: Likewise. + +2001-08-03 H.J. Lu + + * emultempl/beos.em (init): Add the missing initialization. + +2001-08-03 Alan Modra + + * ld.texinfo (Input Section Basics): Clarify ordering of output + sections. + * ldlang.c (callback_t): Add wildcard_list param. + (walk_wild_section): Remove "section" param. Rewrite for + lang_wild_statement_type change. Remove unique_section_p test. + (walk_wild_file): Remove "section" param. + (walk_wild): Remove "section" and "file" params. + (lang_gc_wild): Likewise. + (wild): Likewise. Modify for lang_wild_statement_type change. + (wild_sort): Likewise. Add "sec" param. + (gc_section_callback): Likewise. + (output_section_callback): Likewise. Do unique_section_p test. + (map_input_to_output_sections): Modify call to wild. + (lang_gc_sections_1): Likewise. + (print_wild_statement): Modify for lang_wild_statement_type + change. + (lang_add_wild): Replace filename, filenames_sorted param with + filespec. Replace section_name, sections_sorted, + exclude_filename_list with section_list. + * ldlang.h (lang_add_wild): Here too. + (lang_wild_statement_type): Replace section_name, sections_sorted, + and exclude_filename_list with section_list. + * ldgram.y (current_file): Delete. + (%union): Add wildcard_list. + (file_NAME_list): Set type to wildcard_list. Build a linked list + rather than calling lang_add_wild for each entry. + (input_section_spec_no_keep): Call lang_add_wild here instead. + * ld.h (struct wildcard_list): Declare. + * mri.c (mri_draw_tree): Modify to suit new lang_add_wild. + +2001-08-02 Charles Wilson + + * ldmain.c (main): initialize link_info.pei386_auto_import + * pe-dll.c: new tables for auto-export filtering + (auto_export): change API, pass abfd for contextual filtering. + Loop thru tables of excluded symbols instead of comparing + "by hand". + +2001-08-02 Paul Sokolovsky + + * pe-dll.c: new variable pe_dll_enable_extra_debug. New + static variable current_sec (static struct sec *). Add + forward declaration for add_bfd_to_link. + (process_def_file): Don't export undefined symbols. Do not + export symbols starting with "_imp__". Call auto_export() + with new API. + (pe_walk_relocs_of_symbol): New function. + (generate_reloc): add optional extra debugging + (pe_dll_generate_def_file): eliminate extraneous initial blank + line in output + (make_one): enlarge symtab to make room for __nm__ symbols + (DATA auto-import support). + (make_singleton_name_thunk): New function. + (make_import_fixup_mark): New function. + (make_import_fixup_entry): New function. + (pe_create_import_fixup): New function. + (add_bfd_to_link): Specify that 'name' argument is a CONST + char *. + * pe-dll.h: declare new variable pe_dll_extra_pe_debug; + declare new functions pe_walk_relocs_of_symbol and + pe_create_import_fixup. + * emultempl/pe.em: add new options --enable-auto-import, + --disable-auto-import, and --enable-extra-pe-debug. + (make_import_fixup): New function. + (pe_find_data_imports): New function. + (pr_sym): New function. + (gld_${EMULATION_NAME}_after_open): Add optional extra pe + debugging. Call pe_find_data_imports. Mark .idata as DATA, not + CODE. + +2001-08-02 Charles Wilson + + * ld.texinfo: add additional documentation for + --export-all-symbols. Document --out-implib, + --enable-auto-image-base, --disable-auto-image-base, + --dll-search-prefix, --enable-auto-import, and + --disable-auto-import. + * ldint.texinfo: Add detailed documentation on auto-import + implementation. + +2001-07-30 Nick Clifton + + * ld.texinfo (Simple Assignments): Fix computation in SECTIONS + example. + 2001-07-24 Alan Modra * Makefile.am: Update dependencies with "make dep-am". @@ -111,11 +257,11 @@ 2001-06-18 H.J. Lu - * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'. - (diststuff): Add $(MANS). - * Makefile.in: Regenerated. + * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'. + (diststuff): Add $(MANS). + * Makefile.in: Regenerated. - * ld.1: Removed. + * ld.1: Removed. 2001-06-18 Hans-Peter Nilsson @@ -153,9 +299,9 @@ * ldlang.c (walk_wild): Only call walk_wild_file if lookup_name returns something. - (lookup_name): If load_symbols fails, return NULL. - (load_symbols): Chnage to a boolean function. - (open_input_bfds): If load_symbols fails then do not make the + (lookup_name): If load_symbols fails, return NULL. + (load_symbols): Chnage to a boolean function. + (open_input_bfds): If load_symbols fails then do not make the executable. 2001-06-08 Alan Modra @@ -333,12 +479,12 @@ 2001-05-02 Johan Rydberg - * emulparams/elf32openrisc.sh: New file. + * emulparams/elf32openrisc.sh: New file. - * Makefile.am: Add OpenRISC target. - * Makefile.in: Regenerated. + * Makefile.am: Add OpenRISC target. + * Makefile.in: Regenerated. - * configure.tgt: Add openrisc-*-* mapping. + * configure.tgt: Add openrisc-*-* mapping. 2001-05-02 Nick Clifton @@ -367,9 +513,9 @@ 2001-04-28 Paul Sokolovsky - * ldlang.c (load_symbols): Give emulation a chance - to process unrecognized file before fatal error is - reported, not after. + * ldlang.c (load_symbols): Give emulation a chance + to process unrecognized file before fatal error is + reported, not after. 2001-04-27 Sean McNeil @@ -503,9 +649,9 @@ 2001-02-26 H.J. Lu * ldlang.c (open_input_bfds): Set the bfd error handler so - that problems can be caught whilst loading symbols. - (record_bfd_errors): New function: Report BFD errors and mark - the executable output as being invalid. + that problems can be caught whilst loading symbols. + (record_bfd_errors): New function: Report BFD errors and mark + the executable output as being invalid. 2001-02-22 Timothy Wall diff -Nupr binutils-2.11.90.0.25/ld/ChangeLog.linux binutils-2.11.90.0.27/ld/ChangeLog.linux --- binutils-2.11.90.0.25/ld/ChangeLog.linux Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/ld/ChangeLog.linux Fri Aug 10 14:08:01 2001 @@ -1,3 +1,7 @@ +2001-08-10 H.J. Lu + + * ldmain.c (main): Fix a typo in comments. + 2001-06-29 H.J. Lu * ldfile.c (ldfile_open_file_search): Don't try diff -Nupr binutils-2.11.90.0.25/ld/configure binutils-2.11.90.0.27/ld/configure --- binutils-2.11.90.0.25/ld/configure Mon May 21 11:39:54 2001 +++ binutils-2.11.90.0.27/ld/configure Fri Aug 10 14:08:01 2001 @@ -2167,7 +2167,7 @@ else want64=false fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" diff -Nupr binutils-2.11.90.0.25/ld/configure.in binutils-2.11.90.0.27/ld/configure.in --- binutils-2.11.90.0.25/ld/configure.in Tue Feb 27 10:48:49 2001 +++ binutils-2.11.90.0.27/ld/configure.in Fri Aug 10 14:08:01 2001 @@ -29,7 +29,7 @@ AC_ARG_ENABLE(64-bit-bfd, *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; esac],[want64=false])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff -Nupr binutils-2.11.90.0.25/ld/emulparams/criself.sh binutils-2.11.90.0.27/ld/emulparams/criself.sh --- binutils-2.11.90.0.25/ld/emulparams/criself.sh Fri Apr 6 15:34:25 2001 +++ binutils-2.11.90.0.27/ld/emulparams/criself.sh Fri Aug 10 14:08:01 2001 @@ -36,7 +36,7 @@ OTHER_READONLY_SECTIONS='PROVIDE (__Etex DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' # Smuggle an "OTHER_DATA_END_SYMBOLS" here. -OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);' +OTHER_SDATA_SECTIONS='PROVIDE (__Edata = .);' # If .bss does not immediately follow .data but has its own start # address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we diff -Nupr binutils-2.11.90.0.25/ld/emulparams/crislinux.sh binutils-2.11.90.0.27/ld/emulparams/crislinux.sh --- binutils-2.11.90.0.25/ld/emulparams/crislinux.sh Fri Apr 6 15:34:25 2001 +++ binutils-2.11.90.0.27/ld/emulparams/crislinux.sh Fri Aug 10 14:08:01 2001 @@ -26,7 +26,7 @@ OTHER_READONLY_SECTIONS='PROVIDE (__Etex DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' # Smuggle an "OTHER_DATA_END_SYMBOLS" here. -OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);' +OTHER_SDATA_SECTIONS='PROVIDE (__Edata = .);' OTHER_BSS_SYMBOLS='PROVIDE (__Sbss = .);' OTHER_BSS_END_SYMBOLS='PROVIDE (__Ebss = .);' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32b4300.sh binutils-2.11.90.0.27/ld/emulparams/elf32b4300.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32b4300.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32b4300.sh Fri Aug 10 14:08:01 2001 @@ -9,7 +9,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32bmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32bmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32bmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32bmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32bmipn32.sh binutils-2.11.90.0.27/ld/emulparams/elf32bmipn32.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32bmipn32.sh Wed Jul 28 11:19:39 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32bmipn32.sh Fri Aug 10 14:08:01 2001 @@ -17,7 +17,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } .srdata : { *(.srdata) } diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32bsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32bsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32bsmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32bsmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32btsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32btsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32btsmip.sh Sun Jul 9 16:38:50 2000 +++ binutils-2.11.90.0.27/ld/emulparams/elf32btsmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32ebmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32ebmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32ebmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32ebmip.sh Fri Aug 10 14:08:01 2001 @@ -10,7 +10,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32elmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32elmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32elmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32elmip.sh Fri Aug 10 14:08:01 2001 @@ -10,7 +10,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32l4300.sh binutils-2.11.90.0.27/ld/emulparams/elf32l4300.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32l4300.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32l4300.sh Fri Aug 10 14:08:01 2001 @@ -9,7 +9,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32lmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32lmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32lmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32lmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32lsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32lsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32lsmip.sh Thu Jun 3 11:02:10 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf32lsmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf32ltsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf32ltsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf32ltsmip.sh Sat Apr 7 22:49:40 2001 +++ binutils-2.11.90.0.27/ld/emulparams/elf32ltsmip.sh Fri Aug 10 14:08:01 2001 @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(. OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf64bmip.sh binutils-2.11.90.0.27/ld/emulparams/elf64bmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf64bmip.sh Wed Jul 28 11:19:39 1999 +++ binutils-2.11.90.0.27/ld/emulparams/elf64bmip.sh Fri Aug 10 14:08:01 2001 @@ -20,7 +20,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } .srdata : { *(.srdata) } diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf64btsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf64btsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf64btsmip.sh Sat Apr 7 22:49:40 2001 +++ binutils-2.11.90.0.27/ld/emulparams/elf64btsmip.sh Fri Aug 10 14:08:01 2001 @@ -25,7 +25,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emulparams/elf64ltsmip.sh binutils-2.11.90.0.27/ld/emulparams/elf64ltsmip.sh --- binutils-2.11.90.0.25/ld/emulparams/elf64ltsmip.sh Sat Apr 7 22:49:40 2001 +++ binutils-2.11.90.0.27/ld/emulparams/elf64ltsmip.sh Fri Aug 10 14:08:01 2001 @@ -25,7 +25,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff -Nupr binutils-2.11.90.0.25/ld/emultempl/aix.em binutils-2.11.90.0.27/ld/emultempl/aix.em --- binutils-2.11.90.0.25/ld/emultempl/aix.em Sat Jun 9 00:13:01 2001 +++ binutils-2.11.90.0.27/ld/emultempl/aix.em Sat Aug 4 19:52:15 2001 @@ -44,11 +44,11 @@ Foundation, Inc., 59 Temple Place - Suit #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" #include "ldctor.h" #include "ldgram.h" diff -Nupr binutils-2.11.90.0.25/ld/emultempl/beos.em binutils-2.11.90.0.27/ld/emultempl/beos.em --- binutils-2.11.90.0.25/ld/emultempl/beos.em Fri May 25 15:57:58 2001 +++ binutils-2.11.90.0.27/ld/emultempl/beos.em Sat Aug 4 19:52:15 2001 @@ -145,7 +145,7 @@ static definfo init[] = #define IMAGEBASEOFF 0 D(ImageBase,"__image_base__", BEOS_EXE_IMAGE_BASE), #define DLLOFF 1 - {&dll, sizeof(dll), 0, "__dll__"}, + {&dll, sizeof(dll), 0, "__dll__", 0}, D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT), D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT), D(MajorOperatingSystemVersion,"__major_os_version__", 4), @@ -595,66 +595,73 @@ sort_sections (s) case lang_wild_statement_enum: { lang_statement_union_type **p = &s->wild_statement.children.head; + struct wildcard_list *sec; - /* Is this the .idata section? */ - if (s->wild_statement.section_name != NULL - && strncmp (s->wild_statement.section_name, ".idata", 6) == 0) + for (sec = s->wild_statement.section_list; sec; sec = sec->next) { - /* Sort the children. We want to sort any objects in - the same archive. In order to handle the case of - including a single archive multiple times, we sort - all the children by archive name and then by object - name. After sorting them, we re-thread the pointer - chain. */ - - while (*p) + /* Is this the .idata section? */ + if (sec->spec.name != NULL + && strncmp (sec->spec.name, ".idata", 6) == 0) { - lang_statement_union_type *start = *p; - if (start->header.type != lang_input_section_enum - || !start->input_section.ifile->the_bfd->my_archive) - p = &(start->header.next); - else - { - lang_statement_union_type *end; - int count; - - for (end = start, count = 0; - end && end->header.type == lang_input_section_enum; - end = end->next) - count++; + /* Sort the children. We want to sort any objects in + the same archive. In order to handle the case of + including a single archive multiple times, we sort + all the children by archive name and then by object + name. After sorting them, we re-thread the pointer + chain. */ - p = sort_sections_1 (p, end, count, sort_by_file_name); + while (*p) + { + lang_statement_union_type *start = *p; + if (start->header.type != lang_input_section_enum + || !start->input_section.ifile->the_bfd->my_archive) + p = &(start->header.next); + else + { + lang_statement_union_type *end; + int count; + + for (end = start, count = 0; + end && (end->header.type + == lang_input_section_enum); + end = end->next) + count++; + + p = sort_sections_1 (p, end, count, + sort_by_file_name); + } } + break; } - break; - } - /* If this is a collection of grouped sections, sort them. - The linker script must explicitly mention "*(.foo\$)" or - "*(.foo\$*)". Don't sort them if \$ is not the last - character (not sure if this is really useful, but it - allows explicitly mentioning some \$ sections and letting - the linker handle the rest). */ - if (s->wild_statement.section_name != NULL) - { - char *q = strchr (s->wild_statement.section_name, '\$'); - - if (q != NULL - && (q[1] == '\0' - || (q[1] == '*' && q[2] == '\0'))) + /* If this is a collection of grouped sections, sort them. + The linker script must explicitly mention "*(.foo\$)" or + "*(.foo\$*)". Don't sort them if \$ is not the last + character (not sure if this is really useful, but it + allows explicitly mentioning some \$ sections and letting + the linker handle the rest). */ + if (sec->spec.name != NULL) { - lang_statement_union_type *end; - int count; + char *q = strchr (sec->spec.name, '\$'); - for (end = *p, count = 0; end; end = end->next) + if (q != NULL + && (q[1] == '\0' + || (q[1] == '*' && q[2] == '\0'))) { - if (end->header.type != lang_input_section_enum) - abort (); - count++; + lang_statement_union_type *end; + int count; + + for (end = *p, count = 0; end; end = end->next) + { + if (end->header.type != lang_input_section_enum) + abort (); + count++; + } + (void) sort_sections_1 (p, end, count, + sort_by_section_name); } - (void) sort_sections_1 (p, end, count, sort_by_section_name); + break; } - break; } } break; @@ -765,11 +772,16 @@ gld${EMULATION_NAME}_place_orphan (file, ps[0] = '\$'; ps[1] = 0; for (l = os->children.head; l; l = l->next) - { - if (l->header.type == lang_wild_statement_enum - && strcmp (l->wild_statement.section_name, output_secname) == 0) - break; - } + if (l->header.type == lang_wild_statement_enum) + { + struct wildcard_list *sec; + + for (sec = l->wild_statement.section_list; sec; sec = sec->next) + if (sec->spec.name && strcmp (sec->spec.name, output_secname) == 0) + break; + if (sec) + break; + } ps[0] = 0; if (l == NULL) #if 1 @@ -778,11 +790,20 @@ gld${EMULATION_NAME}_place_orphan (file, should one decide to not require *(.foo\$) to appear in the linker script. */ { - lang_wild_statement_type *new = new_stat (lang_wild_statement, - &os->children); - new->section_name = xmalloc (strlen (output_secname) + 2); - sprintf (new->section_name, "%s\$", output_secname); + lang_wild_statement_type *new; + struct wildcard_list *tmp; + + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec.name = xmalloc (strlen (output_secname) + 2); + sprintf (tmp->spec.name, "%s\$", output_secname); + tmp->spec.exclude_name_list = NULL; + tmp->sorted = false; + new = new_stat (lang_wild_statement, &os->children); new->filename = NULL; + new->filenames_sorted = false; + new->section_list = tmp; + new->keep_sections = false; lang_list_init (&new->children); l = new; } diff -Nupr binutils-2.11.90.0.25/ld/emultempl/elf32.em binutils-2.11.90.0.27/ld/emultempl/elf32.em --- binutils-2.11.90.0.25/ld/emultempl/elf32.em Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/ld/emultempl/elf32.em Fri Aug 10 14:08:01 2001 @@ -71,6 +71,8 @@ static void gld${EMULATION_NAME}_before_ static boolean gld${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); static lang_output_section_statement_type *output_rel_find PARAMS ((void)); +static asection *output_prev_sec_find + PARAMS ((lang_output_section_statement_type *)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); diff -Nupr binutils-2.11.90.0.25/ld/emultempl/pe.em binutils-2.11.90.0.27/ld/emultempl/pe.em --- binutils-2.11.90.0.25/ld/emultempl/pe.em Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/ld/emultempl/pe.em Sat Aug 4 19:52:15 2001 @@ -146,7 +146,9 @@ gld_${EMULATION_NAME}_before_parse() ldfile_output_architecture = bfd_arch_${ARCH}; output_filename = "${EXECUTABLE_NAME:-a.exe}"; #ifdef DLL_SUPPORT + config.dynamic_link = true; config.has_shared = 1; +/* link_info.pei386_auto_import = true; */ #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2) #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe @@ -191,6 +193,9 @@ gld_${EMULATION_NAME}_before_parse() #define OPTION_DISABLE_AUTO_IMAGE_BASE (OPTION_ENABLE_AUTO_IMAGE_BASE + 1) #define OPTION_DLL_SEARCH_PREFIX (OPTION_DISABLE_AUTO_IMAGE_BASE + 1) #define OPTION_NO_DEFAULT_EXCLUDES (OPTION_DLL_SEARCH_PREFIX + 1) +#define OPTION_DLL_ENABLE_AUTO_IMPORT (OPTION_NO_DEFAULT_EXCLUDES + 1) +#define OPTION_DLL_DISABLE_AUTO_IMPORT (OPTION_DLL_ENABLE_AUTO_IMPORT + 1) +#define OPTION_ENABLE_EXTRA_PE_DEBUG (OPTION_DLL_DISABLE_AUTO_IMPORT + 1) static struct option longopts[] = { /* PE options */ @@ -228,6 +233,9 @@ static struct option longopts[] = { {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE}, {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX}, {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES}, + {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT}, + {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT}, + {"enable-extra-pe-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG}, #endif {NULL, no_argument, NULL, 0} }; @@ -313,6 +321,11 @@ gld_${EMULATION_NAME}_list_options (file fprintf (file, _(" --dll-search-prefix= When linking dynamically to a dll witout an\n")); fprintf (file, _(" importlib, use .dll \n")); fprintf (file, _(" in preference to lib.dll \n")); + fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to \n")); + fprintf (file, _(" __imp_sym for DATA references\n")); + fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); + fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n")); + fprintf (file, _(" or linking to DLLs (esp. auto-import)\n")); #endif } @@ -583,6 +596,15 @@ gld_${EMULATION_NAME}_parse_args(argc, a case OPTION_NO_DEFAULT_EXCLUDES: pe_dll_do_default_excludes = 0; break; + case OPTION_DLL_ENABLE_AUTO_IMPORT: + link_info.pei386_auto_import = true; + break; + case OPTION_DLL_DISABLE_AUTO_IMPORT: + link_info.pei386_auto_import = false; + break; + case OPTION_ENABLE_EXTRA_PE_DEBUG: + pe_dll_extra_pe_debug = 1; + break; #endif } return 1; @@ -716,14 +738,15 @@ pe_undef_cdecl_match (h, string) struct bfd_link_hash_entry *h; PTR string; { - int sl = strlen (string); + int sl; + sl = strlen (string); /* silence compiler warning */ if (h->type == bfd_link_hash_defined && strncmp (h->root.string, string, sl) == 0 && h->root.string[sl] == '@') - { - pe_undef_found_sym = h; - return false; - } + { + pe_undef_found_sym = h; + return false; + } return true; } @@ -733,6 +756,11 @@ pe_fixup_stdcalls () static int gave_warning_message = 0; struct bfd_link_hash_entry *undef, *sym; char *at; + if (pe_dll_extra_pe_debug) + { + printf ("%s\n", __FUNCTION__); + } + for (undef = link_info.hash->undefs; undef; undef=undef->next) if (undef->type == bfd_link_hash_undefined) { @@ -791,11 +819,122 @@ pe_fixup_stdcalls () } } } + +static int +make_import_fixup (rel) + arelent *rel; +{ + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; +/* + bfd *b; +*/ + + if (pe_dll_extra_pe_debug) + { + printf ("arelent: %s@%#x: add=%li\n", sym->name, + (int) rel->address, rel->addend); + } + pe_create_import_fixup (rel); + return 1; +} + +char *pe_data_import_dll; + +static void +pe_find_data_imports () +{ + struct bfd_link_hash_entry *undef, *sym; + for (undef = link_info.hash->undefs; undef; undef=undef->next) + { + if (undef->type == bfd_link_hash_undefined) + { + /* C++ symbols are *long* */ + char buf[4096]; + if (pe_dll_extra_pe_debug) + { + printf ("%s:%s\n", __FUNCTION__, undef->root.string); + } + sprintf (buf, "__imp_%s", undef->root.string); + + sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1); + if (sym && sym->type == bfd_link_hash_defined) + { + einfo (_("Warning: resolving %s by linking to %s (auto-import)\n"), + undef->root.string, buf); + { + bfd *b = sym->u.def.section->owner; + asymbol **symbols; + int nsyms, symsize, i; + + symsize = bfd_get_symtab_upper_bound (b); + symbols = (asymbol **) xmalloc (symsize); + nsyms = bfd_canonicalize_symtab (b, symbols); + + for (i = 0; i < nsyms; i++) + { + if (memcmp(symbols[i]->name, "__head_", + sizeof ("__head_") - 1)) + continue; + if (pe_dll_extra_pe_debug) + { + printf ("->%s\n", symbols[i]->name); + } + pe_data_import_dll = (char*) (symbols[i]->name + + sizeof ("__head_") - 1); + break; + } + } + + pe_walk_relocs_of_symbol (&link_info, undef->root.string, + make_import_fixup); + + /* let's differentiate it somehow from defined */ + undef->type = bfd_link_hash_defweak; + /* we replace original name with __imp_ prefixed, this + 1) may trash memory 2) leads to duplicate symbol generation. + Still, IMHO it's better than having name poluted. */ + undef->root.string = sym->root.string; + undef->u.def.value = sym->u.def.value; + undef->u.def.section = sym->u.def.section; + } + } + } +} #endif /* DLL_SUPPORT */ +static boolean +pr_sym (h, string) + struct bfd_hash_entry *h; + PTR string; +{ + if (pe_dll_extra_pe_debug) + { + printf("+%s\n",h->string); + } + return true; +} + + static void gld_${EMULATION_NAME}_after_open () { + + if (pe_dll_extra_pe_debug) + { + bfd *a; + struct bfd_link_hash_entry *sym; + printf ("%s()\n", __FUNCTION__); + + for (sym = link_info.hash->undefs; sym; sym=sym->next) + printf ("-%s\n", sym->root.string); + bfd_hash_traverse (&link_info.hash->table, pr_sym,NULL); + + for (a = link_info.input_bfds; a; a = a->link_next) + { + printf("*%s\n",a->filename); + } + } + /* Pass the wacky PE command line options into the output bfd. FIXME: This should be done via a function, rather than by including an internal BFD header. */ @@ -810,6 +949,8 @@ gld_${EMULATION_NAME}_after_open () if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */ pe_fixup_stdcalls (); + pe_find_data_imports (output_bfd, &link_info); + pe_process_import_defs(output_bfd, &link_info); if (link_info.shared) pe_dll_build_sections (output_bfd, &link_info); @@ -1251,6 +1392,16 @@ gld_${EMULATION_NAME}_finish () if (pe_out_def_filename) pe_dll_generate_def_file (pe_out_def_filename); #endif /* DLL_SUPPORT */ + + /* I don't know where .idata gets set as code, but it shouldn't be */ + { + asection *asec = bfd_get_section_by_name (output_bfd, ".idata"); + if (asec) + { + asec->flags &= ~SEC_CODE; + asec->flags |= SEC_DATA; + } + } } diff -Nupr binutils-2.11.90.0.25/ld/genscripts.sh binutils-2.11.90.0.27/ld/genscripts.sh --- binutils-2.11.90.0.25/ld/genscripts.sh Tue Jan 23 11:00:35 2001 +++ binutils-2.11.90.0.27/ld/genscripts.sh Fri Aug 10 14:08:01 2001 @@ -99,39 +99,45 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${D LD_FLAG=r DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xr +( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xr LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xu +( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xu LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.x +( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.x LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} TEXT_START_ADDR=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}} -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xn +( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xbn +( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xbn if test -n "$GENERATE_SHLIB_SCRIPT"; then LD_FLAG=shared DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}} CREATE_SHLIB=" " # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR. - (. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xs + ( . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d' > ldscripts/${EMULATION_NAME}.xs fi for i in $EMULATION_LIBPATH ; do diff -Nupr binutils-2.11.90.0.25/ld/ld.h binutils-2.11.90.0.27/ld/ld.h --- binutils-2.11.90.0.25/ld/ld.h Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.27/ld/ld.h Sat Aug 4 19:52:15 2001 @@ -73,6 +73,11 @@ struct wildcard_spec { boolean sorted; }; +struct wildcard_list { + struct wildcard_list *next; + struct wildcard_spec spec; +}; + /* Extra information we hold on sections */ typedef struct user_section_struct { /* Pointer to the section where this data will go */ diff -Nupr binutils-2.11.90.0.25/ld/ld.texinfo binutils-2.11.90.0.27/ld/ld.texinfo --- binutils-2.11.90.0.25/ld/ld.texinfo Sat Jun 23 00:05:22 2001 +++ binutils-2.11.90.0.27/ld/ld.texinfo Sat Aug 4 19:52:15 2001 @@ -1601,8 +1601,22 @@ otherwise wouldn't be any exported symbo explicitly exported via DEF files or implicitly exported via function attributes, the default is to not export anything else unless this option is given. Note that the symbols @code{DllMain@@12}, -@code{DllEntryPoint@@0}, and @code{impure_ptr} will not be automatically -exported. +@code{DllEntryPoint@@0}, @code{DllMainCRTStartup@@12}, and +@code{impure_ptr} will not be automatically +exported. Also, symbols imported from other DLLs will not be +re-exported, nor will symbols specifying the DLL's internal layout +such as those beginning with @code{_head_} or ending with +@code{_iname}. In addition, no symbols from @code{libgcc}, +@code{libstd++}, @code{libmingw32}, or @code{crtX.o} will be exported. +Symbols whose names begin with @code{__rtti_} or @code{__builtin_} will +not be exported, to help with C++ DLLs. Finally, there is an +extensive list of cygwin-private symbols that are not exported +(obviously, this applies on when building DLLs for cygwin targets). +These cygwin-excludes are: @code{_cygwin_dll_entry@@12}, +@code{_cygwin_crt0_common@@8}, @code{_cygwin_noncygwin_dll_entry@@12}, +@code{_fmode}, @code{_impure_ptr}, @code{cygwin_attach_dll}, +@code{cygwin_premain0}, @code{cygwin_premain1}, @code{cygwin_premain2}, +@code{cygwin_premain3}, and @code{environ}. @kindex --exclude-symbols @item --exclude-symbols @var{symbol},@var{symbol},... @@ -1672,6 +1686,55 @@ file corresponding to the DLL the linker library with @code{dlltool} or may be used as a reference to automatically or implicitly exported symbols. +@cindex DLLs, creating +@kindex --out-implib +@item --out-implib @var{file} +The linker will create the file @var{file} which will contain an +import lib corresponding to the DLL the linker is generating. This +import lib (which should be called @code{*.dll.a} or @code{*.a} +may be used to link clients against the generated DLL; this behavior +makes it possible to skip a separate @code{dlltool} import library +creation step. + +@kindex --enable-auto-image-base +@item --enable-auto-image-base +Automatically choose the image base for DLLs, unless one is specified +using the @code{--image-base} argument. By using a hash generated +from the dllname to create unique image bases for each DLL, in-memory +collisions and relocations which can delay program execution are +avoided. + +@kindex --disable-auto-image-base +@item --disable-auto-image-base +Do not automatically generate a unique image base. If there is no +user-specified image base (@code{--image-base}) then use the platform +default. + +@cindex DLLs, linking to +@kindex --dll-search-prefix +@item --dll-search-prefix @var{string} +When linking dynamically to a dll without an import library, i +search for @code{.dll} in preference to +@code{lib.dll}. This behavior allows easy distinction +between DLLs built for the various "subplatforms": native, cygwin, +uwin, pw, etc. For instance, cygwin DLLs typically use +@code{--dll-search-prefix=cyg}. + +@kindex --enable-auto-import +@item --enable-auto-import +Do sophisticalted linking of @code{_symbol} to @code{__imp__symbol} for +DATA imports from DLLs, and create the necessary thunking symbols when +building the DLLs with those DATA exports. + +@kindex --disable-auto-import +@item --disable-auto-import +Do not attempt to do sophisticalted linking of @code{_symbol} to +@code{__imp__symbol} for DATA imports from DLLs. + +@kindex --enable-extra-pe-debug +@item --enable-extra-pe-debug +Show additional debug info related to auto-import symbol thunking. + @kindex --section-alignment @item --section-alignment Sets the section alignment. Sections in memory will always begin at @@ -2225,7 +2288,7 @@ SECTIONS *(.text) _etext = .; @} - _bdata = (. + 3) & ~ 4; + _bdata = (. + 3) & ~ 3; .data : @{ *(.data) @} @} @end smallexample @@ -2476,7 +2539,8 @@ There are two ways to include more than @noindent The difference between these is the order in which the @samp{.text} and @samp{.rdata} input sections will appear in the output section. In the -first example, they will be intermingled. In the second example, all +first example, they will be intermingled, appearing in the same order as +they are found in the linker input. In the second example, all @samp{.text} input sections will appear first, followed by all @samp{.rdata} input sections. diff -Nupr binutils-2.11.90.0.25/ld/ldgram.y binutils-2.11.90.0.27/ld/ldgram.y --- binutils-2.11.90.0.25/ld/ldgram.y Sat May 12 00:58:10 2001 +++ binutils-2.11.90.0.27/ld/ldgram.y Sat Aug 4 19:52:15 2001 @@ -49,7 +49,6 @@ static enum section_type sectype; lang_memory_region_type *region; -struct wildcard_spec current_file; boolean ldgram_want_filename = true; boolean had_script = false; boolean force_make_executable = false; @@ -70,6 +69,7 @@ static int error_index; char *name; const char *cname; struct wildcard_spec wildcard; + struct wildcard_list *wildcard_list; struct name_list *name_list; int token; union etree_union *etree; @@ -91,6 +91,7 @@ static int error_index; %type opt_exp_without_type %type fill_opt %type exclude_name_list +%type file_NAME_list %type memspec_opt casesymlist %type memspec_at_opt %type wildcard_name @@ -417,8 +418,6 @@ wildcard_spec: } ; - - exclude_name_list: exclude_name_list wildcard_name { @@ -440,42 +439,42 @@ exclude_name_list: ; file_NAME_list: + file_NAME_list opt_comma wildcard_spec + { + struct wildcard_list *tmp; + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = $1; + tmp->spec = $3; + $$ = tmp; + } + | wildcard_spec { - lang_add_wild ($1.name, $1.sorted, - current_file.name, - current_file.sorted, - ldgram_had_keep, $1.exclude_name_list); - } - | file_NAME_list opt_comma wildcard_spec - { - lang_add_wild ($3.name, $3.sorted, - current_file.name, - current_file.sorted, - ldgram_had_keep, $3.exclude_name_list); + struct wildcard_list *tmp; + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec = $1; + $$ = tmp; } ; input_section_spec_no_keep: NAME { - lang_add_wild (NULL, false, $1, false, - ldgram_had_keep, NULL); + struct wildcard_spec tmp; + tmp.name = $1; + tmp.exclude_name_list = NULL; + tmp.sorted = false; + lang_add_wild (&tmp, NULL, ldgram_had_keep); } - | '[' + | '[' file_NAME_list ']' { - current_file.name = NULL; - current_file.sorted = false; + lang_add_wild (NULL, $2, ldgram_had_keep); } - file_NAME_list ']' - | wildcard_spec + | wildcard_spec '(' file_NAME_list ')' { - current_file = $1; - /* '*' matches any file name. */ - if (strcmp (current_file.name, "*") == 0) - current_file.name = NULL; + lang_add_wild (&$1, $3, ldgram_had_keep); } - '(' file_NAME_list ')' ; input_section_spec: diff -Nupr binutils-2.11.90.0.25/ld/ldint.texinfo binutils-2.11.90.0.27/ld/ldint.texinfo --- binutils-2.11.90.0.25/ld/ldint.texinfo Thu Mar 15 14:56:52 2001 +++ binutils-2.11.90.0.27/ld/ldint.texinfo Sat Aug 4 19:52:15 2001 @@ -84,6 +84,7 @@ section entitled "GNU Free Documentation * README:: The README File * Emulations:: How linker emulations are generated * Emulation Walkthrough:: A Walkthrough of a Typical Emulation +* Architecture Specific:: Some Architecture Specific Notes * GNU Free Documentation License:: GNU Free Documentation License @end menu @@ -570,6 +571,105 @@ In summary, @item output bfd is written to disk @end itemize + +@node Architecture Specific +@chapter Some Architecture Specific Notes + +This is the place for notes on the behavior of @code{ld} on +specific platforms. Currently, only Intel x86 is documented (and +of that, only the auto-import behavior for DLLs). + +@menu +* ix86:: Intel x86 +@end menu + +@node ix86 +@section Intel x86 + +@table @emph +@code{ld} can create DLLs that operate with various runtimes available +on a common x86 operating system. These runtimes include native (using +the mingw "platform"), cygwin, and pw. + +@item auto-import from DLLs +@enumerate +@item +With this feature on, DLL clients can import variables from DLL +without any concern from their side (for example, without any source +code modifications). Auto-import can be enabled using the +@code{--enable-auto-import} flag, or disabled via the +@code{--disable-auto-import} flag. Auto-import is disabled by default. + +@item +This is done completely in bounds of the PE specification (to be fair, +there's a minor violation of the spec at one point, but in practice +auto-import works on all known variants of that common x86 operating +system) So, the resulting DLL can be used with any other PE +compiler/linker. + +@item +Auto-import is fully compatible with standard import method, in which +variables are decorated using attribute modifiers. Libraries of either +type may be mixed together. + +@item +Overhead (space): 8 bytes per imported symbol, plus 20 for each +reference to it; Overhead (load time): negligible; Overhead +(virtual/physical memory): should be less than effect of DLL +relocation. +@end enumerate + +Motivation + +The obvious and only way to get rid of dllimport insanity is +to make client access variable directly in the DLL, bypassing +the extra dereference imposed by ordinary DLL runtime linking. +I.e., whenever client contains someting like + +@code{mov dll_var,%eax,} + +address of dll_var in the command should be relocated to point +into loaded DLL. The aim is to make OS loader do so, and than +make ld help with that. Import section of PE made following +way: there's a vector of structures each describing imports +from particular DLL. Each such structure points to two other +parellel vectors: one holding imported names, and one which +will hold address of corresponding imported name. So, the +solution is de-vectorize these structures, making import +locations be sparse and pointing directly into code. + +Implementation + +For each reference of data symbol to be imported from DLL (to +set of which belong symbols with name , if __imp_ is +found in implib), the import fixup entry is generated. That +entry is of type IMAGE_IMPORT_DESCRIPTOR and stored in .idata$3 +subsection. Each fixup entry contains pointer to symbol's address +within .text section (marked with __fuN_ symbol, where N is +integer), pointer to DLL name (so, DLL name is referenced by +multiple entries), and pointer to symbol name thunk. Symbol name +thunk is singleton vector (__nm_th_) pointing to +IMAGE_IMPORT_BY_NAME structure (__nm_) directly containing +imported name. Here comes that "om the edge" problem mentioned above: +PE specification rambles that name vector (OriginalFirstThunk) should +run in parallel with addresses vector (FirstThunk), i.e. that they +should have same number of elements and terminated with zero. We violate +this, since FirstThunk points directly into machine code. But in +practice, OS loader implemented the sane way: it goes thru +OriginalFirstThunk and puts addresses to FirstThunk, not something +else. It once again should be noted that dll and symbol name +structures are reused across fixup entries and should be there +anyway to support standard import stuff, so sustained overhead is +20 bytes per reference. Other question is whether having several +IMAGE_IMPORT_DESCRIPTORS for the same DLL is possible. Answer is yes, +it is done even by native compiler/linker (libth32's functions are in +fact resident in windows9x kernel32.dll, so if you use it, you have +two IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is +whether referencing the same PE structures several times is valid. +The answer is why not, prohibiting that (detecting violation) would +require more work on behalf of loader than not doing it. + +@end table @node GNU Free Documentation License @chapter GNU Free Documentation License diff -Nupr binutils-2.11.90.0.25/ld/ldlang.c binutils-2.11.90.0.27/ld/ldlang.c --- binutils-2.11.90.0.25/ld/ldlang.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/ld/ldlang.c Sat Aug 4 19:52:15 2001 @@ -78,16 +78,16 @@ static void already_linked_table_init PA static void already_linked_table_free PARAMS ((void)); static boolean wildcardp PARAMS ((const char *)); static lang_statement_union_type *wild_sort - PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, - asection *)); + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, + lang_input_statement_type *, asection *)); static void output_section_callback - PARAMS ((lang_wild_statement_type *, asection *, + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static lang_input_statement_type *lookup_name PARAMS ((const char *)); static boolean load_symbols PARAMS ((lang_input_statement_type *, lang_statement_list_type *)); static void wild - PARAMS ((lang_wild_statement_type *, const char *, const char *, + PARAMS ((lang_wild_statement_type *, const char *, lang_output_section_statement_type *)); static bfd *open_output PARAMS ((const char *)); static void ldlang_open_output PARAMS ((lang_statement_union_type *)); @@ -135,11 +135,10 @@ static int topower PARAMS ((int)); static void lang_set_startof PARAMS ((void)); static void reset_memory_regions PARAMS ((void)); static void gc_section_callback - PARAMS ((lang_wild_statement_type *, asection *, + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static void lang_record_phdrs PARAMS ((void)); -static void lang_gc_wild - PARAMS ((lang_wild_statement_type *, const char *, const char *)); +static void lang_gc_wild PARAMS ((lang_wild_statement_type *)); static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *)); static void lang_gc_sections PARAMS ((void)); static int lang_vers_match_lang_c @@ -155,17 +154,18 @@ static void os_region_check struct memory_region_struct *, etree_type *, bfd_vma)); typedef void (*callback_t) PARAMS ((lang_wild_statement_type *, - asection *, lang_input_statement_type *, + struct wildcard_list *, + asection *, + lang_input_statement_type *, PTR)); static void walk_wild - PARAMS ((lang_wild_statement_type *, const char *, const char *, - callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, callback_t, PTR)); static void walk_wild_section - PARAMS ((lang_wild_statement_type *, const char *, - lang_input_statement_type *, callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, + callback_t, PTR)); static void walk_wild_file - PARAMS ((lang_wild_statement_type *, const char *, - lang_input_statement_type *, callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, + callback_t, PTR)); static int get_target PARAMS ((const bfd_target *, PTR)); static void stricpy PARAMS ((char *, char *)); @@ -236,74 +236,78 @@ unique_section_p (secnam) /* Generic traversal routines for finding matching sections. */ static void -walk_wild_section (ptr, section, file, callback, data) +walk_wild_section (ptr, file, callback, data) lang_wild_statement_type *ptr; - const char *section; lang_input_statement_type *file; callback_t callback; PTR data; { - /* Don't process sections from files which were excluded. */ - if (ptr->exclude_filename_list != NULL) + asection *s; + + if (file->just_syms_flag) + return; + + for (s = file->the_bfd->sections; s != NULL; s = s->next) { - struct name_list *list_tmp; - for (list_tmp = ptr->exclude_filename_list; - list_tmp; - list_tmp = list_tmp->next) + struct wildcard_list *sec; + + sec = ptr->section_list; + do { - boolean match; + boolean skip = false; - if (wildcardp (list_tmp->name)) - match = fnmatch (list_tmp->name, file->filename, 0) == 0; - else - match = strcmp (list_tmp->name, file->filename) == 0; + if (sec != NULL) + { + struct name_list *list_tmp; - if (match) - return; - } - } + /* Don't process sections from files which were + excluded. */ + for (list_tmp = sec->spec.exclude_name_list; + list_tmp; + list_tmp = list_tmp->next) + { + if (wildcardp (list_tmp->name)) + skip = fnmatch (list_tmp->name, file->filename, 0) == 0; + else + skip = strcmp (list_tmp->name, file->filename) == 0; - if (file->just_syms_flag == false) - { - register asection *s; - boolean wildcard = false; + if (skip) + break; + } - if (section != NULL) - wildcard = wildcardp (section); + if (!skip && sec->spec.name != NULL) + { + const char *sname = bfd_get_section_name (file->the_bfd, s); - for (s = file->the_bfd->sections; s != NULL; s = s->next) - { - boolean match; - const char *sname = bfd_get_section_name (file->the_bfd, s); + if (wildcardp (sec->spec.name)) + skip = fnmatch (sec->spec.name, sname, 0) != 0; + else + skip = strcmp (sec->spec.name, sname) != 0; + } + } - if (section == NULL) - match = true; - else if (wildcard) - match = fnmatch (section, sname, 0) == 0; - else - match = strcmp (section, sname) == 0; + if (!skip) + (*callback) (ptr, sec, s, file, data); - /* If this is a wild-card output section statement, exclude - sections that match UNIQUE_SECTION_LIST. */ - if (match && (data == NULL || !unique_section_p (sname))) - (*callback) (ptr, s, file, data); + if (sec != NULL) + sec = sec->next; } + while (sec != NULL); } } /* Handle a wild statement for a single file F. */ static void -walk_wild_file (s, section, f, callback, data) +walk_wild_file (s, f, callback, data) lang_wild_statement_type *s; - const char *section; lang_input_statement_type *f; callback_t callback; PTR data; { if (f->the_bfd == NULL || ! bfd_check_format (f->the_bfd, bfd_archive)) - walk_wild_section (s, section, f, callback, data); + walk_wild_section (s, f, callback, data); else { bfd *member; @@ -320,7 +324,7 @@ walk_wild_file (s, section, f, callback, lang_input_statement. */ if (member->usrdata != NULL) { - walk_wild_section (s, section, + walk_wild_section (s, (lang_input_statement_type *) member->usrdata, callback, data); } @@ -331,27 +335,27 @@ walk_wild_file (s, section, f, callback, } static void -walk_wild (s, section, file, callback, data) +walk_wild (s, callback, data) lang_wild_statement_type *s; - const char *section; - const char *file; callback_t callback; PTR data; { - if (file == (char *) NULL) + const char *file_spec = s->filename; + + if (file_spec == NULL) { /* Perform the iteration over all files in the list. */ LANG_FOR_EACH_INPUT_STATEMENT (f) { - walk_wild_file (s, section, f, callback, data); + walk_wild_file (s, f, callback, data); } } - else if (wildcardp (file)) + else if (wildcardp (file_spec)) { LANG_FOR_EACH_INPUT_STATEMENT (f) { - if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0) - walk_wild_file (s, section, f, callback, data); + if (fnmatch (file_spec, f->filename, FNM_FILE_NAME) == 0) + walk_wild_file (s, f, callback, data); } } else @@ -359,9 +363,9 @@ walk_wild (s, section, file, callback, d lang_input_statement_type *f; /* Perform the iteration over a single file. */ - f = lookup_name (file); + f = lookup_name (file_spec); if (f) - walk_wild_file (s, section, f, callback, data); + walk_wild_file (s, f, callback, data); } } @@ -1242,15 +1246,16 @@ wild_doit (ptr, section, output, file) new section should just go at the end of the current list. */ static lang_statement_union_type * -wild_sort (wild, file, section) +wild_sort (wild, sec, file, section) lang_wild_statement_type *wild; + struct wildcard_list *sec; lang_input_statement_type *file; asection *section; { const char *section_name; lang_statement_union_type *l; - if (! wild->filenames_sorted && ! wild->sections_sorted) + if (!wild->filenames_sorted && (sec == NULL || !sec->spec.sorted)) return NULL; section_name = bfd_get_section_name (file->the_bfd, section); @@ -1324,7 +1329,7 @@ wild_sort (wild, file, section) /* Here either the files are not sorted by name, or we are looking at the sections for this file. */ - if (wild->sections_sorted) + if (sec != NULL && sec->spec.sorted) { if (strcmp (section_name, bfd_get_section_name (ls->ifile->the_bfd, @@ -1341,20 +1346,25 @@ wild_sort (wild, file, section) NULL, in which case it is a wild card. */ static void -output_section_callback (ptr, section, file, output) +output_section_callback (ptr, sec, section, file, output) lang_wild_statement_type *ptr; + struct wildcard_list *sec; asection *section; lang_input_statement_type *file; PTR output; { lang_statement_union_type *before; + /* Exclude sections that match UNIQUE_SECTION_LIST. */ + if (unique_section_p (bfd_get_section_name (file->the_bfd, section))) + return; + /* If the wild pattern was marked KEEP, the member sections should be as well. */ if (ptr->keep_sections) section->flags |= SEC_KEEP; - before = wild_sort (ptr, file, section); + before = wild_sort (ptr, sec, file, section); /* Here BEFORE points to the lang_input_section which should follow the one we are about to add. If BEFORE @@ -1557,28 +1567,32 @@ load_symbols (entry, place) return entry->loaded; } -/* Handle a wild statement. SECTION or FILE or both may be NULL, - indicating that it is a wildcard. Separate lang_input_section - statements are created for each part of the expansion; they are - added after the wild statement S. OUTPUT is the output section. */ +/* Handle a wild statement. S->FILENAME or S->SECTION_LIST or both + may be NULL, indicating that it is a wildcard. Separate + lang_input_section statements are created for each part of the + expansion; they are added after the wild statement S. OUTPUT is + the output section. */ static void -wild (s, section, file, target, output) +wild (s, target, output) lang_wild_statement_type *s; - const char *section; - const char *file; const char *target ATTRIBUTE_UNUSED; lang_output_section_statement_type *output; { - walk_wild (s, section, file, output_section_callback, (PTR) output); + struct wildcard_list *sec; - if (section != (char *) NULL - && strcmp (section, "COMMON") == 0 - && default_common_section == NULL) - { - /* Remember the section that common is going to in case we later - get something which doesn't know where to put it. */ - default_common_section = output; + walk_wild (s, output_section_callback, (PTR) output); + + for (sec = s->section_list; sec != NULL; sec = sec->next) + { + if (default_common_section != NULL) + break; + if (sec->spec.name != NULL && strcmp (sec->spec.name, "COMMON") == 0) + { + /* Remember the section that common is going to in case we + later get something which doesn't know where to put it. */ + default_common_section = output; + } } } @@ -2052,13 +2066,8 @@ map_input_to_output_sections (s, target, { switch (s->header.type) { - case lang_wild_statement_enum: - wild (&s->wild_statement, s->wild_statement.section_name, - s->wild_statement.filename, target, - output_section_statement); - - break; + wild (&s->wild_statement, target, output_section_statement); case lang_constructors_statement_enum: map_input_to_output_sections (constructor_list.head, target, @@ -2441,18 +2450,12 @@ print_wild_statement (w, os) lang_wild_statement_type *w; lang_output_section_statement_type *os; { + struct wildcard_list *sec; + print_space (); if (w->filenames_sorted) minfo ("SORT("); - if (w->exclude_filename_list != NULL) - { - name_list *tmp; - minfo ("EXCLUDE_FILE ( %s", w->exclude_filename_list->name); - for (tmp = w->exclude_filename_list->next; tmp; tmp = tmp->next) - minfo (", %s", tmp->name); - minfo (")"); - } if (w->filename != NULL) minfo ("%s", w->filename); else @@ -2461,14 +2464,25 @@ print_wild_statement (w, os) minfo (")"); minfo ("("); - if (w->sections_sorted) - minfo ("SORT("); - if (w->section_name != NULL) - minfo ("%s", w->section_name); - else - minfo ("*"); - if (w->sections_sorted) - minfo (")"); + for (sec = w->section_list; sec; sec = sec->next) + { + if (sec->spec.sorted) + minfo ("SORT("); + if (sec->spec.exclude_name_list != NULL) + { + name_list *tmp; + minfo ("EXCLUDE_FILE ( %s", sec->spec.exclude_name_list->name); + for (tmp = sec->spec.exclude_name_list->next; tmp; tmp = tmp->next) + minfo (", %s", tmp->name); + minfo (")"); + } + if (sec->spec.name != NULL) + minfo ("%s", sec->spec.name); + else + minfo ("*"); + if (sec->spec.sorted) + minfo (")"); + } minfo (")"); print_nl (); @@ -3978,32 +3992,28 @@ reset_memory_regions () } } -/* Expand a wild statement for a particular FILE, marking its sections KEEP - as needed. SECTION may be NULL, in which case it is a wild card. */ +/* If the wild pattern was marked KEEP, the member sections + should be as well. */ static void -gc_section_callback (ptr, section, file, data) +gc_section_callback (ptr, sec, section, file, data) lang_wild_statement_type *ptr; + struct wildcard_list *sec ATTRIBUTE_UNUSED; asection *section; lang_input_statement_type *file ATTRIBUTE_UNUSED; PTR data ATTRIBUTE_UNUSED; { - /* If the wild pattern was marked KEEP, the member sections - should be as well. */ if (ptr->keep_sections) section->flags |= SEC_KEEP; } -/* Handle a wild statement, marking it against GC. SECTION or FILE or both - may be NULL, indicating that it is a wildcard. */ +/* Handle a wild statement, marking it against GC. */ static void -lang_gc_wild (s, section, file) +lang_gc_wild (s) lang_wild_statement_type *s; - const char *section; - const char *file; { - walk_wild (s, section, file, gc_section_callback, NULL); + walk_wild (s, gc_section_callback, NULL); } /* Iterate over sections marking them against GC. */ @@ -4017,10 +4027,7 @@ lang_gc_sections_1 (s) switch (s->header.type) { case lang_wild_statement_enum: - lang_gc_wild (&s->wild_statement, - s->wild_statement.section_name, - s->wild_statement.filename); - break; + lang_gc_wild (&s->wild_statement); case lang_constructors_statement_enum: lang_gc_sections_1 (constructor_list.head); break; @@ -4211,32 +4218,44 @@ lang_process () /* EXPORTED TO YACC */ void -lang_add_wild (section_name, sections_sorted, filename, filenames_sorted, - keep_sections, exclude_filename_list) - const char *const section_name; - boolean sections_sorted; - const char *const filename; - boolean filenames_sorted; +lang_add_wild (filespec, section_list, keep_sections) + struct wildcard_spec *filespec; + struct wildcard_list *section_list; boolean keep_sections; - struct name_list *exclude_filename_list; { - lang_wild_statement_type *new = new_stat (lang_wild_statement, - stat_ptr); + struct wildcard_list *curr, *next; + lang_wild_statement_type *new; + + /* Reverse the list as the parser puts it back to front. */ + for (curr = section_list, section_list = NULL; + curr != NULL; + section_list = curr, curr = next) + { + if (curr->spec.name != NULL && strcmp (curr->spec.name, "COMMON") == 0) + placed_commons = true; - if (section_name != (char *) NULL && strcmp (section_name, "COMMON") == 0) + next = curr->next; + curr->next = section_list; + } + + if (filespec != NULL && filespec->name != NULL) { - placed_commons = true; + if (strcmp (filespec->name, "*") == 0) + filespec->name = NULL; + else if (! wildcardp (filespec->name)) + lang_has_input_file = true; } - if (filename != NULL && ! wildcardp (filename)) + + new = new_stat (lang_wild_statement, stat_ptr); + new->filename = NULL; + new->filenames_sorted = false; + if (filespec != NULL) { - lang_has_input_file = true; + new->filename = filespec->name; + new->filenames_sorted = filespec->sorted; } - new->section_name = section_name; - new->sections_sorted = sections_sorted; - new->filename = filename; - new->filenames_sorted = filenames_sorted; + new->section_list = section_list; new->keep_sections = keep_sections; - new->exclude_filename_list = exclude_filename_list; lang_list_init (&new->children); } diff -Nupr binutils-2.11.90.0.25/ld/ldlang.h binutils-2.11.90.0.27/ld/ldlang.h --- binutils-2.11.90.0.25/ld/ldlang.h Thu Mar 15 14:56:54 2001 +++ binutils-2.11.90.0.27/ld/ldlang.h Sat Aug 4 19:52:15 2001 @@ -257,12 +257,10 @@ typedef struct { typedef struct lang_wild_statement_struct { lang_statement_header_type header; - const char *section_name; - boolean sections_sorted; const char *filename; boolean filenames_sorted; + struct wildcard_list *section_list; boolean keep_sections; - struct name_list *exclude_filename_list; lang_statement_list_type children; } lang_wild_statement_type; @@ -385,7 +383,7 @@ extern void lang_section_start PARAMS (( extern void lang_add_entry PARAMS ((const char *, boolean)); extern void lang_add_target PARAMS ((const char *)); extern void lang_add_wild - PARAMS ((const char *, boolean, const char *, boolean, boolean, name_list *)); + PARAMS ((struct wildcard_spec *, struct wildcard_list *, boolean)); extern void lang_add_map PARAMS ((const char *)); extern void lang_add_fill PARAMS ((int)); extern lang_assignment_statement_type * lang_add_assignment PARAMS ((union etree_union *)); diff -Nupr binutils-2.11.90.0.25/ld/ldmain.c binutils-2.11.90.0.27/ld/ldmain.c --- binutils-2.11.90.0.25/ld/ldmain.c Sat Jul 14 10:29:15 2001 +++ binutils-2.11.90.0.27/ld/ldmain.c Fri Aug 10 14:08:01 2001 @@ -244,6 +244,7 @@ main (argc, argv) link_info.new_dtags = false; link_info.flags = (bfd_vma) 0; link_info.flags_1 = (bfd_vma) 0; + link_info.pei386_auto_import = false; ldfile_add_arch (""); @@ -326,7 +327,7 @@ main (argc, argv) else { /* We thought there was an external linker script. But - we couldn't find it. Let's try gain for the internal + we couldn't find it. Let's try again for the internal one without command_line.multilib_dir. */ char *saved = command_line.multilib_dir; command_line.multilib_dir = NULL; diff -Nupr binutils-2.11.90.0.25/ld/mri.c binutils-2.11.90.0.27/ld/mri.c --- binutils-2.11.90.0.25/ld/mri.c Thu Mar 15 14:56:57 2001 +++ binutils-2.11.90.0.27/ld/mri.c Sat Aug 4 19:52:15 2001 @@ -220,6 +220,7 @@ mri_draw_tree () struct section_name_struct *aptr; etree_type *align = 0; etree_type *subalign = 0; + struct wildcard_list *tmp; /* See if an alignment has been specified. */ for (aptr = alignment; aptr; aptr = aptr->next) @@ -238,12 +239,24 @@ mri_draw_tree () 1, align, subalign, (etree_type *) NULL); base = 0; - lang_add_wild (p->name, false, (char *) NULL, false, false, NULL); + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec.name = p->name; + tmp->spec.exclude_name_list = NULL; + tmp->spec.sorted = false; + lang_add_wild (NULL, tmp, false); /* If there is an alias for this section, add it too. */ for (aptr = alias; aptr; aptr = aptr->next) if (strcmp (aptr->alias, p->name) == 0) - lang_add_wild (aptr->name, false, (char *) NULL, false, false, NULL); + { + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec.name = aptr->name; + tmp->spec.exclude_name_list = NULL; + tmp->spec.sorted = false; + lang_add_wild (NULL, tmp, false); + } lang_leave_output_section_statement (0, "*default*", (struct lang_output_section_phdr_list *) NULL, diff -Nupr binutils-2.11.90.0.25/ld/pe-dll.c binutils-2.11.90.0.27/ld/pe-dll.c --- binutils-2.11.90.0.25/ld/pe-dll.c Thu Mar 15 14:56:57 2001 +++ binutils-2.11.90.0.27/ld/pe-dll.c Sat Aug 4 19:52:15 2001 @@ -54,6 +54,85 @@ ************************************************************************/ +/************************************************************************ + + Auto-import feature by Paul Sokolovsky + + Quick facts: + + 1. With this feature on, DLL clients can import variables from DLL + without any concern from their side (for example, without any source + code modifications). + + 2. This is done completely in bounds of the PE specification (to be fair, + there's a place where it pokes nose out of, but in practise it works). + So, resulting module can be used with any other PE compiler/linker. + + 3. Auto-import is fully compatible with standard import method and they + can be mixed together. + + 4. Overheads: space: 8 bytes per imported symbol, plus 20 for each + reference to it; load time: negligible; virtual/physical memory: should be + less than effect of DLL relocation, and I sincerely hope it doesn't affect + DLL sharability (too much). + + Idea + + The obvious and only way to get rid of dllimport insanity is to make client + access variable directly in the DLL, bypassing extra dereference. I.e., + whenever client contains someting like + + mov dll_var,%eax, + + address of dll_var in the command should be relocated to point into loaded + DLL. The aim is to make OS loader do so, and than make ld help with that. + Import section of PE made following way: there's a vector of structures + each describing imports from particular DLL. Each such structure points + to two other parellel vectors: one holding imported names, and one which + will hold address of corresponding imported name. So, the solution is + de-vectorize these structures, making import locations be sparse and + pointing directly into code. Before continuing, it is worth a note that, + while authors strives to make PE act ELF-like, there're some other people + make ELF act PE-like: elfvector, ;-) . + + Implementation + + For each reference of data symbol to be imported from DLL (to set of which + belong symbols with name , if __imp_ is found in implib), the + import fixup entry is generated. That entry is of type + IMAGE_IMPORT_DESCRIPTOR and stored in .idata$3 subsection. Each + fixup entry contains pointer to symbol's address within .text section + (marked with __fuN_ symbol, where N is integer), pointer to DLL name + (so, DLL name is referenced by multiple entries), and pointer to symbol + name thunk. Symbol name thunk is singleton vector (__nm_th_) + pointing to IMAGE_IMPORT_BY_NAME structure (__nm_) directly + containing imported name. Here comes that "om the edge" problem mentioned + above: PE specification rambles that name vector (OriginalFirstThunk) + should run in parallel with addresses vector (FirstThunk), i.e. that they + should have same number of elements and terminated with zero. We violate + this, since FirstThunk points directly into machine code. But in practise, + OS loader implemented the sane way: it goes thru OriginalFirstThunk and + puts addresses to FirstThunk, not something else. It once again should be + noted that dll and symbol name structures are reused across fixup entries + and should be there anyway to support standard import stuff, so sustained + overhead is 20 bytes per reference. Other question is whether having several + IMAGE_IMPORT_DESCRIPTORS for the same DLL is possible. Answer is yes, it is + done even by native compiler/linker (libth32's functions are in fact reside + in windows9x kernel32.dll, so if you use it, you have two + IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is whether + referencing the same PE structures several times is valid. The answer is why + not, prohibitting that (detecting violation) would require more work on + behalf of loader than not doing it. + + + See also: ld/emultempl/pe.em + + ************************************************************************/ + +static void +add_bfd_to_link (bfd *abfd, CONST char *name, + struct bfd_link_info *link_info); + /* for emultempl/pe.em */ def_file *pe_def_file = 0; @@ -63,6 +142,7 @@ int pe_dll_kill_ats = 0; int pe_dll_stdcall_aliases = 0; int pe_dll_warn_dup_exports = 0; int pe_dll_compat_implib = 0; +int pe_dll_extra_pe_debug = 0; /************************************************************************ @@ -86,6 +166,11 @@ typedef struct { int underscored; } pe_details_type; +typedef struct { + char *name; + int len; +} autofilter_entry_type; + #define PE_ARCH_i386 1 #define PE_ARCH_sh 2 #define PE_ARCH_mips 3 @@ -129,6 +214,50 @@ static pe_details_type pe_detail_list[] static pe_details_type *pe_details; +static autofilter_entry_type autofilter_symbollist[] = { + { "DllMain@12", 10 }, + { "DllEntryPoint@0", 15 }, + { "DllMainCRTStartup@12", 20 }, + { "_cygwin_dll_entry@12", 20 }, + { "_cygwin_crt0_common@8", 21 }, + { "_cygwin_noncygwin_dll_entry@12", 30 }, + { "impure_ptr", 10 }, + { NULL, 0 } +}; +/* Do not specify library suffix explicitly, to allow for dllized versions */ +static autofilter_entry_type autofilter_liblist[] = { + { "libgcc.", 7 }, + { "libstdc++.", 10 }, + { "libmingw32.", 11 }, + { NULL, 0 } +}; +static autofilter_entry_type autofilter_objlist[] = { + { "crt0.o", 6 }, + { "crt1.o", 6 }, + { "crt2.o", 6 }, + { NULL, 0 } +}; +static autofilter_entry_type autofilter_symbolprefixlist[] = { +/* { "__imp_", 6 }, */ +/* Do __imp_ explicitly to save time */ + { "__rtti_", 7 }, + { "__builtin_", 10 }, + { "_head_", 6 }, /* don't export symbols specifying internal DLL layout */ + { "_fmode", 6 }, + { "_impure_ptr", 11 }, + { "cygwin_attach_dll", 17 }, + { "cygwin_premain0", 15 }, + { "cygwin_premain1", 15 }, + { "cygwin_premain2", 15 }, + { "cygwin_premain3", 15 }, + { "environ", 7 }, + { NULL, 0 } +}; +static autofilter_entry_type autofilter_symbolsuffixlist[] = { + { "_iname", 6 }, + { NULL, 0 } +}; + #define U(str) (pe_details->underscored ? "_" str : str) void @@ -231,24 +360,98 @@ pe_dll_add_excludes (new_excludes) free (local_copy); } +/* + abfd is a bfd containing n (or NULL) + It can be used for contextual checks. +*/ static int -auto_export (d, n) +auto_export (abfd, d, n) + bfd *abfd; def_file *d; const char *n; { int i; struct exclude_list_struct *ex; + autofilter_entry_type *afptr; + + /* we should not re-export imported stuff */ + if (strncmp (n, "_imp__", 6) == 0) + return 0; + for (i = 0; i < d->num_exports; i++) if (strcmp (d->exports[i].name, n) == 0) return 0; if (pe_dll_do_default_excludes) { - if (strcmp (n, "DllMain@12") == 0) - return 0; - if (strcmp (n, "DllEntryPoint@0") == 0) - return 0; - if (strcmp (n, "impure_ptr") == 0) - return 0; + if (pe_dll_extra_pe_debug) + { + printf ("considering exporting: %s, abfd=%p, abfd->my_arc=%p\n", + n, abfd, abfd->my_archive); + } + + /* First of all, make context checks: + Don't export anything from libgcc */ + if (abfd && abfd->my_archive) + { + afptr = autofilter_liblist; + while (afptr->name) + { + if (strstr (abfd->my_archive->filename, afptr->name)) + return 0; + afptr++; + } + } + + /* Next, exclude symbols from certain startup objects */ + { + char *p; + afptr = autofilter_objlist; + while (afptr->name) + { + if (abfd && + (p = strstr (abfd->filename, afptr->name)) && + (*(p + afptr->len - 1) == 0)) + return 0; + afptr++; + } + } + + /* Don't try to blindly exclude all symbols + that begin with '__'; this was tried and + it is too restrictive */ + + /* Then, exclude specific symbols */ + afptr = autofilter_symbollist; + while (afptr->name) + { + if (strcmp (n, afptr->name) == 0) + return 0; + afptr++; + } + + /* Next, exclude symbols starting with ... */ + afptr = autofilter_symbolprefixlist; + while (afptr->name) + { + if (strncmp (n, afptr->name, afptr->len) == 0) + return 0; + afptr++; + } + + /* Finally, exclude symbols ending with ... */ + { + int len = strlen(n); + afptr = autofilter_symbolsuffixlist; + while (afptr->name) + { + if ((len >= afptr->len) && + /* add 1 to insure match with trailing '\0' */ + strncmp (n + len - afptr->len, afptr->name, + afptr->len + 1) == 0) + return 0; + afptr++; + } + } } for (ex = excludes; ex; ex = ex->next) if (strcmp (n, ex->string) == 0) @@ -302,20 +505,36 @@ process_def_file (abfd, info) for (j = 0; j < nsyms; j++) { /* We should export symbols which are either global or not - anything at all. (.bss data is the latter) */ - if ((symbols[j]->flags & BSF_GLOBAL) - || (symbols[j]->flags == BSF_NO_FLAGS)) + anything at all. (.bss data is the latter) + We should not export undefined symbols + */ + if (symbols[j]->section != &bfd_und_section + && ((symbols[j]->flags & BSF_GLOBAL) + || (symbols[j]->flags == BFD_FORT_COMM_DEFAULT_VALUE))) { const char *sn = symbols[j]->name; + + /* we should not re-export imported stuff */ + { + char *name = (char *) xmalloc (strlen (sn) + 2 + 6); + sprintf (name, "%s%s", U("_imp_"), sn); + blhe = bfd_link_hash_lookup (info->hash, name, + false, false, false); + free (name); + + if (blhe && blhe->type == bfd_link_hash_defined) + continue; + } + if (*sn == '_') sn++; - if (auto_export (pe_def_file, sn)) - { - def_file_export *p; - p=def_file_add_export (pe_def_file, sn, 0, -1); - /* Fill data flag properly, from dlltool.c */ - p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); - } + if (auto_export (b, pe_def_file, sn)) + { + def_file_export *p; + p=def_file_add_export (pe_def_file, sn, 0, -1); + /* Fill data flag properly, from dlltool.c */ + p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); + } } } } @@ -350,9 +569,10 @@ process_def_file (abfd, info) { char *tmp = xstrdup (pe_def_file->exports[i].name); *(strchr (tmp, '@')) = 0; - if (auto_export (pe_def_file, tmp)) + if (auto_export (NULL, pe_def_file, tmp)) def_file_add_export (pe_def_file, tmp, - pe_def_file->exports[i].internal_name, -1); + pe_def_file->exports[i].internal_name, + -1); else free (tmp); } @@ -731,6 +951,57 @@ fill_edata (abfd, info) } } + +static struct sec *current_sec; + +void +pe_walk_relocs_of_symbol (info, name, cb) + struct bfd_link_info *info; + CONST char *name; + int (*cb) (arelent *); +{ + bfd *b; + struct sec *s; + + for (b = info->input_bfds; b; b = b->link_next) + { + arelent **relocs; + int relsize, nrelocs, i; + + for (s = b->sections; s; s = s->next) + { + asymbol **symbols; + int nsyms, symsize; + int flags = bfd_get_section_flags (b, s); + + /* Skip discarded linkonce sections */ + if (flags & SEC_LINK_ONCE + && s->output_section == bfd_abs_section_ptr) + continue; + + current_sec=s; + + symsize = bfd_get_symtab_upper_bound (b); + symbols = (asymbol **) xmalloc (symsize); + nsyms = bfd_canonicalize_symtab (b, symbols); + + relsize = bfd_get_reloc_upper_bound (b, s); + relocs = (arelent **) xmalloc ((size_t) relsize); + nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols); + + for (i = 0; i < nrelocs; i++) + { + struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr; + if (!strcmp(name,sym->name)) cb(relocs[i]); + } + free (relocs); + /* Warning: the allocated symbols are remembered in BFD and reused + later, so don't free them! */ + /* free (symbols); */ + } + } +} + /************************************************************************ Gather all the relocations and build the .reloc section @@ -758,7 +1029,8 @@ generate_reloc (abfd, info) for (s = b->sections; s; s = s->next) total_relocs += s->reloc_count; - reloc_data = (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type)); + reloc_data = + (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type)); total_relocs = 0; bi = 0; @@ -801,6 +1073,11 @@ generate_reloc (abfd, info) for (i = 0; i < nrelocs; i++) { + if (pe_dll_extra_pe_debug) + { + struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr; + printf("rel: %s\n",sym->name); + } if (!relocs[i]->howto->pc_relative && relocs[i]->howto->type != pe_details->imagebase_reloc) { @@ -1039,7 +1316,7 @@ pe_dll_generate_def_file (pe_out_def_fil if (pe_def_file->num_exports > 0) { - fprintf (out, "\nEXPORTS\n\n"); + fprintf (out, "EXPORTS\n"); for (i = 0; i < pe_def_file->num_exports; i++) { def_file_export *e = pe_def_file->exports + i; @@ -1445,7 +1722,7 @@ make_one (exp, parent) bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); symptr = 0; - symtab = (asymbol **) xmalloc (10 * sizeof (asymbol *)); + symtab = (asymbol **) xmalloc (11 * sizeof (asymbol *)); tx = quick_section (abfd, ".text", SEC_CODE|SEC_HAS_CONTENTS, 2); id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2); id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2); @@ -1455,6 +1732,9 @@ make_one (exp, parent) quick_symbol (abfd, U (""), exp->internal_name, "", tx, BSF_GLOBAL, 0); quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0); quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0); + /* symbol to reference ord/name of imported symbol, used to implement + auto-import */ + quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL, 0); if (pe_dll_compat_implib) quick_symbol (abfd, U ("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0); @@ -1553,6 +1833,190 @@ make_one (exp, parent) return abfd; } +static bfd * +make_singleton_name_thunk (import, parent) + char *import; + bfd *parent; +{ + /* name thunks go to idata$4 */ + + asection *id4; + unsigned char *d4; + char *oname; + bfd *abfd; + + oname = (char *) xmalloc (20); + sprintf (oname, "nmth%06d.o", tmp_seq); + tmp_seq++; + + abfd = bfd_create (oname, parent); + bfd_find_target (pe_details->object_target, abfd); + bfd_make_writable (abfd); + + bfd_set_format (abfd, bfd_object); + bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); + + symptr = 0; + symtab = (asymbol **) xmalloc (3 * sizeof (asymbol *)); + id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2); + quick_symbol (abfd, U ("_nm_thnk_"), import, "", id4, BSF_GLOBAL, 0); + quick_symbol (abfd, U ("_nm_"), import, "", UNDSEC, BSF_GLOBAL, 0); + + bfd_set_section_size (abfd, id4, 8); + d4 = (unsigned char *) xmalloc (4); + id4->contents = d4; + memset (d4, 0, 8); + quick_reloc (abfd, 0, BFD_RELOC_RVA, 2); + save_relocs (id4); + + bfd_set_symtab (abfd, symtab, symptr); + + bfd_set_section_contents (abfd, id4, d4, 0, 8); + + bfd_make_readable (abfd); + return abfd; +} + +static char * +make_import_fixup_mark (rel) + arelent *rel; +{ + /* we convert reloc to symbol, for later reference */ + static int counter; + static char *fixup_name = NULL; + static int buffer_len = 0; + + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + + bfd *abfd = bfd_asymbol_bfd (sym); + struct coff_link_hash_entry *myh = NULL; + + if (!fixup_name) + { + fixup_name = (char *) xmalloc (384); + buffer_len = 384; + } + + if (strlen (sym->name) + 25 > buffer_len) + /* assume 25 chars for "__fu" + counter + "_". If counter is + bigger than 20 digits long, we've got worse problems than + overflowing this buffer... */ + { + free (fixup_name); + /* new buffer size is length of symbol, plus 25, but then + rounded up to the nearest multiple of 128 */ + buffer_len = ((strlen (sym->name) + 25) + 127) & ~127; + fixup_name = (char *) xmalloc (buffer_len); + } + + sprintf (fixup_name, "__fu%d_%s", counter++, sym->name); + + bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL, + current_sec, /* sym->section, */ + rel->address, NULL, true, false, + (struct bfd_link_hash_entry **) &myh); + +/* + printf("type:%d\n",myh->type); + printf("%s\n",myh->root.u.def.section->name); +*/ + return fixup_name; +} + + +/* + * .section .idata$3 + * .rva __nm_thnk_SYM (singleton thunk with name of func) + * .long 0 + * .long 0 + * .rva __my_dll_iname (name of dll) + * .rva __fuNN_SYM (pointer to reference (address) in text) + * + */ + +static bfd * +make_import_fixup_entry (name, fixup_name, dll_symname,parent) + char *name; + char *fixup_name; + char *dll_symname; + bfd *parent; +{ + asection *id3; + unsigned char *d3; + char *oname; + bfd *abfd; + + oname = (char *) xmalloc (20); + sprintf (oname, "fu%06d.o", tmp_seq); + tmp_seq++; + + abfd = bfd_create (oname, parent); + bfd_find_target (pe_details->object_target, abfd); + bfd_make_writable (abfd); + + bfd_set_format (abfd, bfd_object); + bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); + + symptr = 0; + symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *)); + id3 = quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2); +/* + quick_symbol (abfd, U("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0); +*/ + quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0); + quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0); + quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0); + + bfd_set_section_size (abfd, id3, 20); + d3 = (unsigned char *) xmalloc (20); + id3->contents = d3; + memset (d3, 0, 20); + + quick_reloc (abfd, 0, BFD_RELOC_RVA, 1); + quick_reloc (abfd, 12, BFD_RELOC_RVA, 2); + quick_reloc (abfd, 16, BFD_RELOC_RVA, 3); + save_relocs (id3); + + bfd_set_symtab (abfd, symtab, symptr); + + bfd_set_section_contents (abfd, id3, d3, 0, 20); + + bfd_make_readable (abfd); + return abfd; +} + +void +pe_create_import_fixup (rel) + arelent *rel; +{ + char buf[300]; + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + struct bfd_link_hash_entry *name_thunk_sym; + CONST char *name = sym->name; + char *fixup_name = make_import_fixup_mark (rel); + + sprintf (buf, U ("_nm_thnk_%s"), name); + + name_thunk_sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1); + + if (!name_thunk_sym || name_thunk_sym->type != bfd_link_hash_defined) + { + bfd *b = make_singleton_name_thunk (name, output_bfd); + add_bfd_to_link (b, b->filename, &link_info); + + /* If we ever use autoimport, we have to cast text section writable */ + config.text_read_only = false; + } + + { + extern char *pe_data_import_dll; + bfd *b = make_import_fixup_entry (name, fixup_name, pe_data_import_dll, + output_bfd); + add_bfd_to_link (b, b->filename, &link_info); + } +} + + void pe_dll_generate_implib (def, impfilename) def_file *def; @@ -1631,7 +2095,7 @@ pe_dll_generate_implib (def, impfilename static void add_bfd_to_link (abfd, name, link_info) bfd *abfd; - char *name; + CONST char *name; struct bfd_link_info *link_info; { lang_input_statement_type *fake_file; diff -Nupr binutils-2.11.90.0.25/ld/pe-dll.h binutils-2.11.90.0.27/ld/pe-dll.h --- binutils-2.11.90.0.25/ld/pe-dll.h Thu Mar 15 14:56:58 2001 +++ binutils-2.11.90.0.27/ld/pe-dll.h Sat Aug 4 19:52:15 2001 @@ -33,6 +33,7 @@ extern int pe_dll_kill_ats; extern int pe_dll_stdcall_aliases; extern int pe_dll_warn_dup_exports; extern int pe_dll_compat_implib; +extern int pe_dll_extra_pe_debug; extern void pe_dll_id_target PARAMS ((const char *)); extern void pe_dll_add_excludes PARAMS ((const char *)); @@ -45,4 +46,9 @@ extern void pe_exe_build_sections PARAMS extern void pe_dll_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); extern void pe_exe_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_walk_relocs_of_symbol PARAMS ((struct bfd_link_info * info, + CONST char *name, + int (*cb) (arelent *))); + +extern void pe_create_import_fixup PARAMS ((arelent * rel)); #endif /* PE_DLL_H */ diff -Nupr binutils-2.11.90.0.25/ld/scripttempl/elf.sc binutils-2.11.90.0.27/ld/scripttempl/elf.sc --- binutils-2.11.90.0.25/ld/scripttempl/elf.sc Tue Sep 5 10:49:40 2000 +++ binutils-2.11.90.0.27/ld/scripttempl/elf.sc Fri Aug 10 14:08:01 2001 @@ -17,7 +17,8 @@ # DATA_START_SYMBOLS - symbols that appear at the start of the # .data section. # OTHER_GOT_SYMBOLS - symbols defined just before .got. -# OTHER_GOT_SECTIONS - sections just after .got and .sdata. +# OTHER_GOT_SECTIONS - sections just after .got. +# OTHER_SDATA_SECTIONS - sections just after .sdata. # OTHER_BSS_SYMBOLS - symbols that appear at the start of the # .bss section besides __bss_start. # DATA_PLT - .plt should be in data segment, not text segment. @@ -308,14 +309,15 @@ SECTIONS .gcc_except_table : { *(.gcc_except_table) } ${WRITABLE_RODATA+${RODATA}} ${RELOCATING+${OTHER_READWRITE_SECTIONS}} + ${TEXT_DYNAMIC-${DYNAMIC}} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} ${DATA_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + ${RELOCATING+${OTHER_GOT_SECTIONS}} ${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SBSS2}} - ${TEXT_DYNAMIC-${DYNAMIC}} /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ @@ -326,7 +328,7 @@ SECTIONS ${RELOCATING+*(.sdata.*)} ${RELOCATING+*(.gnu.linkonce.s.*)} } - ${RELOCATING+${OTHER_GOT_SECTIONS}} + ${RELOCATING+${OTHER_SDATA_SECTIONS}} ${RELOCATING+_edata = .;} ${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+__bss_start = .;} diff -Nupr binutils-2.11.90.0.25/ld/scripttempl/elfm68hc11.sc binutils-2.11.90.0.27/ld/scripttempl/elfm68hc11.sc --- binutils-2.11.90.0.25/ld/scripttempl/elfm68hc11.sc Tue Sep 5 10:49:41 2000 +++ binutils-2.11.90.0.27/ld/scripttempl/elfm68hc11.sc Sat Aug 4 19:52:15 2001 @@ -26,7 +26,7 @@ test "$LD_FLAG" = "N" && DATA_ADDR=. CTOR=".ctors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __CTOR_LIST__ = .; } + ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+${CTOR_START}} *(.ctors) /* We don't want to include the .ctor section from @@ -39,19 +39,19 @@ CTOR=".ctors ${CONSTRUCTING-0} : KEEP (*(.ctors)) */ ${CONSTRUCTING+${CTOR_END}} - ${CONSTRUCTING+ __CTOR_END__ = .; } + ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } } ${RELOCATING+ > ${DATA_MEMORY}}" DTOR=" .dtors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __DTOR_LIST__ = .; } + ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } *(.dtors) /* KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) */ - ${CONSTRUCTING+ __DTOR_END__ = .; } + ${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); } } ${RELOCATING+ > ${DATA_MEMORY}}" @@ -117,6 +117,15 @@ STARTUP_CODE=" *(.install4) /* Section that calls the main. */ " +FINISH_CODE=" + /* Finish code. */ + *(.fini0) /* Beginning of finish code (_exit symbol). */ + *(.fini1) /* Place holder for applications. */ + *(.fini2) /* C++ destructors. */ + *(.fini3) /* Place holder for applications. */ + *(.fini4) /* Runtime exit. */ +" + PRE_COMPUTE_DATA_SIZE=" /* SCz: this does not work yet... This is supposed to force the loading of _map_data.o (from libgcc.a) when the .data section is not empty. @@ -137,6 +146,14 @@ INSTALL_RELOC=" .install4 0 : { *(.install4) } " +FINISH_RELOC=" + .fini0 0 : { *(.fini0) } + .fini1 0 : { *(.fini1) } + .fini2 0 : { *(.fini2) } + .fini3 0 : { *(.fini3) } + .fini4 0 : { *(.fini4) } +" + BSS_DATA_RELOC=" .data1 0 : { *(.data1) } @@ -170,15 +187,83 @@ SECTIONS .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } - .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) } - .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) } - .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rel.text ${RELOCATING-0} : + { + *(.rel.text) + ${RELOCATING+*(.rel.text.*)} + ${RELOCATING+*(.rel.gnu.linkonce.t.*)} + } + .rela.text ${RELOCATING-0} : + { + *(.rela.text) + ${RELOCATING+*(.rela.text.*)} + ${RELOCATING+*(.rela.gnu.linkonce.t.*)} + } + .rel.data ${RELOCATING-0} : + { + *(.rel.data) + ${RELOCATING+*(.rel.data.*)} + ${RELOCATING+*(.rel.gnu.linkonce.d.*)} + } + .rela.data ${RELOCATING-0} : + { + *(.rela.data) + ${RELOCATING+*(.rela.data.*)} + ${RELOCATING+*(.rela.gnu.linkonce.d.*)} + } + .rel.rodata ${RELOCATING-0} : + { + *(.rel.rodata) + ${RELOCATING+*(.rel.rodata.*)} + ${RELOCATING+*(.rel.gnu.linkonce.r.*)} + } + .rela.rodata ${RELOCATING-0} : + { + *(.rela.rodata) + ${RELOCATING+*(.rela.rodata.*)} + ${RELOCATING+*(.rela.gnu.linkonce.r.*)} + } + .rel.sdata ${RELOCATING-0} : + { + *(.rel.sdata) + ${RELOCATING+*(.rel.sdata.*)} + ${RELOCATING+*(.rel.gnu.linkonce.s.*)} + } + .rela.sdata ${RELOCATING-0} : + { + *(.rela.sdata) + ${RELOCATING+*(.rela.sdata.*)} + ${RELOCATING+*(.rela.gnu.linkonce.s.*)} + } + .rel.sbss ${RELOCATING-0} : + { + *(.rel.sbss) + ${RELOCATING+*(.rel.sbss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} + } + .rela.sbss ${RELOCATING-0} : + { + *(.rela.sbss) + ${RELOCATING+*(.rela.sbss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} + } + .rel.bss ${RELOCATING-0} : + { + *(.rel.bss) + ${RELOCATING+*(.rel.bss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.b.*)} + } + .rela.bss ${RELOCATING-0} : + { + *(.rela.bss) + ${RELOCATING+*(.rela.bss.*)} + ${RELOCATING+*(.rela.gnu.linkonce.b.*)} + } .rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.etext ${RELOCATING-0} : { *(.rela.etest) } .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.edata ${RELOCATING-0} : { *(.rela.edata) } .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } - .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) } .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } @@ -187,16 +272,12 @@ SECTIONS .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.fini ${RELOCATING-0} : { *(.rela.fini) } - .rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.plt ${RELOCATING-0} : { *(.rela.plt) } - .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) } - .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } .rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } .rel.edata ${RELOCATING-0} : { *(.rel.edata) } - .rel.sbss ${RELOCATING-0} : { *(.rel.sbss) } .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } @@ -206,7 +287,6 @@ SECTIONS .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.fini ${RELOCATING-0} : { *(.rel.fini) } - .rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.plt ${RELOCATING-0} : { *(.rel.plt) } /* Concatenate .page0 sections. Put them in the page0 memory bank @@ -228,6 +308,7 @@ SECTIONS } ${RELOCATING+=${NOP-0}} ${RELOCATING-${INSTALL_RELOC}} + ${RELOCATING-${FINISH_RELOC}} .text ${RELOCATING-0}: { @@ -236,10 +317,12 @@ SECTIONS ${RELOCATING+*(.init)} *(.text) - *(.fini) + ${RELOCATING+*(.text.*)} /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) - *(.gnu.linkonce.t*) + ${RELOCATING+*(.gnu.linkonce.t.*)} + + ${RELOCATING+${FINISH_CODE}} ${RELOCATING+_etext = .;} ${RELOCATING+PROVIDE (etext = .);} @@ -254,7 +337,8 @@ SECTIONS .rodata ${RELOCATING-0} : { *(.rodata) - *(.gnu.linkonce.r*) + ${RELOCATING+*(.rodata.*)} + ${RELOCATING+*(.gnu.linkonce.r*)} } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata1 ${RELOCATING-0} : @@ -262,6 +346,10 @@ SECTIONS *(.rodata1) } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Constructor and destructor tables are in ROM. */ + ${RELOCATING+${CTOR}} + ${RELOCATING+${DTOR}} + /* Start of the data section image in ROM. */ ${RELOCATING+__data_image = .;} ${RELOCATING+PROVIDE (__data_image = .);} @@ -278,8 +366,9 @@ SECTIONS ${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+*(.sdata)} *(.data) + ${RELOCATING+*(.data.*)} ${RELOCATING+*(.data1)} - *(.gnu.linkonce.d*) + ${RELOCATING+*(.gnu.linkonce.d.*)} ${CONSTRUCTING+CONSTRUCTORS} ${RELOCATING+_edata = .;} @@ -308,14 +397,13 @@ SECTIONS *(.dynbss) *(.bss) + ${RELOCATING+*(.bss.*)} + ${RELOCATING+*(.gnu.linkonce.b.*)} *(COMMON) ${RELOCATING+PROVIDE (_end = .);} } ${RELOCATING+ > ${DATA_MEMORY}} ${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} - - ${RELOCATING+${CTOR}} - ${RELOCATING+${DTOR}} ${RELOCATING+${VECTORS}} diff -Nupr binutils-2.11.90.0.25/ld/scripttempl/elfm68hc12.sc binutils-2.11.90.0.27/ld/scripttempl/elfm68hc12.sc --- binutils-2.11.90.0.25/ld/scripttempl/elfm68hc12.sc Tue Sep 5 10:49:41 2000 +++ binutils-2.11.90.0.27/ld/scripttempl/elfm68hc12.sc Sat Aug 4 19:52:15 2001 @@ -26,7 +26,7 @@ test "$LD_FLAG" = "N" && DATA_ADDR=. CTOR=".ctors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __CTOR_LIST__ = .; } + ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+${CTOR_START}} *(.ctors) /* We don't want to include the .ctor section from @@ -39,19 +39,19 @@ CTOR=".ctors ${CONSTRUCTING-0} : KEEP (*(.ctors)) */ ${CONSTRUCTING+${CTOR_END}} - ${CONSTRUCTING+ __CTOR_END__ = .; } + ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } } ${RELOCATING+ > ${DATA_MEMORY}}" DTOR=" .dtors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __DTOR_LIST__ = .; } + ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } *(.dtors) /* KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) */ - ${CONSTRUCTING+ __DTOR_END__ = .; } + ${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); } } ${RELOCATING+ > ${DATA_MEMORY}}" @@ -117,6 +117,15 @@ STARTUP_CODE=" *(.install4) /* Section that calls the main. */ " +FINISH_CODE=" + /* Finish code. */ + *(.fini0) /* Beginning of finish code (_exit symbol). */ + *(.fini1) /* Place holder for applications. */ + *(.fini2) /* C++ destructors. */ + *(.fini3) /* Place holder for applications. */ + *(.fini4) /* Runtime exit. */ +" + PRE_COMPUTE_DATA_SIZE=" /* SCz: this does not work yet... This is supposed to force the loading of _map_data.o (from libgcc.a) when the .data section is not empty. @@ -137,6 +146,14 @@ INSTALL_RELOC=" .install4 0 : { *(.install4) } " +FINISH_RELOC=" + .fini0 0 : { *(.fini0) } + .fini1 0 : { *(.fini1) } + .fini2 0 : { *(.fini2) } + .fini3 0 : { *(.fini3) } + .fini4 0 : { *(.fini4) } +" + BSS_DATA_RELOC=" .data1 0 : { *(.data1) } @@ -170,15 +187,83 @@ SECTIONS .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } - .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) } - .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) } - .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rel.text ${RELOCATING-0} : + { + *(.rel.text) + ${RELOCATING+*(.rel.text.*)} + ${RELOCATING+*(.rel.gnu.linkonce.t.*)} + } + .rela.text ${RELOCATING-0} : + { + *(.rela.text) + ${RELOCATING+*(.rela.text.*)} + ${RELOCATING+*(.rela.gnu.linkonce.t.*)} + } + .rel.data ${RELOCATING-0} : + { + *(.rel.data) + ${RELOCATING+*(.rel.data.*)} + ${RELOCATING+*(.rel.gnu.linkonce.d.*)} + } + .rela.data ${RELOCATING-0} : + { + *(.rela.data) + ${RELOCATING+*(.rela.data.*)} + ${RELOCATING+*(.rela.gnu.linkonce.d.*)} + } + .rel.rodata ${RELOCATING-0} : + { + *(.rel.rodata) + ${RELOCATING+*(.rel.rodata.*)} + ${RELOCATING+*(.rel.gnu.linkonce.r.*)} + } + .rela.rodata ${RELOCATING-0} : + { + *(.rela.rodata) + ${RELOCATING+*(.rela.rodata.*)} + ${RELOCATING+*(.rela.gnu.linkonce.r.*)} + } + .rel.sdata ${RELOCATING-0} : + { + *(.rel.sdata) + ${RELOCATING+*(.rel.sdata.*)} + ${RELOCATING+*(.rel.gnu.linkonce.s.*)} + } + .rela.sdata ${RELOCATING-0} : + { + *(.rela.sdata) + ${RELOCATING+*(.rela.sdata.*)} + ${RELOCATING+*(.rela.gnu.linkonce.s.*)} + } + .rel.sbss ${RELOCATING-0} : + { + *(.rel.sbss) + ${RELOCATING+*(.rel.sbss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} + } + .rela.sbss ${RELOCATING-0} : + { + *(.rela.sbss) + ${RELOCATING+*(.rela.sbss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} + } + .rel.bss ${RELOCATING-0} : + { + *(.rel.bss) + ${RELOCATING+*(.rel.bss.*)} + ${RELOCATING+*(.rel.gnu.linkonce.b.*)} + } + .rela.bss ${RELOCATING-0} : + { + *(.rela.bss) + ${RELOCATING+*(.rela.bss.*)} + ${RELOCATING+*(.rela.gnu.linkonce.b.*)} + } .rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.etext ${RELOCATING-0} : { *(.rela.etest) } .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } .rela.edata ${RELOCATING-0} : { *(.rela.edata) } .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } - .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) } .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } @@ -187,16 +272,12 @@ SECTIONS .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } .rela.init ${RELOCATING-0} : { *(.rela.init) } .rela.fini ${RELOCATING-0} : { *(.rela.fini) } - .rela.bss ${RELOCATING-0} : { *(.rela.bss) } .rela.plt ${RELOCATING-0} : { *(.rela.plt) } - .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) } - .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } .rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } .rel.edata ${RELOCATING-0} : { *(.rel.edata) } - .rel.sbss ${RELOCATING-0} : { *(.rel.sbss) } .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } @@ -206,7 +287,6 @@ SECTIONS .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } .rel.init ${RELOCATING-0} : { *(.rel.init) } .rel.fini ${RELOCATING-0} : { *(.rel.fini) } - .rel.bss ${RELOCATING-0} : { *(.rel.bss) } .rel.plt ${RELOCATING-0} : { *(.rel.plt) } /* Concatenate .page0 sections. Put them in the page0 memory bank @@ -228,6 +308,7 @@ SECTIONS } ${RELOCATING+=${NOP-0}} ${RELOCATING-${INSTALL_RELOC}} + ${RELOCATING-${FINISH_RELOC}} .text ${RELOCATING-0}: { @@ -236,10 +317,12 @@ SECTIONS ${RELOCATING+*(.init)} *(.text) - *(.fini) + ${RELOCATING+*(.text.*)} /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) - *(.gnu.linkonce.t*) + ${RELOCATING+*(.gnu.linkonce.t.*)} + + ${RELOCATING+${FINISH_CODE}} ${RELOCATING+_etext = .;} ${RELOCATING+PROVIDE (etext = .);} @@ -254,7 +337,8 @@ SECTIONS .rodata ${RELOCATING-0} : { *(.rodata) - *(.gnu.linkonce.r*) + ${RELOCATING+*(.rodata.*)} + ${RELOCATING+*(.gnu.linkonce.r*)} } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata1 ${RELOCATING-0} : @@ -262,6 +346,10 @@ SECTIONS *(.rodata1) } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Constructor and destructor tables are in ROM. */ + ${RELOCATING+${CTOR}} + ${RELOCATING+${DTOR}} + /* Start of the data section image in ROM. */ ${RELOCATING+__data_image = .;} ${RELOCATING+PROVIDE (__data_image = .);} @@ -278,8 +366,9 @@ SECTIONS ${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+*(.sdata)} *(.data) + ${RELOCATING+*(.data.*)} ${RELOCATING+*(.data1)} - *(.gnu.linkonce.d*) + ${RELOCATING+*(.gnu.linkonce.d.*)} ${CONSTRUCTING+CONSTRUCTORS} ${RELOCATING+_edata = .;} @@ -308,14 +397,13 @@ SECTIONS *(.dynbss) *(.bss) + ${RELOCATING+*(.bss.*)} + ${RELOCATING+*(.gnu.linkonce.b.*)} *(COMMON) ${RELOCATING+PROVIDE (_end = .);} } ${RELOCATING+ > ${DATA_MEMORY}} ${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} - - ${RELOCATING+${CTOR}} - ${RELOCATING+${DTOR}} ${RELOCATING+${VECTORS}} diff -Nupr binutils-2.11.90.0.25/ld/testsuite/ChangeLog binutils-2.11.90.0.27/ld/testsuite/ChangeLog --- binutils-2.11.90.0.25/ld/testsuite/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/ld/testsuite/ChangeLog Sat Aug 4 19:52:15 2001 @@ -1,3 +1,18 @@ +2001-08-01 Loren J. Rittle + + * ld-cdtest/cdtest-nrv.dat: New file. + * ld-cdtest/cdtest.exp: Do not require any exception support + library. Check results against NRV. + +2001-08-01 Loren J. Rittle + + * ld-srec/srec.exp: Do not require any exception support + library. + +2001-07-27 H.J. Lu + + * ld-selective/selective.exp: Fix the error in the last change. + 2001-07-24 Loren J. Rittle * ld-selective/selective.exp: Support g++ V3 ABI (along side diff -Nupr binutils-2.11.90.0.25/ld/testsuite/ld-cdtest/cdtest-nrv.dat binutils-2.11.90.0.27/ld/testsuite/ld-cdtest/cdtest-nrv.dat --- binutils-2.11.90.0.25/ld/testsuite/ld-cdtest/cdtest-nrv.dat Wed Dec 31 16:00:00 1969 +++ binutils-2.11.90.0.27/ld/testsuite/ld-cdtest/cdtest-nrv.dat Sat Aug 4 19:52:15 2001 @@ -0,0 +1,13 @@ +Constructing Foo(1) "static_foo" +Constructing Foo(2) "static_foo" +Constructing Foo(3) "automatic_foo" +Constructing Foo(4) "default-foo" +Constructing Foo(5) "other_foo1" +Constructing Foo(6) "other_foo2" +Copying Foo(5) "other_foo1" to Foo(6) +Destructing Foo(6) "other_foo1" (remaining foos: 5) +Destructing Foo(5) "other_foo1" (remaining foos: 4) +Destructing Foo(4) "default-foo" (remaining foos: 3) +Destructing Foo(3) "automatic_foo" (remaining foos: 2) +Destructing Foo(2) "static_foo" (remaining foos: 1) +Destructing Foo(1) "static_foo" (remaining foos: 0) diff -Nupr binutils-2.11.90.0.25/ld/testsuite/ld-cdtest/cdtest.exp binutils-2.11.90.0.27/ld/testsuite/ld-cdtest/cdtest.exp --- binutils-2.11.90.0.25/ld/testsuite/ld-cdtest/cdtest.exp Thu Mar 15 14:57:20 2001 +++ binutils-2.11.90.0.27/ld/testsuite/ld-cdtest/cdtest.exp Sat Aug 4 19:52:15 2001 @@ -1,5 +1,5 @@ # Expect script for LD cdtest Tests -# Copyright 1993, 1994, 1995, 1997 Free Software Foundation, Inc. +# Copyright 1993, 1994, 1995, 1997, 2001 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,35 +35,55 @@ if { [which $CXX] == 0 } { return } -if { ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/cdtest-foo.cc tmpdir/cdtest-foo.o] - || ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/cdtest-bar.cc tmpdir/cdtest-bar.o] - || ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/cdtest-main.cc tmpdir/cdtest-main.o] } { +if { ![ld_compile "$CXX $CXXFLAGS -fgnu-linker -fno-exceptions" $srcdir/$subdir/cdtest-foo.cc tmpdir/cdtest-foo.o] + || ![ld_compile "$CXX $CXXFLAGS -fgnu-linker -fno-exceptions" $srcdir/$subdir/cdtest-bar.cc tmpdir/cdtest-bar.o] + || ![ld_compile "$CXX $CXXFLAGS -fgnu-linker -fno-exceptions" $srcdir/$subdir/cdtest-main.cc tmpdir/cdtest-main.o] } { unresolved $test1 unresolved $test2 return } +set expected_output "$srcdir/$subdir/cdtest.dat" + if ![ld_link $ld tmpdir/cdtest {tmpdir/cdtest-foo.o tmpdir/cdtest-bar.o tmpdir/cdtest-main.o}] { fail $test1 } else { - send_log "tmpdir/cdtest >tmpdir/cdtest.out\n" - verbose "tmpdir/cdtest >tmpdir/cdtest.out" + send_log "tmpdir/cdtest >tmpdir/cdtest.out\n" + verbose "tmpdir/cdtest >tmpdir/cdtest.out" catch "exec tmpdir/cdtest >tmpdir/cdtest.out" exec_output + if ![string match "" $exec_output] then { send_log "$exec_output\n" verbose "$exec_output" 1 + fail $test1 } else { - send_log "diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat\n" - verbose "diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat" - catch "exec diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat" exec_output + send_log "diff tmpdir/cdtest.out $expected_output\n" + verbose "diff tmpdir/cdtest.out $expected_output" + catch "exec diff tmpdir/cdtest.out $expected_output" exec_output set exec_output [prune_warnings $exec_output] + if ![string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" 1 + + send_log "Checking against Named Return Value optimization\n" + verbose "Checking against Named Return Value optimization" 1 + + set expected_output "$srcdir/$subdir/cdtest-nrv.dat" + + send_log "diff tmpdir/cdtest.out $expected_output\n" + verbose "diff tmpdir/cdtest.out $expected_output" + catch "exec diff tmpdir/cdtest.out $expected_output" exec_output + set exec_output [prune_warnings $exec_output] + } + if [string match "" $exec_output] then { pass $test1 } else { send_log "$exec_output\n" - verbose "$exec_output" 1 + verbose "$exec_output" 1 + fail $test1 } } @@ -75,24 +95,27 @@ if ![ld_relocate $ld tmpdir/cdtest.o {-U if ![ld_link $ld tmpdir/cdtest tmpdir/cdtest.o] { fail $test2 } else { - send_log "tmpdir/cdtest >tmpdir/cdtest.out\n" - verbose "tmpdir/cdtest >tmpdir/cdtest.out" + send_log "tmpdir/cdtest >tmpdir/cdtest.out\n" + verbose "tmpdir/cdtest >tmpdir/cdtest.out" catch "exec tmpdir/cdtest >tmpdir/cdtest.out" exec_output + if ![string match "" $exec_output] then { send_log "$exec_output\n" - verbose "$exec_output" 1 + verbose "$exec_output" 1 + fail $test2 } else { - send_log "diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat\n" - verbose "diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat" - catch "exec diff tmpdir/cdtest.out $srcdir/$subdir/cdtest.dat" exec_output + send_log "diff tmpdir/cdtest.out $expected_output\n" + verbose "diff tmpdir/cdtest.out $expected_output" + catch "exec diff tmpdir/cdtest.out $expected_output" exec_output set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { pass $test2 } else { send_log "$exec_output\n" - verbose "$exec_output" 1 + verbose "$exec_output" 1 + fail $test2 } } diff -Nupr binutils-2.11.90.0.25/ld/testsuite/ld-selective/selective.exp binutils-2.11.90.0.27/ld/testsuite/ld-selective/selective.exp --- binutils-2.11.90.0.25/ld/testsuite/ld-selective/selective.exp Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/ld/testsuite/ld-selective/selective.exp Sat Aug 4 19:52:15 2001 @@ -41,8 +41,8 @@ set seltests { {selective1 C 1.c {} {} {dropme1 dropme2} {alpha*-*}} {selective2 C 2.c {} {} {foo} {alpha*-* mips*-*}} {selective3 C 2.c {-u foo} {foo} {{foo 0}} {mips*-*}} - {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {mips*-*}} - {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {mips*-*}} + {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {alpha*-* mips*-*}} + {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {alpha*-* mips*-*}} {selective6 C++ 5.cc {} {start a A::bar()} {A::foo() B::foo() dropme1() dropme2()} {*-*-*}} } diff -Nupr binutils-2.11.90.0.25/ld/testsuite/ld-srec/srec.exp binutils-2.11.90.0.27/ld/testsuite/ld-srec/srec.exp --- binutils-2.11.90.0.25/ld/testsuite/ld-srec/srec.exp Sat Jun 9 00:13:02 2001 +++ binutils-2.11.90.0.27/ld/testsuite/ld-srec/srec.exp Sat Aug 4 19:52:15 2001 @@ -387,7 +387,7 @@ if { [which $CXX] == 0 } { return } -if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] { +if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] { unresolved $test2 return } diff -Nupr binutils-2.11.90.0.25/libiberty/ChangeLog binutils-2.11.90.0.27/libiberty/ChangeLog --- binutils-2.11.90.0.25/libiberty/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/libiberty/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,29 @@ +2001-08-07 Jason Merrill + + * cp-demangle.c (demangle_special_name): "GR" -> "reference temporary + for". + +2001-08-03 Richard Henderson + + * Makefile.in (concat.o): Depend on config.h. + +2001-07-30 Andreas Jaeger + + * regex.c: Declare wcs functions only if compiling with + MBS_SUPPORT. + Don't use #elif for traditional C. + +2001-07-23 Ulrich Drepper + + * regex.c: Revamp memory allocation for WCHAR functions to + not use too much stack. + +2001-07-30 Andreas Jaeger + + * regex.c: Declare wcs functions only if compiling with + MBS_SUPPORT. + Don't use #elif for traditional C. + 2001-07-25 Daniel Jacobowitz * Makefile.in (regex.o): Add dependency on config.h. diff -Nupr binutils-2.11.90.0.25/libiberty/Makefile.in binutils-2.11.90.0.27/libiberty/Makefile.in --- binutils-2.11.90.0.25/libiberty/Makefile.in Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/libiberty/Makefile.in Sat Aug 4 19:52:15 2001 @@ -261,7 +261,7 @@ argv.o: config.h $(INCDIR)/libiberty.h basename.o: $(INCDIR)/libiberty.h choose-temp.o: config.h clock.o: config.h -concat.o: $(INCDIR)/libiberty.h +concat.o: config.h $(INCDIR)/libiberty.h cplus-dem.o: config.h $(INCDIR)/demangle.h cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h dyn-string.o: config.h $(INCDIR)/dyn-string.h diff -Nupr binutils-2.11.90.0.25/libiberty/concat.c binutils-2.11.90.0.27/libiberty/concat.c --- binutils-2.11.90.0.25/libiberty/concat.c Tue Jun 19 11:57:59 2001 +++ binutils-2.11.90.0.27/libiberty/concat.c Sat Aug 4 19:52:15 2001 @@ -53,6 +53,9 @@ NOTES */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "ansidecl.h" #include "libiberty.h" #include /* size_t */ diff -Nupr binutils-2.11.90.0.25/libiberty/cp-demangle.c binutils-2.11.90.0.27/libiberty/cp-demangle.c --- binutils-2.11.90.0.25/libiberty/cp-demangle.c Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/libiberty/cp-demangle.c Fri Aug 10 14:08:01 2001 @@ -1842,11 +1842,27 @@ demangle_special_name (dm) if (peek == 'G') { - /* A guard variable name. Consume the G. */ + /* Consume the G. */ advance_char (dm); - RETURN_IF_ERROR (demangle_char (dm, 'V')); - RETURN_IF_ERROR (result_add (dm, "guard variable for ")); - RETURN_IF_ERROR (demangle_name (dm, &unused)); + switch (peek_char (dm)) + { + case 'V': + /* A guard variable name. */ + advance_char (dm); + RETURN_IF_ERROR (result_add (dm, "guard variable for ")); + RETURN_IF_ERROR (demangle_name (dm, &unused)); + break; + + case 'R': + /* A reference temporary. */ + advance_char (dm); + RETURN_IF_ERROR (result_add (dm, "reference temporary for ")); + RETURN_IF_ERROR (demangle_name (dm, &unused)); + break; + + default: + return "Unrecognized ."; + } } else if (peek == 'T') { diff -Nupr binutils-2.11.90.0.25/libiberty/regex.c binutils-2.11.90.0.27/libiberty/regex.c --- binutils-2.11.90.0.25/libiberty/regex.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/libiberty/regex.c Sat Aug 4 19:52:15 2001 @@ -410,9 +410,6 @@ typedef char boolean; static reg_errcode_t byte_regex_compile _RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)); -static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size, - reg_syntax_t syntax, - struct re_pattern_buffer *bufp)); static int byte_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, const char *string1, int size1, @@ -420,6 +417,19 @@ static int byte_re_match_2_internal PARA int pos, struct re_registers *regs, int stop)); +static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, + const char *string1, int size1, + const char *string2, int size2, + int startpos, int range, + struct re_registers *regs, int stop)); +static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); + +#ifdef MBS_SUPPORT +static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size, + reg_syntax_t syntax, + struct re_pattern_buffer *bufp)); + + static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, const char *cstring1, int csize1, const char *cstring2, int csize2, @@ -429,19 +439,13 @@ static int wcs_re_match_2_internal PARAM wchar_t *string1, int size1, wchar_t *string2, int size2, int *mbs_offset1, int *mbs_offset2)); -static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, - const char *string1, int size1, - const char *string2, int size2, - int startpos, int range, - struct re_registers *regs, int stop)); static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop)); -static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); - +#endif /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A @@ -611,29 +615,31 @@ typedef enum # define PREFIX(name) byte_##name # define ARG_PREFIX(name) name # define PUT_CHAR(c) putchar (c) -#elif defined WCHAR -# define CHAR_T wchar_t -# define UCHAR_T wchar_t -# define COMPILED_BUFFER_VAR wc_buffer -# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ -# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1) -# define PREFIX(name) wcs_##name -# define ARG_PREFIX(name) c##name -/* Should we use wide stream?? */ -# define PUT_CHAR(c) printf ("%C", c); -# define TRUE 1 -# define FALSE 0 #else -# ifdef MBS_SUPPORT -# define WCHAR +# ifdef WCHAR +# define CHAR_T wchar_t +# define UCHAR_T wchar_t +# define COMPILED_BUFFER_VAR wc_buffer +# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ +# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1) +# define PREFIX(name) wcs_##name +# define ARG_PREFIX(name) c##name +/* Should we use wide stream?? */ +# define PUT_CHAR(c) printf ("%C", c); +# define TRUE 1 +# define FALSE 0 +# else +# ifdef MBS_SUPPORT +# define WCHAR +# define INSIDE_RECURSION +# include "regex.c" +# undef INSIDE_RECURSION +# endif +# define BYTE # define INSIDE_RECURSION # include "regex.c" # undef INSIDE_RECURSION # endif -# define BYTE -# define INSIDE_RECURSION -# include "regex.c" -# undef INSIDE_RECURSION #endif #ifdef INSIDE_RECURSION @@ -5076,16 +5082,35 @@ weak_alias (__re_search_2, re_search_2) #endif #ifdef WCHAR -# define FREE_WCS_BUFFERS() \ - do { \ - FREE_VAR (string1); \ - FREE_VAR (string2); \ - FREE_VAR (mbs_offset1); \ - FREE_VAR (mbs_offset2); \ +# define MAX_ALLOCA_SIZE 2000 + +# define FREE_WCS_BUFFERS() \ + do { \ + if (size1 > MAX_ALLOCA_SIZE) \ + { \ + free (wcs_string1); \ + free (mbs_offset1); \ + } \ + else \ + { \ + FREE_VAR (wcs_string1); \ + FREE_VAR (mbs_offset1); \ + } \ + if (size2 > MAX_ALLOCA_SIZE) \ + { \ + free (wcs_string2); \ + free (mbs_offset2); \ + } \ + else \ + { \ + FREE_VAR (wcs_string2); \ + FREE_VAR (mbs_offset2); \ + } \ } while (0) #endif + static int PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range, regs, stop) @@ -5160,36 +5185,72 @@ PREFIX(re_search_2) (bufp, string1, size fill them with converted string. */ if (size1 != 0) { - wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T); - mbs_offset1 = REGEX_TALLOC (size1 + 1, int); - is_binary = REGEX_TALLOC (size1 + 1, char); + if (size1 > MAX_ALLOCA_SIZE) + { + wcs_string1 = TALLOC (size1 + 1, CHAR_T); + mbs_offset1 = TALLOC (size1 + 1, int); + is_binary = TALLOC (size1 + 1, char); + } + else + { + wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T); + mbs_offset1 = REGEX_TALLOC (size1 + 1, int); + is_binary = REGEX_TALLOC (size1 + 1, char); + } if (!wcs_string1 || !mbs_offset1 || !is_binary) { - FREE_VAR (wcs_string1); - FREE_VAR (mbs_offset1); - FREE_VAR (is_binary); + if (size1 > MAX_ALLOCA_SIZE) + { + free (wcs_string1); + free (mbs_offset1); + free (is_binary); + } + else + { + FREE_VAR (wcs_string1); + FREE_VAR (mbs_offset1); + FREE_VAR (is_binary); + } return -2; } wcs_size1 = convert_mbs_to_wcs(wcs_string1, string1, size1, mbs_offset1, is_binary); wcs_string1[wcs_size1] = L'\0'; /* for a sentinel */ - FREE_VAR (is_binary); + if (size1 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); } if (size2 != 0) { - wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T); - mbs_offset2 = REGEX_TALLOC (size2 + 1, int); - is_binary = REGEX_TALLOC (size2 + 1, char); + if (size2 > MAX_ALLOCA_SIZE) + { + wcs_string2 = TALLOC (size2 + 1, CHAR_T); + mbs_offset2 = TALLOC (size2 + 1, int); + is_binary = TALLOC (size2 + 1, char); + } + else + { + wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T); + mbs_offset2 = REGEX_TALLOC (size2 + 1, int); + is_binary = REGEX_TALLOC (size2 + 1, char); + } if (!wcs_string2 || !mbs_offset2 || !is_binary) { FREE_WCS_BUFFERS (); - FREE_VAR (is_binary); + if (size2 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); return -2; } wcs_size2 = convert_mbs_to_wcs(wcs_string2, string2, size2, mbs_offset2, is_binary); wcs_string2[wcs_size2] = L'\0'; /* for a sentinel */ - FREE_VAR (is_binary); + if (size2 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); } #endif /* WCHAR */ diff -Nupr binutils-2.11.90.0.25/mips/ChangeLog binutils-2.11.90.0.27/mips/ChangeLog --- binutils-2.11.90.0.25/mips/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/mips/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,20 @@ +2001-08-10 H.J. Lu + + * binutils-mips64.patch: Updated. + +2001-08-04 H.J. Lu + + * binutils-mips64.patch: Updated. + +2001-08-02 H.J. Lu + + * README: Don't apply gas-mips-dwarf2.patch. + +2001-08-02 H.J. Lu + + * gas-mips-dwarf2.patch: Remove the dwarf2_directive_file + change. It is incompatible with ECOFF. + 2001-07-26 H.J. Lu * gas-mips-dwarf2.patch: New. A dwarf2 patch. diff -Nupr binutils-2.11.90.0.25/mips/README binutils-2.11.90.0.27/mips/README --- binutils-2.11.90.0.25/mips/README Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/mips/README Sat Aug 4 19:52:15 2001 @@ -17,7 +17,6 @@ dir=`dirname $0` #patch -p1 -b --suffix .reloc < $dir/binutils-mips-reloc.patch patch -p1 -b --suffix .mips64 < $dir/binutils-mips64.patch && \ -patch -p0 -b --suffix .mips < $dir/gas-mips.patch && \ -patch -p0 -b --suffix .dwarf2 < $dir/gas-mips-dwarf2.patch +patch -p0 -b --suffix .mips < $dir/gas-mips.patch find -name "*.rej" | grep rej && exit 1 find -name "*.orig" | xargs rm -fv diff -Nupr binutils-2.11.90.0.25/mips/binutils-mips64.patch binutils-2.11.90.0.27/mips/binutils-mips64.patch --- binutils-2.11.90.0.25/mips/binutils-mips64.patch Fri Jul 6 09:26:11 2001 +++ binutils-2.11.90.0.27/mips/binutils-mips64.patch Fri Aug 10 14:08:01 2001 @@ -1,6 +1,6 @@ ---- binutils/bfd/config.bfd.mips64 Thu Jun 7 23:36:17 2001 -+++ binutils/bfd/config.bfd Fri Jul 6 09:11:42 2001 -@@ -673,6 +673,16 @@ case "${targ}" in +--- binutils/bfd/config.bfd.mips64 Fri Aug 3 08:47:34 2001 ++++ binutils/bfd/config.bfd Fri Aug 10 10:07:12 2001 +@@ -674,6 +674,16 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; @@ -18,7 +18,7 @@ targ_defvec=bfd_elf32_tradlittlemips_vec targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" --- binutils/bfd/elf32-mips.c.mips64 Wed Jul 4 10:21:18 2001 -+++ binutils/bfd/elf32-mips.c Fri Jul 6 09:11:42 2001 ++++ binutils/bfd/elf32-mips.c Fri Aug 10 10:07:12 2001 @@ -1980,7 +1980,9 @@ static CONST struct elf_reloc_map mips_r { BFD_RELOC_MIPS_SUB, R_MIPS_SUB }, { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE }, @@ -40,7 +40,7 @@ BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); --- binutils/bfd/elf64-mips.c.mips64 Thu May 3 09:27:24 2001 -+++ binutils/bfd/elf64-mips.c Fri Jul 6 09:11:42 2001 ++++ binutils/bfd/elf64-mips.c Fri Aug 10 10:07:12 2001 @@ -1276,11 +1276,11 @@ mips_elf64_be_swap_reloc_in (abfd, src, &mirel); @@ -131,7 +131,7 @@ #include "elf64-target.h" --- binutils/configure.in.mips64 Thu May 24 23:17:50 2001 -+++ binutils/configure.in Fri Jul 6 09:11:42 2001 ++++ binutils/configure.in Fri Aug 10 10:07:12 2001 @@ -854,13 +854,12 @@ case "${target}" in noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss" ;; @@ -147,8 +147,8 @@ ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi" ---- binutils/gas/config/tc-mips.c.mips64 Wed Jul 4 10:21:40 2001 -+++ binutils/gas/config/tc-mips.c Fri Jul 6 09:11:42 2001 +--- binutils/gas/config/tc-mips.c.mips64 Fri Aug 10 09:55:06 2001 ++++ binutils/gas/config/tc-mips.c Fri Aug 10 10:11:07 2001 @@ -109,6 +109,10 @@ extern int target_big_endian; 64 bit [e.g. --target=mips64-elf]. */ static int mips_64; @@ -160,7 +160,17 @@ /* The default target format to use. */ const char * -@@ -427,11 +431,38 @@ static struct frag *prev_insn_frag; +@@ -274,6 +278,9 @@ static int mips_32bit_abi = 0; + (HAVE_32BIT_GPRS \ + || bfd_arch_bits_per_address (stdoutput) == 32) + ++#define HAVE_32BIT_LOAD_ADDRESSES \ ++ (HAVE_32BIT_ADDRESSES || mips_abi2) ++ + /* Whether the processor uses hardware interlocks to protect + reads from the HI and LO registers, and thus does not + require nops to be inserted. */ +@@ -450,11 +457,38 @@ static struct frag *prev_insn_frag; /* The offset into prev_insn_frag for the previous instruction. */ static long prev_insn_where; @@ -201,7 +211,7 @@ /* Non-zero if the previous instruction was in a delay slot. */ static int prev_insn_is_delay_slot; -@@ -641,7 +672,7 @@ static void mips16_mark_labels PARAMS (( +@@ -664,7 +698,7 @@ static void mips16_mark_labels PARAMS (( static void append_insn PARAMS ((char *place, struct mips_cl_insn * ip, expressionS * p, @@ -210,7 +220,7 @@ boolean)); static void mips_no_prev_insn PARAMS ((int)); static void mips_emit_delays PARAMS ((boolean)); -@@ -672,8 +703,10 @@ static void mips16_ip PARAMS ((char *str +@@ -696,8 +730,10 @@ static void mips16_ip PARAMS ((char *str static void mips16_immed PARAMS ((char *, unsigned int, int, offsetT, boolean, boolean, boolean, unsigned long *, boolean *, unsigned short *)); @@ -222,7 +232,7 @@ static symbolS *get_symbol PARAMS ((void)); static void mips_align PARAMS ((int to, int fill, symbolS *label)); static void s_align PARAMS ((int)); -@@ -850,12 +883,15 @@ static expressionS offset_expr; +@@ -874,12 +910,15 @@ static expressionS offset_expr; /* Relocs associated with imm_expr and offset_expr. */ @@ -241,7 +251,7 @@ /* These are set by mips16_ip if an explicit extension is used. */ -@@ -1149,7 +1185,7 @@ md_begin () +@@ -1187,7 +1226,7 @@ md_begin () if (strcmp (TARGET_OS, "elf") != 0) flags |= SEC_ALLOC | SEC_LOAD; @@ -250,7 +260,7 @@ { sec = subseg_new (".reginfo", (subsegT) 0); -@@ -1225,10 +1261,13 @@ md_assemble (str) +@@ -1263,10 +1302,13 @@ md_assemble (str) struct mips_cl_insn insn; imm_expr.X_op = O_absent; @@ -266,7 +276,7 @@ if (mips_opts.mips16) mips16_ip (str, &insn); -@@ -1255,12 +1294,13 @@ md_assemble (str) +@@ -1293,12 +1335,13 @@ md_assemble (str) else { if (imm_expr.X_op != O_absent) @@ -283,7 +293,7 @@ } } -@@ -1412,12 +1452,12 @@ append_insn (place, ip, address_expr, re +@@ -1450,12 +1493,12 @@ append_insn (place, ip, address_expr, re char *place; struct mips_cl_insn *ip; expressionS *address_expr; @@ -298,7 +308,7 @@ int nops = 0; /* Mark instruction labels in mips16 mode. */ -@@ -1763,16 +1803,16 @@ append_insn (place, ip, address_expr, re +@@ -1801,16 +1844,16 @@ append_insn (place, ip, address_expr, re } } @@ -318,7 +328,7 @@ == BFD_RELOC_MIPS16_JMP)), make_expr_symbol (address_expr), (offsetT) 0, (char *) NULL); -@@ -1781,7 +1821,7 @@ append_insn (place, ip, address_expr, re +@@ -1819,7 +1862,7 @@ append_insn (place, ip, address_expr, re f = place; else if (mips_opts.mips16 && ! ip->use_extend @@ -327,7 +337,7 @@ { /* Make sure there is enough room to swap this instruction with a following jump instruction. */ -@@ -1798,12 +1838,13 @@ append_insn (place, ip, address_expr, re +@@ -1836,12 +1879,13 @@ append_insn (place, ip, address_expr, re f = frag_more (4); } @@ -344,7 +354,7 @@ { case BFD_RELOC_32: ip->insn_opcode |= address_expr->X_add_number; -@@ -1840,33 +1881,52 @@ append_insn (place, ip, address_expr, re +@@ -1878,33 +1922,52 @@ append_insn (place, ip, address_expr, re else { need_reloc: @@ -406,7 +416,7 @@ { md_number_to_chars (f, ip->insn_opcode >> 16, 2); md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2); -@@ -2150,7 +2210,7 @@ append_insn (place, ip, address_expr, re +@@ -2188,7 +2251,7 @@ append_insn (place, ip, address_expr, re /* If the previous instruction had a fixup in mips16 mode, we can not swap. This normally means that the previous instruction was a 4 byte branch anyhow. */ @@ -415,7 +425,7 @@ /* If the previous instruction is a sync, sync.l, or sync.p, we can not swap. */ || (prev_pinfo & INSN_SYNC)) -@@ -2176,15 +2236,36 @@ append_insn (place, ip, address_expr, re +@@ -2214,15 +2277,36 @@ append_insn (place, ip, address_expr, re memcpy (temp, prev_f, 4); memcpy (prev_f, f, 4); memcpy (f, temp, 4); @@ -458,7 +468,7 @@ } } else -@@ -2192,13 +2273,13 @@ append_insn (place, ip, address_expr, re +@@ -2230,13 +2314,13 @@ append_insn (place, ip, address_expr, re char *prev_f; char temp[2]; @@ -475,7 +485,7 @@ memcpy (f, temp, 2); } else -@@ -2206,10 +2287,18 @@ append_insn (place, ip, address_expr, re +@@ -2244,10 +2328,18 @@ append_insn (place, ip, address_expr, re memcpy (f, f + 2, 2); memcpy (f + 2, temp, 2); } @@ -497,7 +507,7 @@ } } -@@ -2227,8 +2316,10 @@ append_insn (place, ip, address_expr, re +@@ -2265,8 +2357,10 @@ append_insn (place, ip, address_expr, re prev_insn.insn_mo = &dummy_opcode; } @@ -510,7 +520,7 @@ prev_insn_extended = 0; } else if (pinfo & INSN_COND_BRANCH_LIKELY) -@@ -2241,8 +2332,10 @@ append_insn (place, ip, address_expr, re +@@ -2279,8 +2373,10 @@ append_insn (place, ip, address_expr, re /* Update the previous insn information. */ prev_prev_insn = *ip; prev_insn.insn_mo = &dummy_opcode; @@ -523,7 +533,7 @@ prev_insn_extended = 0; } else -@@ -2259,11 +2352,11 @@ append_insn (place, ip, address_expr, re +@@ -2297,11 +2393,11 @@ append_insn (place, ip, address_expr, re is not in a delay slot. */ prev_insn_is_delay_slot = 0; @@ -538,7 +548,7 @@ } prev_prev_insn_unreordered = prev_insn_unreordered; -@@ -2279,7 +2372,7 @@ append_insn (place, ip, address_expr, re +@@ -2317,7 +2413,7 @@ append_insn (place, ip, address_expr, re PC relative relocs. */ prev_prev_insn = prev_insn; prev_insn = *ip; @@ -547,7 +557,7 @@ prev_prev_insn_unreordered = prev_insn_unreordered; prev_insn_unreordered = 1; } -@@ -2319,7 +2412,8 @@ mips_no_prev_insn (preserve) +@@ -2357,7 +2453,8 @@ mips_no_prev_insn (preserve) prev_insn_is_delay_slot = 0; prev_insn_unreordered = 0; prev_insn_extended = 0; @@ -557,7 +567,7 @@ prev_prev_insn_unreordered = 0; mips_clear_insn_labels (); } -@@ -2459,6 +2553,7 @@ macro_build (place, counter, ep, name, f +@@ -2497,6 +2594,7 @@ macro_build (place, counter, ep, name, f #endif { struct mips_cl_insn insn; @@ -565,7 +575,7 @@ bfd_reloc_code_real_type r; va_list args; -@@ -2586,6 +2681,8 @@ macro_build (place, counter, ep, name, f +@@ -2626,6 +2724,8 @@ macro_build (place, counter, ep, name, f r = (bfd_reloc_code_real_type) va_arg (args, int); assert (r == BFD_RELOC_MIPS_GPREL || r == BFD_RELOC_MIPS_LITERAL @@ -574,7 +584,7 @@ || r == BFD_RELOC_LO16 || r == BFD_RELOC_MIPS_GOT16 || r == BFD_RELOC_MIPS_CALL16 -@@ -2602,6 +2699,7 @@ macro_build (place, counter, ep, name, f +@@ -2642,6 +2742,7 @@ macro_build (place, counter, ep, name, f || (ep->X_op == O_symbol && (r == BFD_RELOC_HI16_S || r == BFD_RELOC_HI16 @@ -582,7 +592,7 @@ || r == BFD_RELOC_MIPS_GOT_HI16 || r == BFD_RELOC_MIPS_CALL_HI16)) || (ep->X_op == O_subtract -@@ -2649,7 +2747,10 @@ macro_build (place, counter, ep, name, f +@@ -2689,7 +2790,10 @@ macro_build (place, counter, ep, name, f va_end (args); assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL); @@ -594,7 +604,7 @@ } static void -@@ -2662,6 +2763,7 @@ mips16_macro_build (place, counter, ep, +@@ -2702,6 +2806,7 @@ mips16_macro_build (place, counter, ep, va_list args; { struct mips_cl_insn insn; @@ -602,7 +612,7 @@ bfd_reloc_code_real_type r; r = BFD_RELOC_UNUSED; -@@ -2775,7 +2877,10 @@ mips16_macro_build (place, counter, ep, +@@ -2815,7 +2920,10 @@ mips16_macro_build (place, counter, ep, assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL); @@ -614,7 +624,7 @@ } /* -@@ -2790,6 +2895,7 @@ macro_build_lui (place, counter, ep, reg +@@ -2830,6 +2938,7 @@ macro_build_lui (place, counter, ep, reg { expressionS high_expr; struct mips_cl_insn insn; @@ -622,7 +632,7 @@ bfd_reloc_code_real_type r; CONST char *name = "lui"; CONST char *fmt = "t,u"; -@@ -2838,14 +2944,17 @@ macro_build_lui (place, counter, ep, reg +@@ -2878,14 +2987,17 @@ macro_build_lui (place, counter, ep, reg assert (strcmp (name, insn.insn_mo->name) == 0); assert (strcmp (fmt, insn.insn_mo->args) == 0); @@ -642,46 +652,34 @@ } /* set_at() -@@ -3303,7 +3412,8 @@ load_address (counter, reg, ep) +@@ -3338,7 +3450,7 @@ load_address (counter, reg, ep) + ep->X_add_number = 0; frag_grow (20); macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, counter, (expressionS *) NULL, "nop", ""); -@@ -3358,7 +3468,8 @@ load_address (counter, reg, ep) + p = frag_var (rs_machine_dependent, 4, 0, +@@ -3385,7 +3497,7 @@ load_address (counter, reg, ep) + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", reg, reg, GP); macro_build ((char *) NULL, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT_LO16, reg); p = frag_var (rs_machine_dependent, 12 + off, 0, -@@ -3376,7 +3487,8 @@ load_address (counter, reg, ep) + RELAX_ENCODE (12, 12 + off, off, 8 + off, 0, +@@ -3400,7 +3512,7 @@ load_address (counter, reg, ep) + macro_build (p, counter, (expressionS *) NULL, "nop", ""); + p += 4; } - macro_build (p, counter, ep, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- macro_build (p, counter, ep, HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ macro_build (p, counter, ep, HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP); p += 4; -@@ -4214,7 +4326,7 @@ macro (ip) - frag_grow (20); - macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) - ? "addiu" : "daddiu"), - "t,r,j", tempreg, GP, (int) BFD_RELOC_MIPS_GPREL); - p = frag_var (rs_machine_dependent, 8, 0, -@@ -4223,14 +4335,49 @@ macro (ip) + macro_build (p, counter, (expressionS *) NULL, "nop", ""); +@@ -4213,12 +4325,48 @@ macro (ip) offset_expr.X_add_symbol, (offsetT) 0, (char *) NULL); } @@ -689,24 +687,21 @@ - if (p != NULL) - p += 4; - macro_build (p, &icnt, &offset_expr, -- ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -- ? "addiu" : "daddiu"), +- HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", - "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); + + if (bfd_arch_bits_per_address (stdoutput) == 32 ++ || ! mips_64 + || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + { -+ if (dbl) ++ if (dbl && ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + as_warn (_("Instruction dla used in 32-bit mode")); + + macro_build_lui (p, &icnt, &offset_expr, tempreg); + if (p != NULL) + p += 4; + macro_build (p, &icnt, &offset_expr, -+ ((bfd_arch_bits_per_address (stdoutput) == 32 -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ ? "addiu" : "daddiu"), ++ HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu", + "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16); + } + else @@ -739,7 +734,7 @@ } else if (mips_pic == SVR4_PIC && ! mips_big_got) { -@@ -4664,7 +4811,9 @@ macro (ip) +@@ -4620,7 +4768,9 @@ macro (ip) macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "jalr", "d,s", dreg, sreg); @@ -750,37 +745,34 @@ as_warn (_("No .cprestore pseudo-op used in PIC code")); else { -@@ -4714,7 +4863,8 @@ macro (ip) +@@ -4667,7 +4817,7 @@ macro (ip) + if (! mips_big_got) { macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL16, GP); -@@ -4742,7 +4892,8 @@ macro (ip) + macro_build ((char *) NULL, &icnt, (expressionS *) NULL, +@@ -4691,7 +4841,7 @@ macro (ip) + HAVE_32BIT_ADDRESSES ? "addu" : "daddu", "d,v,t", PIC_CALL_REG, PIC_CALL_REG, GP); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL_LO16, PIC_CALL_REG); -@@ -4760,7 +4911,8 @@ macro (ip) + macro_build ((char *) NULL, &icnt, (expressionS *) NULL, +@@ -4707,7 +4857,7 @@ macro (ip) + p += 4; } macro_build (p, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", PIC_CALL_REG, (int) BFD_RELOC_MIPS_GOT16, GP); -@@ -5027,11 +5179,40 @@ macro (ip) + p += 4; +@@ -4969,11 +5119,41 @@ macro (ip) (char *) NULL); used_at = 0; } @@ -792,6 +784,7 @@ + + + if (bfd_arch_bits_per_address (stdoutput) == 32 ++ || ! mips_64 + || ! ISA_HAS_64BIT_REGS (mips_opts.isa) + || offset_expr.X_op == O_constant) + { @@ -826,17 +819,16 @@ } else { -@@ -5093,7 +5274,8 @@ macro (ip) +@@ -5030,7 +5210,7 @@ macro (ip) + as_bad (_("PIC code offset overflow (max 16 signed bits)")); frag_grow (20); macro_build ((char *) NULL, &icnt, &offset_expr, - ((bfd_arch_bits_per_address (stdoutput) == 32 -- || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) -+ || ! ISA_HAS_64BIT_REGS (mips_opts.isa) -+ || mips_abi2) - ? "lw" : "ld"), +- HAVE_32BIT_ADDRESSES ? "lw" : "ld", ++ HAVE_32BIT_LOAD_ADDRESSES ? "lw" : "ld", "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP); macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", ""); -@@ -7126,7 +7308,7 @@ mips_ip (str, ip) + p = frag_var (rs_machine_dependent, 4, 0, +@@ -7004,7 +7184,7 @@ mips_ip (str, ip) insn_error = NULL; for (args = insn->args;; ++args) { @@ -845,7 +837,7 @@ ++s; switch (*args) { -@@ -7759,29 +7941,32 @@ mips_ip (str, ip) +@@ -7653,29 +7833,32 @@ mips_ip (str, ip) case 'i': /* 16 bit unsigned immediate */ case 'j': /* 16 bit signed immediate */ @@ -894,7 +886,7 @@ || ((imm_expr.X_add_number < 0 || imm_expr.X_add_number >= 0x10000) && imm_expr.X_op == O_constant)) -@@ -7814,7 +7999,8 @@ mips_ip (str, ip) +@@ -7708,7 +7891,8 @@ mips_ip (str, ip) max = 0x8000; else max = 0x10000; @@ -904,7 +896,7 @@ || ((imm_expr.X_add_number < -0x8000 || imm_expr.X_add_number >= max) && imm_expr.X_op == O_constant) -@@ -7831,11 +8017,14 @@ mips_ip (str, ip) +@@ -7725,11 +7909,14 @@ mips_ip (str, ip) as_bad (_("16 bit expression not in range -32768..32767")); } } @@ -920,7 +912,7 @@ /* If this value won't fit into a 16 bit offset, then go find a macro that will generate the 32 bit offset -@@ -7848,7 +8037,7 @@ mips_ip (str, ip) +@@ -7742,7 +7929,7 @@ mips_ip (str, ip) fashion is that the macro function doesn't expect to see anything which can be handled in a single constant instruction. */ @@ -929,7 +921,7 @@ && (offset_expr.X_op != O_constant || offset_expr.X_add_number >= 0x8000 || offset_expr.X_add_number < -0x8000) -@@ -7858,14 +8047,28 @@ mips_ip (str, ip) +@@ -7752,14 +7939,28 @@ mips_ip (str, ip) != S_GET_SEGMENT (offset_expr.X_op_symbol)))) break; @@ -964,7 +956,7 @@ s = expr_end; continue; -@@ -7876,30 +8079,36 @@ mips_ip (str, ip) +@@ -7770,30 +7971,36 @@ mips_ip (str, ip) continue; case 'u': /* upper 16 bits */ @@ -1016,7 +1008,7 @@ s = expr_end; continue; -@@ -8332,7 +8541,7 @@ mips16_ip (str, ip) +@@ -8226,7 +8433,7 @@ mips16_ip (str, ip) explicit extensions correctly. */ imm_expr.X_op = O_constant; imm_expr.X_add_number = 0; @@ -1025,7 +1017,7 @@ continue; } -@@ -8340,7 +8549,7 @@ mips16_ip (str, ip) +@@ -8234,7 +8441,7 @@ mips16_ip (str, ip) } /* We need to relax this instruction. */ @@ -1034,7 +1026,7 @@ s = expr_end; continue; -@@ -8687,94 +8896,35 @@ mips16_immed (file, line, type, val, war +@@ -8581,94 +8788,35 @@ mips16_immed (file, line, type, val, war } } @@ -1148,7 +1140,7 @@ } static void -@@ -8950,13 +9100,15 @@ struct option md_longopts[] = +@@ -8846,13 +8994,15 @@ struct option md_longopts[] = #define OPTION_CALL_SHARED (OPTION_ELF_BASE + 0) #define OPTION_NON_SHARED (OPTION_ELF_BASE + 1) #define OPTION_XGOT (OPTION_ELF_BASE + 2) @@ -1166,7 +1158,7 @@ {"64", no_argument, NULL, OPTION_64}, #endif -@@ -9202,6 +9354,10 @@ md_parse_option (c, arg) +@@ -9123,6 +9273,10 @@ md_parse_option (c, arg) mips_64 = 0; break; @@ -1177,7 +1169,7 @@ case OPTION_64: { const char **list, **l; -@@ -9217,6 +9373,7 @@ md_parse_option (c, arg) +@@ -9138,6 +9292,7 @@ md_parse_option (c, arg) as_fatal (_("No compiled in support for 64 bit object file format")); free (list); mips_64 = 1; @@ -1185,7 +1177,7 @@ } break; #endif /* OBJ_ELF */ -@@ -9381,7 +9538,8 @@ MIPS options:\n\ +@@ -9311,7 +9466,8 @@ MIPS options:\n\ -non_shared do not generate position independent code\n\ -xgot assume a 32 bit GOT\n\ -32 create 32 bit object file (default)\n\ @@ -1195,7 +1187,7 @@ #endif } -@@ -9557,7 +9715,10 @@ mips_frob_file () +@@ -9487,7 +9643,10 @@ mips_frob_file () /* When generating embedded PIC code we must keep all PC relative relocations, in case the linker has to relax a call. We also need @@ -1207,7 +1199,7 @@ int mips_force_relocation (fixp) -@@ -9567,6 +9728,10 @@ mips_force_relocation (fixp) +@@ -9497,6 +9656,10 @@ mips_force_relocation (fixp) || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 1; @@ -1218,7 +1210,7 @@ return (mips_pic == EMBEDDED_PIC && (fixp->fx_pcrel || SWITCH_TABLE (fixp) -@@ -9686,6 +9851,8 @@ md_apply_fix (fixP, valueP) +@@ -9618,6 +9781,8 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_MIPS_JMP: case BFD_RELOC_HI16: case BFD_RELOC_HI16_S: @@ -1227,7 +1219,7 @@ case BFD_RELOC_MIPS_GPREL: case BFD_RELOC_MIPS_LITERAL: case BFD_RELOC_MIPS_CALL16: -@@ -9695,6 +9862,7 @@ md_apply_fix (fixP, valueP) +@@ -9627,6 +9792,7 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_MIPS_GOT_LO16: case BFD_RELOC_MIPS_CALL_HI16: case BFD_RELOC_MIPS_CALL_LO16: @@ -1235,7 +1227,7 @@ case BFD_RELOC_MIPS16_GPREL: if (fixP->fx_pcrel) as_bad_where (fixP->fx_file, fixP->fx_line, -@@ -10491,8 +10659,9 @@ s_cpload (ignore) +@@ -10423,8 +10589,9 @@ s_cpload (ignore) expressionS ex; int icnt = 0; @@ -1247,7 +1239,7 @@ { s_ignore (0); return; -@@ -10531,8 +10700,9 @@ s_cprestore (ignore) +@@ -10463,8 +10630,9 @@ s_cprestore (ignore) expressionS ex; int icnt = 0; @@ -1259,7 +1251,7 @@ { s_ignore (0); return; -@@ -10787,7 +10957,7 @@ nopic_need_relax (sym, before_relaxing) +@@ -10715,7 +10883,7 @@ nopic_need_relax (sym, before_relaxing) if (sym == 0) return 0; @@ -1268,7 +1260,7 @@ { const char *symname; int change; -@@ -11190,6 +11360,8 @@ tc_gen_reloc (section, fixp) +@@ -11120,6 +11288,8 @@ tc_gen_reloc (section, fixp) asection *section ATTRIBUTE_UNUSED; fixS *fixp; { @@ -1277,7 +1269,7 @@ static arelent *retval[4]; arelent *reloc; bfd_reloc_code_real_type code; -@@ -11197,8 +11369,21 @@ tc_gen_reloc (section, fixp) +@@ -11127,8 +11297,21 @@ tc_gen_reloc (section, fixp) reloc = retval[0] = (arelent *) xmalloc (sizeof (arelent)); retval[1] = NULL; @@ -1299,7 +1291,7 @@ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; if (mips_pic == EMBEDDED_PIC -@@ -11257,7 +11442,8 @@ tc_gen_reloc (section, fixp) +@@ -11187,7 +11370,8 @@ tc_gen_reloc (section, fixp) || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_HI16 || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_LO16 || fixp->fx_r_type == BFD_RELOC_MIPS_CALL_HI16 @@ -1309,7 +1301,7 @@ { arelent *reloc2; -@@ -11540,6 +11726,188 @@ md_convert_frag (abfd, asec, fragp) +@@ -11470,6 +11654,188 @@ md_convert_frag (abfd, asec, fragp) } } @@ -1498,7 +1490,7 @@ #ifdef OBJ_ELF /* This function is called after the relocs have been generated. -@@ -11648,6 +12016,8 @@ mips_elf_final_processing () +@@ -11578,6 +11944,8 @@ mips_elf_final_processing () ; else if (strcmp (mips_abi_string, "32") == 0) elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32; @@ -1507,7 +1499,7 @@ else if (strcmp (mips_abi_string, "o64") == 0) elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O64; else if (strcmp (mips_abi_string, "eabi") == 0) -@@ -11657,6 +12027,11 @@ mips_elf_final_processing () +@@ -11587,6 +11955,11 @@ mips_elf_final_processing () else elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32; } @@ -1519,9 +1511,9 @@ if (mips_32bitmode) elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE; ---- binutils/ld/configure.tgt.mips64 Fri Jun 29 11:18:31 2001 -+++ binutils/ld/configure.tgt Fri Jul 6 09:11:42 2001 -@@ -281,6 +281,12 @@ mips*el-*-rtems*) targ_emul=elf32elmip ; +--- binutils/ld/configure.tgt.mips64 Sat Jul 14 10:19:28 2001 ++++ binutils/ld/configure.tgt Fri Aug 10 10:07:12 2001 +@@ -286,6 +286,12 @@ mips*el-*-rtems*) targ_emul=elf32elmip ; mips*-*-rtems*) targ_emul=elf32ebmip ;; mips*el-*-vxworks*) targ_emul=elf32elmip ;; mips*-*-vxworks*) targ_emul=elf32ebmip ;; diff -Nupr binutils-2.11.90.0.25/mips/gas-mips-dwarf2.patch binutils-2.11.90.0.27/mips/gas-mips-dwarf2.patch --- binutils-2.11.90.0.25/mips/gas-mips-dwarf2.patch Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/mips/gas-mips-dwarf2.patch Sat Aug 4 19:52:15 2001 @@ -1,17 +1,16 @@ -2001-07-20 H.J. Lu +2001-08-02 H.J. Lu * config/tc-mips.c: Include "dwarf2dbg.h" for ELF. - (s_file): Don't define for ELF. - (mips_nonecoff_pseudo_table): Use dwarf2_directive_file on - "file" and dwarf2_directive_loc on "loc" for ELF. + (mips_nonecoff_pseudo_table): Use dwarf2_directive_loc on + "loc" for ELF. -Index: config/tc-mips.c +Index: gas/config/tc-mips.c =================================================================== RCS file: /work/cvs/gnu/binutils/gas/config/tc-mips.c,v -retrieving revision 1.1.1.40 -diff -u -p -r1.1.1.40 tc-mips.c ---- gas/config/tc-mips.c 2001/07/23 22:08:29 1.1.1.40 -+++ gas/config/tc-mips.c 2001/07/23 22:31:45 +retrieving revision 1.46 +diff -u -p -r1.46 tc-mips.c +--- gas/config/tc-mips.c 2001/07/26 16:59:13 1.46 ++++ gas/config/tc-mips.c 2001/08/03 05:01:22 @@ -80,6 +80,7 @@ static int mips_output_flavor () { retur #include "ecoff.h" @@ -20,25 +19,8 @@ diff -u -p -r1.1.1.40 tc-mips.c static char *mips_regmask_frag; #endif -@@ -698,7 +699,9 @@ static void s_mips_frame PARAMS ((int)); - static void s_mips_mask PARAMS ((int)); - static void s_mips_stab PARAMS ((int)); - static void s_mips_weakext PARAMS ((int)); -+#if !defined (OBJ_ELF) && !defined (OBJ_MAYBE_ELF) - static void s_file PARAMS ((int)); -+#endif - static int mips16_extended_frag PARAMS ((fragS *, asection *, long)); - static const char *mips_isa_to_str PARAMS ((int)); - static const char *mips_cpu_to_str PARAMS ((int)); -@@ -797,10 +800,18 @@ static const pseudo_typeS mips_nonecoff_ - {"end", s_mips_end, 0}, - {"endb", s_ignore, 0}, - {"ent", s_mips_ent, 0}, -+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -+ {"file", dwarf2_directive_file, 0}, -+#else +@@ -800,7 +801,11 @@ static const pseudo_typeS mips_nonecoff_ {"file", s_file, 0}, -+#endif {"fmask", s_mips_mask, 'F'}, {"frame", s_mips_frame, 0}, +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) @@ -49,19 +31,3 @@ diff -u -p -r1.1.1.40 tc-mips.c {"mask", s_mips_mask, 'R'}, {"verstamp", s_ignore, 0}, { NULL, NULL, 0 }, -@@ -11776,6 +11787,7 @@ get_number () - return negative ? -val : val; - } - -+#if !defined (OBJ_ELF) && !defined (OBJ_MAYBE_ELF) - /* The .file directive; just like the usual .file directive, but there - is an initial number which is the ECOFF file index. */ - -@@ -11788,6 +11800,7 @@ s_file (x) - line = get_number (); - s_app_file (0); - } -+#endif - - /* The .end directive. */ - diff -Nupr binutils-2.11.90.0.25/opcodes/ChangeLog binutils-2.11.90.0.27/opcodes/ChangeLog --- binutils-2.11.90.0.25/opcodes/ChangeLog Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/opcodes/ChangeLog Fri Aug 10 14:08:01 2001 @@ -1,3 +1,58 @@ +2001-08-10 Richard Sandiford + + * mips-dis.c (print_insn_mips): Remove OPCODE_IS_MEMBER's gp32 + argument. + * mips-opc.c (G6): Undefine. + (mips_builtin_opcodes): Remove gp32 entry for "move". Add macro + as the first "move" alternative. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * ppc-opc.c: Revert 2001-08-08. + +2001-08-09 Alan Modra + + * dis-buf.c (generic_strcat_address): Add missing prototype. + #if 0 the functions as it is unused. + +2001-08-08 Alan Modra + + 1999-10-25 Torbjorn Granlund + * ppc-opc.c: Include "bfd.h". + (powerpc_operands): Add new field for reloc type. + +2001-07-21 Thiemo Seufer + + * mips-dis.c (print_insn_arg): Don't use software integer registers + for coprocessor registers. + (get_mips_isa): Removed. + (is_newabi): New function, checks if NewABI is used. + (_print_insn_mips): Get distinction between old ABI and new ABI right. + +2001-08-01 Christian Groessler + + * z8kgen.c: Fixed indentation of opt[] array. Include stdio.h to + get stderr definition. + (internal, gas): Removed warnings. + (gas): Create a correct final entry for created array. + * z8k-opc.h: Recreated with new z8kgen. + +2001-07-28 Kazu Hirata + + * i386-dis.c: Fix formatting. + +2001-07-28 Matthias Kramm + + * i386-dis.c: Change formatting conventions for architecture + i386:intel to better match the format of various intel i386 + assemblers, like nasm, tasm or masm. + 2001-07-24 Alan Modra * Makefile.am: Update dependencies with "make dep-am". diff -Nupr binutils-2.11.90.0.25/opcodes/configure binutils-2.11.90.0.27/opcodes/configure --- binutils-2.11.90.0.25/opcodes/configure Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/opcodes/configure Fri Aug 10 14:08:01 2001 @@ -55,7 +55,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -170,7 +169,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -341,11 +339,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -511,16 +504,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -559,12 +548,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:563: checking for Cygwin environment" >&5 +echo "configure:552: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -592,19 +581,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:596: checking for mingw32 environment" >&5 +echo "configure:585: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -669,7 +658,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:673: checking host system type" >&5 +echo "configure:662: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -690,7 +679,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:694: checking target system type" >&5 +echo "configure:683: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -708,7 +697,7 @@ target_os=`echo $target | sed 's/^\([^-] echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:712: checking build system type" >&5 +echo "configure:701: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -732,7 +721,7 @@ test "$host_alias" != "$target_alias" && echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:736: checking for strerror in -lcposix" >&5 +echo "configure:725: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -740,7 +729,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -791,7 +780,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOM # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:795: checking for a BSD compatible install" >&5 +echo "configure:784: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -844,7 +833,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:848: checking whether build environment is sane" >&5 +echo "configure:837: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -901,7 +890,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:905: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:894: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -947,7 +936,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:951: checking for working aclocal" >&5 +echo "configure:940: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -960,7 +949,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:964: checking for working autoconf" >&5 +echo "configure:953: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -973,7 +962,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:977: checking for working automake" >&5 +echo "configure:966: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -986,7 +975,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:990: checking for working autoheader" >&5 +echo "configure:979: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -999,7 +988,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1003: checking for working makeinfo" >&5 +echo "configure:992: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1022,7 +1011,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1026: checking for $ac_word" >&5 +echo "configure:1015: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1054,7 +1043,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1058: checking for $ac_word" >&5 +echo "configure:1047: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1086,7 +1075,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1090: checking for $ac_word" >&5 +echo "configure:1079: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1192,7 +1181,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1196: checking for $ac_word" >&5 +echo "configure:1185: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1222,7 +1211,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1226: checking for $ac_word" >&5 +echo "configure:1215: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1273,7 +1262,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1277: checking for $ac_word" >&5 +echo "configure:1266: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1305,7 +1294,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1309: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1298: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1316,12 +1305,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1320 "configure" +#line 1309 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1347,12 +1336,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1351: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1340: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1356: checking whether we are using GNU C" >&5 +echo "configure:1345: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1361,7 +1350,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1380,7 +1369,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1384: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1373: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1423,7 +1412,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1427: checking for ld used by GCC" >&5 +echo "configure:1416: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1453,10 +1442,10 @@ echo "configure:1427: checking for ld us esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1457: checking for GNU ld" >&5 +echo "configure:1446: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1460: checking for non-GNU ld" >&5 +echo "configure:1449: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1491,7 +1480,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1495: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1484: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1508,7 +1497,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1512: checking for $LD option to reload object files" >&5 +echo "configure:1501: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1520,7 +1509,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1524: checking for BSD-compatible nm" >&5 +echo "configure:1513: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1558,7 +1547,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1562: checking whether ln -s works" >&5 +echo "configure:1551: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1579,7 +1568,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1583: checking how to recognise dependant libraries" >&5 +echo "configure:1572: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1743,13 +1732,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1747: checking for object suffix" >&5 +echo "configure:1736: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1769,7 +1758,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1773: checking for executable suffix" >&5 +echo "configure:1762: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1779,10 +1768,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1806,7 +1795,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1810: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1799: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1868,7 +1857,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1872: checking for file" >&5 +echo "configure:1861: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1939,7 +1928,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1943: checking for $ac_word" >&5 +echo "configure:1932: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1971,7 +1960,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1975: checking for $ac_word" >&5 +echo "configure:1964: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2006,7 +1995,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2010: checking for $ac_word" >&5 +echo "configure:1999: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2038,7 +2027,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2042: checking for $ac_word" >&5 +echo "configure:2031: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2105,8 +2094,8 @@ test x"$pic_mode" = xno && libtool_flags case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2109 "configure"' > conftest.$ac_ext - if { (eval echo configure:2110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2098 "configure"' > conftest.$ac_ext + if { (eval echo configure:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2127,7 +2116,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2131: checking whether the C compiler needs -belf" >&5 +echo "configure:2120: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2140,14 +2129,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2283,7 +2272,7 @@ if test "${enable_commonbfdlib+set}" = s esac fi -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2315,7 +2304,7 @@ if test -z "$target" ; then fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:2319: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2308: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -2340,7 +2329,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2344: checking for executable suffix" >&5 +echo "configure:2333: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2350,10 +2339,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2376,7 +2365,7 @@ ac_exeext=$EXEEXT # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2380: checking for $ac_word" >&5 +echo "configure:2369: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2406,7 +2395,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2410: checking for $ac_word" >&5 +echo "configure:2399: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2457,7 +2446,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2461: checking for $ac_word" >&5 +echo "configure:2450: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2489,7 +2478,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2493: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2482: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2500,12 +2489,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2504 "configure" +#line 2493 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2531,12 +2520,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2535: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2524: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2540: checking whether we are using GNU C" >&5 +echo "configure:2529: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2545,7 +2534,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2564,7 +2553,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2568: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2557: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2598,7 +2587,7 @@ fi ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2602: checking how to run the C preprocessor" >&5 +echo "configure:2591: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2613,13 +2602,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2630,13 +2619,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2647,13 +2636,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2680,7 +2669,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2684: checking for $ac_word" >&5 +echo "configure:2673: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2708,12 +2697,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2712: checking for ANSI C header files" >&5 +echo "configure:2701: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2721,7 +2710,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2738,7 +2727,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2756,7 +2745,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2777,7 +2766,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2788,7 +2777,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2812,12 +2801,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2816: checking for working const" >&5 +echo "configure:2805: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2887,21 +2876,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2891: checking for inline" >&5 +echo "configure:2880: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2927,12 +2916,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2931: checking for off_t" >&5 +echo "configure:2920: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2960,12 +2949,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2964: checking for size_t" >&5 +echo "configure:2953: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2995,19 +2984,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2999: checking for working alloca.h" >&5 +echo "configure:2988: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3028,12 +3017,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3032: checking for alloca" >&5 +echo "configure:3021: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3093,12 +3082,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3097: checking whether alloca needs Cray hooks" >&5 +echo "configure:3086: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3127: checking for $ac_func" >&5 +echo "configure:3116: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3178,7 +3167,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3182: checking stack direction for C alloca" >&5 +echo "configure:3171: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3186,7 +3175,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3230,17 +3219,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3234: checking for $ac_hdr" >&5 +echo "configure:3223: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3269,12 +3258,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3273: checking for $ac_func" >&5 +echo "configure:3262: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3322,7 +3311,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3326: checking for working mmap" >&5 +echo "configure:3315: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3330,7 +3319,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3498,17 +3487,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3502: checking for $ac_hdr" >&5 +echo "configure:3491: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3538,12 +3527,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3542: checking for $ac_func" >&5 +echo "configure:3531: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3595,12 +3584,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3599: checking for $ac_func" >&5 +echo "configure:3588: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3657,19 +3646,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3661: checking for LC_MESSAGES" >&5 +echo "configure:3650: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3690,7 +3679,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3694: checking whether NLS is requested" >&5 +echo "configure:3683: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3710,7 +3699,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3714: checking whether included gettext is requested" >&5 +echo "configure:3703: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3729,17 +3718,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3733: checking for libintl.h" >&5 +echo "configure:3722: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3756,19 +3745,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3760: checking for gettext in libc" >&5 +echo "configure:3749: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3784,7 +3773,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3788: checking for bindtextdomain in -lintl" >&5 +echo "configure:3777: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3792,7 +3781,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3819,19 +3808,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3823: checking for gettext in libintl" >&5 +echo "configure:3812: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3859,7 +3848,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3863: checking for $ac_word" >&5 +echo "configure:3852: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3893,12 +3882,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3897: checking for $ac_func" >&5 +echo "configure:3886: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3948,7 +3937,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3952: checking for $ac_word" >&5 +echo "configure:3941: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3984,7 +3973,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3988: checking for $ac_word" >&5 +echo "configure:3977: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4016,7 +4005,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4056,7 +4045,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4060: checking for $ac_word" >&5 +echo "configure:4049: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4090,7 +4079,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4094: checking for $ac_word" >&5 +echo "configure:4083: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4126,7 +4115,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4130: checking for $ac_word" >&5 +echo "configure:4119: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4216,7 +4205,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4220: checking for catalogs to be installed" >&5 +echo "configure:4209: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4244,17 +4233,17 @@ echo "configure:4220: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4248: checking for linux/version.h" >&5 +echo "configure:4237: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4331,7 +4320,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4335: checking for a BSD compatible install" >&5 +echo "configure:4324: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4388,17 +4377,17 @@ for ac_hdr in string.h strings.h stdlib. do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4392: checking for $ac_hdr" >&5 +echo "configure:4381: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff -Nupr binutils-2.11.90.0.25/opcodes/configure.in binutils-2.11.90.0.27/opcodes/configure.in --- binutils-2.11.90.0.25/opcodes/configure.in Sun Jun 10 10:55:09 2001 +++ binutils-2.11.90.0.27/opcodes/configure.in Fri Aug 10 14:08:01 2001 @@ -43,7 +43,7 @@ AC_ARG_ENABLE(commonbfdlib, *) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;; esac])dnl -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff -Nupr binutils-2.11.90.0.25/opcodes/dis-buf.c binutils-2.11.90.0.27/opcodes/dis-buf.c --- binutils-2.11.90.0.25/opcodes/dis-buf.c Thu Mar 15 14:52:03 2001 +++ binutils-2.11.90.0.27/opcodes/dis-buf.c Fri Aug 10 14:08:01 2001 @@ -80,10 +80,13 @@ generic_print_address (addr, info) (*info->fprintf_func) (info->stream, "0x%s", buf); } +#if 0 /* Just concatenate the address as hex. This is included for completeness even though both GDB and objdump provide their own (to print symbolic addresses). */ +void generic_strcat_address PARAMS ((bfd_vma, char *, int)); + void generic_strcat_address (addr, buf, len) bfd_vma addr; @@ -102,6 +105,7 @@ generic_strcat_address (addr, buf, len) } return; } +#endif /* Just return the given address. */ diff -Nupr binutils-2.11.90.0.25/opcodes/i386-dis.c binutils-2.11.90.0.27/opcodes/i386-dis.c --- binutils-2.11.90.0.25/opcodes/i386-dis.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/opcodes/i386-dis.c Sat Aug 4 19:52:15 2001 @@ -96,8 +96,7 @@ static void OP_SIMD_Suffix PARAMS ((int, static void SIMD_Fixup PARAMS ((int, int)); static void BadOp PARAMS ((void)); -struct dis_private -{ +struct dis_private { /* Points to first byte not fetched. */ bfd_byte *max_fetched; bfd_byte the_buffer[MAXLEN]; @@ -157,7 +156,7 @@ static int used_prefixes; to ADDR (exclusive) are valid. Returns 1 for success, longjmps on error. */ #define FETCH_DATA(info, addr) \ - ((addr) <= ((struct dis_private *)(info->private_data))->max_fetched \ + ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \ ? 1 : fetch_data ((info), (addr))) static int @@ -166,7 +165,7 @@ fetch_data (info, addr) bfd_byte *addr; { int status; - struct dis_private *priv = (struct dis_private *)info->private_data; + struct dis_private *priv = (struct dis_private *) info->private_data; bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer); status = (*info->read_memory_func) (start, @@ -299,7 +298,7 @@ fetch_data (info, addr) #define loop_jcxz_flag NULL, loop_jcxz_mode /* bits in sizeflag */ -#if 0 /* leave undefined until someone adds the extra flag to objdump */ +#if 0 /* Leave undefined until someone adds the extra flag to objdump. */ #define SUFFIX_ALWAYS 4 #endif #define AFLAG 2 @@ -773,7 +772,7 @@ static const struct dis386 dis386_twobyt { "(bad)", XX, XX, XX }, { GRPAMD }, { "femms", XX, XX, XX }, - { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix */ + { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix. */ /* 10 */ { PREGRP8 }, { PREGRP9 }, @@ -1132,30 +1131,64 @@ static unsigned char need_modrm; need to update onebyte_has_modrm or twobyte_has_modrm. */ #define MODRM_CHECK if (!need_modrm) abort () -static const char *names64[] = { - "%rax","%rcx","%rdx","%rbx", "%rsp","%rbp","%rsi","%rdi", +static const char **names64; +static const char **names32; +static const char **names16; +static const char **names8; +static const char **names8rex; +static const char **names_seg; +static const char **index16; + +static const char *intel_names64[] = { + "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" +}; +static const char *intel_names32[] = { + "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", + "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" +}; +static const char *intel_names16[] = { + "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", + "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" +}; +static const char *intel_names8[] = { + "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", +}; +static const char *intel_names8rex[] = { + "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", + "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" +}; +static const char *intel_names_seg[] = { + "es", "cs", "ss", "ds", "fs", "gs", "?", "?", +}; +static const char *intel_index16[] = { + "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx" +}; + +static const char *att_names64[] = { + "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" }; -static const char *names32[] = { - "%eax","%ecx","%edx","%ebx", "%esp","%ebp","%esi","%edi", +static const char *att_names32[] = { + "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi", "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d" }; -static const char *names16[] = { - "%ax","%cx","%dx","%bx","%sp","%bp","%si","%di", +static const char *att_names16[] = { + "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di", "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w" }; -static const char *names8[] = { - "%al","%cl","%dl","%bl","%ah","%ch","%dh","%bh", +static const char *att_names8[] = { + "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh", }; -static const char *names8rex[] = { - "%al","%cl","%dl","%bl","%spl", "%bpl", "%sil", "%dil", +static const char *att_names8rex[] = { + "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil", "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b" }; -static const char *names_seg[] = { - "%es","%cs","%ss","%ds","%fs","%gs","%?","%?", +static const char *att_names_seg[] = { + "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?", }; -static const char *index16[] = { - "%bx,%si","%bx,%di","%bp,%si","%bp,%di","%si","%di","%bp","%bx" +static const char *att_index16[] = { + "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx" }; static const struct dis386 grps[][8] = { @@ -1389,7 +1422,7 @@ static const struct dis386 grps[][8] = { { "lfence", None, XX, XX }, { "mfence", None, XX, XX }, { "sfence", None, XX, XX }, - /* FIXME: the sfence with memory operand is clflush! */ + /* FIXME: the sfence with memory operand is clflush! */ }, /* GRP14 */ { @@ -1413,7 +1446,6 @@ static const struct dis386 grps[][8] = { { "(bad)", XX, XX, XX }, { "(bad)", XX, XX, XX }, } - }; static const struct dis386 prefix_user_table[][4] = { @@ -1426,7 +1458,7 @@ static const struct dis386 prefix_user_t }, /* PREGRP1 */ { - { "", XM, EX, OPSIMD }, /* See OP_SIMD_SUFFIX */ + { "", XM, EX, OPSIMD }, /* See OP_SIMD_SUFFIX. */ { "", XM, EX, OPSIMD }, { "", XM, EX, OPSIMD }, { "", XM, EX, OPSIMD }, @@ -1789,7 +1821,6 @@ static int op_ad, op_index[3]; static bfd_vma op_address[3]; static bfd_vma op_riprel[3]; static bfd_vma start_pc; - /* * On the 386's of 1988, the maximum length of an instruction is 15 bytes. @@ -1812,6 +1843,13 @@ print_insn_i386_att (pc, info) disassemble_info *info; { intel_syntax = 0; + names64 = att_names64; + names32 = att_names32; + names16 = att_names16; + names8 = att_names8; + names8rex = att_names8rex; + names_seg = att_names_seg; + index16 = att_index16; open_char = '('; close_char = ')'; separator_char = ','; @@ -1826,6 +1864,13 @@ print_insn_i386_intel (pc, info) disassemble_info *info; { intel_syntax = 1; + names64 = intel_names64; + names32 = intel_names32; + names16 = intel_names16; + names8 = intel_names8; + names8rex = intel_names8rex; + names_seg = intel_names_seg; + index16 = intel_index16; open_char = '['; close_char = ']'; separator_char = '+'; @@ -1858,7 +1903,7 @@ print_insn_i386 (pc, info) || info->mach == bfd_mach_x86_64 || info->mach == bfd_mach_i386_i386_intel_syntax || info->mach == bfd_mach_x86_64_intel_syntax) - sizeflag = AFLAG|DFLAG; + sizeflag = AFLAG | DFLAG; else if (info->mach == bfd_mach_i386_i8086) sizeflag = 0; else @@ -2049,17 +2094,17 @@ print_insn_i386 (pc, info) obufp = op1out; op_ad = 2; if (dp->op1) - (*dp->op1)(dp->bytemode1, sizeflag); + (*dp->op1) (dp->bytemode1, sizeflag); obufp = op2out; op_ad = 1; if (dp->op2) - (*dp->op2)(dp->bytemode2, sizeflag); + (*dp->op2) (dp->bytemode2, sizeflag); obufp = op3out; op_ad = 0; if (dp->op3) - (*dp->op3)(dp->bytemode3, sizeflag); + (*dp->op3) (dp->bytemode3, sizeflag); } } @@ -2340,7 +2385,6 @@ static const struct dis386 float_reg[][8 }, }; - static char *fgrps[][8] = { /* d9_2 0 */ { @@ -2400,7 +2444,7 @@ dofloat (sizeflag) if (mod != 3) { - putop (float_mem[(floatop - 0xd8 ) * 8 + reg], sizeflag); + putop (float_mem[(floatop - 0xd8) * 8 + reg], sizeflag); obufp = op1out; if (floatop == 0xdb) OP_E (x_mode, sizeflag); @@ -2410,7 +2454,7 @@ dofloat (sizeflag) OP_E (v_mode, sizeflag); return; } - /* skip mod/rm byte */ + /* Skip mod/rm byte. */ MODRM_CHECK; codep++; @@ -2419,7 +2463,7 @@ dofloat (sizeflag) { putop (fgrps[dp->bytemode1][rm], sizeflag); - /* instruction fnstsw is only one with strange arg */ + /* Instruction fnstsw is only one with strange arg. */ if (floatop == 0xdf && codep[-1] == 0xe0) strcpy (op1out, names16[0]); } @@ -2429,10 +2473,10 @@ dofloat (sizeflag) obufp = op1out; if (dp->op1) - (*dp->op1)(dp->bytemode1, sizeflag); + (*dp->op1) (dp->bytemode1, sizeflag); obufp = op2out; if (dp->op2) - (*dp->op2)(dp->bytemode2, sizeflag); + (*dp->op2) (dp->bytemode2, sizeflag); } } @@ -2450,10 +2494,10 @@ OP_STi (bytemode, sizeflag) int sizeflag ATTRIBUTE_UNUSED; { sprintf (scratchbuf, "%%st(%d)", rm); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } -/* capital letters in template are macros */ +/* Capital letters in template are macros. */ static int putop (template, sizeflag) const char *template; @@ -2584,7 +2628,7 @@ putop (template, sizeflag) *obufp++ = 'q'; break; } - /* Fall through */ + /* Fall through. */ case 'P': if (intel_syntax) break; @@ -2616,7 +2660,7 @@ putop (template, sizeflag) *obufp++ = 'q'; break; } - /* Fall through */ + /* Fall through. */ case 'Q': if (intel_syntax) break; @@ -2755,33 +2799,33 @@ append_seg () { if (prefixes & PREFIX_CS) { - oappend ("%cs:"); used_prefixes |= PREFIX_CS; + oappend ("%cs:" + intel_syntax); } if (prefixes & PREFIX_DS) { - oappend ("%ds:"); used_prefixes |= PREFIX_DS; + oappend ("%ds:" + intel_syntax); } if (prefixes & PREFIX_SS) { - oappend ("%ss:"); used_prefixes |= PREFIX_SS; + oappend ("%ss:" + intel_syntax); } if (prefixes & PREFIX_ES) { - oappend ("%es:"); used_prefixes |= PREFIX_ES; + oappend ("%es:" + intel_syntax); } if (prefixes & PREFIX_FS) { - oappend ("%fs:"); used_prefixes |= PREFIX_FS; + oappend ("%fs:" + intel_syntax); } if (prefixes & PREFIX_GS) { - oappend ("%gs:"); used_prefixes |= PREFIX_GS; + oappend ("%gs:" + intel_syntax); } } @@ -2810,7 +2854,7 @@ print_operand_value (buf, hex, disp) buf[0] = '0'; buf[1] = 'x'; sprintf_vma (tmp, disp); - for (i = 0; tmp[i] == '0' && tmp[i+1]; i++); + for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++); strcpy (buf + 2, tmp + i); } else @@ -2822,7 +2866,7 @@ print_operand_value (buf, hex, disp) { *(buf++) = '-'; v = -disp; - /* Check for possible overflow on 0x8000000000000000 */ + /* Check for possible overflow on 0x8000000000000000. */ if (v < 0) { strcpy (buf, "9223372036854775808"); @@ -2839,7 +2883,7 @@ print_operand_value (buf, hex, disp) tmp[29] = 0; while (v) { - tmp[28-i] = (v % 10) + '0'; + tmp[28 - i] = (v % 10) + '0'; v /= 10; i++; } @@ -2867,7 +2911,7 @@ OP_E (bytemode, sizeflag) if (rex & REX_EXTZ) add += 8; - /* skip mod/rm byte */ + /* Skip mod/rm byte. */ MODRM_CHECK; codep++; @@ -2908,10 +2952,10 @@ OP_E (bytemode, sizeflag) used_prefixes |= (prefixes & PREFIX_DATA); break; case 0: - if ( !(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */) + if (!(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */) && !(codep[-2] == 0xAE && codep[-1] == 0xF0 /* mfence */) && !(codep[-2] == 0xAE && codep[-1] == 0xe8 /* lfence */)) - BadOp(); /* bad sfence,lea,lds,les,lfs,lgs,lss modrm */ + BadOp (); /* bad sfence,lea,lds,les,lfs,lgs,lss modrm */ break; default: oappend (INTERNAL_DISASSEMBLER_ERROR); @@ -3036,10 +3080,12 @@ OP_E (bytemode, sizeflag) *obufp++ = separator_char; *obufp = '\0'; } - sprintf (scratchbuf, "%s", mode_64bit ? names64[index] : names32[index]); + sprintf (scratchbuf, "%s", + mode_64bit ? names64[index] : names32[index]); } else - sprintf (scratchbuf, ",%s", mode_64bit ? names64[index] : names32[index]); + sprintf (scratchbuf, ",%s", + mode_64bit ? names64[index] : names32[index]); oappend (scratchbuf); } if (!intel_syntax @@ -3057,9 +3103,15 @@ OP_E (bytemode, sizeflag) if (intel_syntax) if (mod != 0 || (base & 7) == 5) { - /* Don't print zero displacements */ + /* Don't print zero displacements. */ if (disp != 0) { + if ((bfd_signed_vma) disp > 0) + { + *obufp++ = '+'; + *obufp = '\0'; + } + print_operand_value (scratchbuf, 0, disp); oappend (scratchbuf); } @@ -3077,7 +3129,7 @@ OP_E (bytemode, sizeflag) ; else { - oappend (names_seg[3]); + oappend (names_seg[ds_reg - es_reg]); oappend (":"); } print_operand_value (scratchbuf, 1, disp); @@ -3190,7 +3242,7 @@ get64 () b |= (*codep++ & 0xff) << 24; x = a + ((bfd_vma) b << 32); #else - abort(); + abort (); x = 0; #endif return x; @@ -3269,7 +3321,10 @@ OP_REG (code, sizeflag) switch (code) { case indir_dx_reg: - s = "(%dx)"; + if (intel_syntax) + s = "[dx]"; + else + s = "(%dx)"; break; case ax_reg: case cx_reg: case dx_reg: case bx_reg: case sp_reg: case bp_reg: case si_reg: case di_reg: @@ -3295,7 +3350,7 @@ OP_REG (code, sizeflag) break; } code += eAX_reg - rAX_reg; - /* Fall through */ + /* Fall through. */ case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg: case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg: USED_REX (REX_MODE64); @@ -3324,7 +3379,10 @@ OP_IMREG (code, sizeflag) switch (code) { case indir_dx_reg: - s = "(%dx)"; + if (intel_syntax) + s = "[dx]"; + else + s = "(%dx)"; break; case ax_reg: case cx_reg: case dx_reg: case bx_reg: case sp_reg: case bp_reg: case si_reg: case di_reg: @@ -3381,7 +3439,7 @@ OP_I (bytemode, sizeflag) op = get32s (); break; } - /* Fall through */ + /* Fall through. */ case v_mode: USED_REX (REX_MODE64); if (rex & REX_MODE64) @@ -3409,8 +3467,8 @@ OP_I (bytemode, sizeflag) op &= mask; scratchbuf[0] = '$'; - print_operand_value (scratchbuf + !intel_syntax, 1, op); - oappend (scratchbuf); + print_operand_value (scratchbuf + 1, 1, op); + oappend (scratchbuf + intel_syntax); scratchbuf[0] = '\0'; } @@ -3462,8 +3520,8 @@ OP_I64 (bytemode, sizeflag) op &= mask; scratchbuf[0] = '$'; - print_operand_value (scratchbuf + !intel_syntax, 1, op); - oappend (scratchbuf); + print_operand_value (scratchbuf + 1, 1, op); + oappend (scratchbuf + intel_syntax); scratchbuf[0] = '\0'; } @@ -3496,7 +3554,7 @@ OP_sI (bytemode, sizeflag) else { mask = 0xffffffff; - op = get16(); + op = get16 (); if ((op & 0x8000) != 0) op -= 0x10000; } @@ -3515,7 +3573,7 @@ OP_sI (bytemode, sizeflag) scratchbuf[0] = '$'; print_operand_value (scratchbuf + 1, 1, op); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3540,7 +3598,7 @@ OP_J (bytemode, sizeflag) else { disp = get16 (); - /* for some reason, a data16 prefix on a jump instruction + /* For some reason, a data16 prefix on a jump instruction means that the pc is masked to 16 bits after the displacement is added! */ mask = 0xffff; @@ -3561,11 +3619,7 @@ OP_SEG (dummy, sizeflag) int dummy ATTRIBUTE_UNUSED; int sizeflag ATTRIBUTE_UNUSED; { - static char *sreg[] = { - "%es","%cs","%ss","%ds","%fs","%gs","%?","%?", - }; - - oappend (sreg[reg]); + oappend (names_seg[reg]); } static void @@ -3586,7 +3640,10 @@ OP_DIR (dummy, sizeflag) seg = get16 (); } used_prefixes |= (prefixes & PREFIX_DATA); - sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset); + if (intel_syntax) + sprintf (scratchbuf, "0x%x,0x%x", seg, offset); + else + sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset); oappend (scratchbuf); } @@ -3609,7 +3666,7 @@ OP_OFF (bytemode, sizeflag) if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES | PREFIX_FS | PREFIX_GS))) { - oappend (names_seg[3]); + oappend (names_seg[ds_reg - es_reg]); oappend (":"); } } @@ -3632,14 +3689,14 @@ OP_OFF64 (bytemode, sizeflag) append_seg (); - off = get64(); + off = get64 (); if (intel_syntax) { if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES | PREFIX_FS | PREFIX_GS))) { - oappend (names_seg[3]); + oappend (names_seg[ds_reg - es_reg]); oappend (":"); } } @@ -3653,7 +3710,11 @@ ptr_reg (code, sizeflag) int sizeflag; { const char *s; - oappend ("("); + if (intel_syntax) + oappend ("["); + else + oappend ("("); + USED_REX (REX_MODE64); if (rex & REX_MODE64) s = names64[code - eAX_reg]; @@ -3662,7 +3723,10 @@ ptr_reg (code, sizeflag) else s = names16[code - eAX_reg]; oappend (s); - oappend (")"); + if (intel_syntax) + oappend ("]"); + else + oappend (")"); } static void @@ -3670,7 +3734,7 @@ OP_ESreg (code, sizeflag) int code; int sizeflag; { - oappend ("%es:"); + oappend ("%es:" + intel_syntax); ptr_reg (code, sizeflag); } @@ -3687,7 +3751,7 @@ OP_DSreg (code, sizeflag) | PREFIX_FS | PREFIX_GS)) == 0) prefixes |= PREFIX_DS; - append_seg(); + append_seg (); ptr_reg (code, sizeflag); } @@ -3700,8 +3764,8 @@ OP_C (dummy, sizeflag) USED_REX (REX_EXTX); if (rex & REX_EXTX) add = 8; - sprintf (scratchbuf, "%%cr%d", reg+add); - oappend (scratchbuf); + sprintf (scratchbuf, "%%cr%d", reg + add); + oappend (scratchbuf + intel_syntax); } static void @@ -3713,7 +3777,10 @@ OP_D (dummy, sizeflag) USED_REX (REX_EXTX); if (rex & REX_EXTX) add = 8; - sprintf (scratchbuf, "%%db%d", reg+add); + if (intel_syntax) + sprintf (scratchbuf, "db%d", reg + add); + else + sprintf (scratchbuf, "%%db%d", reg + add); oappend (scratchbuf); } @@ -3723,7 +3790,7 @@ OP_T (dummy, sizeflag) int sizeflag ATTRIBUTE_UNUSED; { sprintf (scratchbuf, "%%tr%d", reg); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3734,7 +3801,7 @@ OP_Rd (bytemode, sizeflag) if (mod == 3) OP_E (bytemode, sizeflag); else - BadOp(); + BadOp (); } static void @@ -3751,7 +3818,7 @@ OP_MMX (bytemode, sizeflag) sprintf (scratchbuf, "%%xmm%d", reg + add); else sprintf (scratchbuf, "%%mm%d", reg + add); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3764,7 +3831,7 @@ OP_XMM (bytemode, sizeflag) if (rex & REX_EXTX) add = 8; sprintf (scratchbuf, "%%xmm%d", reg + add); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3782,7 +3849,7 @@ OP_EM (bytemode, sizeflag) if (rex & REX_EXTZ) add = 8; - /* skip mod/rm byte */ + /* Skip mod/rm byte. */ MODRM_CHECK; codep++; used_prefixes |= (prefixes & PREFIX_DATA); @@ -3790,7 +3857,7 @@ OP_EM (bytemode, sizeflag) sprintf (scratchbuf, "%%xmm%d", rm + add); else sprintf (scratchbuf, "%%mm%d", rm + add); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3808,11 +3875,11 @@ OP_EX (bytemode, sizeflag) if (rex & REX_EXTZ) add = 8; - /* skip mod/rm byte */ + /* Skip mod/rm byte. */ MODRM_CHECK; codep++; sprintf (scratchbuf, "%%xmm%d", rm + add); - oappend (scratchbuf); + oappend (scratchbuf + intel_syntax); } static void @@ -3823,7 +3890,7 @@ OP_MS (bytemode, sizeflag) if (mod == 3) OP_EM (bytemode, sizeflag); else - BadOp(); + BadOp (); } static void @@ -3834,7 +3901,7 @@ OP_XS (bytemode, sizeflag) if (mod == 3) OP_EX (bytemode, sizeflag); else - BadOp(); + BadOp (); } static const char *Suffix3DNow[] = { @@ -3915,7 +3982,7 @@ OP_3DNowSuffix (bytemode, sizeflag) /* AMD 3DNow! instructions are specified by an opcode suffix in the place where an 8-bit immediate would normally go. ie. the last byte of the instruction. */ - obufp = obuf + strlen(obuf); + obufp = obuf + strlen (obuf); mnemonic = Suffix3DNow[*codep++ & 0xff]; if (mnemonic) oappend (mnemonic); @@ -3927,12 +3994,11 @@ OP_3DNowSuffix (bytemode, sizeflag) we have a bad opcode. This necessitates some cleaning up. */ op1out[0] = '\0'; op2out[0] = '\0'; - BadOp(); + BadOp (); } } - -static const char *simd_cmp_op [] = { +static const char *simd_cmp_op[] = { "eq", "lt", "le", @@ -3951,7 +4017,7 @@ OP_SIMD_Suffix (bytemode, sizeflag) unsigned int cmp_type; FETCH_DATA (the_info, codep + 1); - obufp = obuf + strlen(obuf); + obufp = obuf + strlen (obuf); cmp_type = *codep++ & 0xff; if (cmp_type < 8) { @@ -3981,7 +4047,7 @@ OP_SIMD_Suffix (bytemode, sizeflag) /* We have a bad extension byte. Clean up. */ op1out[0] = '\0'; op2out[0] = '\0'; - BadOp(); + BadOp (); } } @@ -3994,17 +4060,19 @@ SIMD_Fixup (extrachar, sizeflag) forms of these instructions. */ if (mod == 3) { - char *p = obuf + strlen(obuf); - *(p+1) = '\0'; - *p = *(p-1); - *(p-1) = *(p-2); - *(p-2) = *(p-3); - *(p-3) = extrachar; + char *p = obuf + strlen (obuf); + *(p + 1) = '\0'; + *p = *(p - 1); + *(p - 1) = *(p - 2); + *(p - 2) = *(p - 3); + *(p - 3) = extrachar; } } -static void BadOp (void) +static void +BadOp (void) { - codep = insn_codep + 1; /* throw away prefixes and 1st. opcode byte */ + /* Throw away prefixes and 1st. opcode byte. */ + codep = insn_codep + 1; oappend ("(bad)"); } diff -Nupr binutils-2.11.90.0.25/opcodes/mips-dis.c binutils-2.11.90.0.27/opcodes/mips-dis.c --- binutils-2.11.90.0.25/opcodes/mips-dis.c Wed May 23 10:53:39 2001 +++ binutils-2.11.90.0.27/opcodes/mips-dis.c Fri Aug 10 14:08:01 2001 @@ -256,13 +256,13 @@ print_insn_arg (d, l, pc, info) break; case 'E': - (*info->fprintf_func) (info->stream, "%s", - reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); + (*info->fprintf_func) (info->stream, "$%d", + (l >> OP_SH_RT) & OP_MASK_RT); break; case 'G': - (*info->fprintf_func) (info->stream, "%s", - reg_names[(l >> OP_SH_RD) & OP_MASK_RD]); + (*info->fprintf_func) (info->stream, "$%d", + (l >> OP_SH_RD) & OP_MASK_RD); break; case 'N': @@ -395,17 +395,19 @@ mips_isa_type (mach, isa, cputype) } } -/* Figure out ISA from disassemble_info data */ +/* Check if the object uses NewABI conventions. */ static int -get_mips_isa (info) - struct disassemble_info *info; +is_newabi(header) + Elf_Internal_Ehdr *header; { - int isa; - int cpu; + if ((header->e_flags + & (E_MIPS_ABI_EABI32 | E_MIPS_ABI_EABI64 | EF_MIPS_ABI2)) != 0 + || (header->e_ident[EI_CLASS] == ELFCLASS64 + && (header->e_flags & E_MIPS_ABI_O64) == 0)) + return 1; - mips_isa_type (info->mach, &isa, &cpu); - return isa; + return 0; } /* Print the mips instruction at address MEMADDR in debugged memory, @@ -467,7 +469,7 @@ print_insn_mips (memaddr, word, info) { register const char *d; - if (! OPCODE_IS_MEMBER (op, mips_isa, target_processor, 0)) + if (! OPCODE_IS_MEMBER (op, mips_isa, target_processor)) continue; (*info->fprintf_func) (info->stream, "%s", op->name); @@ -522,14 +524,16 @@ _print_insn_mips (memaddr, info, endiann #endif /* Use mips64_reg_names for new ABI. */ - if (info->flavour == bfd_target_elf_flavour - && info->symbols != NULL - && (((get_mips_isa(info) | INSN_ISA_MASK) & ISA_MIPS2) != 0) - && ((elf_elfheader (bfd_asymbol_bfd(*(info->symbols)))->e_flags - & EF_MIPS_ABI2) != 0)) - reg_names = mips64_reg_names; - else - reg_names = mips32_reg_names; + reg_names = mips32_reg_names; + + if (info->flavour == bfd_target_elf_flavour && info->symbols != NULL) + { + Elf_Internal_Ehdr *header; + + header = elf_elfheader(bfd_asymbol_bfd(*(info->symbols))); + if (is_newabi(header)) + reg_names = mips64_reg_names; + } status = (*info->read_memory_func) (memaddr, buffer, INSNLEN, info); if (status == 0) diff -Nupr binutils-2.11.90.0.25/opcodes/mips-opc.c binutils-2.11.90.0.27/opcodes/mips-opc.c --- binutils-2.11.90.0.25/opcodes/mips-opc.c Thu Jul 26 18:02:55 2001 +++ binutils-2.11.90.0.27/opcodes/mips-opc.c Fri Aug 10 14:08:01 2001 @@ -96,8 +96,6 @@ Software Foundation, 59 Temple Place - S #define G3 (I4 \ ) -#define G6 INSN_GP32 - /* The order of overloaded instructions matters. Label arguments and register arguments look the same. Instructions that can have either for arguments must apear in the correct order in this table for the @@ -121,7 +119,7 @@ const struct mips_opcode mips_builtin_op {"li", "t,j", 0x24000000, 0xffe00000, WR_t, I1 }, /* addiu */ {"li", "t,i", 0x34000000, 0xffe00000, WR_t, I1 }, /* ori */ {"li", "t,I", 0, (int) M_LI, INSN_MACRO, I1 }, -{"move", "d,s", 0x00000025, 0xfc1f07ff, WR_d|RD_s, I1|G6 },/* or */ +{"move", "d,s", 0, (int) M_MOVE, INSN_MACRO, I1 }, {"move", "d,s", 0x0000002d, 0xfc1f07ff, WR_d|RD_s, I3 },/* daddu */ {"move", "d,s", 0x00000021, 0xfc1f07ff, WR_d|RD_s, I1 },/* addu */ {"move", "d,s", 0x00000025, 0xfc1f07ff, WR_d|RD_s, I1 },/* or */ diff -Nupr binutils-2.11.90.0.25/opcodes/z8k-opc.h binutils-2.11.90.0.27/opcodes/z8k-opc.h --- binutils-2.11.90.0.25/opcodes/z8k-opc.h Tue Apr 24 09:11:17 2001 +++ binutils-2.11.90.0.27/opcodes/z8k-opc.h Sat Aug 4 19:52:15 2001 @@ -4467,5 +4467,13 @@ opcode_entry_type z8k_table[] = { #endif "xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),}, {CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,420}, -0,0}; + +/* end marker */ +{ +#ifdef NICENAMES +NULL,0,0, +0, +#endif +NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0} +}; #endif diff -Nupr binutils-2.11.90.0.25/opcodes/z8kgen.c binutils-2.11.90.0.27/opcodes/z8kgen.c --- binutils-2.11.90.0.25/opcodes/z8kgen.c Tue Apr 24 09:11:18 2001 +++ binutils-2.11.90.0.27/opcodes/z8kgen.c Sat Aug 4 19:52:15 2001 @@ -19,6 +19,7 @@ /* This program generates z8k-opc.h */ +#include #include "sysdep.h" #define BYTE_INFO_LEN 10 @@ -81,12 +82,12 @@ struct op opt[] = "CZSV--", 5, 16, "1011 0101 ssss dddd", "adc rd,rs", 0, "CZSVDH", 5, 8, "1011 0100 ssss dddd", "adcb rbd,rbs", 0, "CZSV--", 7, 16, "0000 0001 ssN0 dddd", "add rd,@rs", 0, -"CZSV--", 9, 16, "0100 0001 0000 dddd address_src", "add rd,address_src", 0, + "CZSV--", 9, 16, "0100 0001 0000 dddd address_src", "add rd,address_src", 0, "CZSV--", 10, 16, "0100 0001 ssN0 dddd address_src", "add rd,address_src(rs)", 0, "CZSV--", 7, 16, "0000 0001 0000 dddd imm16", "add rd,imm16", 0, "CZSV--", 4, 16, "1000 0001 ssss dddd", "add rd,rs", 0, "CZSVDH", 7, 8, "0000 0000 ssN0 dddd", "addb rbd,@rs", 0, -"CZSVDH", 9, 8, "0100 0000 0000 dddd address_src", "addb rbd,address_src", 0, + "CZSVDH", 9, 8, "0100 0000 0000 dddd address_src", "addb rbd,address_src", 0, "CZSVDH", 10, 8, "0100 0000 ssN0 dddd address_src", "addb rbd,address_src(rs)", 0, "CZSVDH", 7, 8, "0000 0000 0000 dddd imm8 imm8", "addb rbd,imm8", 0, "CZSVDH", 4, 8, "1000 0000 ssss dddd", "addb rbd,rbs", 0, @@ -97,12 +98,12 @@ struct op opt[] = "CZSV--", 8, 32, "1001 0110 ssss dddd", "addl rrd,rrs", 0, "-ZS---", 7, 16, "0000 0111 ssN0 dddd", "and rd,@rs", 0, -"-ZS---", 9, 16, "0100 0111 0000 dddd address_src", "and rd,address_src", 0, + "-ZS---", 9, 16, "0100 0111 0000 dddd address_src", "and rd,address_src", 0, "-ZS---", 10, 16, "0100 0111 ssN0 dddd address_src", "and rd,address_src(rs)", 0, "-ZS---", 7, 16, "0000 0111 0000 dddd imm16", "and rd,imm16", 0, "-ZS---", 4, 16, "1000 0111 ssss dddd", "and rd,rs", 0, "-ZSP--", 7, 8, "0000 0110 ssN0 dddd", "andb rbd,@rs", 0, -"-ZSP--", 9, 8, "0100 0110 0000 dddd address_src", "andb rbd,address_src", 0, + "-ZSP--", 9, 8, "0100 0110 0000 dddd address_src", "andb rbd,address_src", 0, "-ZSP--", 10, 8, "0100 0110 ssN0 dddd address_src", "andb rbd,address_src(rs)", 0, "-ZSP--", 7, 8, "0000 0110 0000 dddd imm8 imm8", "andb rbd,imm8", 0, "-ZSP--", 4, 8, "1000 0110 ssss dddd", "andb rbd,rbs", 0, @@ -111,13 +112,13 @@ struct op opt[] = "-Z----", 11, 16, "0110 0111 ddN0 imm4 address_dst", "bit address_dst(rd),imm4", 0, "-Z----", 10, 16, "0110 0111 0000 imm4 address_dst", "bit address_dst,imm4", 0, "-Z----", 4, 16, "1010 0111 dddd imm4", "bit rd,imm4", 0, -"-Z----", 10, 16, "0010 0111 0000 ssss 0000 dddd 0000 0000", "bit rd,rs", 0, + "-Z----", 10, 16, "0010 0111 0000 ssss 0000 dddd 0000 0000", "bit rd,rs", 0, "-Z----", 8, 8, "0010 0110 ddN0 imm4", "bitb @rd,imm4", 0, "-Z----", 11, 8, "0110 0110 ddN0 imm4 address_dst", "bitb address_dst(rd),imm4", 0, "-Z----", 10, 8, "0110 0110 0000 imm4 address_dst", "bitb address_dst,imm4", 0, "-Z----", 4, 8, "1010 0110 dddd imm4", "bitb rbd,imm4", 0, -"-Z----", 10, 8, "0010 0110 0000 ssss 0000 dddd 0000 0000", "bitb rbd,rs", 0, + "-Z----", 10, 8, "0010 0110 0000 ssss 0000 dddd 0000 0000", "bitb rbd,rs", 0, "------", 10, 32, "0001 1111 ddN0 0000", "call @rd", 0, "------", 12, 32, "0101 1111 0000 0000 address_dst", "call address_dst", 0, @@ -156,7 +157,7 @@ struct op opt[] = "CZSV--", 15, 8, "0100 1100 ddN0 0001 address_dst imm8 imm8", "cpb address_dst(rd),imm8", 0, "CZSV--", 14, 8, "0100 1100 0000 0001 address_dst imm8 imm8", "cpb address_dst,imm8", 0, "CZSV--", 7, 8, "0000 1010 ssN0 dddd", "cpb rbd,@rs", 0, -"CZSV--", 9, 8, "0100 1010 0000 dddd address_src", "cpb rbd,address_src", 0, + "CZSV--", 9, 8, "0100 1010 0000 dddd address_src", "cpb rbd,address_src", 0, "CZSV--", 10, 8, "0100 1010 ssN0 dddd address_src", "cpb rbd,address_src(rs)", 0, "CZSV--", 7, 8, "0000 1010 0000 dddd imm8 imm8", "cpb rbd,imm8", 0, "CZSV--", 4, 8, "1000 1010 ssss dddd", "cpb rbd,rbs", 0, @@ -194,11 +195,11 @@ struct op opt[] = "------", 7, 16, "0111 1100 0000 01ii", "ei i2", 0, "------", 6, 16, "1010 1101 ssss dddd", "ex rd,rs", 0, "------", 12, 16, "0010 1101 ssN0 dddd", "ex rd,@rs", 0, -"------", 15, 16, "0110 1101 0000 dddd address_src", "ex rd,address_src", 0, + "------", 15, 16, "0110 1101 0000 dddd address_src", "ex rd,address_src", 0, "------", 16, 16, "0110 1101 ssN0 dddd address_src", "ex rd,address_src(rs)", 0, "------", 12, 8, "0010 1100 ssN0 dddd", "exb rbd,@rs", 0, -"------", 15, 8, "0110 1100 0000 dddd address_src", "exb rbd,address_src", 0, + "------", 15, 8, "0110 1100 0000 dddd address_src", "exb rbd,address_src", 0, "------", 16, 8, "0110 1100 ssN0 dddd address_src", "exb rbd,address_src(rs)", 0, "------", 6, 8, "1010 1100 ssss dddd", "exb rbd,rbs", 0, @@ -234,7 +235,7 @@ struct op opt[] = "------", 15, 16, "0100 1101 ddN0 0101 address_dst imm16", "ld address_dst(rd),imm16", 0, "------", 12, 16, "0110 1111 ddN0 ssss address_dst", "ld address_dst(rd),rs", 0, "------", 14, 16, "0100 1101 0000 0101 address_dst imm16", "ld address_dst,imm16", 0, -"------", 11, 16, "0110 1111 0000 ssss address_dst", "ld address_dst,rs", 0, + "------", 11, 16, "0110 1111 0000 ssss address_dst", "ld address_dst,rs", 0, "------", 14, 16, "0011 0011 ddN0 ssss imm16", "ld rd(imm16),rs", 0, "------", 14, 16, "0111 0011 ddN0 ssss 0000 xxxx 0000 0000", "ld rd(rx),rs", 0, "------", 7, 16, "0010 0001 ssN0 dddd", "ld rd,@rs", 0, @@ -250,11 +251,11 @@ struct op opt[] = "------", 15, 8, "0100 1100 ddN0 0101 address_dst imm8 imm8", "ldb address_dst(rd),imm8", 0, "------", 12, 8, "0110 1110 ddN0 ssss address_dst", "ldb address_dst(rd),rbs", 0, "------", 14, 8, "0100 1100 0000 0101 address_dst imm8 imm8", "ldb address_dst,imm8", 0, -"------", 11, 8, "0110 1110 0000 ssss address_dst", "ldb address_dst,rbs", 0, + "------", 11, 8, "0110 1110 0000 ssss address_dst", "ldb address_dst,rbs", 0, "------", 14, 8, "0011 0010 ddN0 ssss imm16", "ldb rd(imm16),rbs", 0, "------", 14, 8, "0111 0010 ddN0 ssss 0000 xxxx 0000 0000", "ldb rd(rx),rbs", 0, "------", 7, 8, "0010 0000 ssN0 dddd", "ldb rbd,@rs", 0, -"------", 9, 8, "0110 0000 0000 dddd address_src", "ldb rbd,address_src", 0, + "------", 9, 8, "0110 0000 0000 dddd address_src", "ldb rbd,address_src", 0, "------", 10, 8, "0110 0000 ssN0 dddd address_src", "ldb rbd,address_src(rs)", 0, "------", 5, 8, "1100 dddd imm8", "ldb rbd,imm8", 0, "------", 3, 8, "1010 0000 ssss dddd", "ldb rbd,rbs", 0, @@ -335,7 +336,7 @@ struct op opt[] = "CZS---", 4, 16, "1000 0101 ssss dddd", "or rd,rs", 0, "CZSP--", 7, 8, "0000 0100 ssN0 dddd", "orb rbd,@rs", 0, -"CZSP--", 9, 8, "0100 0100 0000 dddd address_src", "orb rbd,address_src", 0, + "CZSP--", 9, 8, "0100 0100 0000 dddd address_src", "orb rbd,address_src", 0, "CZSP--", 10, 8, "0100 0100 ssN0 dddd address_src", "orb rbd,address_src(rs)", 0, "CZSP--", 7, 8, "0000 0100 0000 dddd imm8 imm8", "orb rbd,imm8", 0, "CZSP--", 4, 8, "1000 0100 ssss dddd", "orb rbd,rbs", 0, @@ -375,13 +376,13 @@ struct op opt[] = "------", 14, 16, "0110 0011 ddN0 imm4 address_dst", "res address_dst(rd),imm4", 0, "------", 13, 16, "0110 0011 0000 imm4 address_dst", "res address_dst,imm4", 0, "------", 4, 16, "1010 0011 dddd imm4", "res rd,imm4", 0, -"------", 10, 16, "0010 0011 0000 ssss 0000 dddd 0000 0000", "res rd,rs", 0, + "------", 10, 16, "0010 0011 0000 ssss 0000 dddd 0000 0000", "res rd,rs", 0, "------", 11, 8, "0010 0010 ddN0 imm4", "resb @rd,imm4", 0, "------", 14, 8, "0110 0010 ddN0 imm4 address_dst", "resb address_dst(rd),imm4", 0, "------", 13, 8, "0110 0010 0000 imm4 address_dst", "resb address_dst,imm4", 0, "------", 4, 8, "1010 0010 dddd imm4", "resb rbd,imm4", 0, -"------", 10, 8, "0010 0010 0000 ssss 0000 dddd 0000 0000", "resb rbd,rs", 0, + "------", 10, 8, "0010 0010 0000 ssss 0000 dddd 0000 0000", "resb rbd,rs", 0, "CZSV--", 7, 16, "1000 1101 flags 0011", "resflg flags", 0, "------", 10, 16, "1001 1110 0000 cccc", "ret cc", 0, @@ -404,24 +405,24 @@ struct op opt[] = "CZSVDH", 33, 8, "0111 1111 imm8", "sc imm8", 0, -"CZSV--", 15, 16, "1011 0011 dddd 1011 0000 ssss 0000 0000", "sda rd,rs", 0, -"CZSV--", 15, 8, "1011 0010 dddd 1011 0000 ssss 0000 0000", "sdab rbd,rs", 0, + "CZSV--", 15, 16, "1011 0011 dddd 1011 0000 ssss 0000 0000", "sda rd,rs", 0, + "CZSV--", 15, 8, "1011 0010 dddd 1011 0000 ssss 0000 0000", "sdab rbd,rs", 0, "CZSV--", 15, 32, "1011 0011 dddd 1111 0000 ssss 0000 0000", "sdal rrd,rs", 0, -"CZS---", 15, 16, "1011 0011 dddd 0011 0000 ssss 0000 0000", "sdl rd,rs", 0, -"CZS---", 15, 8, "1011 0010 dddd 0011 0000 ssss 0000 0000", "sdlb rbd,rs", 0, + "CZS---", 15, 16, "1011 0011 dddd 0011 0000 ssss 0000 0000", "sdl rd,rs", 0, + "CZS---", 15, 8, "1011 0010 dddd 0011 0000 ssss 0000 0000", "sdlb rbd,rs", 0, "CZS---", 15, 32, "1011 0011 dddd 0111 0000 ssss 0000 0000", "sdll rrd,rs", 0, "------", 11, 16, "0010 0101 ddN0 imm4", "set @rd,imm4", 0, "------", 14, 16, "0110 0101 ddN0 imm4 address_dst", "set address_dst(rd),imm4", 0, "------", 13, 16, "0110 0101 0000 imm4 address_dst", "set address_dst,imm4", 0, "------", 4, 16, "1010 0101 dddd imm4", "set rd,imm4", 0, -"------", 10, 16, "0010 0101 0000 ssss 0000 dddd 0000 0000", "set rd,rs", 0, + "------", 10, 16, "0010 0101 0000 ssss 0000 dddd 0000 0000", "set rd,rs", 0, "------", 11, 8, "0010 0100 ddN0 imm4", "setb @rd,imm4", 0, "------", 14, 8, "0110 0100 ddN0 imm4 address_dst", "setb address_dst(rd),imm4", 0, "------", 13, 8, "0110 0100 0000 imm4 address_dst", "setb address_dst,imm4", 0, "------", 4, 8, "1010 0100 dddd imm4", "setb rbd,imm4", 0, -"------", 10, 8, "0010 0100 0000 ssss 0000 dddd 0000 0000", "setb rbd,rs", 0, + "------", 10, 8, "0010 0100 0000 ssss 0000 dddd 0000 0000", "setb rbd,rs", 0, "CZSV--", 7, 16, "1000 1101 flags 0001", "setflg flags", 0, @@ -456,13 +457,13 @@ struct op opt[] = "CZSV--", 13, 32, "1011 0011 dddd 0101 1111 1111 nim8", "srll rrd,imm8", 0, "CZSV--", 7, 16, "0000 0011 ssN0 dddd", "sub rd,@rs", 0, -"CZSV--", 9, 16, "0100 0011 0000 dddd address_src", "sub rd,address_src", 0, + "CZSV--", 9, 16, "0100 0011 0000 dddd address_src", "sub rd,address_src", 0, "CZSV--", 10, 16, "0100 0011 ssN0 dddd address_src", "sub rd,address_src(rs)", 0, "CZSV--", 7, 16, "0000 0011 0000 dddd imm16", "sub rd,imm16", 0, "CZSV--", 4, 16, "1000 0011 ssss dddd", "sub rd,rs", 0, "CZSVDH", 7, 8, "0000 0010 ssN0 dddd", "subb rbd,@rs", 0, -"CZSVDH", 9, 8, "0100 0010 0000 dddd address_src", "subb rbd,address_src", 0, + "CZSVDH", 9, 8, "0100 0010 0000 dddd address_src", "subb rbd,address_src", 0, "CZSVDH", 10, 8, "0100 0010 ssN0 dddd address_src", "subb rbd,address_src(rs)", 0, "CZSVDH", 7, 8, "0000 0010 0000 dddd imm8 imm8", "subb rbd,imm8", 0, "CZSVDH", 4, 8, "1000 0010 ssss dddd", "subb rbd,rbs", 0, @@ -487,7 +488,7 @@ struct op opt[] = "-ZSP--", 7, 8, "1000 1100 dddd 0100", "testb rbd", 0, "-ZS---", 13, 32, "0001 1100 ddN0 1000", "testl @rd", 0, -"-ZS---", 16, 32, "0101 1100 0000 1000 address_dst", "testl address_dst", 0, + "-ZS---", 16, 32, "0101 1100 0000 1000 address_dst", "testl address_dst", 0, "-ZS---", 17, 32, "0101 1100 ddN0 1000 address_dst", "testl address_dst(rd)", 0, "-ZS---", 13, 32, "1001 1100 dddd 1000", "testl rrd", 0, @@ -512,13 +513,13 @@ struct op opt[] = "--S---", 7, 8, "1000 1100 dddd 0110", "tsetb rbd", 0, "-ZS---", 7, 16, "0000 1001 ssN0 dddd", "xor rd,@rs", 0, -"-ZS---", 9, 16, "0100 1001 0000 dddd address_src", "xor rd,address_src", 0, + "-ZS---", 9, 16, "0100 1001 0000 dddd address_src", "xor rd,address_src", 0, "-ZS---", 10, 16, "0100 1001 ssN0 dddd address_src", "xor rd,address_src(rs)", 0, "-ZS---", 7, 16, "0000 1001 0000 dddd imm16", "xor rd,imm16", 0, "-ZS---", 4, 16, "1000 1001 ssss dddd", "xor rd,rs", 0, "-ZSP--", 7, 8, "0000 1000 ssN0 dddd", "xorb rbd,@rs", 0, -"-ZSP--", 9, 8, "0100 1000 0000 dddd address_src", "xorb rbd,address_src", 0, + "-ZSP--", 9, 8, "0100 1000 0000 dddd address_src", "xorb rbd,address_src", 0, "-ZSP--", 10, 8, "0100 1000 ssN0 dddd address_src", "xorb rbd,address_src(rs)", 0, "-ZSP--", 7, 8, "0000 1000 0000 dddd imm8 imm8", "xorb rbd,imm8", 0, "-ZSP--", 4, 8, "1000 1000 ssss dddd", "xorb rbd,rbs", 0, @@ -703,7 +704,6 @@ struct tok_struct toks[] = "01ii", "CLASS_01II", 1, "00ii", "CLASS_00II", 1, 0, 0 - }; char * @@ -899,7 +899,7 @@ void internal () { int c = count (); - struct op *new = xmalloc (sizeof (struct op) * c); + struct op *new = (struct op *) xmalloc (sizeof (struct op) * c); struct op *p = opt; memcpy (new, p, c * sizeof (struct op)); @@ -958,7 +958,7 @@ gas () struct op *p = opt; int idx = 0; char *oldname = ""; - struct op *new = xmalloc (sizeof (struct op) * c); + struct op *new = (struct op *) xmalloc (sizeof (struct op) * c); memcpy (new, p, c * sizeof (struct op)); @@ -1278,7 +1278,9 @@ gas () printf ("},\n"); new++; } - printf ("0,0};\n"); + printf ("\n/* end marker */\n"); + printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n"); + printf ("NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0}\n};\n"); printf ("#endif\n"); } @@ -1319,5 +1321,5 @@ main (ac, av) printf ("-d : generate new table for disassemble\n"); printf ("-h : generate new table for humans\n"); } -return 0; + return 0; }