#include <private.h>

Go to the source code of this file.
Defines | |
| #define | native_encoding (*(unsigned char*)&__encoding) |
| #define | rewrite(var, val, f) do{if((var)!=(val)){(var)=(val);(f)|=ELF_F_DIRTY;}}while(0) |
| #define | align(var, val) do{if((val)>1){(var)+=(val)-1;(var)-=(var)%(val);}}while(0) |
| #define | max(a, b) ((a)>(b)?(a):(b)) |
| #define | ptrinside(p, a, l) ((p)>=(a)&&(p)<(a)+(l)) |
| #define | newptr(p, o, n) ((p)=((p)-(o))+(n)) |
Functions/Subroutines | |
| static off_t | scn_data_layout (Elf_Scn *scn, unsigned v, unsigned type, size_t *algn, unsigned *flag) |
| static size_t | scn_entsize (const Elf *elf, unsigned version, unsigned stype) |
| static off_t | _elf32_layout (Elf *elf, unsigned *flag) |
| static int | _elf_update_pointers (Elf *elf, char *outbuf, size_t len) |
| static off_t | _elf32_write (Elf *elf, char *outbuf, size_t len) |
| static off_t | _elf_output (Elf *elf, int fd, size_t len, off_t(*_elf_write)(Elf *, char *, size_t)) |
| off_t | elf_update (Elf *elf, Elf_Cmd cmd) |
Variables | |
| static const char | rcsid [] = "@(#) $Id: update.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $" |
| static const unsigned short | __encoding = ELFDATA2LSB + (ELFDATA2MSB << 8) |
Definition at line 40 of file update.c.
Referenced by _bfd_add_merge_section(), _bfd_elf_tls_setup(), _elf32_layout(), Adjusted_Alignment(), allocate_dynamic_stack_space(), Allocate_Space(), alpha_align_insns(), alpha_expand_block_clear(), alpha_expand_compare_and_swap_12(), alpha_expand_lock_test_and_set_12(), apply_args_size(), apply_result_size(), arc_va_arg(), assign_file_positions_for_segments(), Assign_Offset(), assign_parm_find_stack_rtl(), assign_stack_temp_for_type(), aux_memset(), bfin_expand_movmem(), bfin_expand_strmov(), can_move_by_pieces(), change_address(), clear_storage(), clipper_movstr(), clipper_va_arg(), compute_alignment(), compute_argument_addresses(), compute_clrmem_length(), compute_ebb_actions(), compute_movmem_length(), compute_movstrsi_length(), Create_DST_type_For_Tree(), Create_Maligned_TY(), Create_TY_For_Tree(), crx_expand_movmem(), cvrt_to_pdg(), CODEREP::Divisable(), DST_enter_normal_field(), DST_enter_struct_union_members(), Dump_all(), dump_constants(), elf_link_add_object_symbols(), emit_block_move(), emit_move_sequence(), emit_pic_helper(), expand_block_clear(), expand_block_move(), expand_expr_real_1(), expand_main_function(), expand_movstr(), expand_one_stack_var(), expand_one_stack_var_at(), expand_used_vars(), final_addr_vec_align(), final_scan_insn(), finalize_type_size(), force_reg(), frv_expand_block_clear(), frv_expand_block_move(), function_arg(), function_arg_advance(), function_arg_partial_nregs(), gen_cmpstrsi(), Get_Align(), get_basic_type(), get_decl_align_unit(), get_pointer_alignment(), gimplify_init_constructor(), gimplify_omp_atomic(), GTY(), hppa_va_arg(), i860_gimplify_va_arg_expr(), i860_va_arg(), i960_pr_align(), init_alignment_context(), initial_elimination_offset(), IPO_generate_new_types(), IPO_get_new_ordering(), ix86_expand_clrmem(), ix86_expand_clrstr(), ix86_expand_movmem(), ix86_expand_movstr(), ix86_expand_strlensi_unroll_1(), ix86_function_arg_boundary(), ix86_gimplify_va_arg(), ix86_va_arg(), load_pic_register(), loop_givs_rescan(), m32r_expand_block_move(), m68hc11_va_arg(), m88k_va_arg(), mcore_expand_block_move(), Memop_Variant(), mips_gimplify_va_arg_expr(), mips_va_arg(), mmix_expand_builtin_va_arg(), mn10200_va_arg(), mn10300_arg_partial_bytes(), mn10300_va_arg(), mri_draw_tree(), output_block_clear(), output_block_move(), output_stack_adjust(), pj_expand_builtin_va_arg(), profile_function(), realign_file(), record_section(), round_push(), rounded_frame_size(), rs6000_arg_partial_bytes(), rs6000_expand_compare_and_swapqhi(), rs6000_gimplify_va_arg(), rs6000_parm_start(), rs6000_special_round_type_align(), rs6000_va_arg(), sbitmap_vector_alloc(), scn_data_layout(), send_attr_ntry(), set_mem_attributes_minus_bitpos(), sh5_schedule_saves(), sh_expand_epilogue(), sh_expand_prologue(), shorten_branches(), sparc_gimplify_va_arg(), sparc_output_deferred_case_vectors(), sparc_va_arg(), Split_Individual_Common(), ST_alignment(), STB_align(), store_by_pieces_1(), Trace_Stack_Segments(), v850_arg_partial_bytes(), VEC(), WFE_Expand_Expr(), WGEN_Expand_Expr(), Write_Elf_Symtab(), xtensa_emit_block_move(), xtensa_expand_block_move(), and xtensa_gimplify_va_arg_expr().
| #define native_encoding (*(unsigned char*)&__encoding) |
Definition at line 505 of file update.c.
Referenced by _elf_update_pointers(), and add_new_contents().
Definition at line 125 of file update.c.
References _fsize, align, Elf::e_ehdr, Elf::e_ehdr_flags, Elf32_Ehdr::e_ehsize, Elf::e_elf_flags, Elf32_Ehdr::e_ident, Elf::e_phdr_flags, Elf32_Ehdr::e_phentsize, Elf32_Ehdr::e_phnum, Elf::e_phnum, Elf32_Ehdr::e_phoff, Elf::e_scn_1, Elf32_Ehdr::e_shentsize, Elf32_Ehdr::e_shnum, Elf32_Ehdr::e_shoff, Elf32_Ehdr::e_version, EI_CLASS, EI_DATA, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, EI_VERSION, elf_assert, ELF_F_LAYOUT, ELF_T_ADDR, ELF_T_EHDR, ELF_T_PHDR, ELF_T_SHDR, ELFCLASS32, ELFDATANONE, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, EV_CURRENT, EV_NONE, if(), layout(), len, max, native_encoding, rewrite, Elf_Scn::s_index, Elf_Scn::s_link, Elf_Scn::s_shdr_flags, scn_data_layout(), scn_entsize(), seterr, Elf32_Shdr::sh_addralign, Elf32_Shdr::sh_entsize, Elf32_Shdr::sh_offset, Elf32_Shdr::sh_size, Elf32_Shdr::sh_type, SHN_LORESERVE, SHN_UNDEF, SHT_NOBITS, SHT_NULL, size_t, valid_encoding, valid_version, and version.
Referenced by elf_update().
Definition at line 618 of file update.c.
References _elf32_xltsize(), _elf_update_pointers(), _elf_version, _msize, Elf_Data::d_buf, Elf_Data::d_off, Elf_Data::d_size, Elf_Data::d_type, Elf_Data::d_version, DATA_MAGIC, dst, Elf::e_ehdr, Elf::e_ehdr_flags, Elf32_Ehdr::e_ehsize, Elf::e_elf_flags, Elf::e_encoding, Elf32_Ehdr::e_ident, Elf::e_phdr, Elf::e_phdr_flags, Elf32_Ehdr::e_phentsize, Elf32_Ehdr::e_phnum, Elf32_Ehdr::e_phoff, Elf::e_readable, Elf::e_scn_1, Elf32_Ehdr::e_shentsize, Elf32_Ehdr::e_shoff, Elf::e_size, Elf::e_version, Elf32_Ehdr::e_version, EI_DATA, EI_VERSION, elf32_xlatetof(), elf_assert, ELF_F_DIRTY, elf_getdata(), ELF_T_BYTE, ELF_T_EHDR, ELF_T_PHDR, ELF_T_SHDR, ELFCLASS32, ELFDATA2LSB, encode(), EV_CURRENT, NULL, Elf_Scn::s_data_1, Elf_Scn::s_elf, Elf_Scn::s_index, Elf_Scn::s_link, Elf_Scn::s_magic, Elf_Scn::s_offset, Elf_Scn::s_scn_flags, Elf_Scn::s_shdr_flags, Elf_Scn::s_size, Elf_Scn::s_type, Elf_Scn::s_uhdr, SCN_MAGIC, Scn_Data::sd_data, Scn_Data::sd_data_flags, Scn_Data::sd_link, Scn_Data::sd_magic, Scn_Data::sd_scn, seterr, Elf32_Shdr::sh_offset, Elf32_Shdr::sh_size, Elf32_Shdr::sh_type, SHN_UNDEF, SHT_NOBITS, SHT_NULL, src, tmp, and valid_type.
Referenced by elf_update().
| static off_t _elf_output | ( | Elf * | elf, | |
| int | fd, | |||
| size_t | len, | |||
| off_t(*)(Elf *, char *, size_t) | _elf_write | |||
| ) | [static] |
Definition at line 872 of file update.c.
References _elf_fill, buf, Elf::e_elf_flags, elf_assert, ELF_F_LAYOUT, err, free(), ftruncate(), lseek, malloc, memset, mmap(), munmap(), NULL, SEEK_SET, seterr, and write.
Referenced by elf_update().
Definition at line 508 of file update.c.
References Elf_Data::d_buf, DATA_MAGIC, Elf::e_class, Elf::e_data, Elf::e_dsize, Elf::e_ehdr, Elf::e_free_ehdr, Elf::e_free_phdr, Elf::e_kind, Elf::e_parent, Elf::e_phdr, Elf::e_rawdata, Elf::e_scn_1, Elf::e_unmap_data, EI_NIDENT, elf_assert, ELF_K_ELF, ELFCLASS32, ELFCLASS64, memcpy, newptr, ptrinside, realloc, Elf_Scn::s_data_1, Elf_Scn::s_elf, Elf_Scn::s_link, Elf_Scn::s_magic, Elf_Scn::s_rawdata, SCN_MAGIC, Scn_Data::sd_data, Scn_Data::sd_free_data, Scn_Data::sd_magic, Scn_Data::sd_memdata, Scn_Data::sd_scn, and seterr.
Referenced by _elf32_write().
Definition at line 929 of file update.c.
References _elf32_layout(), _elf32_write(), _elf_output(), Elf::e_class, Elf::e_disabled, Elf::e_ehdr, Elf::e_fd, Elf::e_kind, Elf::e_magic, Elf::e_writable, elf_assert, ELF_C_NULL, ELF_C_WRITE, ELF_F_DIRTY, ELF_K_ELF, ELF_MAGIC, ELFCLASS32, ELFCLASS64, seterr, and valid_class.
Referenced by Em_End_File().
| static off_t scn_data_layout | ( | Elf_Scn * | scn, | |
| unsigned | v, | |||
| unsigned | type, | |||
| size_t * | algn, | |||
| unsigned * | flag | |||
| ) | [static] |
Definition at line 46 of file update.c.
References _elf32_xltsize(), align, Elf_Data::d_align, Elf_Data::d_off, Elf_Data::d_size, Elf_Data::d_type, Elf_Data::d_version, DATA_MAGIC, Elf::e_class, Elf::e_elf_flags, elf_assert, ELF_F_LAYOUT, elf_getdata(), ELFCLASS32, ELFCLASS64, ELFDATA2LSB, layout(), len, max, NULL, rewrite, Elf_Scn::s_data_1, Elf_Scn::s_elf, Scn_Data::sd_data, Scn_Data::sd_data_flags, Scn_Data::sd_link, Scn_Data::sd_magic, Scn_Data::sd_scn, seterr, SHT_NOBITS, valid_class, valid_type, and valid_version.
Referenced by _elf32_layout().
Definition at line 110 of file update.c.
References _elf_scn_type(), _fsize, Elf::e_class, ELF_T_BYTE, ELF_T_VDEF, and ELF_T_VNEED.
Referenced by _elf32_layout(), and Init_Section().
const unsigned short __encoding = ELFDATA2LSB + (ELFDATA2MSB << 8) [static] |
1.5.6