From 408e5810e0f95789da8db5bb64abc79304af4c4a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Aug 08 2011 13:07:13 +0000 Subject: Rebase on 2.21.53.0.2 tarball. Delete unneeded patches. (BZ 728677) --- diff --git a/.gitignore b/.gitignore index 186cf9b..53f13e6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ binutils-2.20.51.0.10.tar.bz2 /binutils-2.21.51.0.9.tar.bz2 /binutils-2.21.52.0.1.tar.bz2 /binutils-2.21.53.0.1.tar.bz2 +/binutils-2.21.53.0.2.tar.bz2 diff --git a/binutils-2.21.53.0.1-debug_macro.patch b/binutils-2.21.53.0.1-debug_macro.patch deleted file mode 100644 index 09966bb..0000000 --- a/binutils-2.21.53.0.1-debug_macro.patch +++ /dev/null @@ -1,450 +0,0 @@ -diff -cpr ../binutils-2.21.53.0.1.orig/bfd/dwarf2.c ./bfd/dwarf2.c -*** ../binutils-2.21.53.0.1.orig/bfd/dwarf2.c 2011-07-27 09:57:26.018568001 +0100 ---- ./bfd/dwarf2.c 2011-07-27 10:00:21.176567999 +0100 -*************** const struct dwarf_debug_section dwarf_d -*** 287,292 **** ---- 287,293 ---- - { ".debug_line", ".zdebug_line" }, - { ".debug_loc", ".zdebug_loc" }, - { ".debug_macinfo", ".zdebug_macinfo" }, -+ { ".debug_macro", ".zdebug_macro" }, - { ".debug_pubnames", ".zdebug_pubnames" }, - { ".debug_pubtypes", ".zdebug_pubtypes" }, - { ".debug_ranges", ".zdebug_ranges" }, -*************** enum dwarf_debug_section_enum -*** 314,319 **** ---- 315,321 ---- - debug_line, - debug_loc, - debug_macinfo, -+ debug_macro, - debug_pubnames, - debug_pubtypes, - debug_ranges, -diff -cpr ../binutils-2.21.53.0.1.orig/binutils/dwarf.c ./binutils/dwarf.c -*** ../binutils-2.21.53.0.1.orig/binutils/dwarf.c 2011-07-27 09:57:55.204568001 +0100 ---- ./binutils/dwarf.c 2011-07-27 10:00:17.247568001 +0100 -*************** read_and_display_attr_value (unsigned lo -*** 1542,1548 **** - } - } - -! if (do_loc) - return data; - - /* For some attributes we can display further information. */ ---- 1542,1548 ---- - } - } - -! if (do_loc || attribute == 0) - return data; - - /* For some attributes we can display further information. */ -*************** get_AT_name (unsigned long attribute) -*** 1960,1965 **** ---- 1960,1966 ---- - case DW_AT_GNU_all_tail_call_sites: return "DW_AT_GNU_all_tail_call_sites"; - case DW_AT_GNU_all_call_sites: return "DW_AT_GNU_all_call_sites"; - case DW_AT_GNU_all_source_call_sites: return "DW_AT_GNU_all_source_call_sites"; -+ case DW_AT_GNU_macros: return "DW_AT_GNU_macros"; - - /* UPC extension. */ - case DW_AT_upc_threads_scaled: return "DW_AT_upc_threads_scaled"; -*************** display_debug_macinfo (struct dwarf_sect -*** 3450,3455 **** ---- 3451,3771 ---- - return 1; - } - -+ /* Given LINE_OFFSET into the .debug_line section, attempt to return -+ filename and dirname corresponding to file name table entry with index -+ FILEIDX. Return NULL on failure. */ -+ -+ static unsigned char * -+ get_line_filename_and_dirname (dwarf_vma line_offset, dwarf_vma fileidx, -+ unsigned char **dir_name) -+ { -+ struct dwarf_section *section = &debug_displays [line].section; -+ unsigned char *hdrptr, *dirtable, *file_name; -+ unsigned int offset_size, initial_length_size; -+ unsigned int version, opcode_base, bytes_read; -+ dwarf_vma length, diridx; -+ -+ *dir_name = NULL; -+ if (section->start == NULL -+ || line_offset >= section->size -+ || fileidx == 0) -+ return NULL; -+ -+ hdrptr = section->start + line_offset; -+ length = byte_get (hdrptr, 4); -+ hdrptr += 4; -+ if (length == 0xffffffff) -+ { -+ /* This section is 64-bit DWARF 3. */ -+ length = byte_get (hdrptr, 8); -+ hdrptr += 8; -+ offset_size = 8; -+ initial_length_size = 12; -+ } -+ else -+ { -+ offset_size = 4; -+ initial_length_size = 4; -+ } -+ if (length + initial_length_size > section->size) -+ return NULL; -+ version = byte_get (hdrptr, 2); -+ hdrptr += 2; -+ if (version != 2 && version != 3 && version != 4) -+ return NULL; -+ hdrptr += offset_size + 1;/* Skip prologue_length and min_insn_length. */ -+ if (version >= 4) -+ hdrptr++; /* Skip max_ops_per_insn. */ -+ hdrptr += 3; /* Skip default_is_stmt, line_base, line_range. */ -+ opcode_base = byte_get (hdrptr, 1); -+ if (opcode_base == 0) -+ return NULL; -+ hdrptr++; -+ hdrptr += opcode_base - 1; -+ dirtable = hdrptr; -+ /* Skip over dirname table. */ -+ while (*hdrptr != '\0') -+ hdrptr += strlen ((char *) hdrptr) + 1; -+ hdrptr++; /* Skip the NUL at the end of the table. */ -+ /* Now skip over preceding filename table entries. */ -+ for (; *hdrptr != '\0' && fileidx > 1; fileidx--) -+ { -+ hdrptr += strlen ((char *) hdrptr) + 1; -+ read_leb128 (hdrptr, &bytes_read, 0); -+ hdrptr += bytes_read; -+ read_leb128 (hdrptr, &bytes_read, 0); -+ hdrptr += bytes_read; -+ read_leb128 (hdrptr, &bytes_read, 0); -+ hdrptr += bytes_read; -+ } -+ if (*hdrptr == '\0') -+ return NULL; -+ file_name = hdrptr; -+ hdrptr += strlen ((char *) hdrptr) + 1; -+ diridx = read_leb128 (hdrptr, &bytes_read, 0); -+ if (diridx == 0) -+ return file_name; -+ for (; *dirtable != '\0' && diridx > 1; diridx--) -+ dirtable += strlen ((char *) dirtable) + 1; -+ if (*dirtable == '\0') -+ return NULL; -+ *dir_name = dirtable; -+ return file_name; -+ } -+ -+ static int -+ display_debug_macro (struct dwarf_section *section, -+ void *file) -+ { -+ unsigned char *start = section->start; -+ unsigned char *end = start + section->size; -+ unsigned char *curr = start; -+ unsigned char *extended_op_buf[256]; -+ unsigned int bytes_read; -+ -+ load_debug_section (str, file); -+ load_debug_section (line, file); -+ -+ printf (_("Contents of the %s section:\n\n"), section->name); -+ -+ while (curr < end) -+ { -+ unsigned int lineno, version, flags; -+ unsigned int offset_size = 4; -+ const char *string; -+ dwarf_vma line_offset = 0, sec_offset = curr - start, offset; -+ unsigned char **extended_ops = NULL; -+ -+ version = byte_get (curr, 2); -+ curr += 2; -+ -+ if (version != 4) -+ { -+ error (_("Only GNU extension to DWARF 4 of %s is currently supported.\n"), -+ section->name); -+ return 0; -+ } -+ -+ flags = byte_get (curr++, 1); -+ if (flags & 1) -+ offset_size = 8; -+ printf (_(" Offset: 0x%lx\n"), -+ (unsigned long) sec_offset); -+ printf (_(" Version: %d\n"), version); -+ printf (_(" Offset size: %d\n"), offset_size); -+ if (flags & 2) -+ { -+ line_offset = byte_get (curr, offset_size); -+ curr += offset_size; -+ printf (_(" Offset into .debug_line: 0x%lx\n"), -+ (unsigned long) line_offset); -+ } -+ if (flags & 4) -+ { -+ unsigned int i, count = byte_get (curr++, 1), op; -+ dwarf_vma nargs, n; -+ memset (extended_op_buf, 0, sizeof (extended_op_buf)); -+ extended_ops = extended_op_buf; -+ if (count) -+ { -+ printf (_(" Extension opcode arguments:\n")); -+ for (i = 0; i < count; i++) -+ { -+ op = byte_get (curr++, 1); -+ extended_ops[op] = curr; -+ nargs = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ if (nargs == 0) -+ printf (_(" DW_MACRO_GNU_%02x has no arguments\n"), op); -+ else -+ { -+ printf (_(" DW_MACRO_GNU_%02x arguments: "), op); -+ for (n = 0; n < nargs; n++) -+ { -+ unsigned int form = byte_get (curr++, 1); -+ printf ("%s%s", get_FORM_name (form), -+ n == nargs - 1 ? "\n" : ", "); -+ switch (form) -+ { -+ case DW_FORM_data1: -+ case DW_FORM_data2: -+ case DW_FORM_data4: -+ case DW_FORM_data8: -+ case DW_FORM_sdata: -+ case DW_FORM_udata: -+ case DW_FORM_block: -+ case DW_FORM_block1: -+ case DW_FORM_block2: -+ case DW_FORM_block4: -+ case DW_FORM_flag: -+ case DW_FORM_string: -+ case DW_FORM_strp: -+ case DW_FORM_sec_offset: -+ break; -+ default: -+ error (_("Invalid extension opcode form %s\n"), -+ get_FORM_name (form)); -+ return 0; -+ } -+ } -+ } -+ } -+ } -+ } -+ printf ("\n"); -+ -+ while (1) -+ { -+ unsigned int op; -+ -+ if (curr >= end) -+ { -+ error (_(".debug_macro section not zero terminated\n")); -+ return 0; -+ } -+ -+ op = byte_get (curr++, 1); -+ if (op == 0) -+ break; -+ -+ switch (op) -+ { -+ case DW_MACRO_GNU_start_file: -+ { -+ unsigned int filenum; -+ unsigned char *file_name = NULL, *dir_name = NULL; -+ -+ lineno = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ filenum = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ -+ if ((flags & 2) == 0) -+ error (_("DW_MACRO_GNU_start_file used, but no .debug_line offset provided.\n")); -+ else -+ file_name -+ = get_line_filename_and_dirname (line_offset, filenum, -+ &dir_name); -+ if (file_name == NULL) -+ printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d\n"), -+ lineno, filenum); -+ else -+ printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d filename: %s%s%s\n"), -+ lineno, filenum, -+ dir_name != NULL ? (const char *) dir_name : "", -+ dir_name != NULL ? "/" : "", file_name); -+ } -+ break; -+ -+ case DW_MACRO_GNU_end_file: -+ printf (_(" DW_MACRO_GNU_end_file\n")); -+ break; -+ -+ case DW_MACRO_GNU_define: -+ lineno = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ string = (char *) curr; -+ curr += strlen (string) + 1; -+ printf (_(" DW_MACRO_GNU_define - lineno : %d macro : %s\n"), -+ lineno, string); -+ break; -+ -+ case DW_MACRO_GNU_undef: -+ lineno = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ string = (char *) curr; -+ curr += strlen (string) + 1; -+ printf (_(" DW_MACRO_GNU_undef - lineno : %d macro : %s\n"), -+ lineno, string); -+ break; -+ -+ case DW_MACRO_GNU_define_indirect: -+ lineno = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ offset = byte_get (curr, offset_size); -+ curr += offset_size; -+ string = fetch_indirect_string (offset); -+ printf (_(" DW_MACRO_GNU_define_indirect - lineno : %d macro : %s\n"), -+ lineno, string); -+ break; -+ -+ case DW_MACRO_GNU_undef_indirect: -+ lineno = read_leb128 (curr, &bytes_read, 0); -+ curr += bytes_read; -+ offset = byte_get (curr, offset_size); -+ curr += offset_size; -+ string = fetch_indirect_string (offset); -+ printf (_(" DW_MACRO_GNU_undef_indirect - lineno : %d macro : %s\n"), -+ lineno, string); -+ break; -+ -+ case DW_MACRO_GNU_transparent_include: -+ offset = byte_get (curr, offset_size); -+ curr += offset_size; -+ printf (_(" DW_MACRO_GNU_transparent_include - offset : 0x%lx\n"), -+ (unsigned long) offset); -+ break; -+ -+ default: -+ if (extended_ops == NULL || extended_ops[op] == NULL) -+ { -+ error (_(" Unknown macro opcode %02x seen\n"), op); -+ return 0; -+ } -+ else -+ { -+ /* Skip over unhandled opcodes. */ -+ dwarf_vma nargs, n; -+ unsigned char *desc = extended_ops[op]; -+ nargs = read_leb128 (desc, &bytes_read, 0); -+ desc += bytes_read; -+ if (nargs == 0) -+ { -+ printf (_(" DW_MACRO_GNU_%02x\n"), op); -+ break; -+ } -+ printf (_(" DW_MACRO_GNU_%02x -"), op); -+ for (n = 0; n < nargs; n++) -+ { -+ curr -+ = read_and_display_attr_value (0, byte_get (desc++, 1), -+ curr, 0, 0, offset_size, -+ version, NULL, 0, NULL); -+ if (n != nargs - 1) -+ printf (","); -+ } -+ printf ("\n"); -+ } -+ break; -+ } -+ } -+ -+ printf ("\n"); -+ } -+ -+ return 1; -+ } -+ - static int - display_debug_abbrev (struct dwarf_section *section, - void *file ATTRIBUTE_UNUSED) -*************** struct dwarf_section_display debug_displ -*** 5536,5541 **** ---- 5852,5859 ---- - display_debug_frames, &do_debug_frames, 1 }, - { { ".debug_macinfo", ".zdebug_macinfo", NULL, NULL, 0, 0 }, - display_debug_macinfo, &do_debug_macinfo, 0 }, -+ { { ".debug_macro", ".zdebug_macro", NULL, NULL, 0, 0 }, -+ display_debug_macro, &do_debug_macinfo, 1 }, - { { ".debug_str", ".zdebug_str", NULL, NULL, 0, 0 }, - display_debug_str, &do_debug_str, 0 }, - { { ".debug_loc", ".zdebug_loc", NULL, NULL, 0, 0 }, -diff -cpr ../binutils-2.21.53.0.1.orig/binutils/dwarf.h ./binutils/dwarf.h -*** ../binutils-2.21.53.0.1.orig/binutils/dwarf.h 2011-07-27 09:57:54.835568000 +0100 ---- ./binutils/dwarf.h 2011-07-27 10:00:27.506568001 +0100 -*************** enum dwarf_section_display_enum -*** 143,148 **** ---- 143,149 ---- - pubnames, - eh_frame, - macinfo, -+ macro, - str, - loc, - pubtypes, -diff -cpr ../binutils-2.21.53.0.1.orig/binutils/readelf.c ./binutils/readelf.c -*** ../binutils-2.21.53.0.1.orig/binutils/readelf.c 2011-07-27 09:57:55.019568001 +0100 ---- ./binutils/readelf.c 2011-07-27 10:00:35.362568001 +0100 -*************** process_section_headers (FILE * file) -*** 4614,4619 **** ---- 4614,4620 ---- - || (do_debug_ranges && streq (name, "ranges")) - || (do_debug_frames && streq (name, "frame")) - || (do_debug_macinfo && streq (name, "macinfo")) -+ || (do_debug_macinfo && streq (name, "macro")) - || (do_debug_str && streq (name, "str")) - || (do_debug_loc && streq (name, "loc")) - ) -*** ../binutils-2.21.53.0.1.orig/include/dwarf2.h 2011-07-27 09:57:55.773568001 +0100 ---- include/dwarf2.h 2011-07-27 10:20:37.147568000 +0100 -*************** enum dwarf_attribute -*** 366,371 **** ---- 366,373 ---- - DW_AT_GNU_all_tail_call_sites = 0x2116, - DW_AT_GNU_all_call_sites = 0x2117, - DW_AT_GNU_all_source_call_sites = 0x2118, -+ /* Section offset into .debug_macro section. */ -+ DW_AT_GNU_macros = 0x2119, - /* VMS extensions. */ - DW_AT_VMS_rtnbeg_pd_address = 0x2201, - /* GNAT extensions. */ -*************** enum dwarf_macinfo_record_type -*** 880,885 **** ---- 882,901 ---- - DW_MACINFO_vendor_ext = 255 - }; - -+ /* Names and codes for new style macro information. */ -+ enum dwarf_macro_record_type -+ { -+ DW_MACRO_GNU_define = 1, -+ DW_MACRO_GNU_undef = 2, -+ DW_MACRO_GNU_start_file = 3, -+ DW_MACRO_GNU_end_file = 4, -+ DW_MACRO_GNU_define_indirect = 5, -+ DW_MACRO_GNU_undef_indirect = 6, -+ DW_MACRO_GNU_transparent_include = 7, -+ DW_MACRO_GNU_lo_user = 0xe0, -+ DW_MACRO_GNU_hi_user = 0xff -+ }; -+ - /* @@@ For use with GNU frame unwind information. */ - - #define DW_EH_PE_absptr 0x00 diff --git a/binutils-2.21.53.0.1-demangle.patch b/binutils-2.21.53.0.1-demangle.patch deleted file mode 100644 index 4e2f8eb..0000000 --- a/binutils-2.21.53.0.1-demangle.patch +++ /dev/null @@ -1,1062 +0,0 @@ -diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//cp-demangle.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/cp-demangle.c ---- binutils-2.21.53.0.1/libiberty//cp-demangle.c 2011-07-17 22:38:06.000000000 +0200 -+++ gcc-4.6.1-20110715/libiberty/cp-demangle.c 2011-03-15 15:32:36.000000000 +0100 -@@ -278,6 +278,8 @@ struct d_growable_string - enum { D_PRINT_BUFFER_LENGTH = 256 }; - struct d_print_info - { -+ /* The options passed to the demangler. */ -+ int options; - /* Fixed-length allocated buffer for demangled data, flushed to the - callback with a NUL termination once full. */ - char buf[D_PRINT_BUFFER_LENGTH]; -@@ -434,7 +436,7 @@ static void - d_growable_string_callback_adapter (const char *, size_t, void *); - - static void --d_print_init (struct d_print_info *, demangle_callbackref, void *); -+d_print_init (struct d_print_info *, int, demangle_callbackref, void *); - - static inline void d_print_error (struct d_print_info *); - -@@ -452,32 +454,32 @@ static inline void d_append_string (stru - static inline char d_last_char (struct d_print_info *); - - static void --d_print_comp (struct d_print_info *, int, const struct demangle_component *); -+d_print_comp (struct d_print_info *, const struct demangle_component *); - - static void - d_print_java_identifier (struct d_print_info *, const char *, int); - - static void --d_print_mod_list (struct d_print_info *, int, struct d_print_mod *, int); -+d_print_mod_list (struct d_print_info *, struct d_print_mod *, int); - - static void --d_print_mod (struct d_print_info *, int, const struct demangle_component *); -+d_print_mod (struct d_print_info *, const struct demangle_component *); - - static void --d_print_function_type (struct d_print_info *, int, -+d_print_function_type (struct d_print_info *, - const struct demangle_component *, - struct d_print_mod *); - - static void --d_print_array_type (struct d_print_info *, int, -+d_print_array_type (struct d_print_info *, - const struct demangle_component *, - struct d_print_mod *); - - static void --d_print_expr_op (struct d_print_info *, int, const struct demangle_component *); -+d_print_expr_op (struct d_print_info *, const struct demangle_component *); - - static void --d_print_cast (struct d_print_info *, int, const struct demangle_component *); -+d_print_cast (struct d_print_info *, const struct demangle_component *); - - static int d_demangle_callback (const char *, int, - demangle_callbackref, void *); -@@ -2738,18 +2740,10 @@ d_expression (struct d_info *di) - /* Function parameter used in a late-specified return type. */ - int index; - d_advance (di, 2); -- if (d_peek_char (di) == 'T') -- { -- /* 'this' parameter. */ -- d_advance (di, 1); -- index = 0; -- } -- else -- { -- index = d_compact_number (di) + 1; -- if (index == 0) -- return NULL; -- } -+ index = d_compact_number (di); -+ if (index < 0) -+ return NULL; -+ - return d_make_function_param (di, index); - } - else if (IS_DIGIT (peek) -@@ -3299,9 +3293,10 @@ d_growable_string_callback_adapter (cons - /* Initialize a print information structure. */ - - static void --d_print_init (struct d_print_info *dpi, demangle_callbackref callback, -- void *opaque) -+d_print_init (struct d_print_info *dpi, int options, -+ demangle_callbackref callback, void *opaque) - { -+ dpi->options = options; - dpi->len = 0; - dpi->last_char = '\0'; - dpi->templates = NULL; -@@ -3397,9 +3392,9 @@ cplus_demangle_print_callback (int optio - { - struct d_print_info dpi; - -- d_print_init (&dpi, callback, opaque); -+ d_print_init (&dpi, options, callback, opaque); - -- d_print_comp (&dpi, options, dc); -+ d_print_comp (&dpi, dc); - - d_print_flush (&dpi); - -@@ -3542,7 +3537,7 @@ d_pack_length (const struct demangle_com - if needed. */ - - static void --d_print_subexpr (struct d_print_info *dpi, int options, -+d_print_subexpr (struct d_print_info *dpi, - const struct demangle_component *dc) - { - int simple = 0; -@@ -3551,7 +3546,7 @@ d_print_subexpr (struct d_print_info *dp - simple = 1; - if (!simple) - d_append_char (dpi, '('); -- d_print_comp (dpi, options, dc); -+ d_print_comp (dpi, dc); - if (!simple) - d_append_char (dpi, ')'); - } -@@ -3559,13 +3554,9 @@ d_print_subexpr (struct d_print_info *dp - /* Subroutine to handle components. */ - - static void --d_print_comp (struct d_print_info *dpi, int options, -+d_print_comp (struct d_print_info *dpi, - const struct demangle_component *dc) - { -- /* Magic variable to let reference smashing skip over the next modifier -- without needing to modify *dc. */ -- const struct demangle_component *mod_inner = NULL; -- - if (dc == NULL) - { - d_print_error (dpi); -@@ -3577,7 +3568,7 @@ d_print_comp (struct d_print_info *dpi, - switch (dc->type) - { - case DEMANGLE_COMPONENT_NAME: -- if ((options & DMGL_JAVA) == 0) -+ if ((dpi->options & DMGL_JAVA) == 0) - d_append_buffer (dpi, dc->u.s_name.s, dc->u.s_name.len); - else - d_print_java_identifier (dpi, dc->u.s_name.s, dc->u.s_name.len); -@@ -3585,12 +3576,12 @@ d_print_comp (struct d_print_info *dpi, - - case DEMANGLE_COMPONENT_QUAL_NAME: - case DEMANGLE_COMPONENT_LOCAL_NAME: -- d_print_comp (dpi, options, d_left (dc)); -- if ((options & DMGL_JAVA) == 0) -+ d_print_comp (dpi, d_left (dc)); -+ if ((dpi->options & DMGL_JAVA) == 0) - d_append_string (dpi, "::"); - else - d_append_char (dpi, '.'); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - return; - - case DEMANGLE_COMPONENT_TYPED_NAME: -@@ -3680,7 +3671,7 @@ d_print_comp (struct d_print_info *dpi, - } - } - -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - - if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE) - dpi->templates = dpt.next; -@@ -3693,7 +3684,7 @@ d_print_comp (struct d_print_info *dpi, - if (! adpm[i].printed) - { - d_append_char (dpi, ' '); -- d_print_mod (dpi, options, adpm[i].mod); -+ d_print_mod (dpi, adpm[i].mod); - } - } - -@@ -3716,7 +3707,7 @@ d_print_comp (struct d_print_info *dpi, - - dcl = d_left (dc); - -- if ((options & DMGL_JAVA) != 0 -+ if ((dpi->options & DMGL_JAVA) != 0 - && dcl->type == DEMANGLE_COMPONENT_NAME - && dcl->u.s_name.len == 6 - && strncmp (dcl->u.s_name.s, "JArray", 6) == 0) -@@ -3724,16 +3715,16 @@ d_print_comp (struct d_print_info *dpi, - /* Special-case Java arrays, so that JArray appears - instead as TYPE[]. */ - -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - d_append_string (dpi, "[]"); - } - else - { -- d_print_comp (dpi, options, dcl); -+ d_print_comp (dpi, dcl); - if (d_last_char (dpi) == '<') - d_append_char (dpi, ' '); - d_append_char (dpi, '<'); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - /* Avoid generating two consecutive '>' characters, to avoid - the C++ syntactic ambiguity. */ - if (d_last_char (dpi) == '>') -@@ -3768,7 +3759,7 @@ d_print_comp (struct d_print_info *dpi, - hold_dpt = dpi->templates; - dpi->templates = hold_dpt->next; - -- d_print_comp (dpi, options, a); -+ d_print_comp (dpi, a); - - dpi->templates = hold_dpt; - -@@ -3776,79 +3767,79 @@ d_print_comp (struct d_print_info *dpi, - } - - case DEMANGLE_COMPONENT_CTOR: -- d_print_comp (dpi, options, dc->u.s_ctor.name); -+ d_print_comp (dpi, dc->u.s_ctor.name); - return; - - case DEMANGLE_COMPONENT_DTOR: - d_append_char (dpi, '~'); -- d_print_comp (dpi, options, dc->u.s_dtor.name); -+ d_print_comp (dpi, dc->u.s_dtor.name); - return; - - case DEMANGLE_COMPONENT_VTABLE: - d_append_string (dpi, "vtable for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_VTT: - d_append_string (dpi, "VTT for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE: - d_append_string (dpi, "construction vtable for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - d_append_string (dpi, "-in-"); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - return; - - case DEMANGLE_COMPONENT_TYPEINFO: - d_append_string (dpi, "typeinfo for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_TYPEINFO_NAME: - d_append_string (dpi, "typeinfo name for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_TYPEINFO_FN: - d_append_string (dpi, "typeinfo fn for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_THUNK: - d_append_string (dpi, "non-virtual thunk to "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_VIRTUAL_THUNK: - d_append_string (dpi, "virtual thunk to "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_COVARIANT_THUNK: - d_append_string (dpi, "covariant return thunk to "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_JAVA_CLASS: - d_append_string (dpi, "java Class for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_GUARD: - d_append_string (dpi, "guard variable for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_REFTEMP: - d_append_string (dpi, "reference temporary for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_HIDDEN_ALIAS: - d_append_string (dpi, "hidden alias for "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_SUB_STD: -@@ -3875,43 +3866,22 @@ d_print_comp (struct d_print_info *dpi, - break; - if (pdpm->mod->type == dc->type) - { -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - } - } - } - } -- goto modifier; -- -- case DEMANGLE_COMPONENT_REFERENCE: -- case DEMANGLE_COMPONENT_RVALUE_REFERENCE: -- { -- /* Handle reference smashing: & + && = &. */ -- const struct demangle_component *sub = d_left (dc); -- if (sub->type == DEMANGLE_COMPONENT_TEMPLATE_PARAM) -- { -- struct demangle_component *a = d_lookup_template_argument (dpi, sub); -- if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST) -- a = d_index_template_argument (a, dpi->pack_index); -- sub = a; -- } -- -- if (sub->type == DEMANGLE_COMPONENT_REFERENCE -- || sub->type == dc->type) -- dc = sub; -- else if (sub->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE) -- mod_inner = d_left (sub); -- } - /* Fall through. */ -- - case DEMANGLE_COMPONENT_RESTRICT_THIS: - case DEMANGLE_COMPONENT_VOLATILE_THIS: - case DEMANGLE_COMPONENT_CONST_THIS: - case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: - case DEMANGLE_COMPONENT_POINTER: -+ case DEMANGLE_COMPONENT_REFERENCE: -+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE: - case DEMANGLE_COMPONENT_COMPLEX: - case DEMANGLE_COMPONENT_IMAGINARY: -- modifier: - { - /* We keep a list of modifiers on the stack. */ - struct d_print_mod dpm; -@@ -3922,15 +3892,12 @@ d_print_comp (struct d_print_info *dpi, - dpm.printed = 0; - dpm.templates = dpi->templates; - -- if (!mod_inner) -- mod_inner = d_left (dc); -- -- d_print_comp (dpi, options, mod_inner); -+ d_print_comp (dpi, d_left (dc)); - - /* If the modifier didn't get printed by the type, print it - now. */ - if (! dpm.printed) -- d_print_mod (dpi, options, dc); -+ d_print_mod (dpi, dc); - - dpi->modifiers = dpm.next; - -@@ -3938,7 +3905,7 @@ d_print_comp (struct d_print_info *dpi, - } - - case DEMANGLE_COMPONENT_BUILTIN_TYPE: -- if ((options & DMGL_JAVA) == 0) -+ if ((dpi->options & DMGL_JAVA) == 0) - d_append_buffer (dpi, dc->u.s_builtin.type->name, - dc->u.s_builtin.type->len); - else -@@ -3947,21 +3914,16 @@ d_print_comp (struct d_print_info *dpi, - return; - - case DEMANGLE_COMPONENT_VENDOR_TYPE: -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_FUNCTION_TYPE: - { -- if ((options & DMGL_RET_POSTFIX) != 0) -- d_print_function_type (dpi, -- options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP), -- dc, dpi->modifiers); -+ if ((dpi->options & DMGL_RET_POSTFIX) != 0) -+ d_print_function_type (dpi, dc, dpi->modifiers); - - /* Print return type if present */ -- if (d_left (dc) != NULL && (options & DMGL_RET_POSTFIX) != 0) -- d_print_comp (dpi, options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP), -- d_left (dc)); -- else if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0) -+ if (d_left (dc) != NULL) - { - struct d_print_mod dpm; - -@@ -3973,8 +3935,7 @@ d_print_comp (struct d_print_info *dpi, - dpm.printed = 0; - dpm.templates = dpi->templates; - -- d_print_comp (dpi, options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP), -- d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - - dpi->modifiers = dpm.next; - -@@ -3983,14 +3944,12 @@ d_print_comp (struct d_print_info *dpi, - - /* In standard prefix notation, there is a space between the - return type and the function signature. */ -- if ((options & DMGL_RET_POSTFIX) == 0) -+ if ((dpi->options & DMGL_RET_POSTFIX) == 0) - d_append_char (dpi, ' '); - } - -- if ((options & DMGL_RET_POSTFIX) == 0) -- d_print_function_type (dpi, -- options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP), -- dc, dpi->modifiers); -+ if ((dpi->options & DMGL_RET_POSTFIX) == 0) -+ d_print_function_type (dpi, dc, dpi->modifiers); - - return; - } -@@ -4043,7 +4002,7 @@ d_print_comp (struct d_print_info *dpi, - pdpm = pdpm->next; - } - -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - - dpi->modifiers = hold_modifiers; - -@@ -4053,10 +4012,10 @@ d_print_comp (struct d_print_info *dpi, - while (i > 1) - { - --i; -- d_print_mod (dpi, options, adpm[i].mod); -+ d_print_mod (dpi, adpm[i].mod); - } - -- d_print_array_type (dpi, options, dc, dpi->modifiers); -+ d_print_array_type (dpi, dc, dpi->modifiers); - - return; - } -@@ -4072,12 +4031,12 @@ d_print_comp (struct d_print_info *dpi, - dpm.printed = 0; - dpm.templates = dpi->templates; - -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - - /* If the modifier didn't get printed by the type, print it - now. */ - if (! dpm.printed) -- d_print_mod (dpi, options, dc); -+ d_print_mod (dpi, dc); - - dpi->modifiers = dpm.next; - -@@ -4091,7 +4050,7 @@ d_print_comp (struct d_print_info *dpi, - if (dc->u.s_fixed.length->u.s_builtin.type - != &cplus_demangle_builtin_types['i'-'a']) - { -- d_print_comp (dpi, options, dc->u.s_fixed.length); -+ d_print_comp (dpi, dc->u.s_fixed.length); - d_append_char (dpi, ' '); - } - if (dc->u.s_fixed.accum) -@@ -4103,7 +4062,7 @@ d_print_comp (struct d_print_info *dpi, - case DEMANGLE_COMPONENT_ARGLIST: - case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST: - if (d_left (dc) != NULL) -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - if (d_right (dc) != NULL) - { - size_t len; -@@ -4115,7 +4074,7 @@ d_print_comp (struct d_print_info *dpi, - d_append_string (dpi, ", "); - len = dpi->len; - flush_count = dpi->flush_count; -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - /* If that didn't print anything (which can happen with empty - template argument packs), remove the comma and space. */ - if (dpi->flush_count == flush_count && dpi->len == len) -@@ -4138,63 +4097,24 @@ d_print_comp (struct d_print_info *dpi, - - case DEMANGLE_COMPONENT_EXTENDED_OPERATOR: - d_append_string (dpi, "operator "); -- d_print_comp (dpi, options, dc->u.s_extended_operator.name); -+ d_print_comp (dpi, dc->u.s_extended_operator.name); - return; - - case DEMANGLE_COMPONENT_CAST: - d_append_string (dpi, "operator "); -- d_print_cast (dpi, options, dc); -+ d_print_cast (dpi, dc); - return; - - case DEMANGLE_COMPONENT_UNARY: -- if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR -- && d_left (dc)->u.s_operator.op->len == 1 -- && d_left (dc)->u.s_operator.op->name[0] == '&' -- && d_right (dc)->type == DEMANGLE_COMPONENT_TYPED_NAME -- && d_left (d_right (dc))->type == DEMANGLE_COMPONENT_QUAL_NAME -- && d_right (d_right (dc))->type == DEMANGLE_COMPONENT_FUNCTION_TYPE) -- { -- /* Address of a function (therefore in an expression context) must -- have its argument list suppressed. -- -- unary operator ... dc -- operator & ... d_left (dc) -- typed name ... d_right (dc) -- qualified name ... d_left (d_right (dc)) -- -- function type ... d_right (d_right (dc)) -- argument list -- */ -- -- d_print_expr_op (dpi, options, d_left (dc)); -- d_print_comp (dpi, options, d_left (d_right (dc))); -- return; -- } -- else if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR -- && d_left (dc)->u.s_operator.op->len == 1 -- && d_left (dc)->u.s_operator.op->name[0] == '&' -- && d_right (dc)->type == DEMANGLE_COMPONENT_QUAL_NAME) -- { -- /* Keep also already processed variant without the argument list. -- -- unary operator ... dc -- operator & ... d_left (dc) -- qualified name ... d_right (dc) -- */ -- -- d_print_expr_op (dpi, options, d_left (dc)); -- d_print_comp (dpi, options, d_right (dc)); -- return; -- } -- else if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST) -- d_print_expr_op (dpi, options, d_left (dc)); -+ if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST) -+ d_print_expr_op (dpi, d_left (dc)); - else - { - d_append_char (dpi, '('); -- d_print_cast (dpi, options, d_left (dc)); -+ d_print_cast (dpi, d_left (dc)); - d_append_char (dpi, ')'); - } -- d_print_subexpr (dpi, options, d_right (dc)); -+ d_print_subexpr (dpi, d_right (dc)); - return; - - case DEMANGLE_COMPONENT_BINARY: -@@ -4212,32 +4132,18 @@ d_print_comp (struct d_print_info *dpi, - && d_left (dc)->u.s_operator.op->name[0] == '>') - d_append_char (dpi, '('); - -- if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") == 0 -- && d_left (d_right (dc))->type == DEMANGLE_COMPONENT_TYPED_NAME) -- { -- /* Function call used in an expression should not have printed types -- of the function arguments. Values of the function arguments still -- get printed below. */ -- -- const struct demangle_component *func = d_left (d_right (dc)); -- -- if (d_right (func)->type != DEMANGLE_COMPONENT_FUNCTION_TYPE) -- d_print_error (dpi); -- d_print_subexpr (dpi, options, d_left (func)); -- } -- else -- d_print_subexpr (dpi, options, d_left (d_right (dc))); -+ d_print_subexpr (dpi, d_left (d_right (dc))); - if (strcmp (d_left (dc)->u.s_operator.op->code, "ix") == 0) - { - d_append_char (dpi, '['); -- d_print_comp (dpi, options, d_right (d_right (dc))); -+ d_print_comp (dpi, d_right (d_right (dc))); - d_append_char (dpi, ']'); - } - else - { - if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") != 0) -- d_print_expr_op (dpi, options, d_left (dc)); -- d_print_subexpr (dpi, options, d_right (d_right (dc))); -+ d_print_expr_op (dpi, d_left (dc)); -+ d_print_subexpr (dpi, d_right (d_right (dc))); - } - - if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR -@@ -4259,11 +4165,11 @@ d_print_comp (struct d_print_info *dpi, - d_print_error (dpi); - return; - } -- d_print_subexpr (dpi, options, d_left (d_right (dc))); -- d_print_expr_op (dpi, options, d_left (dc)); -- d_print_subexpr (dpi, options, d_left (d_right (d_right (dc)))); -+ d_print_subexpr (dpi, d_left (d_right (dc))); -+ d_print_expr_op (dpi, d_left (dc)); -+ d_print_subexpr (dpi, d_left (d_right (d_right (dc)))); - d_append_string (dpi, " : "); -- d_print_subexpr (dpi, options, d_right (d_right (d_right (dc)))); -+ d_print_subexpr (dpi, d_right (d_right (d_right (dc)))); - return; - - case DEMANGLE_COMPONENT_TRINARY_ARG1: -@@ -4294,7 +4200,7 @@ d_print_comp (struct d_print_info *dpi, - { - if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG) - d_append_char (dpi, '-'); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - switch (tp) - { - default: -@@ -4344,13 +4250,13 @@ d_print_comp (struct d_print_info *dpi, - } - - d_append_char (dpi, '('); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - d_append_char (dpi, ')'); - if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG) - d_append_char (dpi, '-'); - if (tp == D_PRINT_FLOAT) - d_append_char (dpi, '['); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - if (tp == D_PRINT_FLOAT) - d_append_char (dpi, ']'); - } -@@ -4362,12 +4268,12 @@ d_print_comp (struct d_print_info *dpi, - - case DEMANGLE_COMPONENT_JAVA_RESOURCE: - d_append_string (dpi, "java resource "); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - return; - - case DEMANGLE_COMPONENT_COMPOUND_NAME: -- d_print_comp (dpi, options, d_left (dc)); -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_left (dc)); -+ d_print_comp (dpi, d_right (dc)); - return; - - case DEMANGLE_COMPONENT_CHARACTER: -@@ -4376,7 +4282,7 @@ d_print_comp (struct d_print_info *dpi, - - case DEMANGLE_COMPONENT_DECLTYPE: - d_append_string (dpi, "decltype ("); -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - d_append_char (dpi, ')'); - return; - -@@ -4390,7 +4296,7 @@ d_print_comp (struct d_print_info *dpi, - /* d_find_pack won't find anything if the only packs involved - in this expansion are function parameter packs; in that - case, just print the pattern and "...". */ -- d_print_subexpr (dpi, options, d_left (dc)); -+ d_print_subexpr (dpi, d_left (dc)); - d_append_string (dpi, "..."); - return; - } -@@ -4400,7 +4306,7 @@ d_print_comp (struct d_print_info *dpi, - for (i = 0; i < len; ++i) - { - dpi->pack_index = i; -- d_print_comp (dpi, options, dc); -+ d_print_comp (dpi, dc); - if (i < len-1) - d_append_string (dpi, ", "); - } -@@ -4408,32 +4314,24 @@ d_print_comp (struct d_print_info *dpi, - return; - - case DEMANGLE_COMPONENT_FUNCTION_PARAM: -- { -- long num = dc->u.s_number.number; -- if (num == 0) -- d_append_string (dpi, "this"); -- else -- { -- d_append_string (dpi, "{parm#"); -- d_append_num (dpi, num); -- d_append_char (dpi, '}'); -- } -- } -+ d_append_string (dpi, "{parm#"); -+ d_append_num (dpi, dc->u.s_number.number + 1); -+ d_append_char (dpi, '}'); - return; - - case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS: - d_append_string (dpi, "global constructors keyed to "); -- d_print_comp (dpi, options, dc->u.s_binary.left); -+ d_print_comp (dpi, dc->u.s_binary.left); - return; - - case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS: - d_append_string (dpi, "global destructors keyed to "); -- d_print_comp (dpi, options, dc->u.s_binary.left); -+ d_print_comp (dpi, dc->u.s_binary.left); - return; - - case DEMANGLE_COMPONENT_LAMBDA: - d_append_string (dpi, "{lambda("); -- d_print_comp (dpi, options, dc->u.s_unary_num.sub); -+ d_print_comp (dpi, dc->u.s_unary_num.sub); - d_append_string (dpi, ")#"); - d_append_num (dpi, dc->u.s_unary_num.num + 1); - d_append_char (dpi, '}'); -@@ -4507,7 +4405,7 @@ d_print_java_identifier (struct d_print_ - qualifiers on this after printing a function. */ - - static void --d_print_mod_list (struct d_print_info *dpi, int options, -+d_print_mod_list (struct d_print_info *dpi, - struct d_print_mod *mods, int suffix) - { - struct d_print_template *hold_dpt; -@@ -4521,7 +4419,7 @@ d_print_mod_list (struct d_print_info *d - || mods->mod->type == DEMANGLE_COMPONENT_VOLATILE_THIS - || mods->mod->type == DEMANGLE_COMPONENT_CONST_THIS))) - { -- d_print_mod_list (dpi, options, mods->next, suffix); -+ d_print_mod_list (dpi, mods->next, suffix); - return; - } - -@@ -4532,13 +4430,13 @@ d_print_mod_list (struct d_print_info *d - - if (mods->mod->type == DEMANGLE_COMPONENT_FUNCTION_TYPE) - { -- d_print_function_type (dpi, options, mods->mod, mods->next); -+ d_print_function_type (dpi, mods->mod, mods->next); - dpi->templates = hold_dpt; - return; - } - else if (mods->mod->type == DEMANGLE_COMPONENT_ARRAY_TYPE) - { -- d_print_array_type (dpi, options, mods->mod, mods->next); -+ d_print_array_type (dpi, mods->mod, mods->next); - dpi->templates = hold_dpt; - return; - } -@@ -4554,10 +4452,10 @@ d_print_mod_list (struct d_print_info *d - - hold_modifiers = dpi->modifiers; - dpi->modifiers = NULL; -- d_print_comp (dpi, options, d_left (mods->mod)); -+ d_print_comp (dpi, d_left (mods->mod)); - dpi->modifiers = hold_modifiers; - -- if ((options & DMGL_JAVA) == 0) -+ if ((dpi->options & DMGL_JAVA) == 0) - d_append_string (dpi, "::"); - else - d_append_char (dpi, '.'); -@@ -4577,23 +4475,23 @@ d_print_mod_list (struct d_print_info *d - || dc->type == DEMANGLE_COMPONENT_CONST_THIS) - dc = d_left (dc); - -- d_print_comp (dpi, options, dc); -+ d_print_comp (dpi, dc); - - dpi->templates = hold_dpt; - return; - } - -- d_print_mod (dpi, options, mods->mod); -+ d_print_mod (dpi, mods->mod); - - dpi->templates = hold_dpt; - -- d_print_mod_list (dpi, options, mods->next, suffix); -+ d_print_mod_list (dpi, mods->next, suffix); - } - - /* Print a modifier. */ - - static void --d_print_mod (struct d_print_info *dpi, int options, -+d_print_mod (struct d_print_info *dpi, - const struct demangle_component *mod) - { - switch (mod->type) -@@ -4612,11 +4510,11 @@ d_print_mod (struct d_print_info *dpi, i - return; - case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: - d_append_char (dpi, ' '); -- d_print_comp (dpi, options, d_right (mod)); -+ d_print_comp (dpi, d_right (mod)); - return; - case DEMANGLE_COMPONENT_POINTER: - /* There is no pointer symbol in Java. */ -- if ((options & DMGL_JAVA) == 0) -+ if ((dpi->options & DMGL_JAVA) == 0) - d_append_char (dpi, '*'); - return; - case DEMANGLE_COMPONENT_REFERENCE: -@@ -4634,22 +4532,22 @@ d_print_mod (struct d_print_info *dpi, i - case DEMANGLE_COMPONENT_PTRMEM_TYPE: - if (d_last_char (dpi) != '(') - d_append_char (dpi, ' '); -- d_print_comp (dpi, options, d_left (mod)); -+ d_print_comp (dpi, d_left (mod)); - d_append_string (dpi, "::*"); - return; - case DEMANGLE_COMPONENT_TYPED_NAME: -- d_print_comp (dpi, options, d_left (mod)); -+ d_print_comp (dpi, d_left (mod)); - return; - case DEMANGLE_COMPONENT_VECTOR_TYPE: - d_append_string (dpi, " __vector("); -- d_print_comp (dpi, options, d_left (mod)); -+ d_print_comp (dpi, d_left (mod)); - d_append_char (dpi, ')'); - return; - - default: - /* Otherwise, we have something that won't go back on the - modifier stack, so we can just print it. */ -- d_print_comp (dpi, options, mod); -+ d_print_comp (dpi, mod); - return; - } - } -@@ -4657,7 +4555,7 @@ d_print_mod (struct d_print_info *dpi, i - /* Print a function type, except for the return type. */ - - static void --d_print_function_type (struct d_print_info *dpi, int options, -+d_print_function_type (struct d_print_info *dpi, - const struct demangle_component *dc, - struct d_print_mod *mods) - { -@@ -4717,7 +4615,7 @@ d_print_function_type (struct d_print_in - hold_modifiers = dpi->modifiers; - dpi->modifiers = NULL; - -- d_print_mod_list (dpi, options, mods, 0); -+ d_print_mod_list (dpi, mods, 0); - - if (need_paren) - d_append_char (dpi, ')'); -@@ -4725,11 +4623,11 @@ d_print_function_type (struct d_print_in - d_append_char (dpi, '('); - - if (d_right (dc) != NULL) -- d_print_comp (dpi, options, d_right (dc)); -+ d_print_comp (dpi, d_right (dc)); - - d_append_char (dpi, ')'); - -- d_print_mod_list (dpi, options, mods, 1); -+ d_print_mod_list (dpi, mods, 1); - - dpi->modifiers = hold_modifiers; - } -@@ -4737,7 +4635,7 @@ d_print_function_type (struct d_print_in - /* Print an array type, except for the element type. */ - - static void --d_print_array_type (struct d_print_info *dpi, int options, -+d_print_array_type (struct d_print_info *dpi, - const struct demangle_component *dc, - struct d_print_mod *mods) - { -@@ -4771,7 +4669,7 @@ d_print_array_type (struct d_print_info - if (need_paren) - d_append_string (dpi, " ("); - -- d_print_mod_list (dpi, options, mods, 0); -+ d_print_mod_list (dpi, mods, 0); - - if (need_paren) - d_append_char (dpi, ')'); -@@ -4783,7 +4681,7 @@ d_print_array_type (struct d_print_info - d_append_char (dpi, '['); - - if (d_left (dc) != NULL) -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - - d_append_char (dpi, ']'); - } -@@ -4791,24 +4689,24 @@ d_print_array_type (struct d_print_info - /* Print an operator in an expression. */ - - static void --d_print_expr_op (struct d_print_info *dpi, int options, -+d_print_expr_op (struct d_print_info *dpi, - const struct demangle_component *dc) - { - if (dc->type == DEMANGLE_COMPONENT_OPERATOR) - d_append_buffer (dpi, dc->u.s_operator.op->name, - dc->u.s_operator.op->len); - else -- d_print_comp (dpi, options, dc); -+ d_print_comp (dpi, dc); - } - - /* Print a cast. */ - - static void --d_print_cast (struct d_print_info *dpi, int options, -+d_print_cast (struct d_print_info *dpi, - const struct demangle_component *dc) - { - if (d_left (dc)->type != DEMANGLE_COMPONENT_TEMPLATE) -- d_print_comp (dpi, options, d_left (dc)); -+ d_print_comp (dpi, d_left (dc)); - else - { - struct d_print_mod *hold_dpm; -@@ -4826,14 +4724,14 @@ d_print_cast (struct d_print_info *dpi, - dpi->templates = &dpt; - dpt.template_decl = d_left (dc); - -- d_print_comp (dpi, options, d_left (d_left (dc))); -+ d_print_comp (dpi, d_left (d_left (dc))); - - dpi->templates = dpt.next; - - if (d_last_char (dpi) == '<') - d_append_char (dpi, ' '); - d_append_char (dpi, '<'); -- d_print_comp (dpi, options, d_right (d_left (dc))); -+ d_print_comp (dpi, d_right (d_left (dc))); - /* Avoid generating two consecutive '>' characters, to avoid - the C++ syntactic ambiguity. */ - if (d_last_char (dpi) == '>') -Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: cp-demint.c -diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//cplus-dem.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/cplus-dem.c ---- binutils-2.21.53.0.1/libiberty//cplus-dem.c 2011-05-08 16:17:47.000000000 +0200 -+++ gcc-4.6.1-20110715/libiberty/cplus-dem.c 2011-03-15 15:32:36.000000000 +0100 -@@ -1311,7 +1311,8 @@ delete_non_B_K_work_stuff (struct work_s - int i; - - for (i = 0; i < work->ntmpl_args; i++) -- free ((char*) work->tmpl_argvec[i]); -+ if (work->tmpl_argvec[i]) -+ free ((char*) work->tmpl_argvec[i]); - - free ((char*) work->tmpl_argvec); - work->tmpl_argvec = NULL; -Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: crc32.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: fibheap.c -diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//filename_cmp.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/filename_cmp.c ---- binutils-2.21.53.0.1/libiberty//filename_cmp.c 2011-07-17 22:38:06.000000000 +0200 -+++ gcc-4.6.1-20110715/libiberty/filename_cmp.c 2011-03-15 15:32:36.000000000 +0100 -@@ -50,27 +50,19 @@ and backward slashes are equal. - int - filename_cmp (const char *s1, const char *s2) - { --#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \ -- && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM) -+#ifndef HAVE_DOS_BASED_FILE_SYSTEM - return strcmp(s1, s2); - #else - for (;;) - { -- int c1 = *s1; -- int c2 = *s2; -+ int c1 = TOLOWER (*s1); -+ int c2 = TOLOWER (*s2); - --#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM) -- c1 = TOLOWER (c1); -- c2 = TOLOWER (c2); --#endif -- --#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* On DOS-based file systems, the '/' and the '\' are equivalent. */ - if (c1 == '/') - c1 = '\\'; - if (c2 == '/') - c2 = '\\'; --#endif - - if (c1 != c2) - return (c1 - c2); -@@ -108,29 +100,21 @@ and backward slashes are equal. - int - filename_ncmp (const char *s1, const char *s2, size_t n) - { --#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \ -- && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM) -+#ifndef HAVE_DOS_BASED_FILE_SYSTEM - return strncmp(s1, s2, n); - #else - if (!n) - return 0; - for (; n > 0; --n) - { -- int c1 = *s1; -- int c2 = *s2; -+ int c1 = TOLOWER (*s1); -+ int c2 = TOLOWER (*s2); - --#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM) -- c1 = TOLOWER (c1); -- c2 = TOLOWER (c2); --#endif -- --#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* On DOS-based file systems, the '/' and the '\' are equivalent. */ - if (c1 == '/') - c1 = '\\'; - if (c2 == '/') - c2 = '\\'; --#endif - - if (c1 == '\0' || c1 != c2) - return (c1 - c2); -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: fopen_unlocked.c -Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: objalloc.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: partition.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-common.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-common.h -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-unix.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: physmem.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: regex.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: setproctitle.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-coff.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-common.h -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-elf.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-mach-o.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: splay-tree.c -Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: xatexit.c -Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: xmemdup.c diff --git a/binutils.spec b/binutils.spec index 855be56..2c60f2c 100644 --- a/binutils.spec +++ b/binutils.spec @@ -16,8 +16,8 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} -Version: 2.21.53.0.1 -Release: 3%{?dist} +Version: 2.21.53.0.2 +Release: 1%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -31,8 +31,6 @@ Patch05: binutils-2.20.51.0.2-set-long-long.patch Patch06: binutils-2.20.51.0.10-copy-osabi.patch Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch Patch08: binutils-2.20.51.0.2-build-id.patch -Patch09: binutils-2.21.53.0.1-debug_macro.patch -Patch10: binutils-2.21.53.0.1-demangle.patch %define gold_arches %ix86 x86_64 @@ -131,8 +129,6 @@ using libelf instead of BFD. %patch06 -p0 -b .copy-osabi~ %patch07 -p0 -b .sec-merge-emit~ %patch08 -p0 -b .build-id~ -%patch09 -p0 -b .debug_macro~ -%patch10 -p1 -b .demangle~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -422,6 +418,9 @@ exit 0 %endif # %{isnative} %changelog +* Tue Aug 08 2011 Nick Clifton - 2.21.53.0.2-1 +- Rebase on 2.21.53.0.2 tarball. Delete unneeded patches. (BZ 728677) + * Tue Aug 02 2011 Nick Clifton - 2.21.53.0.1-3 - Update libiberty demangling. (BZ 727453) diff --git a/sources b/sources index b5ffbe6..d17d8d8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5b15f6dbced20172431e349b47a30758 binutils-2.21.53.0.1.tar.bz2 +c6868a0e6d0ab7a6cdf30bb0bd32476d binutils-2.21.53.0.2.tar.bz2