#include "bfd.h"#include "sysdep.h"#include "bfdlink.h"#include "ld.h"#include "ldmain.h"#include "ldmisc.h"#include "ldexp.h"#include <ldgram.h>#include "ldlang.h"#include "libiberty.h"#include "safe-ctype.h"

Go to the source code of this file.
| #define BOP | ( | x, | |||
| y | ) | case x : result.value = result.value y other.value; break; |
Referenced by fold_binary().
| etree_type* exp_assert | ( | etree_type * | exp, | |
| const char * | message | |||
| ) |
Definition at line 972 of file ldexp.c.
References etree_union::assert_s, etree_union::child, etree_union::message, n, node_type::node_class, node_type::node_code, stat_alloc(), and etree_union::type.
Referenced by yyparse().
| etree_type* exp_assop | ( | int | code, | |
| const char * | dst, | |||
| etree_type * | src | |||
| ) |
Definition at line 939 of file ldexp.c.
References etree_union::assign, etree_union::dst, memcpy, node_type::node_class, node_type::node_code, etree_union::src, stat_alloc(), and etree_union::type.
Referenced by lang_insert_orphan(), lang_leave_overlay(), lang_leave_overlay_section(), ldctor_build_sets(), mri_public(), and yyparse().
| etree_type* exp_bigintop | ( | bfd_vma | value, | |
| char * | str | |||
| ) |
| etree_type* exp_binop | ( | int | code, | |
| etree_type * | lhs, | |||
| etree_type * | rhs | |||
| ) |
Definition at line 860 of file ldexp.c.
References abs_output_section, etree_union::binary, exp_fold_tree_no_dot(), exp_intop(), lang_first_phase_enum, etree_union::lhs, memcpy, node_type::node_class, node_type::node_code, r, etree_union::rhs, stat_alloc(), etree_union::type, etree_value_type::valid_p, and etree_value_type::value.
Referenced by lang_enter_overlay_section(), lang_insert_orphan(), lang_leave_overlay(), lang_leave_overlay_section(), and yyparse().
| etree_value_type exp_fold_tree | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done, | |||
| bfd_vma | dot, | |||
| bfd_vma * | dotp | |||
| ) |
Definition at line 696 of file ldexp.c.
References _, abs_output_section, etree_union::assert_s, etree_union::assign, assigning_to_dot, bfd_link_hash_common, bfd_link_hash_defined, bfd_link_hash_lookup(), bfd_link_hash_new, bfd_link_hash_undefined, lang_output_section_statement_struct::bfd_section, etree_union::child, bfd_link_hash_entry::def, etree_union::dst, einfo(), exp_fold_tree(), FAIL, FALSE, fold_binary(), fold_name(), fold_trinary(), fold_unary(), h, bfd_link_info::hash, lang_allocating_phase_enum, lang_final_phase_enum, lang_update_definedness(), link_info, memset, etree_union::message, new_rel(), node_type::node_class, NULL, bfd_section::output_offset, bfd_section::output_section, etree_union::rel, result, etree_value_type::section, etree_union::section, etree_union::src, TRUE, bfd_link_hash_entry::type, etree_union::type, bfd_link_hash_entry::u, etree_value_type::valid_p, etree_value_type::value, etree_union::value, and bfd_section::vma.
Referenced by exp_fold_tree(), exp_fold_tree_no_dot(), fold_binary(), fold_trinary(), fold_unary(), lang_do_assignments_1(), lang_size_sections_1(), and print_assignment().
| static etree_value_type exp_fold_tree_no_dot | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done | |||
| ) | [static] |
Definition at line 852 of file ldexp.c.
References exp_fold_tree(), and NULL.
Referenced by exp_binop(), exp_get_abs_int(), exp_get_fill(), exp_get_vma(), exp_nameop(), exp_trinop(), exp_unop(), and fold_name().
| bfd_vma exp_get_abs_int | ( | etree_type * | tree, | |
| int def | ATTRIBUTE_UNUSED, | |||
| char * | name, | |||
| lang_phase_type | allocation_done | |||
| ) |
Definition at line 1155 of file ldexp.c.
References _, abs_output_section, lang_output_section_statement_struct::bfd_section, einfo(), exp_fold_tree_no_dot(), etree_value_type::section, etree_value_type::valid_p, etree_value_type::value, and bfd_section::vma.
Referenced by lang_do_assignments_1(), and print_output_section_statement().
| fill_type* exp_get_fill | ( | etree_type * | tree, | |
| fill_type * | def, | |||
| char * | name, | |||
| lang_phase_type | allocation_done | |||
| ) |
Definition at line 1097 of file ldexp.c.
References _, abs_output_section, _fill_type::data, digit, dst, einfo(), exp_fold_tree_no_dot(), fill(), if(), len, NULL, r, s, _fill_type::size, etree_value_type::str, strlen(), val, etree_value_type::valid_p, and xmalloc().
Referenced by yyparse().
| int exp_get_value_int | ( | etree_type * | tree, | |
| int | def, | |||
| char * | name, | |||
| lang_phase_type | allocation_done | |||
| ) |
Definition at line 1088 of file ldexp.c.
References exp_get_vma().
Referenced by lang_enter_output_section_statement(), and lang_new_phdr().
| bfd_vma exp_get_vma | ( | etree_type * | tree, | |
| bfd_vma | def, | |||
| char * | name, | |||
| lang_phase_type | allocation_done | |||
| ) |
Definition at line 1069 of file ldexp.c.
References _, abs_output_section, einfo(), exp_fold_tree_no_dot(), NULL, r, etree_value_type::valid_p, and etree_value_type::value.
Referenced by exp_get_value_int(), lang_record_phdrs(), and yyparse().
| etree_type* exp_intop | ( | bfd_vma | value | ) |
Definition at line 159 of file ldexp.c.
References INT, NULL, and stat_alloc().
Referenced by exp_binop(), exp_nameop(), exp_trinop(), exp_unop(), lang_insert_orphan(), lang_size_sections_1(), ldctor_build_sets(), set_section_start(), set_segment_start(), and yyparse().
| etree_type* exp_nameop | ( | int | code, | |
| const char * | name | |||
| ) |
Definition at line 920 of file ldexp.c.
References exp_fold_tree_no_dot(), exp_intop(), lang_first_phase_enum, memcpy, etree_union::name, NULL, r, stat_alloc(), etree_value_type::valid_p, and etree_value_type::value.
Referenced by lang_enter_overlay_section(), lang_insert_orphan(), lang_leave_overlay(), lang_leave_overlay_section(), ldctor_build_sets(), mri_draw_tree(), and yyparse().
| static void exp_print_token | ( | token_code_type | code, | |
| int | infix_p | |||
| ) | [static] |
Definition at line 64 of file ldexp.c.
References ADDR, ALIGN_K, ANDAND, ANDEQ, ARRAY_SIZE, BLOCK, BYTE, config, DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END, DEFINED, DIVEQ, ENTRY, EQ, fprintf(), fputc(), fputs(), GE, idx, INT, LE, LENGTH, LOADADDR, LONG, LSHIFT, LSHIFTEQ, ld_config_type::map_file, MAX_K, MEMORY, MINUSEQ, MULTEQ, NAME, NE, NEXT, OREQ, ORIGIN, OROR, PLUSEQ, REL, RSHIFT, RSHIFTEQ, SEARCH_DIR, SECTIONS, SEGMENT_START, SHORT, SIZEOF, SIZEOF_HEADERS, SQUAD, and TARGET_K.
Referenced by exp_print_tree().
| void exp_print_tree | ( | etree_type * | tree | ) |
Definition at line 985 of file ldexp.c.
References etree_union::assert_s, etree_union::assign, etree_union::binary, etree_union::child, etree_union::cond, config, etree_union::dst, exp_print_token(), exp_print_tree(), FAIL, FALSE, fprintf(), etree_union::lhs, ld_config_type::map_file, etree_union::message, minfo(), NAME, bfd_section::name, etree_union::name, node_type::node_class, node_type::node_code, NULL, bfd_section::owner, etree_union::rel, etree_union::rhs, etree_union::section, etree_union::src, etree_union::trinary, TRUE, etree_union::type, etree_union::unary, and etree_union::value.
Referenced by exp_print_tree(), print_address_statement(), print_assignment(), print_data_statement(), and print_reloc_statement().
| etree_type* exp_provide | ( | const char * | dst, | |
| etree_type * | src | |||
| ) |
Definition at line 957 of file ldexp.c.
References etree_union::assign, etree_union::dst, n, node_type::node_class, node_type::node_code, etree_union::src, stat_alloc(), and etree_union::type.
Referenced by yyparse().
| etree_type* exp_relop | ( | asection * | section, | |
| bfd_vma | value | |||
| ) |
Definition at line 183 of file ldexp.c.
References REL, and stat_alloc().
Referenced by ldctor_build_sets().
| etree_type* exp_trinop | ( | int | code, | |
| etree_type * | cond, | |||
| etree_type * | lhs, | |||
| etree_type * | rhs | |||
| ) |
Definition at line 882 of file ldexp.c.
References etree_union::cond, exp_fold_tree_no_dot(), exp_intop(), lang_first_phase_enum, etree_union::lhs, memcpy, node_type::node_class, node_type::node_code, NULL, r, etree_union::rhs, stat_alloc(), etree_union::trinary, etree_union::type, etree_value_type::valid_p, and etree_value_type::value.
Referenced by yyparse().
| etree_type* exp_unop | ( | int | code, | |
| etree_type * | child | |||
| ) |
Definition at line 901 of file ldexp.c.
References abs_output_section, etree_union::child, exp_fold_tree_no_dot(), exp_intop(), lang_first_phase_enum, memcpy, node_type::node_class, node_type::node_code, r, stat_alloc(), etree_union::type, etree_union::unary, etree_value_type::valid_p, and etree_value_type::value.
Referenced by lang_insert_orphan(), ldctor_build_sets(), and yyparse().
| static etree_value_type fold_binary | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done, | |||
| bfd_vma | dot, | |||
| bfd_vma * | dotp | |||
| ) | [static] |
Definition at line 311 of file ldexp.c.
References _, abs_output_section, ALIGN_K, align_n(), ANDAND, etree_union::binary, BOP, DATA_SEGMENT_ALIGN, DATA_SEGMENT_RELRO_END, einfo(), EQ, exp_data_seg::exp_dataseg_adjust, exp_data_seg::exp_dataseg_align_seen, exp_data_seg::exp_dataseg_none, exp_data_seg::exp_dataseg_relro_adjust, exp_data_seg::exp_dataseg_relro_seen, exp_fold_tree(), FAIL, FALSE, GE, lang_allocating_phase_enum, lang_first_phase_enum, LE, etree_union::lhs, LSHIFT, make_abs(), MAX_K, MIN_K, etree_union::name, segment_struct::name, NE, segment_struct::next, node_type::node_code, NULL, OROR, result, etree_union::rhs, RSHIFT, etree_value_type::section, SEGMENT_START, etree_value_type::str, strcmp(), TRUE, etree_union::type, segment_struct::used, etree_value_type::valid_p, etree_value_type::value, and segment_struct::value.
Referenced by ccp_fold(), compare_values_warnv(), copy_prop_visit_cond_stmt(), estimate_niter_from_size_of_data(), exp_fold_tree(), extract_range_from_binary_expr(), fold(), fold_binary_to_constant(), fold_build2_stat(), fold_stmt_r(), loop_niter_by_eval(), n_of_executions_at_most(), optimize_ops_list(), and tree_simplify_using_condition_1().
| static etree_value_type fold_name | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done, | |||
| bfd_vma | dot | |||
| ) | [static] |
Definition at line 522 of file ldexp.c.
References _, abs_output_section, ADDR, assigning_to_dot, bfd_get_section_name, bfd_is_abs_section, bfd_link_add_undef(), bfd_link_hash_common, bfd_link_hash_defined, bfd_link_hash_defweak, bfd_link_hash_new, bfd_link_hash_undefined, bfd_octets_per_byte(), lang_output_section_statement_struct::bfd_section, bfd_sizeof_headers, bfd_wrapped_link_hash_lookup(), bfd_link_hash_entry::def, DEFINED, einfo(), exp_fold_tree_no_dot(), FAIL, FALSE, h, bfd_link_info::hash, lang_allocating_phase_enum, lang_final_phase_enum, lang_first_phase_enum, lang_memory_region_lookup(), lang_output_section_find(), lang_output_section_statement_lookup(), lang_statement_iteration, lang_symbol_definition_iteration(), lang_track_definedness(), LENGTH, memory_region_struct::length, link_info, lang_output_section_statement_struct::load_base, LOADADDR, mem, NAME, etree_union::name, new_abs(), new_rel(), new_rel_from_section(), node_type::node_code, NULL, memory_region_struct::origin, ORIGIN, output_bfd, lang_output_section_statement_struct::processed, bfd_link_info::relocatable, result, etree_value_type::section, bfd_section::size, SIZEOF, SIZEOF_HEADERS, TRUE, bfd_link_hash_entry::type, etree_union::type, bfd_link_hash_entry::u, bfd_link_hash_entry::undef, bfd_link_hash_table::undefs_tail, etree_value_type::valid_p, and etree_value_type::value.
Referenced by exp_fold_tree().
| static etree_value_type fold_trinary | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done, | |||
| bfd_vma | dot, | |||
| bfd_vma * | dotp | |||
| ) | [static] |
Definition at line 501 of file ldexp.c.
References etree_union::cond, exp_fold_tree(), etree_union::lhs, result, etree_union::rhs, etree_union::trinary, etree_value_type::valid_p, and etree_value_type::value.
Referenced by exp_fold_tree().
| static etree_value_type fold_unary | ( | etree_type * | tree, | |
| lang_output_section_statement_type * | current_section, | |||
| lang_phase_type | allocation_done, | |||
| bfd_vma | dot, | |||
| bfd_vma * | dotp | |||
| ) | [static] |
Definition at line 222 of file ldexp.c.
References abs_output_section, ABSOLUTE, ALIGN_K, align_n(), lang_output_section_statement_struct::bfd_section, etree_union::child, DATA_SEGMENT_END, exp_data_seg::exp_dataseg_adjust, exp_data_seg::exp_dataseg_align_seen, exp_data_seg::exp_dataseg_end_seen, exp_data_seg::exp_dataseg_relro_adjust, exp_data_seg::exp_dataseg_relro_seen, exp_fold_tree(), FAIL, FALSE, lang_allocating_phase_enum, lang_first_phase_enum, make_abs(), new_rel_from_section(), NEXT, node_type::node_code, result, etree_value_type::section, etree_union::type, etree_union::unary, etree_value_type::valid_p, etree_value_type::value, and bfd_section::vma.
Referenced by ccp_fold(), convert_to_integer(), exp_fold_tree(), expand_expr_real_1(), fold(), fold_build1_stat(), fold_unary(), fold_unary_to_constant(), maybe_fold_stmt_addition(), try_combine_conversion(), and visit_assignment().
| static void make_abs | ( | etree_value_type * | ptr | ) | [static] |
Definition at line 140 of file ldexp.c.
References abs_output_section, lang_output_section_statement_struct::bfd_section, s, etree_value_type::section, etree_value_type::value, and bfd_section::vma.
Referenced by fold_binary(), and fold_unary().
| static etree_value_type new_abs | ( | bfd_vma | value | ) | [static] |
Definition at line 148 of file ldexp.c.
References abs_output_section, NULL, TRUE, and etree_value_type::valid_p.
Referenced by fold_name().
| static etree_value_type new_rel | ( | bfd_vma | value, | |
| char * | str, | |||
| lang_output_section_statement_type * | section | |||
| ) | [static] |
Definition at line 194 of file ldexp.c.
References TRUE, and etree_value_type::valid_p.
Referenced by exp_fold_tree(), and fold_name().
| static etree_value_type new_rel_from_section | ( | bfd_vma | value, | |
| lang_output_section_statement_type * | section | |||
| ) | [static] |
Definition at line 207 of file ldexp.c.
References lang_output_section_statement_struct::bfd_section, NULL, TRUE, etree_value_type::valid_p, and bfd_section::vma.
Referenced by fold_name(), and fold_unary().
bfd_boolean assigning_to_dot = FALSE [static] |
1.5.6