From f961457f887a965ecca2f35b81e33c077759c347 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 12 Jun 2014 06:03:49 +0200 Subject: symtab.c (section_hash): New hash. * symtab.c (section_hash): New hash. (symtab_unregister_node): Clear section before freeing. (hash_section_hash_entry): New haser. (eq_sections): New function. (symtab_node::set_section_for_node): New method. (set_section_1): Update. (symtab_node::set_section): Take string instead of tree as parameter. (symtab_resolve_alias): Update. * cgraph.h (section_hash_entry_d): New structure. (section_hash_entry): New typedef. (cgraph_node): Change comdat_group_ to x_comdat_group, change section_ to x_section and turn into section_hash_entry; update accestors; put set_section_for_node offline. * tree.c (decl_section_name): Turn into string. (set_decl_section_name): Change parameter to be string. * tree.h (decl_section_name, set_decl_section_name): Update prototypes. * sdbout.c (sdbout_one_type): Update. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Update. * varasm.c (IN_NAMED_SECTION, get_named_section, resolve_unique_section, hot_function_section, get_named_text_section, USE_SELECT_SECTION_FOR_FUNCTIONS, default_function_rodata_section, make_decl_rtl, default_unique_section): Update. * config/c6x/c6x.c (c6x_in_small_data_p): Update. (c6x_elf_unique_section): Update. * config/nios2/nios2.c (nios2_in_small_data_p): Update. * config/pa/pa.c (pa_function_section): Update. * config/pa/pa.h (IN_NAMED_SECTION_P): Update. * config/ia64/ia64.c (ia64_in_small_data_p): Update. * config/arc/arc.c (arc_in_small_data_p): Update. * config/arm/unknown-elf.h (IN_NAMED_SECTION_P): Update. * config/mcore/mcore.c (mcore_unique_section): Update. * config/mips/mips.c (mips16_build_function_stub): Update. (mips16_build_call_stub): Update. (mips_function_rodata_section): Update. (mips_in_small_data_p): Update. * config/score/score.c (score_in_small_data_p): Update. * config/rx/rx.c (rx_in_small_data): Update. * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Update. (rs6000_xcoff_asm_named_section): Update. (rs6000_xcoff_unique_section): Update. * config/frv/frv.c (frv_string_begins_with): Update. (frv_in_small_data_p): Update. * config/v850/v850.c (v850_encode_data_area): Update. * config/bfin/bfin.c (DECL_SECTION_NAME): Update. (bfin_handle_l1_data_attribute): Update. (bfin_handle_l2_attribute): Update. * config/mep/mep.c (mep_unique_section): Update. * config/microblaze/microblaze.c (microblaze_elf_in_small_data_p): Update. * config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): Update. (h8300_handle_tiny_data_attribute): Update. * config/m32r/m32r.c (m32r_in_small_data_p): Update. (m32r_in_small_data_p): Update. * config/alpha/alpha.c (alpha_in_small_data_p): Update. * config/i386/i386.c (ix86_in_large_data_p): Update. * config/i386/winnt.c (i386_pe_unique_section): Update. * config/darwin.c (darwin_function_section): Update. * config/lm32/lm32.c (lm32_in_small_data_p): Update. * tree-emutls.c (get_emutls_init_templ_addr): Update. (new_emutls_decl): Update. * lto-cgraph.c (lto_output_node, input_node, input_varpool_node, input_varpool_node): Update. (ead_string_cst): Turn to ... (read_string): ... this one. * dwarf2out.c (secname_for_decl): Update. * asan.c (asan_protect_global): Update. * c-family/c-common.c (handle_section_attribute): Update handling for section names that are no longer trees. * java/class.c (build_utf8_ref): Update handling for section names that are no longer trees. (emit_register_classes_in_jcr_section): Update. * vtable-class-hierarchy.c: Update handling for section names that are no longer trees. * decl.c (duplicate_decls): Likewise. * gcc-interface/utils.c: Update handling for section names that are no longer trees. From-SVN: r211489 --- gcc/lto-cgraph.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'gcc/lto-cgraph.c') diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 70e813d..803b66a 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -504,7 +504,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, section = node->get_section (); if (!section) section = ""; - lto_output_data_stream (ob->main_stream, section, strlen (section) + 1); streamer_write_hwi_stream (ob->main_stream, node->tp_first_run); @@ -546,6 +545,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, bp_pack_enum (&bp, ld_plugin_symbol_resolution, LDPR_NUM_KNOWN, node->resolution); streamer_write_bitpack (&bp); + lto_output_data_stream (ob->main_stream, section, strlen (section) + 1); if (node->thunk.thunk_p && !boundary_p) { @@ -1006,13 +1006,13 @@ read_identifier (struct lto_input_block *ib) return id; } -/* Return identifier encoded in IB as a plain string. */ +/* Return string encoded in IB, NULL if string is empty. */ -static tree -read_string_cst (struct lto_input_block *ib) +static const char * +read_string (struct lto_input_block *ib) { unsigned int len = strnlen (ib->data + ib->p, ib->len - ib->p - 1); - tree id; + const char *str; if (ib->data[ib->p + len]) lto_section_overrun (ib); @@ -1021,9 +1021,9 @@ read_string_cst (struct lto_input_block *ib) ib->p++; return NULL; } - id = build_string (len, ib->data + ib->p); + str = ib->data + ib->p; ib->p += len + 1; - return id; + return str; } /* Overwrite the information in NODE based on FILE_DATA, TAG, FLAGS, @@ -1116,7 +1116,7 @@ input_node (struct lto_file_decl_data *file_data, int order; int i, count; tree group; - tree section; + const char *section; order = streamer_read_hwi (ib) + order_base; clone_ref = streamer_read_hwi (ib); @@ -1165,7 +1165,6 @@ input_node (struct lto_file_decl_data *file_data, group = read_identifier (ib); if (group) ref2 = streamer_read_hwi (ib); - section = read_string_cst (ib); /* Make sure that we have not read this node before. Nodes that have already been read will have their tag stored in the 'aux' @@ -1192,6 +1191,7 @@ input_node (struct lto_file_decl_data *file_data, } else node->same_comdat_group = (symtab_node *) (intptr_t) LCC_NOT_FOUND; + section = read_string (ib); if (section) node->set_section_for_node (section); @@ -1226,7 +1226,7 @@ input_varpool_node (struct lto_file_decl_data *file_data, int ref = LCC_NOT_FOUND; int order; tree group; - tree section; + const char *section; order = streamer_read_hwi (ib) + order_base; decl_index = streamer_read_uhwi (ib); @@ -1275,7 +1275,7 @@ input_varpool_node (struct lto_file_decl_data *file_data, } else node->same_comdat_group = (symtab_node *) (intptr_t) LCC_NOT_FOUND; - section = read_string_cst (ib); + section = read_string (ib); if (section) node->set_section_for_node (section); node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution, -- cgit v1.1